Time-Dependent Two-Level Systems Notebook
A unitary time step can conserve probability perfectly and still produce the wrong dynamics. Exact exponentiation of a Hamiltonian frozen at each time step removes one source of error, but it does not remove time-ordering error, rotating-wave error, two-state projection error, pulse-model error, or disagreement between a closed-system model and an experiment.
This notebook turns that hierarchy into an executable benchmark. It computes:
- resonant and detuned Rabi oscillations;
- a full laboratory-frame evolution and its rotating-wave approximation (RWA);
- square and Gaussian pulses with the same nominal area;
- ideal and finite-pulse Ramsey sequences; and
- convergence, norm, and analytic-reference diagnostics for every layer.
The retained headline results are:
| Diagnostic | Computed value | Interpretation |
|---|---|---|
| largest matrix-versus-analytic Rabi error | constant-pulse implementation check | |
| largest medium-versus-fine laboratory-frame difference | resolved propagation error estimate | |
| largest lab-versus-RWA difference at | approximation error is resolved numerically | |
| largest lab-versus-RWA difference at | weak-drive approximation degrades | |
| resonant Gaussian area-law error | envelope propagation check | |
| largest detuned square-versus-Gaussian difference | equal area does not fix a detuned unitary | |
| largest finite-versus-instantaneous Ramsey difference | finite pulses alter the fringe envelope | |
| largest retained norm error | propagation remains unitary to roundoff |
The first two rows test different questions. The small norm error says that the numerical evolution stays on the state sphere. The convergence difference estimates how accurately the time-ordered evolution is resolved. Neither quantity says that the RWA or the two-state model is physically accurate.
Run the investigation. The program and retained results below support the stated experiment. Follow Running an Experiment for environment and output-directory guidance. The recorded evidence applies to its stated parameters and environment.
Purpose and Canonical Scope
Section titled “Purpose and Canonical Scope”This page is the canonical home for the executable calculation that:
- implements exact exponentials for constant two-level Hamiltonians;
- checks the detuned Rabi formula against matrix propagation;
- propagates the explicitly oscillating laboratory-frame Hamiltonian with a unitary exponential-midpoint method;
- separates time-step error from laboratory-frame versus RWA discrepancy;
- verifies the resonant pulse-area theorem for square and Gaussian envelopes;
- demonstrates pulse-shape dependence away from resonance;
- constructs ideal and finite-pulse Ramsey fringes;
- generates a phase-stepped Ramsey error signal; and
- exports data, metadata, and validation thresholds in machine-readable form.
The neighboring pages retain broader canonical responsibilities:
- Two-Level Atom owns the projection from a multilevel atom, matrix-element calibration, drive phase, and detuning conventions.
- Rabi Oscillations owns the AMO interpretation of population traces, pulse calibration, Rabi chevrons, readout contrast, and experimental failure signatures.
- Rabi Oscillations: First Encounter owns the introductory closed-form solution.
- Rotating-Wave Approximation owns the approximation’s derivation, scale hierarchy, counter-rotating terms, and analytic error estimates.
- Rotating Frames owns exact time-dependent frame transformations.
- Ramsey Interferometry owns separated-field measurement physics, finite-pulse spectroscopy, frequency-discriminator design, clock noise, and systematic shifts.
- Optical Bloch Equations owns the AMO treatment of relaxation, dephasing, saturation, and fluorescence.
- ODE Solvers and Convergence Tests own the general numerical analysis.
This notebook uses those results as validation standards. It does not duplicate their full derivations, and it does not treat a generic dimensionless calculation as a species-specific prediction.
Reproducibility Contract
Section titled “Reproducibility Contract”The executable artifact is a NumPy-only Python program:
- Download the program
- Detuned Rabi traces
- Laboratory-frame and RWA traces
- Pulse-area scan
- Ramsey scan
- Time-step convergence table
- Machine-readable metadata and validation
Run the downloaded program from the folder where you saved it:
python time-dependent-two-level.py --output-dir resultsThe default run declares:
| Item | Choice |
|---|---|
| language | Python 3 |
| numerical dependency | NumPy |
| random numbers | none |
| internal convention | |
| frequency unit | arbitrary angular-frequency unit |
| time unit | reciprocal angular-frequency unit |
| Rabi samples | |
| laboratory-frame samples | |
| fine carrier steps per cycle | |
| pulse-area samples | |
| Gaussian midpoint steps | |
| Ramsey samples | |
| matrix exponential | analytic Pauli-matrix formula |
| time-dependent integrator | exponential midpoint |
The program has no fitted correction, stochastic seed, hidden optimizer, external solver, or plotting dependency. The CSV files contain the data used by the figure, while the JSON record preserves conventions, parameters, runtime versions, acceptance checks, provenance identifiers, and limitations.
Claim boundary
Section titled “Claim boundary”The calculation is a closed-system propagator and approximation benchmark. It assumes that a two-state projection has already been justified. It does not include:
- spontaneous emission or population relaxation;
- pure dephasing;
- leakage to spectator levels;
- atomic motion or Doppler averaging;
- spatial intensity inhomogeneity;
- pulse-generator transfer functions;
- state-preparation and measurement errors; or
- uncertainty in species-specific transition parameters.
Those omissions are not small-print details. For a real experiment, they can dominate a numerically converged two-state trajectory.
Conventions Before Code
Section titled “Conventions Before Code”Two-level calculations are unusually vulnerable to silent sign and factor-of-two errors. The implementation therefore fixes its conventions before any propagation.
The ordered basis is
represented by
The Pauli matrices are
and
Thus and have eigenvalues and , respectively. The detuning is
A positive detuning therefore means that the unperturbed transition frequency lies above the drive frequency. Some texts use the opposite sign. Population curves with phase zero can hide this difference because they are often even in , while coherences and phase-stepped Ramsey signals cannot.
The phase-dependent transverse operator is
The RWA Hamiltonian used by every constant pulse is
The corresponding laboratory-frame Hamiltonian is
With this linear-drive convention, the near-resonant co-rotating term produces the same that appears in the RWA Hamiltonian. Replacing the laboratory coupling by would double the RWA coupling and invalidate the comparison.
Exact Propagators for Constant Segments
Section titled “Exact Propagators for Constant Segments”Any traceless Hermitian two-state Hamiltonian can be written
Define
Because
its propagator is
The code evaluates this expression directly. For , it returns the identity rather than dividing by zero.
This formula has three practical advantages:
- every constant segment is unitary up to floating-point roundoff;
- no generic matrix-exponential dependency is required; and
- the factor-of-two convention is visible in the coefficients.
It does not solve an arbitrary time-dependent problem exactly. When and do not commute, a product of frozen-Hamiltonian propagators still approximates a time-ordered exponential.
Detuned Rabi Benchmark
Section titled “Detuned Rabi Benchmark”For a constant RWA pulse of phase zero and initial state , define
The analytic excited-state probability is
The notebook uses and scans
over . It computes each point twice:
- directly from the analytic probability; and
- by applying the exact constant-segment matrix propagator to .
The largest probability difference is at floating-point scale. This test catches:
- a reversed basis;
- an omitted factor of ;
- a mistaken generalized Rabi frequency;
- an amplitude prefactor error;
- a projection onto the wrong state; and
- a nonunitary propagator implementation.
What detuning changes
Section titled “What detuning changes”Detuning changes both the oscillation rate and its amplitude:
For the three retained cases:
The oscillations speed up while complete inversion becomes impossible. A single fitted sinusoid with an unconstrained amplitude can therefore conceal whether a reduced contrast came from detuning, dephasing, readout, leakage, or inhomogeneity.
Time-Dependent Laboratory-Frame Propagation
Section titled “Time-Dependent Laboratory-Frame Propagation”The full comparison retains the counter-rotating part of the linear drive:
The benchmark sets
and scans
The horizontal coordinate is the slow time
so every case covers . As decreases, the same slow Rabi interval contains more carrier cycles. That is precisely the scale separation on which the RWA relies.
Exponential-midpoint update
Section titled “Exponential-midpoint update”For a step from to , the program samples the Hamiltonian at the midpoint:
It then updates
Each frozen exponential is evaluated with the Pauli formula. The method is time symmetric and has second-order global accuracy for a smooth Hamiltonian:
at fixed final time, subject to regularity and stability assumptions.
The exact unitary of each substep ensures
in exact arithmetic. It does not ensure that the ordered product equals the exact time-ordered propagator. Norm preservation is therefore a necessary structural check, not a convergence proof.
Sampling and internal stepping are distinct
Section titled “Sampling and internal stepping are distinct”The CSV trace has requested output times. Between two output times, the integrator may take several internal steps so that no internal step exceeds
where is the requested number of steps per carrier cycle. This separation prevents plotting resolution from silently controlling solver accuracy.
The retained convergence ladder is
Rotating-Wave Comparison
Section titled “Rotating-Wave Comparison”On exact resonance, the corresponding RWA prediction is
The notebook compares this curve with the converged laboratory-frame result at identical . The retained diagnostics are:
| versus | versus | lab versus RWA | lab at nominal pulse | |
|---|---|---|---|---|
At the weakest drive, the maximum RWA discrepancy is more than one thousand times the medium-to-fine propagation difference. The mismatch is therefore resolved; reducing the time step cannot make it disappear.
Interpreting the discrepancy carefully
Section titled “Interpreting the discrepancy carefully”The reported lab-versus-RWA value is the maximum pointwise population difference over a finite interval. It combines:
- fast micromotion from the counter-rotating component;
- an accumulated phase difference;
- the leading counter-rotating frequency shift;
- changes in the effective rotation axis; and
- the chosen start phase and observation window.
It is not a universal RWA error bound. A stroboscopic comparison, a phase-averaged comparison, a gate infidelity, a quasienergy difference, and a maximum pointwise population difference answer different questions.
The systematic growth across the selected drive ratios supports the expected weak-drive hierarchy. It does not establish one exact power law from five finite-window points.
Why nominal inversion remains high
Section titled “Why nominal inversion remains high”The maximum trace discrepancy reaches nearly at , while the population at the nominal RWA pulse is still about . These statements are compatible. A pointwise maximum can occur away from the nominal gate time, and fast micromotion can be large locally while partially canceling at a selected endpoint.
For control design, the endpoint unitary or process fidelity is often more relevant than the largest transient population difference. For spectroscopy, the accumulated phase or resonance shift may matter more. The diagnostic must follow the intended observable.
Pulse Area
Section titled “Pulse Area”For a phase-fixed resonant RWA pulse with time-dependent envelope ,
Hamiltonians at all times commute:
The propagator depends only on the pulse area
and an initial ground state has
This is not restricted to square pulses. It holds for any integrable amplitude envelope under the stated resonant, fixed-axis, closed-system Hamiltonian.
Square pulse
Section titled “Square pulse”For duration , the square envelope is
The constant propagator reproduces the area law with maximum discrepancy over
Truncated Gaussian pulse
Section titled “Truncated Gaussian pulse”The comparison Gaussian is centered at with width
It is normalized on the finite pulse interval:
Thus
analytically. Exponential-midpoint propagation with steps reproduces the area law to in probability. That finite error is a quadrature and time-ordering discretization diagnostic, not a failure of the area theorem.
Equal area away from resonance
Section titled “Equal area away from resonance”At detuning ,
Now
which is generally nonzero. Equal area no longer implies equal evolution. The detuning term acts during the pulse, and its noncommuting combination with the changing transverse drive remembers the envelope.
Across the retained scan, the maximum square-versus-Gaussian population difference is
At nominal area :
The difference is not caused by unequal numerical area: both envelopes use the same declared . It is a physical consequence of noncommuting dynamics within the chosen model.
Ramsey Sequences
Section titled “Ramsey Sequences”The benchmark sequence is:
The first pulse creates a coherent superposition. During the free interval, the relative phase advances with detuning. The second pulse maps that phase to population.
Instantaneous-pulse reference
Section titled “Instantaneous-pulse reference”For ideal resonant pulses with phases and , the reference probability is
The program also constructs the corresponding sequence from exact matrix propagators. The maximum formula-versus-matrix discrepancy over the retained grid is .
This check is intentionally independent of the plotted finite-pulse sequence. It verifies pulse order, phase sign, basis order, and the free evolution convention.
Finite pulses
Section titled “Finite pulses”The finite sequence uses
During each pulse, the Hamiltonian includes the same detuning used during free evolution:
The pulse is therefore an exact rotation only at . Away from resonance, its axis tilts and its angle changes. Compared with the instantaneous-pulse curve, the finite-pulse fringe acquires a modified envelope and phase.
The largest population difference over
is . This is a model difference, not numerical noise: every segment has an exact constant Hamiltonian.
On-resonance checks
Section titled “On-resonance checks”For zero relative pulse phase at , the two pulses combine to a rotation:
With the second pulse shifted by , the on-resonance populations are
These values test both pulse calibration and the implementation of .
Phase-stepped error signal
Section titled “Phase-stepped error signal”Define
The error signal crosses zero on resonance:
A centered finite difference on the exported grid gives
For instantaneous pulses in this convention, the magnitude of the corresponding central slope is . The finite-pulse value is larger because phase also accumulates during the two pulses. Treating the dark time as the entire interrogation time would miss that contribution.
The sign of an experimental discriminator depends on the detuning and phase-step conventions. Its zero crossing and calibrated slope are more robust records than a bare statement that the signal is “dispersive.”
Four closed-system checks generated from the downloadable CSV files. Panel (a) verifies the detuned Rabi frequency and amplitude. Panel (b) resolves carrier-scale micromotion and accumulated RWA discrepancy at weak and moderate drive. Panel (c) shows that resonant evolution depends only on pulse area, whereas equal-area square and Gaussian pulses differ at . Panel (d) compares instantaneous and finite Ramsey pulses. Curves are dimensionless model results, not a fit to a particular atom.
What the Figure Does Not Show
Section titled “What the Figure Does Not Show”A compact figure necessarily suppresses several diagnostics that remain in the data:
- panel (a) exports both analytic and matrix-propagated columns for every detuning;
- panel (b) exports all five drive ratios, not only the two displayed;
- the convergence CSV contains coarse, medium, and fine differences for each laboratory trace;
- panel (c) exports square and Gaussian results on and off resonance;
- panel (d) exports both phase steps and their difference;
- the metadata records the maximum norm error for each calculation; and
- validation thresholds are machine-readable rather than inferred from plot thickness.
A plot is an interface to the calculation, not its complete evidentiary record.
Validation Architecture
Section titled “Validation Architecture”The notebook uses a ladder of checks rather than one omnibus comparison.
Level 1: algebra
Section titled “Level 1: algebra”The Pauli matrices obey
and the propagator formula follows from that identity. Constant RWA segments are compared with known analytic probabilities.
Level 2: structure
Section titled “Level 2: structure”Every propagator is unitary in exact arithmetic. The largest retained norm error is
This catches implementation failures such as a sign error in the imaginary exponential coefficient or accidental use of a non-Hermitian Hamiltonian.
Level 3: time-step convergence
Section titled “Level 3: time-step convergence”The full laboratory-frame problem is recomputed at , , and steps per carrier cycle. The fine-level difference is compared with the physical RWA discrepancy.
For a second-order method, halving the step should reduce an asymptotic error by about four. The coarse-to-medium differences are roughly four times the medium-to-fine differences, consistent with the expected regime:
The ratio is not exactly four because the diagnostic is a maximum over a sampled trajectory, floating-point effects are present, and the maximizing time can change with resolution.
Level 4: approximation separation
Section titled “Level 4: approximation separation”The acceptance check requires the weak-drive RWA discrepancy to exceed the weak-drive medium-to-fine numerical difference by more than a factor of . The actual ratio is about
This prevents a calculation from declaring an approximation failure when it has not first resolved the reference dynamics.
Level 5: physical identities
Section titled “Level 5: physical identities”Independent identities test different workflows:
- detuned Rabi formula;
- resonant area theorem;
- ideal Ramsey formula;
- resonant two-pulse inversion;
- zero crossing of the phase-stepped error signal.
Agreement among these tests is stronger than agreement with one curve generated by the same code path.
Error Ledger
Section titled “Error Ledger”For a species-specific driven transition, a useful hierarchy is:
| Layer | Question | Representative diagnostic |
|---|---|---|
| Hilbert-space projection | Are two states isolated? | spectator detunings, leakage calculation |
| Hamiltonian calibration | Are , , , and polarization correct? | independent spectroscopy and power calibration |
| frame choice | Are observables transformed consistently? | exact rotating-frame identity |
| approximation | Is the RWA adequate? | lab-frame comparison or controlled expansion |
| pulse model | Does the delivered field match the envelope? | measured transfer function and waveform |
| propagation | Is time ordering resolved? | step-size convergence |
| floating point | Is unitarity retained? | norm and reversibility checks |
| open-system model | Are , , and noise included? | master-equation comparison |
| ensemble model | Are motion and inhomogeneity included? | distribution average |
| readout | Does computed population map to counts? | calibrated measurement model |
The present notebook addresses the frame, approximation, pulse-model, and propagation rows within an idealized two-state closed system. It does not collapse the remaining rows into a single numerical error bar.
Projection error
Section titled “Projection error”A real atom has additional Zeeman, hyperfine, fine-structure, motional, and possibly continuum states. Even if none is appreciably populated, virtual couplings can shift the two-state resonance. The ratio used in the lab-versus-RWA benchmark says nothing by itself about relative to the nearest spectator-state detuning.
Approximation error
Section titled “Approximation error”The RWA removes counter-rotating terms after a frame transformation. Its validity depends on drive strength, detuning, duration, phase, and target observable. A small instantaneous population error does not guarantee a small phase error after many cycles.
Propagation error
Section titled “Propagation error”The exponential-midpoint method is exactly unitary per step, but it approximates time ordering. The relevant check is convergence of the target observable, state, or unitary, not only the norm.
Model-to-experiment error
Section titled “Model-to-experiment error”Relaxation, phase noise, amplitude noise, finite temperature, Doppler shifts, and readout errors can reshape a Rabi or Ramsey trace. Fitting such a trace with a closed-system curve may return precise but biased parameters.
Reading the Exported Data
Section titled “Reading the Exported Data”Detuned Rabi CSV
Section titled “Detuned Rabi CSV”The columns include:
tauandtau_over_pi;- an analytic population for each detuning ratio; and
- a matrix-propagated population for the same ratio.
Keeping both columns makes the validation reproducible without rerunning Python.
Laboratory-frame CSV
Section titled “Laboratory-frame CSV”The columns include:
- slow time ;
- the resonant RWA population; and
- one fine-grid laboratory-frame population for every .
The physical time differs among drive ratios because each trace uses the same slow interval.
Convergence CSV
Section titled “Convergence CSV”Each row records:
- drive ratio;
- all three carrier-step counts;
- maximum coarse-to-medium difference;
- maximum medium-to-fine difference;
- maximum fine-lab-to-RWA difference;
- nominal -pulse populations; and
- fine-grid norm error.
This table should accompany any claim based on panel (b).
Pulse-area CSV
Section titled “Pulse-area CSV”For each area, the file contains:
- analytic area-law probability;
- resonant square result;
- resonant Gaussian result;
- detuned square result; and
- detuned Gaussian result.
The file supports direct checks of both the theorem and its failure outside the commuting regime.
Ramsey CSV
Section titled “Ramsey CSV”For each detuning, the file contains:
- ;
- free phase ;
- ideal formula and ideal matrix results;
- finite-pulse zero-phase population;
- finite-pulse populations; and
- their difference as an error signal.
Reporting and exposes the two independent scales governing dark evolution and pulse distortion.
Extending the Calculation
Section titled “Extending the Calculation”Compare full unitaries
Section titled “Compare full unitaries”Population from one initial state does not determine a quantum operation. For gate assessment, propagate both basis vectors and assemble
Remove an irrelevant global phase before comparing with a target unitary. Useful metrics include operator norm, average gate fidelity, worst-case state fidelity, and phase error. Declare which one is used.
Add adaptive stepping
Section titled “Add adaptive stepping”An embedded commutator-free or Runge–Kutta method can adapt to a shaped pulse. The tolerance must be validated against a tighter run, and any nonunitary intermediate method should track norm drift separately from local error.
Add a Magnus or Floquet benchmark
Section titled “Add a Magnus or Floquet benchmark”For periodic driving, one can compare:
- direct laboratory propagation;
- a truncated Magnus effective Hamiltonian;
- a Floquet quasienergy calculation; and
- the leading RWA.
Quasienergies require a declared Brillouin-zone convention, while micromotion requires more than a stroboscopic effective Hamiltonian. See Floquet Theory and Magnus Expansion.
Add arbitrary envelopes
Section titled “Add arbitrary envelopes”Replace the built-in square or Gaussian with sampled in-phase and quadrature controls:
Preserve:
- waveform sampling rate;
- interpolation rule;
- amplitude and phase units;
- truncation window;
- transfer-function correction;
- time origin; and
- any filter or resampling operation.
An “arbitrary waveform” without those records is not reproducible.
Add relaxation and dephasing
Section titled “Add relaxation and dephasing”A density-matrix extension can use
where
That extension should validate:
- trace preservation;
- Hermiticity;
- positivity;
- the no-drive relaxation law;
- the resonant steady state; and
- recovery of this unitary notebook when rates vanish.
The Optical Bloch Equation Notebook owns that next computational layer.
Add leakage
Section titled “Add leakage”Enlarge the Hamiltonian to include a spectator state. Compare:
- final target-state population;
- total leakage;
- ac Stark shift;
- effective two-state model;
- pulse-shape sensitivity; and
- convergence with respect to included states.
This separates failure of the two-state projection from failure of the RWA inside the projected subspace.
Add ensemble averaging
Section titled “Add ensemble averaging”For a distribution , an incoherent measurement average is
Average probabilities only when ensemble members are incoherent. If amplitudes interfere before detection, the averaging must occur at the state or field level.
Add optimal control
Section titled “Add optimal control”Control optimization should keep the forward propagator, objective, gradient, constraints, robustness ensemble, and final independent validation distinct. An optimizer can exploit discretization artifacts unless the optimized pulse is re-evaluated on a finer grid and, where relevant, in the full laboratory-frame or multilevel model.
Common Mistakes
Section titled “Common Mistakes”Hiding the detuning sign
Section titled “Hiding the detuning sign”The population of a single zero-phase pulse can be even in . Coherence phases and Ramsey error signals are not. State the sign convention at the top of the calculation.
Losing a factor of two
Section titled “Losing a factor of two”The coefficients in
imply a resonant -pulse time . A different laboratory-drive convention changes that mapping.
Calling norm preservation convergence
Section titled “Calling norm preservation convergence”A product of inaccurate unitary steps remains unitary. Repeat the target observable at smaller steps.
Comparing unresolved dynamics with an approximation
Section titled “Comparing unresolved dynamics with an approximation”If the lab-versus-RWA discrepancy is comparable to the numerical coarse-versus-fine difference, the reference trajectory is not adequate to measure approximation error.
Using output samples as solver steps
Section titled “Using output samples as solver steps”A smooth plot can be generated from a poorly resolved propagator, while an accurate propagator can be sampled sparsely. Record both grids.
Treating maximum pointwise error as universal
Section titled “Treating maximum pointwise error as universal”The maximum depends on interval, phase, observable, and sampling. Gate infidelity, quasienergy error, and transient population error are different metrics.
Assuming equal area means equal pulse
Section titled “Assuming equal area means equal pulse”The area theorem requires a fixed commuting rotation axis. Detuning, phase chirp, quadrature modulation, and additional levels generally break that condition.
Omitting detuning during finite pulses
Section titled “Omitting detuning during finite pulses”Turning off in a simulated Ramsey pulse while retaining it during the dark time creates the instantaneous-pulse approximation, even if the pulse has a nonzero duration in code.
Comparing only the central Ramsey fringe
Section titled “Comparing only the central Ramsey fringe”Finite pulses can preserve the on-resonance value while changing side fringes, slope, and envelope. Scan a range wide enough to expose those changes.
Inferring decoherence from one damped trace
Section titled “Inferring decoherence from one damped trace”Detuning distributions, amplitude inhomogeneity, leakage, motion, technical noise, and readout can all reduce contrast. A phenomenological exponential fit is not by itself a microscopic diagnosis.
Reporting arbitrary units as a species prediction
Section titled “Reporting arbitrary units as a species prediction”Dimensionless results become physical only after a documented mapping of , , time, polarization, and matrix elements to a particular transition.
Dropping metadata after plotting
Section titled “Dropping metadata after plotting”CSV curves without conventions, parameters, and validation thresholds are ambiguous. Keep the machine-readable record with the figure.
Exercises
Section titled “Exercises”Exercise 1: exact Pauli exponential
Section titled “Exercise 1: exact Pauli exponential”Let
Show that and derive the exact propagator used by the notebook. Explain why the formula is continuous as .
Solution
The Pauli product identity is
Therefore
The second term vanishes because is symmetric in , whereas is antisymmetric. Hence
Separate the exponential series into even and odd powers:
As ,
while . Thus the expression tends continuously to . The code handles explicitly to avoid a numerical division by zero.
Exercise 2: detuned Rabi ceiling
Section titled “Exercise 2: detuned Rabi ceiling”For fixed , find the first time at which the detuned Rabi probability reaches its maximum. Evaluate the maximum and time for .
Solution
The probability is
The first maximum of the sine squared occurs when
so
For ,
and therefore
The maximum arrives earlier than the resonant pulse, but it does not invert the population.
Exercise 3: norm versus accuracy
Section titled “Exercise 3: norm versus accuracy”Construct a simple example showing that a unitary numerical propagator can have arbitrarily large phase error while preserving norm exactly.
Solution
Consider the exact Hamiltonian
and an inaccurate numerical model
Both propagators,
are exactly unitary, so every state retains norm one under either evolution. For a superposition, however, the relative phase error is
At , the relative phase is wrong by , which can make an interference probability maximally wrong. Norm preservation detects no problem. Convergence or comparison of the phase-sensitive observable is required.
Exercise 4: midpoint convergence ratio
Section titled “Exercise 4: midpoint convergence ratio”Suppose the leading population error of the laboratory propagator is
Show why the difference between runs at and should be about four times the difference between runs at and .
Solution
At a fixed time,
Similarly,
The leading ratio is therefore
For a maximum over time, the observed ratio need not be exactly four because the maximizing time may differ among resolutions. A ratio near four across several refinements is evidence for, not a proof of, the asymptotic second-order regime.
Exercise 5: resonant area theorem
Section titled “Exercise 5: resonant area theorem”Prove that any two real, fixed-phase resonant envelopes with the same area produce the same final propagator in the two-level RWA model. Identify three ways the conclusion can fail.
Solution
At resonance and fixed phase zero,
Every Hamiltonian is proportional to the same matrix, so
Time ordering is unnecessary:
Thus the final propagator depends only on
The conclusion can fail if:
- , introducing a noncommuting term;
- the drive phase varies, changing the transverse rotation axis;
- additional levels participate, so the same scalar envelope multiplies several unequal transitions;
- relaxation or dephasing acts during envelopes of different duration; or
- the laboratory-frame counter-rotating term is retained outside the RWA.
Any three of these provide the requested failure mechanisms.
Exercise 6: detuned square pulse
Section titled “Exercise 6: detuned square pulse”For a square pulse of duration , area , and detuning , use the constant-pulse formula to reproduce the notebook’s square-pulse population.
Solution
The square amplitude is
The generalized Rabi frequency is
The final population is
This agrees with the exported square-pulse value. The resonant area-law prediction would be , showing that nominal area alone is insufficient when .
Exercise 7: ideal Ramsey phase
Section titled “Exercise 7: ideal Ramsey phase”Starting from , use the notebook’s pulse convention to derive
What happens if the detuning convention is reversed?
Solution
A resonant pulse of phase is
Free evolution is
Applying
to and projecting onto gives an amplitude whose modulus squared is
If detuning is instead defined as
the phase becomes
For zero pulse-phase difference, the cosine population is unchanged. For a phase-stepped error signal, the slope changes sign. That is why the detuning convention cannot be inferred safely from an unshifted Ramsey fringe alone.
Exercise 8: finite-pulse effective time
Section titled “Exercise 8: finite-pulse effective time”The ideal error-signal slope has magnitude , while the finite-pulse calculation gives approximately . Give a physical interpretation and compare the excess with the total pulse duration.
Solution
The two finite pulses each last
Their total duration is
Detuning acts during the pulses as well as during the free interval. The phase-to-population sensitivity therefore corresponds to an effective interrogation time larger than . The observed excess is
This is smaller than the full pulse duration because a driven state does not accumulate Ramsey phase during a pulse in the same way as during free precession. The rotating axis and changing population weight the detuning response.
The result should not be summarized by simply replacing with . The exact effective sensitivity follows from the finite-pulse propagator or a sensitivity-function calculation.
Exercise 9: design a stronger RWA test
Section titled “Exercise 9: design a stronger RWA test”The notebook compares one initial state through a maximum population difference. Design a stronger test for a target gate, including a numerical-convergence condition and an approximation metric.
Solution
Propagate both basis vectors under the full laboratory Hamiltonian to the chosen gate time and assemble the numerical unitary
Construct the target RWA gate
Remove the optimal global phase from . One possible approximation metric is the single-qubit average gate fidelity
The approximation error can be reported as .
Before interpreting it, repeat the full laboratory propagation at step sizes , , and . Require the change in gate infidelity between the two finest runs to be much smaller than the reported lab-versus-RWA infidelity. Also scan the carrier start phase if that phase is not fixed in the intended experiment.
This test probes the full operation rather than one population from one initial state.
Reproducibility Checklist
Section titled “Reproducibility Checklist”Before extending or citing a result, preserve:
- basis order and Pauli convention;
- detuning sign;
- laboratory and RWA amplitude convention;
- initial state;
- pulse phase and time origin;
- internal and output time grids;
- integrator and convergence ladder;
- target observable and error norm;
- pulse envelope and normalization;
- random seed or explicit statement that none is used;
- package and interpreter versions;
- acceptance thresholds;
- all generated numeric outputs; and
- known physical exclusions.
The downloadable metadata records each item used here. A modified calculation should update the metadata and validation tests together with the code.
The Reproducibility Benchmarks suite independently checks the resonant -pulse row and folds this notebook’s producer validations, artifact hashes, and runtime record into a versioned cross-notebook report.
References
Section titled “References”- I. I. Rabi, “Space Quantization in a Gyrating Magnetic Field,” Physical Review 51, 652–654 (1937), doi:10.1103/PhysRev.51.652.
- F. Bloch and A. Siegert, “Magnetic Resonance for Nonrotating Fields,” Physical Review 57, 522–527 (1940), doi:10.1103/PhysRev.57.522.
- N. F. Ramsey, “A Molecular Beam Resonance Method with Separated Oscillating Fields,” Physical Review 78, 695–699 (1950), doi:10.1103/PhysRev.78.695.
- J. H. Shirley, “Solution of the Schrödinger Equation with a Hamiltonian Periodic in Time,” Physical Review 138, B979–B987 (1965), doi:10.1103/PhysRev.138.B979.
- L. Allen and J. H. Eberly, Optical Resonance and Two-Level Atoms, Wiley (1975); Dover reprint (1987).
- C. Cohen-Tannoudji, J. Dupont-Roc, and G. Grynberg, Atom–Photon Interactions: Basic Processes and Applications, Wiley (1992).
- B. W. Shore, The Theory of Coherent Atomic Excitation, Wiley (1990).
- N. V. Vitanov, T. Halfmann, B. W. Shore, and K. Bergmann, “Laser-Induced Population Transfer by Adiabatic Passage Techniques,” Annual Review of Physical Chemistry 52, 763–809 (2001), doi:10.1146/annurev.physchem.52.1.763.
- M. H. Levitt, “Composite Pulses,” Progress in Nuclear Magnetic Resonance Spectroscopy 18, 61–122 (1986), doi:10.1016/0079-6565(86)80005-X.
- J. A. Jones, “Quantum Computing with NMR,” Progress in Nuclear Magnetic Resonance Spectroscopy 59, 91–120 (2011), doi:10.1016/j.pnmrs.2010.11.001.
- M. Bukov, L. D’Alessio, and A. Polkovnikov, “Universal High-Frequency Behavior of Periodically Driven Systems: from Dynamical Stabilization to Floquet Engineering,” Advances in Physics 64, 139–226 (2015), doi:10.1080/00018732.2015.1055918.
- 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.