Quantum SHO Ladder Operator in Mathcad

2 replies · 4K views · last reply
bugbug
Messages
10
Reaction score
0
A Quantum I problem set asks me to graph the first 15 states of the simple harmonic oscillator. Our department uses mathcad heavily, so I think I should write a function that applies the ladder operator repeatedly to generate the wave function. I'm having trouble getting it to actually return a function to me though. Enclosed is the little loop I have written. Any advice on making this actually work?
 
Attachments
  • Mathcad function definition for a quantum harmonic oscillator wavefunction: a loop over step from 1 to n applies the ladder operator, returning psi.
    quantumsholadder.GIF
    1.8 KB · Views: 577
I figured out the problem. I need to assign the result of the application of the wave function to an intermediate function before assigning it back to psi:
 
Attachments
  • Mathcad worksheet defining a function psi(n,x) for the quantum harmonic oscillator: psi(x) set to (m·ω/(π·h))^(1/4)·e^(−m·ω/(2h)·x²), then a for loop over step from 1 to n assigning intermed(x) = 1/√(2h·m·ω)·√step·[−1i·(−1i·h·d/dx psi(x)) + m·ω·x·psi(x)], then psi(x) set to intermed(x), and return psi(x).
    quantumsholadderfix.GIF
    2.1 KB · Views: 580
All right. Now I have another problem. When I attempt to graph psi 3 (x) it takes an extraordinarily long time to process. But if I apply simplify to psi n of x and then paste that into the graph it evaluates in much, much less time. Is there any way to automate this process?