← Go back to the interactive notebook
Background Theory: Numerical Solution of the Schrödinger Equation for a One-Dimensional Quantum Well
Original notebook: theory_1quantumwell.ipynb
Introduction
The Schrödinger equation is the core of quantum mechanics. Solving it, we can obtain chemical and physical properties of molecular and crystal systems. However, solving the Schrödinger equation for realistic systems is computationally very expensive. The analytical solution is only available for simple systems, such as a hydrogen atom.
In this notebook, we demonstrate how to solve the (time-independent) Schrödinger equation numerically for a one-dimensional (1D) quantum well. The eigenvalues and eigenfunctions (wavefunctions) are solved by diagonalization of the Hamiltonian, written in matrix form on a regular grid along the 1D axis. Eigenfunctions and eigenvalues are shown interactively in the figure displayed in the interactive notebook.
Schrödinger equation
The Schrödinger equation is named after the Austrian-Irish physicist Erwin Schrödinger. The (time-independent) Schrödinger equation for a one-dimensional system is:
where is the wavefunction of the 1D system, is the reduced Planck constant, is the potential energy, is the mass of the particle, and is the energy of the system. By solving this eigenvalue problem, we can obtain the wavefunctions (or eigenfunctions) and the corresponding eigenenergies , labelled by an integer index .
Numerical method
If we define the Hamiltonian operator as:
the Schrödinger equation can be written as:
In this form, it is clear that the Schrödinger equation is a typical eigenvalue equation. If we discretize the axis on a regular grid of points , then the wavefunction can be written as a vector: . In turn, we can discretize the Hamiltonian operator as a matrix, and then solve the equation by numerical matrix diagonalization.
Let us briefly discuss how to diagonalize , that is the sum of two terms. Discretizing the potential term is easy, since the potential energy is local. Therefore, the operation can be written as simply multiplying, at each grid point , the wavefunction by the value of the potential at (i.e., ):
that is, the operator is a diagonal matrix, where the diagonal values are obtained by discretizing the potential energy on the same grid.
In order to discretize the kinetic-energy term, we need to first understand how to discretize a second-derivative operator. If we consider a generic (discretized) 1D function , we want to write an approximation for its (discretized) second derivative . We can do this by approximating the derivative:
where is the distance between to neighboring grid points (). Using this result, we can now write the second-derivative operator in matrix form as:
Putting all results together, the Hamiltonian operator can be thus written as:
where .
Using this expression, is now easy to write a numerical form for for any potential term and use numerical routines to diagonalize the matrix and obtain eigenvalues and eigenfunctions. In this example, we use a square-well potential.