Stationary States

Phys 425 2.1 and 2.2: What is a stationary state?
   For this activity, we'll use the solutions to the infinite square well.

(*1. Since we're just concerned with the general behavior of the functions, let's set all these constants to 1. In real life, they'd represent the length of the box (in meters), the reduced Planck's constant, and the mass of the particle. We'll also tell Mathematica that x, n, and t are real. Run this cell using SHIFT+ENTER.*)
L:=1
ℏ:=1
m:=1
$Assumptions = {x,n,t}∈Reals

(*2. This function tells us that the energy eigenstates for the allowable solutions to the infinite square well scale with n^2. Run this cell. I am using the function En to not conflict with Mathematica predefined functions.*)
En[n_]:=(((n^2) (π^2) (ℏ^2))/(2 m (L^2)))

(*3. This function tells us the spatial part of the full wavefunction. Run the cell.*)
ψ[x_,n_]:=(Sqrt[(2/L)])Sin[((n π x)/L)]

(*4. In this cell, input the formula for the time part of the full wavefunction. When finished, run the cell. Hint: To make the imaginary number, i, hit Esc+i+i+Esc or go to Palettes --> Basic Math Assistant. This Palette will also allow you to input Greek letters under the "Typesetting" menu. Or, copy and paste from above! You can also use a previous defined function.*)
ϕ[t_,n_]:=

(*5. In this cell, we'll define the full wavefunction as a function of x, t, and also energy level, n. We'll define it as a piecewise function.*)
Ψ[x_,t_,n_]:=Piecewise[{{FILL IN THIS BLANK,x<0},{FILL IN THIS BLANK,0≤x≤L},{FILL IN THIS BLANK,x>L}}]

(*6. Use Mathematica functions to confirm that the wavefunction is properly normalized for n=1 and n=3. Note, to take the square modulus of a complex number, z, use Abs[z]^2. For defining your limits of integration, you can just write "Infinity" as a word or find the symbo lin your typesetting palette. *)

(*7. Now we're going to show FOUR plots for the n=2 excited state at time t=0. Make a PREDICTION on your page for each of the following graphs of Ψ as a function of x:
1) The real part of Ψ
2) The imaginary part of Ψ
3) The absolute value of Ψ (we may do some review of this)
4) The probability density of the particle.*)

(*8. After your group has all discussed your predictions, run this cell to produce all 4 plots. Compare to your predictions.*)
Plot[Re[Ψ[x,0,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Real[Ψ]"}]
Plot[Im[Ψ[x,0,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Imag[Ψ]"}]
Plot[Abs[Ψ[x,0,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Abs[Ψ]"}]
Plot[Abs[Ψ[x,0,2]]^2,{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Abs[Ψ]^2"}]

(*9. Now make predictions for the same values just a short time later. By "a short time" I mean "just long enough to notice a change in any quantities that might change, but less than 1/4 a period of any oscillation".*)

(*10. After your group has all discussed your predictions, run this cell to produce all 4 plots. Compare to your predictions.*)
Plot[Re[Ψ[x,0.06,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Real[Ψ]"}]
Plot[Im[Ψ[x,0.06,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Imag[Ψ]"}]
Plot[Abs[Ψ[x,0.06,2]],{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Abs[Ψ]"}]
Plot[Abs[Ψ[x,0.06,2]]^2,{x,-L/2,3L/2},PlotRange-> {-2,2},AxesLabel->{"x/L","Abs[Ψ]^2"}]

(*10. To further illustrate what we are seeing, here is an animation of all four quantities. See below for a key. Discuss with your group what you are seeing. You may need to select Dyanmic Updating Enabled in the Evaluation menu. *)
Animate[Show[Plot[{Re[Ψ[x,t,2]],Im[Ψ[x,t,2]],Abs[Ψ[x,t,2]],Abs[Ψ[x,t,2]]^2},{x,0,L},PlotRange-> {-2,2},PlotStyle->{{Blue, Solid},{Blue,Dotted},{Red,Dashed},{Orange,Solid}},AxesLabel->{"x/L","See key"}]],{t,0,0.3175}]
(*BLUE, SOLID = REAL PART*)
(*BLUE, DASHED = IMAGINARY PART*)
(*RED, DASHED = ABSOLUTE VALUE [AKA MODULUS] OF PSI*)
(*ORANGE, SOLID = PROBABILITY DENSITY, AKA SQUARE MODULUS (((|PSI|))^2)*)

(*11. Write, in your own words, what it means to be a "stationary state."*)