Particle in a Box#
What you need to know
Particle in a Box (PIB) as a Model System
The Particle in a Box (PIB) is a simple model that helps illustrate the behavior of electrons confined within atoms and molecules. It serves as a useful tool to introduce key quantum concepts:
Energetic Quantization: Energy levels in quantum systems are discrete, not continuous, as seen in the PIB model.
Probabilistic Nature of Quantum Particles: The probability distribution for the particle’s position is non-uniform, with nodal points where the probability is zero, emphasizing the inherent uncertainty in the particle’s exact location.
Uncertainty Principle: There is an inverse relationship between the uncertainty in position and momentum, demonstrating the fundamental limit on how precisely both quantities can be known simultaneously.
Zero-Point Energy: Quantum particles always possess a minimum kinetic energy, even at absolute zero. This zero-point energy highlights the impossibility of freezing all motion in quantum systems.
Quantum-Classical Correspondence: As the system scales up, quantum behavior smoothly transitions to classical behavior, illustrating the correspondence principle.
Degeneracy of Energy Levels: In systems with symmetries, multiple wave functions can correspond to the same energy level, a phenomenon known as degeneracy.
Classical vs Quantum particle in a box#
Particle in a box is a toy model of electron (or atom, molecule, small quantum object) trapped in some region of space \([0,L]\).
The positional information of a quantum “particle” is described by a quantum wave function \(\psi(x)\) which is obtained by solving Schrödinger equation with boundary conditions
Wave functions are standing waves just like in a guitar on a string problem. With one major difference! Quantum-wave function has a probabilistic meaning and hence has a completely different meaning from a classical notion of a “wave”.
According to classical mechanis in the absence of any attractive interactions particle will be boundicng back and forth between walls with constant speed. Hence and we expect to find particle with equal probability at all locations \(x\).
According to quantum mechancis Quantum particle in the box is going to be found in some regions with high probability in others with little or zero!
Solving the Schrödinger Equation for the Particle in a Box (PIB)#
The Schrödinger equation for a particle in a box (PIB) is defined by a Hamiltonian operator that incorporates the potential energy, which is infinitely large at the boundaries of the box and zero inside. This potential ensures that the particle is confined within the box, where it can only possess kinetic energy.
The potential energy for PIB is defined:
The boundary conditions are:
The Hamiltonian operator is in this case accounting only for kinetic energy!
Now, we have all the necessary ingredients to solve the time-independent Schrödinger equation for the 1D PIB:
Substituting the Hamiltonian, we get:
where the \(k^2\) is a positive real number that relates the particle’s energy \(E\) to its wavefunction.
Solution and Boundary Conditions#
Mathematically, the form of the 1D PIB problem is similar to the ordinary differential equation (ODE) used in the 1D vibrating guitar string problem. The key differences lie in the constant coefficients and the interpretation of the wavefunction.
The general solution to this differential equation is:
Applying the boundary condition \(\psi(0) = 0\), we find that \(A = 0\), leaving us with:
Applying the boundary condition \(\psi(L) = 0\), we get:
This condition is satisfied when:
Thus, the wavefunction becomes:
Using the relationship \(k^2 = \frac{n^2\pi^2}{L^2} = \frac{2mE}{\hbar^2}\), we can express the energy levels as:
The quantization of energy results from confining the wavefunction within a finite space. This is the reason bound states exhibit quantized energy levels. Atoms, molecules, and solids all possess discrete energy levels due to similar constraints.
Wavefunctions Must Be Normalized#
Next, we determine the constant coefficient \(B_n\) by enforcing the normalization condition:
To evaluate the integral, we use the trigonometric identity \(\sin^2(x) = \frac{1}{2}(1 - \cos(2x))=1\)
Since the integral of \(\cos\left(\frac{2n\pi x}{L}\right)\) over a full period from \(0\) to \(L\) is zero, we are left with:
Solving for \(B_n\) we determine normalization constant which ensures that square of wavefunction integrates to 1.
PIB Eigenfunctions and Eigenvalues#
Eigenfunctions and eigenvalues of 1D particle in a box
Full time dependent solution
Where the coefficients \(c_n\) depend on initial condition, e.g could be all zero except one (pure state) or a few of them non-zero (mixed state)
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
# Parameters
L = 1.0 # Length of the box
x = np.linspace(0, L, 1000) # Position array
n_max = 5 # Maximum quantum number to display
# Constants
hbar = 1.0545718e-34 # Reduced Planck's constant (J·s)
m = 9.10938356e-31 # Mass of an electron (kg)
# Functions
def psi_n(n, x, L):
"""Wavefunction for a particle in a 1D box."""
return np.sqrt(2 / L) * np.sin(n * np.pi * x / L)
def psi_n_squared(n, x, L):
"""Probability density (wavefunction squared)."""
return psi_n(n, x, L) ** 2
def energy_levels(n, L):
"""Energy level for the particle in the box."""
return (n**2 * np.pi**2 * hbar**2) / (2 * m * L**2)
# Energy formula string
energy_formula = r"$E_n = \frac{n^2 \pi^2 \hbar^2}{2mL^2}$"
# Plotting
fig, axs = plt.subplots(1, 2, figsize=(8, 6), sharey=True)
# Plot wavefunctions in the first subplot
for n in range(1, n_max + 1):
wavefunction = psi_n(n, x, L)
axs[0].plot(x, wavefunction + n**2, label=f'n={n}')
axs[0].hlines(n**2, 0, L, colors='gray', linestyles='dashed') # Energy level lines
# Wavefunction plot labels and title
axs[0].set_xlabel('Position (x)', fontsize=12)
axs[0].set_ylabel(r'$\psi_n(x)$', fontsize=12)
axs[0].legend(loc='upper right', bbox_to_anchor=(1.15, 1))
# Plot wavefunction squared (probability densities) in the second subplot
for n in range(1, n_max + 1):
wavefunction_squared = psi_n_squared(n, x, L)
axs[1].plot(x, wavefunction_squared + n**2, label=f'n={n}')
axs[1].hlines(n**2, 0, L, colors='gray', linestyles='dashed') # Energy level lines
# Probability density plot labels
axs[1].set_xlabel('Position (x)', fontsize=12)
axs[1].set_ylabel(r'$|\psi_n(x)|^2$', fontsize=12)
# Display the energy formula and levels in the second subplot
for n in range(1, n_max + 1):
energy_value = energy_levels(n, L)
axs[1].text(L, n**2, f"$E_{n}$ = {energy_value:.2e} J", verticalalignment='bottom', fontsize=12)
# Overall title for the figure
fig.suptitle(f'Wavefunctions and Energies for a 1D Particle in a Box (n=1 to n={n_max})')
# Make room for labels outside plot and improve layout
plt.tight_layout(rect=[0, 0, 1, 0.95])
plt.show()
Discrete energy levels and zero point energy#
Quantum particles are never at rest
The lowest energy electon in a box can have is at \(n=1\) at which is not zero!
Keeping in mind that the energy is purely kinetic, this means quantum particles never ceases their motion.
The spacing of energy levels is finite and depends on the size of the box!
Increasing Box size leads to more classical behavior
As the box size is increased energy spacing gets smaller!
Thus quantum effects are more pronounced when electorn is bound in smaller regions of space.
Non-uniform probabilities and nodes#
There are \(n-1\) nodes for quantum state \(n\)
Recall that sine function hitz zero at integer values of \(\pi\), \(sin(n\pi)=0\) when \(n=1,2,3,4,...\)
The wavefunction \(\psi_n(x) = sin \frac{n\pi x}{L}\) will then have \(n-1\) nodes at points \(x=L/n\), \(2L/n\), \(3L/n\), … \((n-1)L/n\).
Note that we do not count \(x=0\) and \(x=L\) points as nodes because they are part of boudnary conditions that apply to all wavefunctions
For instance \(n=3\) nodes are at \(x=L/3\), \(x=2L/3\).
For instance \(n=4\) nodes are at \(L/4\), \(2L/4\), \(3L/4\)
Nodes imply zero probability to find an electron in the box.
\(|\psi_n|^2=0\) at nodal points which means zero probability.
This is in sharp contradiction of classical mechanics which bases its prediction on purely particle like motion of electron.
Existence of nodes implies a wave like character of electron
On time-dependence#
Pure states#
Pure states correspond to time-independent probability distribution.
Below we visualize a few of the wavefunction at its square for \(n=2\).
Show code cell source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
from IPython.display import HTML
# Parameters
L = 1.0 # Length of the box
hbar = 1.0 # Set hbar = 1 for simplicity
m = 1.0 # Set mass = 1 for simplicity
# Define spatial and time arrays
x = np.linspace(0, L, 200)
t = np.linspace(0, 10, 200)
n = 2
# Define energy for nth state
def energy_n(n, L):
return (n**2 * np.pi**2 * hbar**2) / (2 * m * L**2)
# Define wavefunction for nth state
def psi_total(n, x, L, t):
E_n = energy_n(n, L)
return np.sqrt(2 / L) * np.sin(n * np.pi * x / L) * np.exp(-1j * E_n * t / hbar)
# Set up the figure and axis
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(11, 8))
# Set limits for the wavefunction and wavefunction squared
ax1.set_xlim(0, L)
ax1.set_ylim(-2, 2)
ax2.set_xlim(0, L)
ax2.set_ylim(0, 4)
# Set labels for the wavefunction plot
ax1.set_xlabel('Position (x)', fontsize=14)
ax1.set_ylabel(r'Re[$\psi(x,t)$]', fontsize=14)
ax1.set_title('Time Evolution of Wavefunction', fontsize=16)
# Set labels for the squared wavefunction plot
ax2.set_xlabel('Position (x)', fontsize=14)
ax2.set_ylabel(r'$|\psi(x,t)|^2$', fontsize=14)
ax2.set_title('Probability Density', fontsize=16)
### Animation settings
# Initialize the wavefunction and its square plots
line_real, = ax1.plot([], [], lw=2)
line_prob, = ax2.plot([], [], lw=2)
# Initialization function for the plot
def init():
line_real.set_data([], [])
line_prob.set_data([], [])
return line_real, line_prob
# Animation function which updates the plot each frame
def animate(i):
t_val = t[i]
psi = psi_total(n, x, L, t_val)
psi_real = np.real(psi)
psi_squared = np.abs(psi)**2
line_real.set_data(x, psi_real)
line_prob.set_data(x, psi_squared)
return line_real, line_prob
# Create the animation
ani = FuncAnimation(fig, animate, init_func=init, frames=len(t), interval=150, blit=True)
plt.close(fig) # Prevents static display of the last frame
HTML(ani.to_jshtml())