Python Solving 1-D Schrodinger Equation in Python (Scipy) Numerically

AI Thread Summary
The discussion centers around creating animations in Python to illustrate the 1-D simple harmonic oscillator and step potential examples, aimed at aiding understanding of these quantum mechanics concepts. The creator also shares a C++ implementation using the RK4 method and finite-difference scheme with the Eigen library. A participant seeks clarification on the construction of the wave packet used in the animation, questioning whether the spikes correspond to classical boundaries and how the simulation relates to specific cases in Wikipedia's quantum harmonic oscillator examples. The creator explains that the initial wave packet is constructed using a Gaussian function and that setting certain parameters can simulate different states, such as a resting particle or a coherent state. The discussion highlights the educational intent behind the animations and the technical details of the simulations.
corychu
Messages
2
Reaction score
7
I've tried to make an animation using python to demonstrate the 1-D simple harmonic oscillator and step potential examples. Hope that it can be useful for some of you. Have fun~ :)
https://blog.gwlab.page/solving-1-d-schrodinger-equation-in-python-dcb3518ce454

sho.gif


By the way, If you are interested, I also implemented a C++ version using RK4 and finite-difference scheme with Eigen library:
https://github.com/c0rychu/SchrodingerEq_1D_tutorial/tree/master/step_potential_cpp
 
Last edited:
  • Like
Likes Paul Colby, bob012345, Wrichik Basu and 2 others
Technology news on Phys.org
corychu said:
I've tried to make an animation using python to demonstrate the 1-D simple harmonic oscillator and step potential examples. Hope that it can be useful for some of you. Have fun~ :)
https://blog.gwlab.page/solving-1-d-schrodinger-equation-in-python-dcb3518ce454

View attachment 284770

By the way, If you are interested, I also implemented a C++ version using RK4 and finite-difference scheme with Eigen library:
https://github.com/c0rychu/SchrodingerEq_1D_tutorial/tree/master/step_potential_cpp
I looked at your link but it's not completely clear (to me but it probably is to others :smile: ) what you are showing here. How did you construct this wave packet? Are the spikes at the classical boundaries? How does this simulation relate to cases G and H of the Wikipedia simulations? Thanks.

https://en.wikipedia.org/wiki/Quantum_harmonic_oscillator
 
bob012345 said:
I looked at your link but it's not completely clear (to me but it probably is to others :smile: ) what you are showing here. How did you construct this wave packet? Are the spikes at the classical boundaries? How does this simulation relate to cases G and H of the Wikipedia simulations? Thanks.

https://en.wikipedia.org/wiki/Quantum_harmonic_oscillator
Sorry for my late reply :(

I think the goal of the article is to tell you how to implement a lowest-order finite-difference method in Python and how to call the initial-value-problem solver in scipy.

As explained in the source code, my initial wave-pack is constructed by:

psi0 = A * np.exp(-(x-x0)**2 / (2.0 * sigma**2)) * np.exp(1j * kx * x)

So, I guess if you set kx=0, it will work like a particle resting at x0. In this case, it might be correct to think of it as a particle sitting at the classical boundary.

I'm not sure about the G shown in Wikipedia. But it said H is a coherence state.

If I understand correctly, a coherence state is a gaussian wavepacket with a specific width (sigma). So, if you are interested in that, you may set the sigma by the proper formula and run the code.

On the other hand, if the width (sigma) is an arbitrary value, I guess it is called a squeezed state. (Sorry that I'm really not good at quantum optics)
 
  • Like
Likes vanhees71 and bob012345
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top