Time-Dependent Hamiltonian Notebook
This notebook guide makes time ordering numerically unavoidable. A rotating-field two-level Hamiltonian has nonzero commutators at unequal times, yet it also admits an exact rotating-frame solution. It is therefore an unusually clean benchmark for showing why
is generally not the evolution operator.
The formal distinction belongs to Time-Dependent Hamiltonians and Time Ordering. This page owns the reproducible numerical comparison among an exact solution, a deliberately naive exponential, chronologically ordered short-step products, and an adaptive ODE solver.
The existing source notebook notebooks/wave-mechanics-canonical-systems/two-level-systems/two-level-system-dynamics.ipynb supplies compatible Pauli-matrix and state-validation patterns. The present calculation adds explicit drive time dependence and unequal-time noncommutativity.
Purpose
Section titled “Purpose”The notebook should demonstrate that:
- explicit time dependence alone does not invalidate an ordinary exponential; unequal-time noncommutativity does;
- the naive exponential can converge accurately to the wrong operator;
- chronological products of exact short-step exponentials converge to the time-ordered evolution;
- left-endpoint and midpoint products have different global convergence orders;
- an adaptive ODE solver provides an independent numerical route but is not automatically unitary;
- norm conservation is necessary but insufficient for validating a quantum propagator.
The comparison should be operator-level whenever possible. Testing one initial state can miss an error on the orthogonal state or conceal a global phase.
Rotating-Field Model
Section titled “Rotating-Field Model”Use
with
Here is the transverse coupling, is the static longitudinal angular frequency, and is the angular frequency of the rotating transverse field. All three have units of inverse time.
The Hamiltonian is Hermitian and traceless. Its instantaneous eigenvalues are constant,
even though its eigenvectors rotate in time. Constant instantaneous eigenvalues do not make the dynamics equivalent to a time-independent Hamiltonian.
Unequal-Time Commutator
Section titled “Unequal-Time Commutator”For Pauli vectors,
Therefore
This is generically nonzero. For example, at
the cross product is
The notebook should evaluate the commutator norm numerically before attempting time evolution. This prevents the key assumption from remaining implicit.
Exact Rotating-Frame Solution
Section titled “Exact Rotating-Frame Solution”Define the rotation
It obeys
The laboratory Hamiltonian can be written
where
Set
The rotating-frame state satisfies
with the constant Hamiltonian
Thus the exact propagator from to is
This formula is the primary benchmark. Verify it by checking and the operator differential equation
Closed Pauli Exponentials
Section titled “Closed Pauli Exponentials”For any real vector ,
Use the continuous limit when . This identity evaluates every exact and short-step exponential without depending on a general matrix-exponential routine. A library routine remains useful as an independent cross-check.
The Naive Exponential
Section titled “The Naive Exponential”The time-integrated effective vector is
The naive approximation is
This expression uses the exact time integral. Its error is not quadrature error. It discards all information about the order in which differently oriented infinitesimal rotations act.
At one drive period,
the transverse components of vanish:
On resonance, , the naive result is
It predicts no transition between basis states.
The exact result on resonance is
For an initial with ,
while
This is a direct physical consequence of time ordering, not a small numerical correction.
Chronologically Ordered Products
Section titled “Chronologically Ordered Products”Divide into equal steps,
For sampling times , define the exact frozen-Hamiltonian step
The chronological product is
The earliest step acts first and appears on the right. In an implementation that loops forward in , update by left multiplication:
Two baseline choices are:
for the left-endpoint product, and
for the exponential midpoint product.
For smooth , the expected global operator errors are
and
Each individual step and the full product are exactly unitary in exact arithmetic. Unitarity does not prove accuracy: reversing the product order also multiplies unitary matrices but approaches the wrong ordered evolution.
A Discretized Naive Control
Section titled “A Discretized Naive Control”To separate quadrature convergence from time-ordering convergence, also compute
As grows, the sum converges to . For a noncommuting model, however, approaches rather than . Its error therefore plateaus at a nonzero value even while the integral quadrature converges.
This is an important diagnostic pattern: numerical convergence of an intermediate quantity does not establish that the mathematical formula built from it is correct.
Adaptive ODE Route
Section titled “Adaptive ODE Route”As an independent route, integrate
with a high-order adaptive ODE solver. Flatten the complex matrix into a length-four vector and reshape it inside the derivative function. Use a complex initial array so the solver stays in the complex domain.
A high-precision explicit method such as DOP853 is appropriate for this small smooth benchmark. Record relative tolerance, absolute tolerance, accepted step count, function evaluations, and any maximum-step constraint. Tighten tolerances and reduce the maximum step until the operator error stabilizes.
Adaptive local-error control does not enforce exact unitarity. Report the unitarity residual rather than renormalizing columns after each step. The exact rotating-frame result remains the standard against which the adaptive solver is judged.
Commuting Control Case
Section titled “Commuting Control Case”Run the same workflow for
All unequal-time Hamiltonians commute:
The exact propagator is the ordinary exponential
The naive, ordered-product, and adaptive routes should all converge to this answer. This control establishes that the failure in the rotating-field model comes from noncommutativity rather than from explicit time dependence by itself.
Baseline Parameters
Section titled “Baseline Parameters”Set
and evolve for one drive period,
Use the initial state
The exact transition probability is
The naive exponential predicts zero. For the convergence study, begin with
With double precision and the closed Pauli step, these values should expose the first- and second-order regimes before roundoff becomes relevant.
Notebook Workflow
Section titled “Notebook Workflow”Organize the notebook into reproducible stages:
- define Pauli matrices and verify their commutators;
- define and ;
- check Hermiticity and a nonzero unequal-time commutator;
- construct from the rotating-frame formula;
- verify its initial condition and differential equation;
- compute from the analytic integral;
- implement left-endpoint and midpoint chronological products;
- implement the exponentiated-sum control and the deliberately reversed product;
- integrate the operator ODE adaptively;
- compare operator, state, transition-probability, and Bloch-vector results;
- estimate observed convergence orders;
- repeat the calculation for the commuting control Hamiltonian;
- run assertions before making plots.
Record parameter units, transform conventions, multiplication order, solver tolerances, step counts, and error norms.
Operator and State Errors
Section titled “Operator and State Errors”Use the phase-sensitive Frobenius error
Also report the global-phase-insensitive gate error
For a chosen state, use
The unitarity residual is
A wrong ordered product can have near roundoff while is large. Conversely, an adaptive Runge–Kutta solution can have a small physical error and a small but nonzero unitarity residual.
Observed Convergence Order
Section titled “Observed Convergence Order”For an error sequence , estimate
In the asymptotic regime,
for left-endpoint ordering and
for midpoint ordering.
Plot error against on logarithmic axes and report the numerical slopes. A slope inferred from only two coarse points is not convincing; include enough refinements to identify a stable regime.
Bloch and Energy Diagnostics
Section titled “Bloch and Energy Diagnostics”For a pure state, compute
The Bloch-vector norm should remain
Plot the exact and numerical trajectories on equal scales or compare their Cartesian components versus time. The rotating laboratory field and rotating-frame effective field should not be conflated.
For the closed driven system,
An optional finite-difference check of this identity tests both state evolution and explicit Hamiltonian time dependence. The interpretation of energy exchange with the external drive continues in Driven Closed Quantum Systems.
Validation Checks
Section titled “Validation Checks”The minimum validation suite is:
| Check | Target |
|---|---|
| Pauli algebra | |
| Hamiltonian structure | Hermitian and traceless at sampled times |
| Noncommutativity | selected unequal-time commutator norm is nonzero |
| Exact benchmark | initial condition and operator Schrödinger residual vanish |
| Ordered products | left and midpoint routes converge to |
| Observed order | slopes approach one and two, respectively |
| Exponentiated sum | integral converges but operator error plateaus |
| Reversed product | remains unitary but does not converge to forward evolution |
| Adaptive ODE | error decreases under tolerance and maximum-step refinement |
| Transition probability | approaches for the baseline |
| Unitarity | ordered exponential products remain unitary to roundoff |
| Composition | with absolute-time sampling |
| Commuting control | naive and ordered routes converge to the same answer |
| Bloch norm | remains one for exact pure-state evolution |
For the composition test, build both subinterval propagators using the Hamiltonian at their actual laboratory times. Restarting the drive phase at changes the problem.
Expected Results
Section titled “Expected Results”For the baseline model:
- predicts zero transition after one period;
- the exact transition probability is approximately ;
- the exponentiated-sum result approaches the naive answer as quadrature is refined;
- the left chronological product shows first-order global convergence;
- the midpoint chronological product shows second-order global convergence;
- both ordered products remain unitary to roundoff;
- the adaptive ODE result approaches the exact operator as tolerances tighten;
- a reversed product can be exactly unitary and physically wrong;
- all correct routes agree for the commuting control Hamiltonian.
These outcomes distinguish algebraic correctness, numerical accuracy, and structure preservation.
Common Numerical Failures
Section titled “Common Numerical Failures”- Exponentiating the integrated Hamiltonian without checking commutators. Accurate quadrature cannot restore missing time ordering.
- Multiplying step operators on the wrong side. The earliest factor belongs on the right for column-state evolution.
- Calling each frozen step exact and therefore calling the full product exact. Time sampling still creates global error.
- Using only norm conservation. Any unitary matrix preserves norm, including the wrong reversed product.
- Renormalizing an adaptive solution after every output point. This hides solver drift and changes the numerical method.
- Testing one initial state only. Operator errors can act entirely in another state direction.
- Ignoring global phase in every metric. Transition probabilities may be insensitive to a phase that matters in composition or controlled evolution.
- Forgetting the spinor sign . A rotation is not the identity on spinors.
- Restarting the drive phase on each subinterval. Nonautonomous propagators depend on both endpoint times.
- Tightening solver tolerances without limiting step size. A rapidly varying drive may still be undersampled.
- Comparing methods at different Hamiltonian sample times. This confounds method order with a convention change.
- Treating energy nonconservation as numerical failure. The external drive can do work on the closed system.
Extensions
Section titled “Extensions”- Move off resonance and compare the exact rotating-frame transition formula.
- Replace the circularly rotating field with an elliptically polarized drive, removing the simple exact benchmark.
- Compare the midpoint product with a commutator-corrected Magnus approximation on short intervals.
- Add piecewise control pulses and verify chronological factor ordering.
- Continue to Floquet Operators by diagonalizing the one-period propagator.
- Compare the time-dependent benchmark with the operator-splitting errors in the Trotter Evolution Notebook.
Cross-Links
Section titled “Cross-Links”- Time-Dependent Hamiltonians
- Time Ordering
- Dyson Expansion as Formal Evolution
- Rotating Frames
- Driven Closed Quantum Systems
- Two-State Hamiltonians
- Time-Stepping Methods
- Matrix Exponentials Numerically
- Convergence Tests
- Validation Tests
References
Section titled “References”- J. J. Sakurai and J. Napolitano, Modern Quantum Mechanics, 3rd ed., Cambridge University Press, 2020.
- D. J. Tannor, Introduction to Quantum Mechanics: A Time-Dependent Perspective, University Science Books, 2007.
- S. Blanes, F. Casas, J. A. Oteo, and J. Ros, “The Magnus Expansion and Some of Its Applications,” Physics Reports 470, 151–238 (2009), doi:10.1016/j.physrep.2008.11.001.
- E. Hairer, C. Lubich, and G. Wanner, Geometric Numerical Integration, 2nd ed., Springer, 2006.
- SciPy Developers, solve_ivp documentation, consulted for complex-valued adaptive integration and DOP853 solver controls.
Exercises
Section titled “Exercises”1. Evaluate an unequal-time commutator
Section titled “1. Evaluate an unequal-time commutator”Derive the commutator at and .
Solution
The two effective vectors are
and
Their cross product is
Hence
which is nonzero when .
2. Derive the rotating-frame Hamiltonian
Section titled “2. Derive the rotating-frame Hamiltonian”Starting from , derive .
Solution
Differentiate the state:
Multiply by :
Since
one obtains
3. Explain the resonant one-period failure
Section titled “3. Explain the resonant one-period failure”At , show why the naive result predicts no transition while the exact result generally does.
Solution
Over one period the transverse integrals vanish, and
Therefore
This changes only the global phase of a basis state. In the rotating frame, resonance gives
Since ,
The rotation produces
4. Prove stepwise unitarity
Section titled “4. Prove stepwise unitarity”Show that a chronological product of frozen-Hamiltonian exponentials is unitary, regardless of the sampling rule.
Solution
For Hermitian ,
obeys
For
one has
The cancellations prove exact unitarity in exact arithmetic. They do not prove that the sampled product approximates the correct time-ordered operator accurately.
5. Derive the commuting control propagator
Section titled “5. Derive the commuting control propagator”Solve the evolution for and explain why time ordering is unnecessary.
Solution
Every Hamiltonian is proportional to , so all pairs commute. Therefore
The scalar integral is
Substitution gives
6. Distinguish accuracy from unitarity
Section titled “6. Distinguish accuracy from unitarity”Give an example from this notebook of a unitary approximation that is inaccurate and a potentially accurate approximation that is not exactly unitary.
Solution
The reversed product of exact frozen-Hamiltonian exponentials is unitary because it is a product of unitary matrices, but it uses the wrong chronological order and does not converge to the forward propagator. A high-order adaptive Runge–Kutta solution can approximate the exact propagator very accurately, but its finite-step update is not constrained to be exactly unitary. Operator error and unitarity residual must therefore be reported separately.