Quantum Mechanics Project
Quantum Mechanics Project
∂Ψ(x, t) h̄2 2
ih̄ =− ∇ Ψ(x, t) + v(x, t)Ψ(x, t)
∂t 2m
In the special case of a time-independent potential v(x, t) = v(x), Schrödinger’s equation becomes
separable and we may write the particle’s wave function Ψ(x, t) as a product of two terms, Ψ(x, t) =
ψ(x)ϕ(t). Inserting this into the equation and introducing the separation variable En , we arrive at two
separate differential equations,
From this, we may plug in the value of t = 0. Assuming that we know the initial condition for the
system Ψ(x, 0), we may calculate the constant coefficients cn .
X
Ψ(x, 0) ≡ Ψ0 (x) = cn ψn (x)
n
The time-independent Schrödinger’s equation is essentially the eigen-value problem Ĥ |ψn ⟩ = En |ψn ⟩,
and since Ĥ is a Hermitian operator, its eigen-vectors are orthogonal. By the normalization condition
⟨ψn |ψn ⟩ = 1, we deduce that the eigen-vectors of the time-independent Schrödinger’s equation are
orthonormal.
Performing the inner product with the element ψm (x) from the left, we get
X X Z
⟨ψm |Ψ0 ⟩ = cn ⟨ψm |ψn ⟩ = cn δmn = cm ⇒ cn = ψn∗ (x)Ψ0 (x)d3 x
n n
X Z
⇒ Ψ(x, t) = ψn (x)e−iEn t/h̄ ψn∗ (x)Ψ0 (x)d3 x
n
1
2 The One–Dimensional Particle In a Box
Consider the one–dimensional potential
(
0 0≤x≤a
v(x) =
∞ Otherwise
This represents a free particle in a one–dimensional box with walls located at x = 0 and x = a. It
is rather trivial that outside the box, ψ(x) = 0 and inside the box, the time-independent Schrödinger’s
equation reads
h̄2 π 2 2
En = n
2ma2
We have yet to determine Bn , and we may use the normalization condition for that.
Z a nπ a
x a 2πn
⟨ψn |ψn ⟩ = dx|Bn |2 sin2 x = |Bn |2 − sin x =1
0 a 2 4πn a 0
Since n is a natural number, the integral would be equal to a/2 and the normalization condition
would take the form |Bn |2 = 2/a, or
r
2
|Bn | =
a
p
For simplicity, we may choose zero phase for Bn , setting Bn = |Bn |ei0 = 2/a. Thus finally, the
solution for the nth state of the system would simply be
r
2 nπ
ψn (x) = sin x
a a
The state n = 0 serves as a useless example: there is no particle in the box. Excluding that case, the
full solution for the wave function of the particle will take the form
∞ r
h̄π 2 2
X 2 nπ
Ψ(x, t) = cn sin x exp −it n
n=1
a a 2ma2
By the result of the previous section, by having the initial condition Ψ0 (x), we may write the final
solution for the particle in a box problem.
∞ Z a
h̄π 2 2
2X nπ nπ
Ψ(x, t) = sin x exp −it 2
n dxΨ0 (x) sin x
a n=1 a 2ma 0 a
2
3 Choice of Units and Non–Dimensionalization
To implement a solution, we may use dimensionless measures of distance, i.e. X = x/a. Put simply, we
are measuring x in units of a. In this case, we may write
Z a nπ Z 1
dxΨ0 (x) sin x =a dXΨ0 (X) sin(nπX)
0 a 0
2
h̄π
Let us also measure the time t in dimensions of 2ma2 /h̄π 2 , setting T = t 2ma 2 . With these simplifi-
Let us now use Fourier analysis: by an odd expansion of Ψ0 (X) to the interval [−1, 0] we know that
Z 1 Z 1
dXΨ0 (X) sin(nπX) = 2 dXΨ0 (X) sin(nπX)
−1 0
And by assuming that Ψ0 (X) is a periodic function with period 2 for which the left hand side integral
is its Fourier integral over one period, we arrive at
Z 1 Z 1
1 1
dXΨ0 (X) sin(nπX) = dXΨ0 (X) sin(nπX) ≡ Ψ̃0 [n]/2
2 0 2 −1
Where Ψ̃0 [n] are the Fourier series coefficients of the oddly expanded function Ψ0 (X). Finally, we
arrive at the solution which we may implement using a computer.
∞
X 2
Ψ(X, T ) = Ψ̃0 [n] sin(nπX)e−in T
n=1
n=1
The initial wave functions we are going to model are as follows. Notice that all of the initial conditions
are normalized.
(
1 −0.5 ≤ X ≤ +0.5
• Rectangular initial condition: Ψ0 (X) =
0 Otherwise
+16(X + 0.5) −0.5 ≤ X ≤ −0.25
• Half-triangular initial condition: Ψ0 (X) = −16X −0.25 ≤ X ≤ 0
0 Otherwise
+4X + 2 −0.5 ≤ X ≤ 0
• Full-triangular initial condition: Ψ0 (X) = −4X + 2 0 ≤ X ≤ +0.5
0 Otherwise
(
−6(X − 0.5)(X + 0.5) −0.5 ≤ X ≤ +0.5
• Parabolic initial condition: Ψ0 (X) =
0 Otherwise
3
5 Python Implementation
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
eps = 0.0001 # This is a very small value, basically the "dX" in this simulation.
N = 200 # Number of Fourier terms to use.
X = np.arange(-0.5 - eps, +0.5 + eps, eps) # This is used for functions with domain [-0.5, +0.5]
X_extend = np.arange(-1 - eps, +1 + eps, eps) # This is used for functions with domain [-1, +1]
def half_triangular_initial_condition(X):
return np.piecewise(X, [(-0.5 <= X) & (X < -0.25), (-0.25 <= X) & (X <= 0)],
[lambda X: 16 * (X + 0.5), lambda X: -16 * X])
def full_triangular_initial_condition(X):
return np.piecewise(X, [(-0.5 <= X) & (X < 0), (0 <= X) & (X <= 0.5)],
[lambda X: 4 * X + 2, lambda X: -4 * X + 2])
def parabolic_initial_condition(X):
return np.where(np.abs(X) <= 0.5, -6 * (X - 0.5) * (X + 0.5), 0)
# With a choice of "n" in the previous section, we now have an odd extended initial wave function.
# We may now turn to calculating its Fourier sine series coefficients, tilde_Psi_n.
def fourier_sine_coefficients(odd_extended_func, X_extend, n):
odd_extended_func = odd_extended_func * np.sin(n * np.pi * X_extend)
n_coefficient = np.trapezoid(odd_extended_func, X_extend)
return n_coefficient
tilde_Psi_n = np.arange(1, N + 1)
tilde_Psi_n = np.array([fourier_sine_coefficients(odd_extended_Psi_0, X_extend, i) for i in tilde_Psi
# Now by calculating the Fourier series coefficients, we are fully equipped to calculate the time
# evolution of the quantum particle, Psi(X,T), as mentioned in the paper.
def Psi(X, T, tilde_Psi_n):
wavefunction = np.zeros_like(X, dtype=complex)
for n in range(1, N + 1):
4
wavefunction += tilde_Psi_n[n - 1] * np.sin(n * np.pi * (X + 0.5)) * np.exp(-1j * n * n * T /
return wavefunction
# We have now solved Schrödinger’s equation numerically, and now turn our attention to animating it.
# Create a figure with three subplots horizontally, showing Re(Psi), Im(Psi) and |Psi|^2 respectively
fig, axs = plt.subplots(1, 3, figsize=(15, 5))
# Set y-labels.
axs[0].set_ylabel(’Re[$\Psi(X,T)$]’)
axs[1].set_ylabel(’Im[$\Psi(X,T)$]’)
axs[2].set_ylabel(’$|\Psi(X,T)|^2$’)
# Voila!
plt.tight_layout()
plt.show()
5
6 Results
In this section, we simply show examples of how the wave function looks like for different initial con-
ditions at random points in time (between T = 0 and T = 10), as a result of the simulation we have
written using Python.
• The rectangular initial condition: This example was symmetric about the middle of the po-
tential well, and that’s what keeps happening: the wave function stays symmetric about the center
of the potential well X = 0! During its time evolution, it takes jagged forms and changes its
probability density very often, yet it always remains symmetric.
• The half-triangular initial condition: This example was a little bit odd, it had no symmetry
at all, and the probability density often wandered out of the expected region of X 0.25. It did keep
a somewhat smooth shape over time though!
6
• The full-triangular initial condition, and the parabolic initial condition: These two ex-
amples were very similar, mostly due to the fact that their initial wave functions look very much
alike in shape. They both had symmetry, both acted very smoothly and always looked like a peaked
spike at the potential well.