0% found this document useful (0 votes)
47 views7 pages

Quantum Mechanics Project

Uploaded by

Hellfire
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views7 pages

Quantum Mechanics Project

Uploaded by

Hellfire
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Quantum Mechanics Class Project

Dr. Siamak Sadatgousheh


Mohammadmahdi Azimi — 403216002
Mohammadmobin Baharzadeh — 401216017
Sajjad Saatsaz — 401216014
Aban, 1403

1 The Time–Independent Schrödinger’s Equation


The time and space evolution of a quantum particle is governed by the Schrödinger’s equation for the
particle’s wave function Ψ(x, t),

∂Ψ(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,

dϕn (t) iEn


=− ϕn (t)
dt h̄
h̄2 2
 
− ∇ + v(x) ψn (x) = En ψn (x)
2m
Where we call the second equation, the time-independent Schrödinger’s equation.
The solution to the first differential equation is of the form ϕn (t) = an exp (−iEn t/h̄), but we can
also absorb the constant an into whatever the solution for ψn (x) is going to be, therefore we arrive at
ϕn (t) = e−iEn t/h̄ , and the general solution for the particle’s wave function can be obtained as a series
over all possible n.
X
Ψ(x, t) = cn ψn (x)e−iEn t/h̄
n

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 d2 ψn (x) d2 ψn (x)


− = E n ψn (x) ⇒ = −kn2 ψn (x)
2m dx2 dx2

2mEn
Where kn = h̄ . This is a simple harmonic oscillator differential equation with solution of the
form
ψn (x) = An cos kn x + Bn sin kn x
Since ψn (x < 0) = ψn (x > a) = 0, continuity of the wave function at the borders implies that ψn (0) =
ψn (a) = 0. These two conditions together imply that An = 0, and that Bn sin(kn a) = 0. The distinct
solutions are kn = nπ/a with natural n, and this defines our states n. The energy of the nth state is

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-

cations, the final solution will take the following form.


∞ Z 1
2X 2
Ψ(X, T ) = a sin(nπX)e−in T dXΨ0 (X) sin(nπX)
a n=1 0

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

4 Test Initial Conditions


In this section, we choose four different initial conditions Ψ0 (X) and animate P si(X, T ) inside the
boundaries. For this section, we will assume that the bounaries are at X = −0.5 and X = 0.5, which
corresponds to a shift of 0.5 for the solution Ψ(X, T ) obtained in the previous section,

X 2
Ψ(X, T ) = Ψ̃0 [n] sin(nπ(X + 0.5))e−in T

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]

# Define initial wave functions to choose from, mentioned in the paper.


def recangular_initial_condition(X):
return np.where(np.abs(X) <= 0.5, 1, 0)

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)

# Input the initial wave function to use.


# Here, "n" acts as the parameter to change between 4 different choices of initial wave functions.
n = 3
if n == 0:
Psi_0 = recangular_initial_condition(X)
odd_extended_Psi_0 = recangular_initial_condition(X_extend - 0.5) - recangular_initial_condition(
elif n == 1:
Psi_0 = half_triangular_initial_condition(X)
odd_extended_Psi_0 = half_triangular_initial_condition(X_extend - 0.5) - half_triangular_initial_
elif n == 2:
Psi_0 = full_triangular_initial_condition(X)
odd_extended_Psi_0 = full_triangular_initial_condition(X_extend - 0.5) - full_triangular_initial_
elif n == 3:
Psi_0 = parabolic_initial_condition(X)
odd_extended_Psi_0 = parabolic_initial_condition(X_extend - 0.5) - parabolic_initial_condition(-X

# 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

# Precompute Psi(X,T) for many values of T between T=0 and T=10.


T_values = np.linspace(0, 100000, 300)
Psi_X_T = np.array([Psi(X, T, tilde_Psi_n) for T in T_values])

# 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 titles for each subplot.


axs[0].set_title(’Real Part of $\Psi(X,T)$’)
axs[1].set_title(’Imaginary Part of $\Psi(X,T)$’)
axs[2].set_title(’Probability Density $|\Psi(X,T)|^2$’)

# Set the x-axis limits.


for ax in axs:
ax.set_xlim(-0.5, +0.5)

# Initialize lines for each subplot.


line_real, = axs[0].plot(X, np.zeros_like(X), lw=2, color=’black’)
line_imag, = axs[1].plot(X, np.zeros_like(X), lw=2, color=’black’)
line_modulus, = axs[2].plot(X, np.zeros_like(X), lw=2, color=’black’)

# Set the y-axis limits.


axs[0].set_ylim(np.min(np.real(Psi_X_T)), np.max(np.real(Psi_X_T)))
axs[1].set_ylim(np.min(np.imag(Psi_X_T)), np.max(np.imag(Psi_X_T)))
axs[2].set_ylim(0, np.max(np.abs(Psi_X_T) ** 2))

# 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$’)

# Add text annotation for displaying the time T.


time_text = axs[0].text(0.05, 0.9, ’’, transform=axs[0].transAxes, fontsize=12)

# Function to update the plots for each frame of the animation.


def update(frame):
real_part = np.real(Psi_X_T[frame])
imag_part = np.imag(Psi_X_T[frame])
modulus_squared = np.abs(Psi_X_T[frame]) ** 2
line_real.set_ydata(real_part)
line_imag.set_ydata(imag_part)
line_modulus.set_ydata(modulus_squared)

# Update the time text.


time_text.set_text(f’Time T = {T_values[frame] / 10000:.2f}’)

return line_real, line_imag, line_modulus, time_text

# Create the animation.


ani = FuncAnimation(fig, update, frames=len(T_values), blit=True, interval=10)

# 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.

Figure 1: Rectangular initial condition

• 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!

Figure 2: Half-rectangular initial condition

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.

Figure 3: Full-triangular initial condition

Figure 4: Parabolic initial condition

You might also like