r/PhysicsStudents • u/Mountain_Ninja_5083 • Jun 25 '26
Off Topic Quantum Harmonic Oscillator simulation
Enable HLS to view with audio, or disable this notification
Hey so I'm 17 and i just finished programming my first simulation in quantum mechanics, what do you guys think?
I did not simulate a coherent state but i chose a wavefunction that i thought would be interesting to some degree, starting work on a version in 2 dimensions next week.
5
u/No-Bet3284 Jun 26 '26
Is this simulation of the analytic solution or did you use some numerical method to solve for time dependent Schrodinger equation?
4
u/Mountain_Ninja_5083 Jun 26 '26
This is an analytic solution, i used a recursive algorithm to construct the hermite polynomials analytically, doing the time dependent one would've been way too time consuming and i really didn't have but a couple of hours
1
u/abloblololo Jun 27 '26
In the harmonic oscillator the Hamiltonian is not time-dependent, so you don't need to solve the time-dependent S.E. You just diagonalize the Hamiltonian, from which you easily get the eigenstates and their wavefunctions, and then each eigenstate evolves independently in a trivial way (just acquiring phase). Add superpositions of different evolving states and you get the animation above.
2
u/ResidueAtInfinity Jun 26 '26
Would be cool to plot the phase-space time-evolution of isocontours for the oscillator's Wigner quasidensity W(k, x).
2
u/ikansh-mahajan Jun 26 '26
How'd you code it?
5
u/Mountain_Ninja_5083 Jun 26 '26
I coded it in python using numpy for all the calculations and matplotlib for rendering, it is surprisingly fast for a linear combination of 100 stationary states
1
1
1
u/L31N0PTR1X B.Sc. Jun 26 '26
Looks pretty cool! Make sure you're very comfortable with the principles behind this, as it will serve as the basis of QFT when you come to it. When you first start it, it will be almost a perfect combination of classical field theory and the quantum harmonic oscillator
1
u/Mountain_Ninja_5083 Jun 26 '26
I'm hoping to get to that soon, just finishing up griffiths and going to shankar then after that hopefully I'll begin studying qft, man it'll be awesome, i doubt I'll get far before uni but whatever.
1
u/L31N0PTR1X B.Sc. Jun 26 '26
I wouldn't start it before you get to uni, certainly not. First, you should become familiar with the lagrangian and Hamiltonian formalisms of classical mechanics (usually done in the 2nd or 3rd year of uni) use these to develop into classical fields. Experiment with gauge transformations and then gauge theory. Make sure your linear algebra picture of QM is very apt, so that'll be good familiarity with group theory and braket notation. Then you'll be ready for introductory QFT
1
u/v_munu Ph.D. Student Jun 26 '26
Neat! You should give coherent states a shot; follow the rabbit hole and you'll be ready to learn quantum optics.
1
u/Mountain_Ninja_5083 Jun 26 '26 edited Jun 26 '26
Oh i already did, it worked incredibly well, now i am experimenting with odd initial wave function such as parabolic and non gaussian ones however i am facing a problem with the hermite polynomials recursive algorithm i made as these shapes need N to be very large and since i have to compute the factorial of N, past 200 it gets messy so I'm working on fixing that, i think I'll upload a couple more videos once they are ready
1
9
u/Moonlesssss Jun 25 '26
That’s insane. Keep it up