Slinkies. They started out as toys. I still have one to play with on my desk.
Rubber bands What was once something useful, is now a wonderful projectile weapon.
Swings I still love them, but people seem to not make them in adult sizes for some reason.
A person's perception of these objects start to change as they enter their first physics class. Even in that beginning classical mechanics, the problems are filled with harmonic osscilators, like slinkies, rubber bands, or swings, which exert a force proportional to their displacement \begin{equation} F=-kx \end{equation} and therefore a quadratic potential \begin{equation} V(x)=\frac{1}{2} k x^2 \end{equation}
This is all extremely fun and useful in the classical regime, but we add Quantum Mechanics to the mix, and LOW AND BEHOLD! we have one of the few exactly solvable models in Quantum Mechanics. Moreso, this solution demonstrates some extremely important properties of quantum mechanical systems.
Today, I just intend to present the form of the solution, calculate this equation numerically, and visualize the results. If you wish to know how the equation is derived, you can find a standard quantum mechanics textbook, or stay tuned till I manage to write it up.
Note: These are not the same as the "probabilists' Hermite Polynomial". The two functions differ by scaling factors.
Physicists' Hermite polynomials are defined as eigenfunctions for the differential equation \begin{equation} u^{\prime \prime}-2xu^{\prime} = -2 \lambda u \end{equation}
\begin{equation} H_n(x) = (-1)^n \mathrm{e}^{x^2} \frac{\mathrm{d}^n}{\mathrm{d}x^n} \left( e^{-x^2} \right) \end{equation}I leave it as an exercise to the reader (muahahahaha) to
Though a formula exists for calculating a function at $n$ directly, the most efficient method at low $n$ for calculating polynomials relies on recurrence relationships. These recurrence relationships will also be quite handy if you ever need to show orthogonality, or expectation values.
In [1]:
using Roots;
using Plots
pyplot()
Out[1]:
In [2]:
function GenerateHermite(n)
Hermite=Function[]
push!(Hermite,x->1);
push!(Hermite,x->2*x);
for ni in 3:n
push!(Hermite,x->2*x.*Hermite[ni-1](x)-2*n.*Hermite[ni-2](x))
end
return Hermite
end
Out[2]:
So let's generate some Hermite polynomials and look at them.
Make sure you don't call a Hermite you haven't generated yet!
In [3]:
Hermite=GenerateHermite(5);
In [4]:
x=collect(-2:.01:2);
plot(ylims=(-50,50))
for j in 1:5
plot!(x,map(Hermite[j],x),label="H_$j (x)")
end
plot!(xlabel="x",ylabel="y",title="Hermite Polynomials")
Out[4]:
In [5]:
# Let's make our life easy and set all units to 1
m=1
ω=1
ħ=1
#Finally, we define Ψ
Ψ(n,x)=1/sqrt(factorial(n)*2^n)*(m*ω/(ħ*π))^(1/4)*exp(-m*ω*x^2/(2*ħ))*Hermite[n](sqrt(m*ω/ħ)*x)
Out[5]:
In [6]:
zeds=Array{Array{Float64}}(undef,1)
zeds[1]=[] #ground state has no zeros
for j in 2:4
push!(zeds,fzeros(y->Ψ(j,y),-3,3))
end
In [7]:
zeds[3]
Out[7]:
In [8]:
# AHHHHH! So Much code!
# Don't worry; it's all just plotting
x=collect(-3:.01:3) #Set some good axes
plot(xlim=(-3,3),ylim=(-.5,4.5))
for j in 1:4 #how many do you want to view?
plot!(x,map.(y->Ψ(j,y),x).+j.-1,label="| $j >")
plot!(x,(j-1)*ones(length(x)),
color="black",label="")
scatter!(zeds[j],(j-1)*ones(length(zeds[j])),
label="")
end
plot!(x,.5*m*ω^2*x.^2,label="Potential")
scatter!([],[],label="Zeros")
plot!(xlabel="x",ylabel="Ψ+n",legend=:topright,
title="Eigenstates of a Harmonic Osscilator")
Out[8]:
This barely scratched the surface into the richness that can be seen in the quantum harmonic osscilator. Here, just we developed a way for calculating the functions, and visualized the results. Stay tuned to hear here about ground state energy, ladder operators, and atomic trapping.
In [ ]: