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.