Class: Quantum Mechanics
Quantum mechanics is one of the most classic examples of field theories in physics. The Schrödinger equation is a partial differential equation that describes how the quantum state of a physical system changes over time.
In this class, we simulate quantum mechanics through the evolution of the Schrödinger equation.
See the ComFiT Library Reference below for a complete list of class methods and their usage.
Example
The following example demonstrates how to set up a 1D quantum system with a Gaussian wave packet and a potential barrier.
It runs smoothly with comfit 1.8.4
.
import comfit as cf
import matplotlib.pyplot as plt
import numpy as np
# Set up a 1D quantum system
qm = cf.QuantumMechanics(1, xlim=[-50,50], xRes=1001, dt=0.1)
# Initialize a Gaussian wavepacket at x=5 with velocity=1
qm.conf_initial_condition_Gaussian(position=5, width=1, initial_velocity=1)
# Add a potential barrier (optional)
qm.V_ext = 0.5 * (qm.x > 10) * (qm.x < 12) # Barrier from x=10 to 12
height = np.max(abs(qm.psi)) # Get the maximum value of the wavefunction
# Optional: Animate it
for n in range(61):
qm.evolve_schrodinger(5)
fig, ax = qm.plot_complex_field(qm.psi)
qm.plot_field(qm.V_ext, fig=fig, ax=ax, ylim=[0,height], xlim=[0,20])
qm.plot_save(fig, n)
cf.tool_make_animation_gif(n) # Creates animation.gif
The Schrödinger equation
Evolving according to the Schrödinger equation with electron mass
Dividing by the Hartree energy \(E_h = \frac{\hbar^2}{m_e a_0^2}\)
When expressing time in units of \(\frac{\hbar}{E_h}\), potential energy in units of \(E_h\) and length squared in units of
we get the Schrödinger equation in its dimensionless form
So
Atomic unit of | Value |
---|---|
Length | 0.529 Å (Angstrom) |
Energy | 27.2 eV (electron volts) |
Time | 24.2 aS (atto seconds) |
The Born rule
The Born rule states that the probability \(p\) of measuring a particle in the interval \([a,b]\) is given by
A wave packet
A Gaussian wave function is often called a wave packet and can visualize the position and motion of a particle in a quantum mechanical system. An initial wave function with a widt of \(\sigma\) is given by
so that \(|\psi|^2\) is a Gaussian distribution.
An initial velocity \(\mathbf v_0\) can be given to the wave packet by multiplying with a complex phase \(e^{\mathfrak i \mathbf v_0 \cdot \mathbf r}\).
Such an initial condition can be configured by the function qm.conf_initial_condition_Gaussian
.