I have this Mathematica problem that solves numerically the time-dependent Schrödinger equation in a box:

sig = 1;
bsize = 655;

s = NDSolve[{D[u[t, x], t] == I/2*D[u[t, x], x, x], 
    u[0, x] == (1/(2*Pi*sig^2))^(1/4)*Exp[-x^2/(2*sig)^2], 
    u[t, -bsize] == u[t, bsize]},
    u, {t, 0, 10}, {x, -bsize, bsize}];

wx[t_, x_] := u[t, x] /. s
px[t_, x_] := Abs[wx[t, x]]^2

Manipulate[Plot[px[t, x], {x, -10, 10}, PlotRange -> {{-10, 10}, {0, 1}}], {t,0, 10}]

The solution to $t=0$ is:

enter image description here

But, if I increment the box size bsize to bsize=656 I get this incoherent solutions:

enter image description here

Question: What's happening here?


1 Answer 1


First, you're solving the Schrödinger equation not in a box, but rather you apply periodic boundary conditions. That is, it's more like solving the TDSE on a ring. But this just as a comment and shouldn't matter here.

What's happening here is that you evolve a Gaussian wave packet in time. In a suitable hamonic oscillator potential, it would be stable and remain constant under time evolution.

Here, however, there is no potential whatsoever, and so the wavepacket will spread out. This is intended behaviour, and there's a well known analytical formula describing the evolution (usually taught in first quantum mechanics courses). Note that if you'd look at the real or imaginary part you'd see more "wave-stuff" going on. It's only the absolute square, that retains the Gaussian form.

However, there is something wrong with your normalization here. The integral over the solution should remain constant, which obviously isn't the case here.

  • $\begingroup$ Therefore the problem is that Mathematica is using a numerical method that doesn't preserve the norm? $\endgroup$
    – LongJohn
    Commented Apr 28, 2021 at 6:53
  • $\begingroup$ No, that's not the problem here (even if Mathematica likely will use a method that doesnt preserve the norm). The deviation is too large. Look, you initial wavepaket is peaked at 0.4, and has a width of about 2.5. Your final wavepacket has the same peak height, but a much larger width. No integrator whatsoever should show such deviations. I don't see a mistake in your code, unfortunately. Maybe you could comment again about the difference between bsize=655 and bsize=656? Is there any? $\endgroup$
    – davidhigh
    Commented Apr 28, 2021 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.