See all sketches...

Sketch 10

Particle in a Box and QHO: Solving PDEs with ODEs, Ansatz, and Algebraic Approach


Huh...

I've been rereading some things about the particle in a box and QHO setups, but when I was redoing a lot of these integral computations myself, I keep running into tiny errors that keep me from getting the right answer.

Ideally, I feel that my work should be readable and simple enough that I shouldn't feel like I need a solutions manual to ensure its correctness. That's the main reason I'm making this sketch, to determine if there is some way that I can tabularize my computation, or determine a handful of things to memorize that will make organization and verification much simpler.

Even if I can't figure out a better way to organize my work, the making of this sketch should at least make me redo my computations, and on top of this, I want to do some experiments simulating these PDEs.

Date Started: July 6, 2024
Date Finished: In Progress...

Edit: I may have gotten a bit distracted from the original purpose of this sketch, :-), but I think the sketch is still pretty good!

The Premise

A while ago, I was trying to solve Problem 2.5 in Griffiths's Quantum Mechanics book (essentially about computing a bunch of things for the infinite square well). The problem is, everything got extremely messy, and now I feel like not even returning to the book, because if I go back to the book, I feel like I have to complete Problem 2.5, but looking at my past work for Problem 2.5, it just looks miserable:

To me, my work isn't thaaat messy (ehh, maybe it is). But it gets the wrong answer (I think), and I can't immediately see where I went wrong. Do I want to erase it and start from scratch? Maybe I should just skip this problem? Ugh. There has to be a better way of doing all this computation with a low error rate that doesn't involve plugging everything into a symbolic computation tool.

In any case, writing it up in LaTeX should do the trick, so that's why I'm making this sketch.

1D Particle in a Box

I'll start with the 1D Particle in the Box. The goal? It's in the name: we want to simulate a free particle in a box. To frame this mathematically, we can create a "box" by creating an appropriate potential energy function: V(x)={0axa,else. This is a box because particles have finite energy to begin with, so it could not leave the domain (a,a) else it would have infinite energy.

The quantum mechanics perspective allows us to determine the "trajectory" of the particle via its wave function ψ:R×[0,)C, which is a solution to the Schrödinger equation: itψ=22mxxψ+Vψ Generally, we solve this equation via separation by variables, which gives us so called "separable solutions". These solutions are nice for a few reasons, for which one can check out Griffiths. Most importantly, we can find general solutions by taking linear combinations of these separable solutions. So our aim is to first find the separable solutions.

Separation of Variables

For good measure, let's do the separation of variables. Let ψ(x,t)=f(x)g(t), for f:RC and g:RC. This notation is a bit different than what I've seen elsewhere, but the notation elsewhere that I've seen tends to be very notationally-abusive, so I prefer to just keep the variables f and g even though it isn't canonical. Then ifg=22mfg+Vfg To make some progress here, we pray that ψ0 and divide both sides by fg. Then ig(t)g(t)=22mf(x)f(x)+V(x) But now notice, the LHS is a function of time, and the RHS of space. Since this holds for all x and t, we must have that ig(t)g(t)=22mf(x)f(x)+V(x)=E for some EC. Which gives us two "mini-Schrödinger equations": itg=Eg 22mxxf=(EV)f which are affectionately called the time-dependent and time-independent Schrödinger equations respectively (TDSE and TISE). The solution to TDSE can be seen quickly to be: g=eiEt so finding these so called "separable solutions" reduces to solving TISE. You may be saying: hold on, what about boundary conditions? Well, in our case, any Dirichlet or Neumann boundary conditions would result in a constant being multiplied out front, so a solution such as g=CeiEt. But we can always push that constant over to f, the solution to TISE, so it sufficies to just take g=eiEt here.

TISE for 1D Particle in a Box

We now return to the particle in a box situation. First, we need to find the separable solutions, which from above just means solving TISE. For x[a,a], we know that V=0, so we wish to solve xxf=2mE2f, whose solutions are well known: sinusoids. f=Acos(kx)+Bsin(kx) where k=2mE. For x[a,a], V=, so the only even slightly reasonable solution is where f=0 (technically this is a bit awkward to be multiplying 0 and , but perhaps we could define it in that way in our extended real number line, or instead work with V as a limit of a sequence of functions).

Physically, it makes the most sense if f is reasonably regular, so we enforce that f should be continuous. Then we must have: 0=Acos(ka)+Bsin(ka) 0=Acos(ka)+Bsin(ka) so Acos(ka)=0 and Bsin(ka)=0. If we further want our solution to be "normalizable" (AKA, we want functions with finite but nonzero L2 norm), we force either A=0 and ka=nπ for nZ or B=0 and ka=(2n1)π2 for nZ. For a given n, we may take kn to be the corresponding value of k as per these relations. In any case, 2kna=nπ for nZ, and for even n, we obtain a solution of the form Bsin(knx), and for odd n, we obtain a solution of the form Acos(knx). Up to sign (which doesn't matter because we normalize anyway), then the solutions become fn(x)={Csin(knx+kna)x[a,a],0else. (we add in a kna to turn the cosine into a sine term by shifting). To summarize, our solution to TISE for particle in a box satisfies a few properties:

Integration

I thought of a few ways to try and be more organized. I couldn't come up with a good way to tabularize all the computation, but what could be an improvement (while not as spacially efficient as tabularization) is indentation. Here's what it might look like for the computations to find C above:

We would like to know several things about the particle in a box. What are the expectations of the position and momentum? Perhaps, can we compute the acceleration of the particle? Additionally, what are the variances? It would be nice to determine a few moments of the probability distributions for positions, momentums, etc. of these particles so that we can get a good feel for them distributionally.

Each computation comes with its own integral:

There are, in particular, three main integrals which need to be computed: ψxψdx, ψx2ψdx, and ψ(hix)2ψdx.

For the first two, we are actually very lucky, because things commute, and for separable solutions ψ=fg, we know from above that gg=1. The integrals are thus the same as fnfnxdx and fnfnx2dx. Also, it turns out that for our particular problem, we may choose C to be real (in the end it doesn't matter for our general solutions since they will be linear combinations), so that fn is real-valued, and the integrals become fn2xdx and fn2x2dx.

Since fn2 is an even function, fn2x is odd, so fn2xdx=0.

On the other hand, fn2x2 is even, so fn2x2dx=20fn2x2dx. Now we have: (Compact Support)0fn2x2dx=0afn2x2dx=0aC2sin2(knx+kna)x2dx=C20ax2sin2(knx+kna)dx(Double Angle Formula)=C20ax2(12cos(2knx+2kna))dx=C20ax2dx2C20ax2cos(2knx+2kna)dx Now the first expression becomes C2a3/3. As for the second expression, we do integration by parts tabularly.

Signs D I
+ x2 cos(2knx+2kna)
- 2x 12knsin(2knx+2kna)
+ 2 14kn2cos(2knx+2kna)
- 0 18kn3sin(2knx+2kna)
so the second integral is (1knxsin(2knx+2kna)+12kn2cos(2knx+2kna))|0a=aknsin(4kna)+12kn2cos(4kna)12kn2cos(2kna). Now 2kna=nπ, so this reduces to 12kn2(1(1)n). So for n even, the integral evaluates to C2a33 and for n odd, the integral evaluates to C2a332C2kn2 This means that fn2x2dx=2C2a33 when n is even and fn2x2dx=2C2a334C2kn2 when n is odd.

Quantum Harmonic Oscillators (QHO)

The importance of the QHO is that in nature, whenever a system is subject to a conservative force, and is around a stable equilibrium, the fluctuation around that equilibrium is approximately a harmonic oscillator. Mathematically, it is also distinct from our previous example because now V isn't constant with respect to x. For a harmonic motion, our angular frequency satisfies ω=km, so k=mω2. This means our Shrodinger equation becomes: 22md2ψEdx2+12mω2x2ψE=EψE Note that this section of this sketch closely follows the methods from two of my Quantum Mechanics professor's lectures.

Analytic Method

First we will use an analytic method, shown by my quantum mechanics professor. There are four steps:

  1. Introduce dimensionless parameters (we write x=bξ, where b has units of lengths and ξ is a dimensionless parameter).
  2. Try to guess the ansatz by considering some limits (ξ± and ξ0).
  3. Substitute the ansatz into the TISE and consider the power series.
  4. Impose boundary condition to find the allowed energy values.

From the first step, our equation becomes: 22mb2d2ψEdξ2+12mω2b2ξ2ψE=EψE which rewriting becomes: d2ψEdξ2m2ω2b42ξ2ψE+2mEb22ψE=0 We now notice that each term should have the same units as ψE, so the coefficients of the second and third terms should be dimensionless. Thus, we can take b=mω which defines a length scale based on the fact that m2ω2b42 should be dimensionless. Then, 2mEb22=2Eω, which is idneed dimensionless. It is natural here to define E=2Eω. With these definitions, TISE becomes: d2ψEdξ2ξ2ψE+EψE=0

Now it's time for the second step, guessing an ansatz.
Consider ξ, or ξ>>E. Then TISE becomes d2ψEdξ2ξ2ψE=0. This is sorta like d2ψEdξ2k2ψE=0, which makes us guess ψE=ξme±ξ2/2. Then ψE=mξm1e±ξ2/2±ξm+1e±ξ2/2 ψE=ξm+2e±ξ2/2[1±(2m+1)1ξ2+m(m1)1ξ2] Now in the limit, this indeed does satisfy d2ψEdξ2ξ2ψE=0, so this ansatz works. Since TISE is linear, this would mean mAmξme±ξ2/2 is also a solution.
Consider ξ0. This becomes d2ψdξ2+EψE=0. The general solution is then ψEAsin(Eξ)+Bcos(Eξ)AEξ+B+B2Eξ2 via Taylor expansion. Considering our ansatz from the previous limit, it seems that under a taylor expansion, that would still work here! The mAmξm part is somewhat like the AEξ term and the exponential term is somewhat like the other term.
Based on these two limits, we guess a form ψE=h(ξ)eξ2/2 for the solution where h has a power series (we want the minus sign so that ψE is finite as ξ blows up). You might be saying: if we were going to use a power series, why do the ansatz step? If that's what you're thinking, please see Appendix A for a more thorough discussion of that.

So far so good, for the third step, we will now substitute the ansatz into the TISE. Notice that ψE=(hξh)eξ2/2 and ψE=(hhξhξ(hξh))eξ2/2=(h+(ξ21)h2ξh)eξ2/2. The Shrodinger equation then becomes h2ξh+(ξ21+Eξ2)h=0 Now using that h is analytic, we write h=j=0ajξj, so j=0aj+2(j+2)(j+1)ξj2ξj=1ajjξj1+(E1)j=0ajξj=0 2aj+2+a0(E1)+j=1(aj+2(j+2)(j+1)2jaj+(E1)aj)ξj=0 From this we get the recursive relation: aj+2=(2j+1E)(j+2)(j+1)aj Basically, once we choose a0 and a1, we can find the result. In order for ψE0 to go to zero as |ξ|, we need the series to terminate at a finite term, so we need 2j+1E=0 for some j=n. For a demonstration of this result, see Appendix B. Since E=2Eω, E=(n+12)ω which is called energy quantization.

We can only have bound states because V(x) tends to infinity as |x|. Since V(x)=V(x) so V is even, the bound states are either symmetric or antisymmetric. In the symmetric case, we have a1=a3==0. Now for each value of n, we obtain a polynomial h, and a0 is an appropriate normalization factor. Notice that n=0 and n=1 lead to the same polynomial h, and similarly with n=2k and n=2k+1 in general. In the antisymmetric case, we construct a3, a5, and so on from a1. The h polynomials here are called Hermite polynomials. We then get ψn for each n being the product of a Hermite polynomial and a Gaussian.

Algebraic Method

Notice that clasically, H=p22m+12mω2x2=12m(p+imωx)(pimωx). This motivates trying a similar factorization of the operator in quantum mechanics. We can try to write our Hamiltonian operator in the form: H^a^a^ (notice that the RHS is always Hermitian for all a^). We can squint at this and write: a^12mω(mωX^+iP^). The reason for the ω in the denominator is because of the "energy scale" (recall the stuff we did before with dimensionless quantiites). a^12mω(mωX^iP^). These are called the annihilation and creation operators respectively. You can compute quickly via linearity and basic properties that the commutation relation between them is [a^,a^]=1, the identity! So they don't commute. One can compute fairly easily that: (a^a^+12)ω=H^. from which it becomes not too difficult to compute that [a^,H^]=ωa^ and [a^,H^]=([H^,a^])=([a^,H^])=ωa^. From this we get two nice results: (assuming they aren't the zero vector) a^|E is an energy eigenstate of energy Eω, and a^|E is an energy eigenstate of energy E+ω. First let's examine the usefulness of these results, and then we will prove them later in Appendix C. Once we know these relations, we can define a a ground state |0 as an eigenvalue of a^, and notice that it must have energy 12ω. Then repeatedly applying the creation operator gets us more and more states of increasing energies. Let |n denote |En, where En=(n+12)ω and n0. Then |cn|2=|cn|2n1|n1=n|a^a^|n=n|(H^ω12)|n=n|(n+12)ωω|n12=n+1212=n so |cn|2=n. In other words, a^|n=n|n1. Substituting this into n|a^a^|n, we see that a^|n=n+1|n+1. Sometimes we define the number operator N^=a^a^, so that H^=ω(N^+12). Aside from being mathematically nice, these are very useful operators when solving problems. There are two more important ideas: X^=2mω2mω(a^+a^) P^=i2mω2(a^a^) which allows us to much more easily do computations relating to X^ and P^ when working with energy eigenstates.

Now we can actually solve this via an algebraic method. By definition, a^|0=0. But this means, by acting by x| on the left, 12mω[mωx+i(iddx)]ψ0=0 Simplifying, this becomes mωxψ0+dψ0dx=0 Separating the variables, mωxdx=1ψ0dψ0 so ψ0=Aemωx2/2. Since x=bξ with b=mω, ψ0=Aeξ2/2. So this is arguably a lot easier than doing all the weird analytic stuff. :-)

Appendix A: What if we skip the ansatz step?

This time, let's entirely skip the ansatz step and try to solve the differential equation by Taylor expanding ψE.

Appendix B: Energy Quantization of QHO

Appendix C: PRoving Important Algebraic Relations

References