Time - Dependent Wave Functions

Particle in an Inpenetrable Box (0<x<1)

(*Normalized energy eigenstates*)
phi[n_,x_]=Sqrt[2]Sin[n Pi x];

(*State 1 at t=0 describes a function that is flat in the interal [0.4,0.6] and zero elsewhere *)
psi1[x_]=1/Sqrt[0.2]HeavisideTheta[x-0.4] HeavisideTheta[0.6-x]

(*State 2 at t=0 describes a function that is flat in the interal [0,0.2] and zero elsewhere *)
psi2[x_]=1/Sqrt[0.2]HeavisideTheta[x] HeavisideTheta[0.2-x]

(*Projection of State 1 on energy eigenstate n*)
c1[n_]=Integrate[phi[n,x]/Sqrt[0.2],{x,0.4,0.6}]

(*Projection of State 2 on energy eigenstate n*)
c2[n_]=Integrate[phi[n,x]/Sqrt[0.2],{x,0,0.2}]

(*State 1 at t=0 as series of n states, but series terminated at m-th term*)
psi1[m_,x_]:=Sum[c1[n]phi[n,x],{n,1,m}]

(*Time-dependent state 1 as series of n states, but series terminated at m-th term*)
psi1[m_,x_,t_]:=Sum[Exp[I t n^2]c1[n]phi[n,x],{n,1,m}]

(*State 2 at t=0 as series of n states, but series terminated at m-th term*)
psi2[m_,x_]:=Sum[c2[n]phi[n,x],{n,1,m}]

(*Time-dependent state 2 as series of n states, but series terminated at m-th term*)
psi2[m_,x_,t_]:=Sum[Exp[I t n^2]c2[n]phi[n,x],{n,1,m}]

(*Pictures for time-dependence of the modulus squared of state 1*)
tt1=Table[Plot[Abs[psi1[10,x,t]]^2,{x,0,1},PlotRange->{0,8}],{t,0,0.79,0.01}];

(*Pictures for time-dependence of the modulus squared of state 2*)
tt2=Table[Plot[Abs[psi2[10,x,t]]^2,{x,0,1},PlotRange->{0,8}],{t,0,6.3,0.025}];

ListAnimate[tt1,10]

ListAnimate[tt2,10]

Animate[tt0,{}]

Coherent State for Harmonic Oszillator

We take the result for a coherent state from the lecture notes Chap 3.2 and plot a movie for its time dependence.  (delta=0,omega=1)

PsiZsquared[x_,t_,x0_,xtilde_]=1/((Pi)^(1/2)xtilde) Exp[-(x-x0 Cos[t])^2/xtilde^2]

(*Pictures for time-dependence of the modulus squared of state 1*)
tt3=Table[Plot[PsiZsquared[x,t,1,0.4],{x,-2,2},PlotRange->{0,Automatic}],{t,0,2Pi-0.1,.1}];

ListAnimate[tt3,10]