A Byte of PhysicsLogo

Wavefunction evolution

A wavefunction is not a static probability map. Its complex amplitudes evolve, and their changing relative phases determine future interference. Two states can have identical position probability density at one instant yet evolve into different densities because their phases—and therefore their momentum content—differ.

For an isolated quantum system, the Hamiltonian generates deterministic, unitary evolution of the state between measurements. Quantum probabilities enter when measurement outcomes are predicted, not because the Schrödinger equation randomly changes the closed-system wavefunction.

Time evolution from the Schrödinger equation

The time-dependent Schrödinger equation is

\[i\hbar\frac{\partial}{\partial t}|\psi(t)\rangle=\hat H(t)|\psi(t)\rangle\]

If the Hamiltonian is time-independent, the formal solution is

\[|\psi(t)\rangle=\hat U(t)|\psi(0)\rangle,\qquad \hat U(t)=e^{-i\hat Ht/\hbar}\]

For a self-adjoint Hamiltonian, \(\hat U^\dagger\hat U=I\). Therefore inner products and normalization are preserved:

\[\langle\psi(t)|\psi(t)\rangle=\langle\psi(0)|\psi(0)\rangle\]

This is stronger than merely renormalizing the state after a step. A unitary rule preserves the relative geometry of all states, including overlaps and probabilities.

Evolution in the energy basis

Let energy eigenstates satisfy

\[\hat H|E_n\rangle=E_n|E_n\rangle\]

Expand an initial state as

\[|\psi(0)\rangle=\sum_n c_n|E_n\rangle\]

Then each component acquires its own phase:

\[|\psi(t)\rangle=\sum_n c_ne^{-iE_nt/\hbar}|E_n\rangle\]

The probabilities \(|c_n|^2\) for energy measurements remain constant when the Hamiltonian is time-independent. The phases still matter for other observables.

import numpy as np

energies = np.array([0.0, 2.0])
initial = np.array([1.0, 1.0], dtype=complex) / np.sqrt(2)
time = 0.5
coefficients = initial * np.exp(-1j * energies * time)  # hbar=1.
assert np.isclose(np.vdot(coefficients, coefficients), 1.0)
print("Evolved energy-basis coefficients:", coefficients)

Because the complex exponential has magnitude one, every coefficient keeps the same magnitude. A computed change in \(|c_n|\) under this specific time-independent evolution indicates numerical error or an incorrectly applied basis transformation.

Stationary states

For a single energy eigenstate,

\[\psi_n(x,t)=\phi_n(x)e^{-iE_nt/\hbar}\]

and

\[|\psi_n(x,t)|^2=|\phi_n(x)|^2\]

The wavefunction is changing through its phase even though the position density is stationary. “Stationary” therefore does not mean that every mathematical part of the state is frozen. It means probabilities for time-independent observables have no time dependence in that energy eigenstate.

For a bound stationary state in one dimension with suitable boundaries, the probability current can be zero even though the phase evolves. In other systems, such as a particle on a ring, a stationary state can carry nonzero current while retaining a time-independent density.

Superpositions and beat frequencies

Consider two energy eigenstates:

\[|\psi(t)\rangle=c_1e^{-iE_1t/\hbar}|E_1\rangle+c_2e^{-iE_2t/\hbar}|E_2\rangle\]

The common phase of the whole state is unobservable, but the relative phase

\[\Delta\phi(t)=\Delta\phi(0)-\frac{(E_2-E_1)t}{\hbar}\]

can create oscillating cross terms in position density and in other expectation values. The angular beat frequency is

\[\omega_{21}=\frac{E_2-E_1}{\hbar}\]

This is why storing only

\(|\psi|^2\)

at one time is insufficient. The missing relative phase determines later interference.

state_a = np.array([1.0, 1.0], dtype=complex) / np.sqrt(2)
state_b = np.array([1.0, 1j], dtype=complex) / np.sqrt(2)
plus = np.array([1.0, 1.0]) / np.sqrt(2)
for state in [state_a, state_b]:
    evolved = state * np.exp(-1j * energies * time)
    probability_plus = abs(np.vdot(plus, evolved)) ** 2
    print("Probability of the plus outcome:", probability_plus)

Global phase and relative phase

Multiplying every amplitude by one constant phase,

\[|\psi\rangle\longrightarrow e^{i\chi}|\psi\rangle\]

does not change any expectation or ideal measurement probability. For example,

\[|e^{i\chi}\psi(x)|^2=|\psi(x)|^2\]

A position-dependent phase is not global. If \(\psi(x)\to e^{ik_0x}\psi(x)\), the density is initially unchanged but the momentum distribution shifts by \(\hbar k_0\). The packet consequently moves differently.

rotated = np.exp(0.7j) * state_a
assert np.allclose(abs(rotated) ** 2, abs(state_a) ** 2)
assert np.isclose(abs(np.vdot(plus, rotated)) ** 2, abs(np.vdot(plus, state_a)) ** 2)
print("Global phase leaves measurement probabilities unchanged.")

This test checks density calculation but not the complete evolution algorithm, because any global phase is physically equivalent.

Probability conservation and current

For a particle with a real potential, the probability density

\[\rho(x,t)=|\psi(x,t)|^2\]

and probability current

\[j(x,t)=\frac{\hbar}{m}\operatorname{Im}\left(\psi^*\frac{\partial\psi}{\partial x}\right)\]

obey the continuity equation

\[\frac{\partial\rho}{\partial t}+\frac{\partial j}{\partial x}=0\]

Integrating over a region from \(a\) to \(b\) gives

\[\frac{d}{dt}\int_a^b\rho\,dx=j(a,t)-j(b,t)\]

Probability inside changes only through flux across the boundaries. On the whole line, a normalizable state with vanishing boundary flux keeps total probability one. On a finite numerical domain, a change may be physical outgoing flux, an absorbing boundary, or numerical error; the boundary policy decides which interpretation applies.

Free wave-packet motion

A localized free particle is a superposition of momenta. For a nonrelativistic particle,

\[E(p)=\frac{p^2}{2m},\qquad \omega(k)=\frac{\hbar k^2}{2m}\]

Different wave-number components acquire phase at different rates. A narrow packet's center moves with group velocity

\[v_g=\frac{d\omega}{dk}=\frac{\hbar k_0}{m}=\frac{p_0}{m}\]

and its width generally increases. For an initially minimum-uncertainty Gaussian with position standard deviation \(\sigma_0\), the free-particle width evolves as

\[\sigma_x(t)=\sigma_0\sqrt{1+\left(\frac{\hbar t}{2m\sigma_0^2}\right)^2}\]

under the convention that \(\sigma_0\) is the initial standard deviation of position. Narrower packets spread faster because they require a broader momentum distribution. More massive packets spread more slowly.

The formula assumes free, nonrelativistic evolution on an unbounded line. A potential, boundary, or non-Gaussian initial shape changes the details.

Evolution in a potential

A potential changes both phase and amplitude distribution through the Hamiltonian. Ehrenfest's theorem connects expectation values to classical-looking relations:

\[\frac{d\langle x\rangle}{dt}=\frac{\langle p\rangle}{m},\qquad \frac{d\langle p\rangle}{dt}=-\left\langle\frac{dV}{dx}\right\rangle\]

These equations do not say that every wave packet follows one classical trajectory. In general,

\(\langle V'(x)\rangle\)

is not equal to \(V'(\langle x\rangle)\). They agree exactly for forces at most linear in position and approximately for a narrow packet in a slowly varying potential.

For a time-independent Hamiltonian, total energy expectation is conserved. In a time-dependent potential, energy can enter or leave the system, so a changing energy expectation is not automatically an error.

Time-dependent Hamiltonians

If Hamiltonians at different times do not commute, one cannot generally write

\(e^{-i\hat Ht/\hbar}\)

using one constant Hamiltonian. The evolution operator satisfies

\[i\hbar\frac{\partial \hat U(t,t_0)}{\partial t}=\hat H(t)\hat U(t,t_0),\qquad \hat U(t_0,t_0)=I\]

and formally requires time ordering. Computationally, advance with the Hamiltonian evaluated according to a documented step rule and verify convergence as the time step decreases.

state = np.array([1.0, 0.0], dtype=complex)
dt = 0.01
for step in range(100):
    midpoint_time = (step + 0.5) * dt
    H = np.array([[0.0, np.cos(midpoint_time)], [np.cos(midpoint_time), 1.0]])
    energies, basis = np.linalg.eigh(H)
    state = basis @ (np.exp(-1j * energies * dt) * (basis.conj().T @ state))
assert np.isclose(np.vdot(state, state), 1.0)
print("Final probabilities:", abs(state) ** 2)

Reversibility and diagnostic checks

Exact closed-system unitary evolution is reversible:

\[\hat U(-t)=\hat U(t)^\dagger=\hat U(t)^{-1}\]

An implementation can evolve forward, apply the inverse evolution, and compare the recovered state with the initial state up to numerical tolerance and global phase. Also check:

Do not judge only the density plot. Phase error can be invisible until two components later overlap.

Closed systems, measurements, and environments

Unitary evolution describes a closed system between idealized measurements. A measurement updates the conditional state associated with an outcome and cannot be modeled as ordinary unitary evolution of the measured subsystem alone. Including the apparatus and environment in a larger state restores unitary evolution of that larger closed system, while the reduced subsystem can show decoherence and apparently irreversible behavior.

This lesson uses pure, nonrelativistic, single-particle states. It omits spin, particle creation, many-body symmetrization, mixed-state density matrices, relativistic fields, and a microscopic detector. These are extensions of the framework, not reasons to discard complex phase or probability conservation in the domain where the Schrödinger equation applies.

A worked Python notebook

Evolve an equal superposition of energies zero and two, then measure in the plus/minus basis. The question for this calculation is precise: how does probability of a plus-basis outcome change when we change elapsed time, while keeping the other choices fixed? The earlier sections explain the physical relationship. Here we turn one part of that relationship into a calculation that you can run, inspect, and change in Google Colab.

Reduced Planck constant is one and the Hamiltonian is time independent. Keep that sentence beside the results. A formula can return a number outside its useful range, and a plotting library will usually draw that number without asking whether the physical assumptions still hold. The selected interval is from 0 to 3.14159 scaled time units. It gives us a specific domain to discuss instead of leaving the graph's range to a software default.

Use the notebook link above the lesson, run the setup cell, and then run the cells in order. The code below is also included there. NumPy handles the arrays of numerical values, SymPy keeps the equation symbolic, and Matplotlib draws the results. If these libraries or notebook cells are unfamiliar, start with Your first physics notebook.

State the relationship before choosing a graph

In this small example, q stands for elapsed time, expressed in scaled time units. The output is probability of a plus-basis outcome, expressed in dimensionless. The equation below uses the numerical values in those units. Any fixed coefficients therefore carry the units needed to make the relation consistent. A value supplied in another unit must be converted before it enters this expression.

\[f(q) = \cos^{2}{\left(q \right)}\]

This is a function of one changing input. It is not a statement that the physical system has only one variable. We deliberately hold the other inputs fixed so that one cause of variation is visible. Changing several inputs at once would make it harder to tell which change produced the output difference. Write down the held-fixed choices before trying a different experiment.

At 0.5 scaled time units, the expression gives 0.770151 dimensionless. This is our reference calculation. It is a prediction of the stated example, not a new measurement. Its displayed digits help us compare implementations. They should not be read as a claim that physical inputs are known to six significant figures.

import numpy as np
import sympy as sp
import matplotlib.pyplot as plt

q = sp.Symbol("q", real=True)
expression = sp.sympify("cos(q)**2", locals={"q": q})
reference_input = 0.5
reference_output = float(expression.subs(q, reference_input))
print("Input:", reference_input, "scaled time units")
print(
    "Predicted probability of a plus-basis outcome:", reference_output, "dimensionless"
)

sp.Symbol declares a mathematical symbol. It does not assign a numerical measurement to that symbol. subs then replaces the symbol with our chosen input, and float converts the resulting symbolic number into a standard Python numerical value. Keeping these steps separate lets us inspect the equation before numerical substitution. It also prevents a later plot from becoming the only surviving record of the model.

Compare a few cases you can explain

Before drawing hundreds of points, calculate three. The lower endpoint gives 1 dimensionless. The midpoint, at 1.5708 scaled time units, gives 3.7494e-33 dimensionless. The upper endpoint gives 1 dimensionless. Read these together with the assumptions: they describe different choices of elapsed time within the same example, with the other inputs held fixed.

These three values are a useful first check, but they do not establish the shape between them. Two endpoints can be equal even when the curve bends or oscillates in between. Likewise, a large change between endpoints does not tell us whether the relationship is linear. We need the equation and intermediate samples to answer those questions.

evaluate = sp.lambdify(q, expression, modules="numpy")
inputs = np.array([0.0, 1.5707963267948966, 3.141592653589793])
outputs = np.asarray(evaluate(inputs), dtype=float)
outputs = np.broadcast_to(outputs, inputs.shape)
for input_value, output_value in zip(inputs, outputs):
    print(f"{input_value:.6g} scaled time units -> {output_value:.6g} dimensionless")
assert np.all(np.isfinite(outputs))

lambdify turns the symbolic expression into a numerical function. We explicitly select NumPy as its numerical backend so it can accept an array. The same expression now has two useful forms: one for algebra and one for calculating many cases. The assertion checks that the chosen inputs produce finite outputs. It would catch an infinity or an undefined numerical result, but a finite value can still be physically inappropriate.

Make a graph that answers the question

The horizontal axis shows elapsed time; the vertical axis shows probability of a plus-basis outcome. Every plotted point is a prediction of the same expression. We mark the reference case separately so that a reader can connect the earlier printed value to its place on the curve. The axis labels include units because a shape without a scale cannot tell us the size of a physical effect.

input_grid = np.linspace(0.0, 3.141592653589793, 301)
output_grid = np.asarray(evaluate(input_grid), dtype=float)
output_grid = np.broadcast_to(output_grid, input_grid.shape)
fig, ax = plt.subplots(figsize=(7, 4))
ax.plot(input_grid, output_grid, label="Stated model")
ax.scatter([reference_input], [reference_output], label="Reference case", zorder=3)
ax.set_xlabel("Elapsed time (scaled time units)")
ax.set_ylabel("Probability of a plus-basis outcome (dimensionless)")
ax.legend()
ax.grid(alpha=0.25)
fig.tight_layout()
plt.show()

Look for a sign change, a turning point, or a region where the curve becomes steep. Connect each feature to the expression rather than to the colour of the line. If the curve has a minimum or maximum, changing the input in opposite directions may have similar effects on the output near that point. If it is nearly straight over a short interval, a local linear approximation may be useful even when the complete expression is nonlinear.

Increasing the number of samples makes the line smoother and may reveal features that a coarse grid missed. It does not improve the physical inputs or enlarge the model's validity range. For quantities that can take only discrete values, use the line as a guide to the relationship and interpret only the allowed input values. A plotting function does not enforce such restrictions for you.

Measure the local sensitivity

A derivative asks a more specific question than the whole graph: how quickly does probability of a plus-basis outcome change near the reference input? Its units are the output unit divided by the input unit. For this calculation, the derivative at 0.5 scaled time units is -0.841471 in those ratio units. Locally, the output decreases as the input increases. This statement is local; the sign or size of the slope can be different elsewhere on the curve.

\[f'(q) = - 2 \sin{\left(q \right)} \cos{\left(q \right)}\]

For a small input change, multiply the derivative by that change to estimate the output change. Then compare that estimate with a fresh evaluation of the full expression. The distinction between these two calculations matters: the derivative gives a tangent approximation, while substitution evaluates the chosen expression at the new point.

slope_expression = sp.diff(expression, q)
slope_at_reference = float(slope_expression.subs(q, reference_input))
changed_input = 0.515707963267949
linear_prediction = reference_output + slope_at_reference * (
    changed_input - reference_input
)
full_prediction = float(evaluate(changed_input))
print("Symbolic derivative:", slope_expression)
print("Tangent prediction:", linear_prediction, "dimensionless")
print("Full expression:", full_prediction, "dimensionless")
print("Approximation difference:", full_prediction - linear_prediction, "dimensionless")

Here the changed input is 0.515708 scaled time units. The tangent estimate is 0.756933 dimensionless, while the full expression gives 0.756802 dimensionless. If the two values are close, it means the chosen input change is small enough for this local approximation at this point. It does not mean the entire model is linear. If the slope is zero, a quadratic or higher-order term may supply the leading change instead.

This is also the beginning of uncertainty propagation. If the input has a small stated standard uncertainty, the magnitude of the slope times that uncertainty estimates one contribution to output uncertainty. Do not automatically use the same rule for a wide interval, a discontinuity, a turning point with zero first derivative, or several correlated uncertain inputs. Those situations need more of the model than one slope.

Check the derivative with numerical differences

We can estimate the same slope from values on either side of the reference point. Subtract the lower output from the upper output and divide by twice the input step. Parentheses are essential: the entire output difference must be divided by the entire input interval. Without them, Python can execute a different mathematical expression while still producing a plausible number.

The calculation below uses three decreasing step sizes. Each estimate is compared with the symbolic derivative, so the reference is independent of the numerical difference formula. Near an endpoint, it is acceptable here to evaluate a small extension only because the displayed mathematical expression is smooth there; such a check does not assert that extrapolated values describe additional physical cases.

input_span = 3.141592653589793
for fraction in [1e-2, 1e-3, 1e-4]:
    step = input_span * fraction
    upper = float(evaluate(reference_input + step))
    lower = float(evaluate(reference_input - step))
    numerical_slope = (upper - lower) / (2 * step)
    difference = numerical_slope - slope_at_reference
    print(f"step={step:.6g}: slope={numerical_slope:.6g}, difference={difference:.6g}")

For a smooth function, reducing the step often reduces the approximation error at first. Very small steps can eventually make subtraction of nearly equal floating-point values less reliable. Therefore “smaller” is not an unlimited guarantee of “better.” Compare the observed behaviour over a useful range of steps instead of choosing the smallest number the computer can represent.

An absolute slope difference is useful when the expected slope is near zero. A relative difference would divide by a very small reference and could look enormous even when the absolute discrepancy is tiny. Away from zero, a relative difference can help compare quantities with very different scales. The tolerance should reflect the question and the numerical method, rather than a universal decimal threshold copied into every test.

Change the example and preserve the reasoning

Make one copy of the reference calculation before editing it. Choose a second value of elapsed time inside the stated interval, predict whether probability of a plus-basis outcome will rise or fall, and then evaluate the expression. Place the prediction and the result in a text cell. If they disagree, identify whether the mistake was in the sign, the unit conversion, the algebra, or the assumption about how the curve behaves.

Next choose a shorter plotting interval around the reference point. Compare the local curve with its tangent approximation. Then widen the interval again. The difference shows why a useful local estimate need not describe the whole range. Keep the axis labels and numerical scale visible when comparing the plots; automatic axis limits can make two different effects appear equally large.

Finally, return to the physical limit stated at the start: Reduced Planck constant is one and the Hamiltonian is time independent. Describe one change to the setup that would violate that limit. State what new input, equation, or observation would be needed before trusting an answer in the changed situation. This last step connects the Python experiment to the physics instead of treating successful execution as the only criterion for a useful result.

Before saving, restart the runtime and run all cells in order. A result that depends on an earlier, now-deleted input cell is not reproducible from the saved notebook. Keep unrounded values for later calculations, round only the reported output, and label any new data as measured, assumed, or generated. The graph and printed values should remain traceable to the same expression and the same choices of inputs.

Recover the output change by integrating the slope

There is another way to check that the expression and its derivative describe the same relationship. Add up the small output changes predicted by the slope across the chosen input interval. In the continuous limit, this integral equals the output at the upper endpoint minus the output at the lower endpoint. The result has units of dimensionless: the input unit in the integration cancels the input unit in the denominator of the slope.

This statement is about the mathematics of this particular relationship. It does not assign a new physical meaning to an arbitrary area under a graph. For example, an area under force versus distance represents work, while an area under a different pair of quantities may represent something else or have no standard name. Always carry the axis units through the calculation before naming an integral.

slope_function = sp.lambdify(q, slope_expression, modules="numpy")
endpoint_change = float(evaluate(3.141592653589793) - evaluate(0.0))
for points in [101, 201, 401]:
    grid = np.linspace(0.0, 3.141592653589793, points)
    slopes = np.asarray(slope_function(grid), dtype=float)
    slopes = np.broadcast_to(slopes, grid.shape)
    integrated_change = np.trapezoid(slopes, grid)
    print(
        points,
        "integrated change:",
        integrated_change,
        "endpoint change:",
        endpoint_change,
    )

The trapezoidal rule joins neighbouring slope samples with straight segments and adds their signed areas. A negative contribution remains negative; replacing every slope by its magnitude would calculate a different quantity. Increasing the sample count provides a practical refinement check. If the values do not settle toward the endpoint difference, first inspect the interval, singularities, and array ordering.

Do not conclude that two agreeing calculations prove the model is physically complete. Both use the same selected relationship, so an omitted effect would be omitted from both. Their agreement is evidence that the numerical tools implement that relationship consistently. Comparing with an independent experiment or a more appropriate physical model is a separate test.

Keep this comparison in the notebook when you change the expression. It is particularly useful after adding a coefficient, changing a sign convention, or converting an input unit. A code cell that produces a smooth graph can conceal these mistakes; a second calculation of the same output change gives you another place to notice them.

Sources


Share to: