Responsive Navbar with Google Search
TDSE Solution: Crank-Nicolson Methods
Python runs in your browser. Heavy or infinite loops may freeze your browser tab. Use "Stop" if needed; for heavy jobs, run locally.
Program 1

Crank-Nicolson Methods

Time Evolution of Gaussian Wavepacket C-N Method
Output 1

The Crank-Nicolson method is particularly advantageous for time-dependent problems because it treats the spatial derivative in a way that is stable for larger time steps compared to explicit methods. It achieves this by averaging the spatial derivatives at two consecutive time levels, which leads to a second-order accurate method in both time and space.

Derivation

1. Time Discretization:

The time interval is divided into discrete steps:

\[ t_n = n \Delta t \quad \text{for} \quad n = 0, 1, 2, \ldots \]

2. Spatial Discretization:

The spatial domain is divided into \(N\) grid points:

\[ x_k = k \Delta x \quad \text{for} \quad k = 0, 1, 2, \ldots, N \]

3. Finite Difference Approximations:

The Crank-Nicolson method approximates the time derivative using the average of the values at the current and next time levels:

\[ \frac{\partial \psi}{\partial t} \approx \frac{\psi_{k}^{n+1} - \psi_{k}^{n}}{\Delta t} \]

This gives the equation:

\[ \frac{\psi_{k}^{n+1} - \psi_{k}^{n}}{\Delta t} = \frac{1}{2} \left( \frac{\partial \psi}{\partial t} \bigg|_{t=t_n} + \frac{\partial \psi}{\partial t} \bigg|_{t=t_{n+1}} \right) \]

4. Second Derivative Approximation:

The second spatial derivative is approximated using central differences:

\[ \frac{\partial^2 \psi}{\partial x^2} \approx \frac{\psi_{k+1}^{n} - 2\psi_{k}^{n} + \psi_{k-1}^{n}}{(\Delta x)^2} \] and \[ \frac{\partial^2 \psi}{\partial x^2} \approx \frac{\psi_{k+1}^{n+1} - 2\psi_{k}^{n+1} + \psi_{k-1}^{n+1}}{(\Delta x)^2} \]

5. Substituting into the TDSE:

In the context of the TDSE:

\[ i \hbar \frac{\partial \psi}{\partial t} = -\frac{\hbar^2}{2m} \frac{\partial^2 \psi}{\partial x^2} + V(x) \psi \]

Using the Crank-Nicolson approximation gives us:

\[\small i \hbar \frac{\psi_{k}^{n+1} - \psi_{k}^{n}}{\Delta t} = \] \[\small -\frac{\hbar^2}{4m(\Delta x)^2} \left( \psi_{k+1}^{n+1} - 2\psi_{k}^{n+1} + \psi_{k-1}^{n+1} + \psi_{k+1}^{n} - 2\psi_{k}^{n} + \psi_{k-1}^{n} \right) \] \[\small + \frac{(V_k^{n+1}\psi_{k}^{n+1} + V_k^{n}\psi_{k}^{n})}{2} \]

6. Rearranging the Equation:

This results in a system of equations that can be expressed in matrix form:

\[\small \psi_k^{n+1} \left(1 + 2\mu + i \Delta t V_k^{n+1} \right) - \mu \psi_{k+1}^{n+1} - \mu \psi_{k-1}^{n+1} \] \[\small = \psi_k^{n} \left(1 - 2\mu - i \Delta t V_k^{n} \right) - \mu \psi_{k+1}^{n} - \mu \psi_{k-1}^{n} \]

Matrix Formulation

The Crank-Nicolson method leads to a tridiagonal system of equations which can be expressed as:

\[ A \psi^{n} = B \psi^{n+1} \]

Matrix Formulations

1. Matrix \(\mathbf{B}\):

The matrix \(\mathbf{B}\) corresponds to the coefficients of the unknown wave function \(\psi^{n+1}\) at the new time level \(t_{n+1}\).

The general form of the tridiagonal matrix \(\mathbf{B}\) is given by:

\[\tiny \mathbf{B} = \begin{bmatrix} 1 + 2\mu + i \Delta t V(x_1) & -\mu & 0 & \cdots & 0 \\ -\mu & 1 + 2\mu + i \Delta t V(x_2) & -\mu & \cdots & 0 \\ 0 & -\mu & 1 + 2\mu + i \Delta t V(x_3) & \ddots & 0 \\ \vdots & \vdots & \ddots & \ddots & -\mu \\ 0 & 0 & 0 & -\mu & 1 + 2\mu + i \Delta t V(x_N) \end{bmatrix} \]

2. Matrix \(\mathbf{A}\):

The matrix \(\mathbf{A}\) corresponds to the coefficients of the known wave function \(\psi^n\) at the previous time level \(t_n\).

The general form of the tridiagonal matrix \(\mathbf{A}\) is given by:

\[\tiny \mathbf{A} = \begin{bmatrix} 1 - 2\mu - i \Delta t V(x_1) & \mu & 0 & \cdots & 0 \\ \mu & 1 - 2\mu - i \Delta t V(x_2) & \mu & \cdots & 0 \\ 0 & \mu & 1 - 2\mu - i \Delta t V(x_3) & \ddots & 0 \\ \vdots & \vdots & \ddots & \ddots & \mu \\ 0 & 0 & 0 & \mu & 1 - 2\mu - i \Delta t V(x_N) \end{bmatrix} \]
  • Matrix \(\mathbf{A}\): Contains the coefficients for the new time level \(t^{n}\) and includes terms that account for both the spatial and potential contributions.
  • Matrix \(\mathbf{B}\): Contains the coefficients for the current time level \(t^{n+1}\) and reflects the contributions from the previous state of the wave function.

These matrices are central to the Crank-Nicolson method's implementation, allowing for the efficient solution of the resulting linear system at each time step.