- 3 The One-Dimensional Particle in a Box
- 3.1 🥅 Learning Objectives
- 3.2 Cyanine Dyes
- 3.3 Postulate: The squared magnitude of the wavefunction is proportional to probability
- 3.4 The Wavefunctions of the Particle in a Box (boundary conditions)
- 3.5 Postulate: The wavefunction of a system is determined by solving the Schrödinger equation
- 3.6 The Wavefunctions of the Particle in a Box (solution)
- 3.7 Normalization of Wavefunctions
- 3.8 Normalization Check
- 3.9 The Energies of the Particle in a Box
- 3.10 Zero-Point Energy
- 3.11 Atomic Units
- 3.12 Postulate: The wavefunction contains all the physically meaningful information about a system.
- 3.13 Postulate: Observable Quantities Correspond to Linear, Hermitian Operators.
- 3.14 Heisenberg Uncertainty Principle
- 3.15 Double-Checking the Energy of a Particle-in-a-Box
- 3.16 Visualizing the Particle-in-a-Box Wavefunctions, Probabilities, etc.
- 3.17 🪞 Self-Reflection
- 3.18 🤔 Thought-Provoking Questions
- 3.19 🔁 Recapitulation
- 3.20 🔮 Next Up...
- 3.21 📚 References

Cyanine dye molecules are often modelled as one-dimension particles in a box. To understand why, start by thinking classically. You learn in organic chemistry that electrons can more “freely” along alternating double bonds. If this is true, then you can imagine that the electrons can more from one Nitrogen to the other, almost without resistance. On the other hand, there are sp^{3}-hybridized functional groups attached to the Nitrogen atom, so once the electron gets to Nitrogen atom, it has to turn around and go back whence it came. A very, very, very simple model would be to imagine that the electron is totally free between the Nitrogen atoms, and totally forbidden from going much beyond the Nitrogen atoms. This suggests modeling these systems a potential energy function like:
$$V(x)=\{\begin{array}{ll}+\mathrm{\infty}& x\le 0\\ 0& 0<x<a\\ +\mathrm{\infty}& a\le x\end{array}$$
where $a$ is the length of the box. A reasonable approximate formula for $a$ is
$$a=(5.67+2.49(k+1))\cdot {10}^{-10}\text{m}$$

What is the interpretation of the wavefunction? The Born postulate indicates that the squared magnitude of the wavefunction is proportional to the probability of observing the system at that location. E.g., if $\psi (x)$ is the wavefunction for an electron as a function of $x$, then $$p(x)=|\psi (x){|}^{2}$$ is the probability of observing an electron at the point $x$. This is called the Born Postulate.

The nice thing about this “particle in a box” model is that it is easy to solve the time-independent Schrödinger equation in this case. Because there is no chance that the particle could ever “escape” an infinite box like this (such an electron would have infinite potential energy!), $|\psi (x){|}^{2}$ must equal zero outside the box. Therefore the wavefunction can only be nonzero inside the box. In addition, the wavefunction should be zero at the edges of the box, because otherwise the wavefunction will not be continuous. So we should have a wavefunction like $$\psi (x)=\{\begin{array}{ll}0& x\le 0\\ \text{?????}& 0<x<a\\ 0& a\le x\end{array}$$

How do we find the wavefunction for the particle-in-a-box or, for that matter, any other system? The wavefunction can be determined by solving the time-independent (when the potential is time-independent) or time-dependent (when the potential is time-dependent) Schrödinger equation.

To find the wavefunctions for a system, one solves the Schrödinger equation. For a particle of mass $m$ in a one-dimensional box, the (time-independent) Schrödinger equation is: $$(-\frac{{\hslash}^{2}}{2m}\frac{{d}^{2}}{d{x}^{2}}+V(x)){\psi}_{n}(x)={E}_{n}{\psi}_{n}(x)$$ where $$V(x)=\{\begin{array}{ll}+\mathrm{\infty}& x\le 0\\ 0& 0<x<a\\ +\mathrm{\infty}& a\le x\end{array}$$ We already deduced that $\psi (x)=0$ except when the electron is inside the box ($0<x<a$), so we only need to consider the Schrödinger equation inside the box: $$(-\frac{{\hslash}^{2}}{2m}\frac{{d}^{2}}{d{x}^{2}}){\psi}_{n}(x)={E}_{n}{\psi}_{n}(x)$$ There are systematic ways to solve this equation, but let's solve it by inspection. That is, we need to know:

Question: What function(s), when differentiated twice, are proportional to themselves?\

This suggests that the eigenfunctions of the 1-dimensional particle-in-a-box must be some linear combination of sine and cosine functions,
$${\psi}_{n}(x)=A\mathrm{sin}(cx)+B\mathrm{cos}(dx)$$
We know that the wavefunction must be zero at the edges of the box, $\psi (0)=0$ and $\psi (a)=0$. These are called the *boundary conditions* for the problem. Examining the first boundary condition,
$$0=\psi (0)=A\mathrm{sin}(0)+B\mathrm{cos}(0)=0+B$$
indicates that $B=0$. The second boundary condition
$$0=\psi (a)=A\mathrm{sin}(ca)$$
requires us to recall that $\mathrm{sin}(x)=0$ whenever $x$ is an integer multiple of $\pi $. So $c=n\pi $ where $n=1,2,3,\dots $. The wavefunction for the particle in a box is thus,
$${\psi}_{n}(x)={A}_{n}\mathrm{sin}\left({\textstyle \frac{n\pi x}{a}}\right)\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}n=1,2,3,\dots $$

As seen in the previous section, if a wavefunction solves the Schrödinger equation, any constant multiple of the wavefunction also solves the Schrödinger equation,
$$\hat{H}\psi (x)=E\psi (x)\phantom{\rule{1em}{0ex}}\u27f7\phantom{\rule{1em}{0ex}}\hat{H}(A\psi (x))=E(A\psi (x))$$
Owing to the Born postulate, the complex square of the wavefunction can be interpreted as probability. Since the probability of a particle being at *some* point in space is one, we can define the normalization constant, $A$, for the wavefunction through the requirement that:
$${\int}_{-\mathrm{\infty}}^{\mathrm{\infty}}{|\psi (x)|}^{2}dx=1.$$
In the case of a particle in a box, this is:
$$\begin{array}{}\text{(1)}& 1& ={\int}_{-\mathrm{\infty}}^{\mathrm{\infty}}{|{\psi}_{n}(x)|}^{2}dx\text{(2)}& & ={\int}_{0}^{a}{\psi}_{n}(x){\psi}_{n}^{\ast}(x)dx\text{(3)}& & ={\int}_{0}^{a}{A}_{n}\mathrm{sin}\left({\textstyle \frac{n\pi x}{a}}\right){({A}_{n}\mathrm{sin}\left({\textstyle \frac{n\pi x}{a}}\right))}^{\ast}dx\text{(4)}& & ={\left|{A}_{n}\right|}^{2}{\int}_{0}^{a}{\mathrm{sin}}^{2}\left({\textstyle \frac{n\pi x}{a}}\right)dx\end{array}$$
To evaluate this integral, it is useful to remember some trigonometric identities. (You can learn more about how I remember trigonometric identities here.) The specific identity we need here is ${\mathrm{sin}}^{2}x={\textstyle \frac{1}{2}}(1-\mathrm{cos}2x)$:

So
$${\left|{A}_{n}\right|}^{2}={\textstyle \frac{2}{a}}$$
Note that this does not completely determine ${A}_{n}$. For example, any of the following normalization constants are allowed,
$${A}_{n}=\sqrt{{\textstyle \frac{2}{a}}}=-\sqrt{{\textstyle \frac{2}{a}}}=i\sqrt{{\textstyle \frac{2}{a}}}=-i\sqrt{{\textstyle \frac{2}{a}}}$$
In general, any square root of unity can be used,
$${A}_{n}=(k\pm i\sqrt{1-{k}^{2}})\sqrt{{\textstyle \frac{2}{a}}}$$
where $k$ is any real number. The arbitrariness of the *phase* of the wavefunction is an important feature. Because the wavefunction can be imaginary (e.g., if you choose ${A}_{n}=i\sqrt{{\textstyle \frac{2}{a}}}$), it is obvious that the wavefunction is not an observable property of a system. **The wavefunction is only a mathematical tool for quantum mechanics; it is not a physical object.**

Summarizing, the (normalized) wavefunction for a particle with mass $m$ confined to a one-dimensional box with length $a$ can be written as: $${\psi}_{n}(x)=\sqrt{{\textstyle \frac{2}{a}}}\mathrm{sin}\left({\textstyle \frac{n\pi x}{a}}\right)\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}n=1,2,3,\dots $$

Note that in this case, the normalization condition is the same for all $n$; that is an unusual property of the particle-in-a-box wavefunction.

While this normalization convention is used 99% of the time, there are some cases where it is more convenient to make a different choice for the amplitude of the wavefunctions. I say this to remind you that normalization the wavefunction is something we do for convenience; it is not required by physics!

One advantage of using Jupyter is that we can easily check our (symbolic) mathematics. Let's confirm that the wavefunction is normalized by evaluating, $${\int}_{0}^{a}{|{\psi}_{n}(x)|}^{2}\phantom{\rule{thinmathspace}{0ex}}dx$$

In [1]:

```
# Execute this code block to import required objects.
# Note: The numpy library from autograd is imported, which behaves the same as
# importing numpy directly. However, to make automatic differentiation work,
# you should NOT import numpy directly by `import numpy as np`.
import autograd.numpy as np
from autograd import elementwise_grad as egrad
# import numpy as np
from scipy.integrate import trapezoid, quad
from scipy import constants
import ipywidgets as widgets
import matplotlib.pyplot as plt
# set the size of the plot
# plt.rcParams['figure.figsize'] = [10, 5]
```

In [2]:

```
#The next few lines just set up the sliders for setting parameters.
#Principle quantum number slider:
n = widgets.IntSlider(
value=1,
min=1,
max=10,
step=1,
description='n (quant. #):',
disabled=False,
continuous_update=True,
orientation='horizontal',
readout=True,
readout_format='d')
#Box length slider:
a = widgets.FloatSlider(
value=1,
min=.01,
max=10.0,
step=0.01,
description='a (length):',
disabled=False,
continuous_update=True,
orientation='horizontal',
readout=True,
readout_format='.2f',
)
# Define a function for the wavefunction
def compute_wavefunction(x, n, a):
"""Compute 1-dimensional particle-in-a-box wave-function value(s).
Parameters
----------
x: float or np.ndarray
Position of the particle.
n: int
Quantum number value.
a: float
Length of the box.
"""
# check argument n
if not (isinstance(n, int) and n > 0):
raise ValueError("Argument n should be a positive integer.")
# check argument a
if a <= 0.0:
raise ValueError("Argument a should be positive.")
# check argument x
if not (isinstance(x, float) or hasattr(x, "__iter__")):
raise ValueError("Argument x should be a float or an array!")
# compute wave-function
value = np.sqrt(2 / a) * np.sin(n * np.pi * x / a)
# set wave-function values out of the box equal to zero
if hasattr(x, "__iter__"):
value[x > a] = 0.0
value[x < 0] = 0.0
else:
if x < 0.0 or x > a:
value = 0.0
return value
# Define a function for the wavefunction squared
def compute_probability(x, n, a):
"""Compute 1-dimensional particle-in-a-box probablity value(s).
See `compute_wavefunction` parameters.
"""
return compute_wavefunction(x, n, a)**2
#This next bit of code just prints out the normalization error
def check_normalization(a, n):
#check the computed values of the moments against the analytic formula
normalization,error = quad(compute_probability, 0, a, args=(n, a))
print("Normalization of wavefunction = ", normalization)
out = widgets.interactive_output(check_normalization, {'a': a, 'n': n})
widgets.HBox([widgets.VBox([a, n]),out])
```

How do we compute the energy of a particle in a box? All we need to do is substitute the eigenfunctions of the Hamiltonian, ${\psi}_{n}(x)$ back into the Schrödinger equation to determine the eigenenergies, ${E}_{n}$. That is, from
$$\hat{H}{\psi}_{n}(x)={E}_{n}{\psi}_{n}(x)$$
we deduce
$$\begin{array}{}\text{(10)}& -\frac{{\hslash}^{2}}{2m}\frac{{d}^{2}}{d{x}^{2}}({A}_{n}\mathrm{sin}\left(\frac{n\pi x}{a}\right))& ={E}_{n}({A}_{n}\mathrm{sin}\left(\frac{n\pi x}{a}\right))\text{(11)}& -{A}_{n}\frac{{\hslash}^{2}}{2m}\frac{d}{dx}(\frac{n\pi}{a}\mathrm{cos}\left(\frac{n\pi x}{a}\right))& ={E}_{n}({A}_{n}\mathrm{sin}\left(\frac{n\pi x}{a}\right))\text{(12)}& {A}_{n}\frac{{\hslash}^{2}}{2m}{\left(\frac{n\pi}{a}\right)}^{2}\mathrm{sin}\left(\frac{n\pi x}{a}\right)& ={E}_{n}({A}_{n}\mathrm{sin}\left(\frac{n\pi x}{a}\right))\text{(13)}& \frac{{\hslash}^{2}{n}^{2}{\pi}^{2}}{2m{a}^{2}}& ={E}_{n}\end{array}$$
Using the definition of $\hslash $, we can rearrange this to:
$$\begin{array}{}\text{(14)}& {E}_{n}& =\frac{{\hslash}^{2}{n}^{2}{\pi}^{2}}{2m{a}^{2}}\phantom{\rule{2em}{0ex}}\phantom{\rule{2em}{0ex}}n=1,2,3,\dots \text{(15)}& & =\frac{{h}^{2}{n}^{2}}{8m{a}^{2}}\end{array}$$
Notice that only certain energies are allowed. This is a fundamental principle of quantum mechanics, and it is related to the "waviness" of particles. Certain "frequencies" are resonant, and other "frequencies" cannot be observed. *The only energies that can be observed for a particle-in-a-box are the ones given by the above formula.*

Naïvely, you might expect that the lowest-energy state of a particle in a box has zero energy. (The potential in the box is zero, after all, so shouldn't the lowest-energy state be the state with zero kinetic energy? And if the kinetic energy were zero and the potential energy were zero, then the total energy would be zero.)

But this doesn't happen. It turns out that you can never "stop" a quantum particle; it always has a zero-point motion, typically a resonant oscillation about the lowest-potential-energy location(s). Indeed, the more you try to confine a particle to stop it, the bigger its kinetic energy becomes. This is clear in the particle-in-a-box, which has only kinetic energy. There the (kinetic) energy increases rapidly, as ${a}^{-2}$, as the box becomes smaller:
$${T}_{n}={E}_{n}=\frac{{h}^{2}{n}^{2}}{8m{a}^{2}}$$
The residual energy in the electronic ground state is called the **zero-point energy**,
$${E}_{\text{zero-point energy}}=\frac{{h}^{2}}{8m{a}^{2}}$$
The existence of the zero-point energy, and the fact that zero-point kinetic energy is always positive, is a general feature of quantum mechanics.

Zero-Point Energy Principle:Let $V(x)$ be a nonnegative potential. The ground-state energy is always greater than zero.

More generally, for any potential that is bound from below, $${V}_{\text{min}}=\underset{x}{min}V(x)$$ the ground-state energy of the system satisfies ${E}_{\text{zero-point energy}}>{V}_{\text{min}}$.

Nuance: There is a tiny mathematical footnote here; there are some $V(x)$ for which there are

nobound states. In such cases, e.g., $V(x)=\text{constant}$, it is possible for $E={V}_{\text{min}}$.)

Because Planck's constant and the electron mass are tiny numbers, it is often useful to use atomic units when performing calculations. We'll learn more about atomic units later but, for now, we only need to know that, in atomic units, $\hslash $, the mass of the electron, ${m}_{e}$, the charge of the electron, $e$, and the average (mean) distance of an electron from the nucleus in the Hydrogen atom, ${a}_{0}$, are all defined to be equal to 1.0 in atomic units. $$\begin{array}{}\text{(16)}& \hslash & =\frac{h}{2\pi}=1.0545718\times {10}^{-34}\text{J s}=1\text{a.u.}\text{(17)}& {m}_{e}& =9.10938356\times {10}^{-31}\text{kg}=1\text{a.u.}\text{(18)}& e& =1.602176634\times {10}^{-}19\text{C}=1\text{a.u.}\text{(19)}& {a}_{0}& =5.291772109\times {10}^{-11}\text{m}=1\text{Bohr}=1\text{a.u.}\end{array}$$ The unit of energy in atomic units is called the Hartree, $${E}_{h}=4.359744722\times {10}^{-18}\text{J}=1\text{Hartree}=1\text{a.u.}$$ and the ground-state (zero-point) energy of the Hydrogen atom is $-{\textstyle \frac{1}{2}}{E}_{h}$.

We can now define functions for the eigenenergies of the 1-dimensional particle in a box:

In [3]:

```
#The next few lines just set up the sliders for setting parameters.
#Principle quantum number slider:
n = widgets.IntSlider(
value=1,
min=1,
max=10,
step=1,
description='n (quant. #):',
disabled=False,
continuous_update=True,
orientation='horizontal',
readout=True,
readout_format='d')
#Box length slider:
a = widgets.FloatSlider(
value=1,
min=.01,
max=10.0,
step=0.01,
description='a (length):',
disabled=False,
continuous_update=True,
orientation='horizontal',
readout=True,
readout_format='.2f',
)
# Define a function for the energy of a particle in a box
# with length a and quantum number n [in atomic units!]
# The length is input in Bohr (atomic units)
def compute_energy(n, a):
"Compute 1-dimensional particle-in-a-box energy."
return n**2 * np.pi**2 / (2 * a**2)
# Define a function for the energy of an electron in a box
# with length a and quantum number n [in SI units!].
# The length is input in meters.
def compute_energy_si(n, a):
"Compute 1-dimensional particle-in-a-box energy."
return n**2 * constants.h**2 / (8 * constants.m_e* a**2)
#Define variable for atomic unit of length in meters
a0 = constants.value('atomic unit of length')
#This next bit of code just prints out the energy in atomic and SI units
def print_energy(a, n):
print(f'The energy of an electron in a box of length {a:.2f} a.u. with '
f'quantum number {n} is {compute_energy(n, a):.2f} a.u..')
print(f'The energy of an electron in a box of length {a*a0:.2e} m with '
f'quantum number {n} is {compute_energy_si(n, a*a0):.2e} Joules.')
out = widgets.interactive_output(print_energy, {'a': a, 'n': n})
widgets.VBox([widgets.VBox([a, n]),out])
```

While the wavefunction is not itself observable, all observable properties of a system can be determined from the wavefunction. However, just because the wavefunction encapsulates all the *observable* properties of a system does not mean that it contains *all information* about a system. In quantum mechanics, some things are not observable. Consider that for the ground ($n=1$) state of the particle in a box, the root-mean-square average momentum,
$${\overline{p}}_{rms}=\sqrt{2m\cdot T}=\sqrt{(2m)\frac{{h}^{2}{n}^{2}}{8m{a}^{2}}}=\frac{hn}{2a}$$
increases as you squeeze the box. That is, the more you try to constrain the particle in space, the faster it moves. You can't "stop" the particle no matter how hard you squeeze it, so it's impossible to exactly know where the particle is located. You can only determine its *average* position.

The *correspondence* principle says that for every classical observable there is a linear, Hermitian, operator that allows computation of the quantum-mechanical observable. An operator, $\hat{C}$ is linear if for any complex numbers $a$ and $b$, and any wavefunctions ${\psi}_{1}(x)$ and ${\psi}_{2}(x)$,
$$\hat{C}(a{\psi}_{1}(x,t)+b{\psi}_{2}(x,t))=a\hat{C}{\psi}_{1}(x,t)+b\hat{C}{\psi}_{2}(x,t)$$
Similarly, an operator is Hermitian if it satisfies the relation,
$$\int {\psi}_{1}^{\ast}(x,t)\hat{C}{\psi}_{2}(x,t)\phantom{\rule{thinmathspace}{0ex}}dx=\int {(\hat{C}{\psi}_{1}(x,t))}^{\ast}{\psi}_{2}(x,t)\phantom{\rule{thinmathspace}{0ex}}dx$$
or, equivalently,