Discretization of the linear Schrödinger equation
a la Crank-Nicolson results in a system of linear equations of the form where withImplement the scheme above in order to solve the Schrödinger equation with .
The initial condition is
where . Use . Place *N*=300 grid points in the interval *x*=-40 to *x*=40.The analytical solution is
where . The period of the solution is .This problem is taken from Computational Methods for Physicists by S. Sirca and M. Horvat.