# Numerical solution of zero-potential time-dependent Schrödinger equation in 1D

I want to solve numerically the one-dimensional time-dependent Schrödinger equation $$i \psi_t(x,t)=-\frac{\hbar}{2m} \psi''(x,t)$$

My issue is that I don't have the physical background to understand what are the correct boundary conditions/initial state and I don't know how to know if the solution I get is the correct one. So I want to try to reproduce the same solution I found on wikipedia, shown below:

What I've seen is that one usually discretize $$\psi''(x,t)$$ with the usual centeral finite difference scheme $$\psi''(x_i,t) = \frac{\psi_{i+1}(t) - 2\psi_i(t) + \psi_{i-1}(t)}{dx^2} + \mathcal{O}(h^2)$$

and hence the PDE becomes a system of ODEs that I can solve with an appropriate method.

Here are my questions:

• What boundary conditions do I have to impose to have a behaviour like in the figure? The solution does not appear to have a "fixed" value. How can I impose them (I'd need an answer in terms of what entries of the matrix I should change)
• What could be an initial condition do I have to impose to have a "wave" like the one in the picture?

Following the suggestion of @AloneProgrammer, I focus on the particle in a box case, where my domain now is $$[0,1]$$ and I have $$0$$ potential inside the domain, and $$V(x) = \infty$$ outside. In this configuration, the boundary conditions at $$0$$ and $$L$$ are Dirichlet homogeneous,i.e. $$\psi(0,t) = \psi(L,t) = 0$$

Hence the PDE becomes (I don't consider for the moment $$\hbar$$ and set $$m=1$$):

$$\begin{cases} \psi_t = \frac{\mathbf{i}}{2} \psi_{xx} \\ \psi(0,t) = \psi(1,t) = 0 \\ \psi(x,0) = \sin(2 \pi x) \end{cases}$$

where I choose as initial datum $$\psi(x,0)$$ a sinus. I integrate up to time $$T=1$$ using a suitable numerical method for the time integration and discretizing with finite difference in space as written above. I show in the following the plot of real and imaginary part at different times.

• Do you have any insist on reproducing that particular animation? I think it's better to solve a free particle in a box, where you have analytical solution and then compare your numerical results with that. If you agree I will elaborate it a bit more in an answer. Also, I don't think it's a good idea to convert Schrodinger equation, which is a PDE, to an ODE. I will elaborate a bit more about that as well in my answer if you want. – Alone Programmer Dec 19 '19 at 3:42
• Yes, if you could elaborate it as an answer it would be perfect ! Especially for the case where I have an analytical solution to compare. anyway, I prefer to keep my approach for the moment, since it's just a simple method of lines – VoB Dec 19 '19 at 6:46
• @AloneProgrammer I edited my answer considering a free particle in a box as you suggested. Is it okay in your opinion? I know that usually one end up with solving the time independent one, but I have to solve the time dependent. I don't know what could be the analytical solution, and moreover I don't know what am I supposed to plot once I found $\psi(x,t)$. I just plotted the real and imaginary part of the soluition at different times like $t=0.1,0.3$ – VoB Dec 19 '19 at 9:19
• Moreover, I noticed that the norm square of the solution at each time step is always equal to the norm of the initial data $\psi(x,0)= \sin(2 \pi x)$, which I know that it's a propery that has to be satisfied. – VoB Dec 19 '19 at 10:05
• It's a standard absorbing boundary condition. There are many references one can find for it regarding the Schroedinger equation. – Wolfgang Bangerth Dec 19 '19 at 20:06

Initial conditions: The initial condition is a wavepacket. In general, this means you have an arbitrary mixture of plane waves $$e^{ikx}$$. A common example is to construct it by applying a another Gaussian to the plane wave on the basis of a plane-wave $$e^{i(kx)}$$ by applying a Gaussian with mean $$x_0$$ and width $$\lambda$$ to it, i.e. $$\Psi(x, t=0) = e^{i(kx)} e^{-\frac{(x-x_0)^2}{2\lambda^2}}$$ As usual, this should further be normalized so that $$||\Psi(x, t=0)||=1$$.