Message Boards Message Boards

Get a fully simplified solution to the quantum harmonic oscillator?


I teach quantum mechanics and made a Mathematica homework problem that allows the students to explore solutions to the quantum harmonic oscillator. The solution to Schrodinger's equation for the quantum harmonic can be written in terms of is the Kummer confluent hypergeometric function, Hypergeometric1F1 for Mathematica.

The general method for solving this problem is to first transform the Schrodinger equation using a dimensionless variable, xi. We would then solve this differential equation for even and odd solutions. The even solutions go like

F1[(1 - k)/4, 1/2, \[Xi]^2]

while the odd solutions go like

F1[(1 - k)/4 + 1/2, 3/2, \[Xi]^2]

In an older version of mathematica (I think it was version 9 when I first wrote this homework problem), I could solve the differential equation and get out the Hypergeometric1F1 function. In the latest version (version 11), the solution is not fully simplified (see attached mathematica file which explores the even solutions).

Unfortunately, the latest form is not very useful for teaching because you have to take the limit (for example, the limit as k->1) of the function to plot the solution. Any help in getting the output back to the Hypergeometric1F1 function would be greatly appreciated.

POSTED BY: Will Smith
1 month ago

Do you mean this line:


needs to produce something more simple than this? -

$$\frac{e^{-\frac{c^2}{2}} \left(-2 (a-1) e^{c^2} \Gamma \left(\frac{7}{4}-\frac{a}{4}\right) \Gamma \left(\frac{a-3}{2}\right) H_{\frac{1}{2} (-a-1)}(i c)-2 i \Gamma \left(\frac{1}{2}-\frac{a}{2}\right) \Gamma \left(\frac{a+3}{4}\right) H_{\frac{a-1}{2}}(c)\right)}{\pi \left(\csc \left(\frac{1}{4} \pi (a+1)\right)-i \sec \left(\frac{1}{4} \pi (a+1)\right)\right)}$$

Sorry, I switched to latin letters from greek, too hard for this simple editor.

POSTED BY: Sam Carrettie
1 month ago

Yes, in previous versions of Mathematica (version 9) the output of this code:

\[Psi]even[\[Xi]_, K_] = 
 FullSimplify[\[Psi][\[Xi]] /. 
   DSolve[{D[\[Psi][\[Xi]], {\[Xi], 
          2}] - (\[Xi]^2 - K) \[Psi][\[Xi]] == 0, \[Psi][0] == 1, 
      Derivative[1][\[Psi]][0] == 0}, \[Psi][\[Xi]], \[Xi]][[1]], 
  K > 0]


E^(-(\[Xi]^2/2)) Hypergeometric1F1[(1 - K)/4, 1/2, \[Xi]^2]

Now the output from version 11 is what you wrote. The current output (the one you wrote) is not an effective way to teach the solutions, and it isn't fully simplified anyway. I was trying to figure out how to reduce the current output (the one you wrote) to the full simplified version (which Mathematica version 9 used to output).

Thanks for any insight!

POSTED BY: Will Smith
1 month ago

Not very elegant but gets you to the result:

eq1 = D[r[x], {x, 2}] - (x^2 - k) r[x] == 0;
r2 = r[x] /. (DSolve[eq1, {r[x]}, x][[1]])

(* C[2] ParabolicCylinderD[1/2 (-1-k),\[ImaginaryI] Sqrt[2] x]+C[1] \
ParabolicCylinderD[1/2 (-1+k),Sqrt[2] x]  *)

eq3 = {(r2 /. x -> 0 ) == 1, ( D[r2, x] /. x -> 0) == 0};
sol2 = FullSimplify[Solve[eq3, {C[1], C[2]}], 
   k > 0 && k \[Element] Integers][[1]]

(*  {C[1]\[Rule]((1-\[ImaginaryI]) 2^(1/4 (-7+k)) (1+(-1)^k) \
\[ExponentialE]^(-(1/4) \[ImaginaryI] k \[Pi]) Gamma[1/2-k/2] \
Gamma[(3+k)/4])/\[Pi],C[2]\[Rule]((1+\[ImaginaryI]) 2^(-(7/4)-k/4) \
(1+(-1)^k) \[ExponentialE]^(-(1/4) \[ImaginaryI] k \[Pi]) \
Gamma[3/4-k/4] Gamma[(1+k)/2])/\[Pi]}  *)

FullSimplify[r2 /. sol2]

(*  \[ExponentialE]^(-(x^2/2)) Hypergeometric1F1[(1-k)/4,1/2,x^2]  *)
POSTED BY: Michael Helmle
1 month ago

That's wonderful! Thank you very much!

POSTED BY: Will Smith
1 month ago

Group Abstract Group Abstract