Optimal Control Toy Problems
This notebook guide specifies a reproducible toy problem in open-system quantum control. The baseline task is to drive a single qubit toward a target rotation or target state while pure dephasing acts during the pulse. The notebook should compare simple pulse families, optimize a small number of parameters, and report fidelity as the dephasing strength is varied. For the conceptual page on objectives, constraints, gradients, and robustness, see Optimal Control.
As of this review, no executable notebook under notebooks/density-open-systems/optimal-control-toy-problems/ is promoted as a reproduced artifact. This page is the admission contract for that notebook: it states the model, objective functions, optimization rules, robustness checks, validation tests, and accepted outputs required before pulse-optimization results should be cited.
Purpose
Section titled “Purpose”The notebook should demonstrate how to:
- build a driven two-level Hamiltonian with declared rotating-frame conventions;
- include Markovian pure dephasing during the control pulse;
- compare an analytic square-pulse baseline with shaped or piecewise-constant pulses;
- optimize pulse parameters under amplitude and smoothness constraints;
- evaluate final-state and gate-style fidelities;
- sweep dephasing strength and detuning to test robustness;
- distinguish physical limitations from optimizer failure;
- record enough numerical metadata that another reader can reproduce the result.
The first version should use a single qubit. Multi-qubit gates, leakage levels, hardware transfer functions, closed-loop laboratory calibration, and gradient-based high-dimensional optimal control should wait until this toy problem is validated.
Directory Plan
Section titled “Directory Plan”Use a dedicated directory:
notebooks/density-open-systems/optimal-control-toy-problems/ optimal-control-toy-problems.ipynb README.mdThe opening notebook cell or README.md should state:
- Python and package versions;
- basis ordering and Pauli convention;
- rotating-frame Hamiltonian convention;
- whether angular frequencies or ordinary frequencies are used;
- pulse parametrization and amplitude bounds;
- solver method, time grid, and tolerances;
- optimizer, stopping criteria, random seed, and initial guesses;
- fidelity definition and validation cases;
- date and commit identifier when the notebook is promoted.
Baseline Driven Qubit
Section titled “Baseline Driven Qubit”Use a rotating-frame Hamiltonian
Here is the detuning and , are quadrature controls. With pure dephasing, the density matrix evolves as
This convention makes the off-diagonal element decay as
when the Hamiltonian is absent. The notebook should verify this limit before any pulse optimization is trusted.
Target Tasks
Section titled “Target Tasks”Implement two target tasks.
State transfer
Section titled “State transfer”Prepare
and maximize population in at final time :
This is the simplest objective because it can be checked directly from the final density matrix. It does not certify a full gate, but it is an excellent first test of solver and pulse conventions.
Gate-style target
Section titled “Gate-style target”For a more demanding test, compare the noisy final channel with the target unitary rotation
The notebook may compute an average gate fidelity from Choi matrices or from a standard finite-dimensional formula, but it must state the convention. A lower-risk first implementation is to average state fidelities over the six Pauli-axis pure states:
Define
This six-state score is not a substitute for a carefully conventioned process fidelity, but it gives a reproducible gate-style diagnostic that is harder to game than one input state.
Pulse Families
Section titled “Pulse Families”Start with pulse families whose parameters can be printed in a table.
Square pulse
Section titled “Square pulse”For a resonant square pulse, set , , and . A noiseless pulse satisfies
This baseline should reach in the noiseless state-transfer problem, up to numerical tolerance. If it does not, the sign, basis, time unit, or Hamiltonian normalization is wrong.
Raised-cosine pulse
Section titled “Raised-cosine pulse”Use a smooth envelope such as
The parameter can be adjusted so that the pulse area is near . This tests whether the optimizer can improve a physically smoother pulse without hiding area mistakes.
Piecewise-constant pulse
Section titled “Piecewise-constant pulse”Divide the pulse into equal time bins and use
The controls should obey
For the first notebook, use small , such as or . A toy problem with too many free parameters can produce impressive-looking overfitting before the validation logic is in place.
Objective Function
Section titled “Objective Function”Convert fidelity maximization into a minimization problem:
Here denotes the pulse parameters. The amplitude penalty discourages unnecessarily strong controls, while the smoothness penalty discourages rapid oscillations. If the notebook uses hard amplitude clipping instead of penalties, it should say so and should report how often the optimizer hits the bound.
The notebook should always report both the penalized objective and the physical fidelity . A pulse with lower may have lower fidelity if it is deliberately smoother or weaker.
Optimization Protocol
Section titled “Optimization Protocol”Use an optimization protocol that is easy to reproduce:
- evaluate the square-pulse baseline;
- run a coarse grid or Latin-hypercube search over a small parameter domain;
- refine the best points with a gradient-free optimizer such as Nelder–Mead, Powell, or COBYLA;
- repeat from several seeds or initial guesses;
- validate the best pulse on parameter values that were not used in the objective.
For each run, store:
- initial parameters;
- final parameters;
- number of function evaluations;
- optimizer status message;
- best objective value;
- best fidelity;
- wall-clock time;
- random seed, if randomness was used.
Gradient-based methods, GRAPE-style updates, and automatic differentiation are valuable later, but they are not required for the first toy notebook. The priority is a small, auditable optimization where every convention is visible.
Noise and Robustness Sweeps
Section titled “Noise and Robustness Sweeps”Optimize at a declared training point, for example
Then evaluate the same optimized pulse over a grid such as
The notebook should plot or tabulate:
- square-pulse fidelity on the grid;
- optimized-pulse fidelity on the grid;
- difference between optimized and baseline fidelity;
- regions where the optimized pulse is worse than the baseline;
- sensitivity to the time-step and solver tolerance.
Robustness must be evaluated out of sample. Optimizing separately at every grid point can be useful for exploration, but it does not show that one pulse is robust.
Physical Interpretation
Section titled “Physical Interpretation”Pure dephasing during a finite control pulse is not merely a numerical nuisance. If the target operation requires superpositions in the basis, dephasing removes precisely the phase information that the control is trying to organize. Faster pulses can reduce exposure time, but amplitude bounds and detuning errors limit how far that strategy can go.
The notebook should therefore interpret optimized pulses conservatively:
- an improvement over a square pulse may mean better detuning robustness, not magic cancellation of Markovian dephasing;
- a pulse trained at one dephasing rate may overfit that rate;
- a higher state-transfer fidelity may not imply a higher gate fidelity;
- a pulse that uses both quadratures may depend on phase calibration not included in the toy model;
- dephasing noise that commutes with is not equivalent to amplitude damping or leakage.
For pulse sequences that suppress low-frequency noise by sign reversal and filtering, see Dynamical Decoupling. This notebook instead tests driven control in a small Markovian model.
Validation Tests
Section titled “Validation Tests”The promoted notebook should pass all of the following checks.
Noiseless square-pulse check
Section titled “Noiseless square-pulse check”For , , , and ,
The numerical error should decrease when the time step and solver tolerance are tightened.
Pure-dephasing limit
Section titled “Pure-dephasing limit”With controls off, the populations in the basis should remain fixed and the coherence should decay as
This checks the factor of in the dissipator convention.
Trace, Hermiticity, and positivity
Section titled “Trace, Hermiticity, and positivity”At every saved time point, compute
Small negative eigenvalues at roundoff level should be reported separately from genuine positivity failures.
Channel check
Section titled “Channel check”If the notebook reports a gate-style score, it should propagate a basis of input density matrices and reconstruct the finite-time map. The corresponding Choi matrix should be positive within tolerance and should have the trace-preserving partial-trace condition used in Simulating Quantum Channels.
Optimizer sanity check
Section titled “Optimizer sanity check”The optimizer should rediscover the square-pulse area rule in the noiseless one-parameter case. If the notebook optimizes for a resonant square pulse and does not find
the optimization pipeline is not ready for higher-dimensional pulses.
Accepted Outputs
Section titled “Accepted Outputs”A promoted version should save:
- pulse-parameter tables in a machine-readable file;
- plots of baseline and optimized pulse envelopes;
- fidelity versus dephasing strength;
- fidelity versus detuning;
- optimization convergence history;
- validation residuals for trace, Hermiticity, positivity, and channel checks;
- a short text summary of the model and conventions.
Exploratory plots may be included, but accepted outputs should be clearly separated from scratch calculations. A reader should be able to regenerate the accepted figures from a clean run.
Common Mistakes
Section titled “Common Mistakes”- Optimizing one input state and then calling the result a gate.
- Forgetting that a global phase is irrelevant for unitary comparison but not for raw matrix subtraction.
- Mixing angular frequency and ordinary frequency in .
- Reporting the penalized objective without reporting the physical fidelity.
- Comparing an optimized pulse with a poorly calibrated square-pulse baseline.
- Allowing unconstrained amplitudes, then interpreting the result as realistic control.
- Training and testing on the same noise and detuning point.
- Ignoring solver tolerance when differences in fidelity are small.
Exercises
Section titled “Exercises”Noiseless π Pulse
Section titled “Noiseless π Pulse”For
show that the pulse duration for is .
Solution
The unitary is
Acting on gives full population transfer when the cosine term vanishes and the sine has unit magnitude. Thus
Pure-Dephasing Populations
Section titled “Pure-Dephasing Populations”Show that the dissipator
does not change the -basis populations.
Solution
Write
Then
Therefore
The diagonal entries vanish, so the populations are unchanged. The coherences decay at rate .
Penalized Objective
Section titled “Penalized Objective”Why should the notebook report both and when it uses amplitude or smoothness penalties?
Solution
The objective mixes physical infidelity with design preferences such as weaker or smoother pulses. A pulse can have a lower because it uses less power while also having a lower physical fidelity. Reporting both and lets readers see the tradeoff instead of mistaking the optimizer’s bookkeeping score for the experimental success probability.
Robustness Test
Section titled “Robustness Test”A pulse is optimized at and . Why is evaluating it at the same point insufficient evidence of robustness?
Solution
Robustness means performance persists when model parameters move away from the training point. A pulse can overfit one detuning and dephasing rate. It should be tested on a grid of detunings and dephasing strengths that were not separately optimized. Only then can one compare whether it is broadly better than the square-pulse baseline.
Cross-Links
Section titled “Cross-Links”- Lindblad–GKSL Equation
- Pure Dephasing Master Equation
- Solving Lindblad Equations
- Bloch Vector Noise Models
- Decoherence Timescale Estimation
- Dynamical Decoupling
- Optimal Control
- Reservoir Engineering
- Formula Sheet
- Approximation Checklist
References
Section titled “References”- D. D’Alessandro, Introduction to Quantum Control and Dynamics, Chapman and Hall/CRC (2007).
- C. Brif, R. Chakrabarti, and H. Rabitz, “Control of quantum phenomena: Past, present and future,” New Journal of Physics 12, 075008 (2010).
- N. Khaneja, T. Reiss, C. Kehlet, T. Schulte-Herbruggen, and S. J. Glaser, “Optimal control of coupled spin dynamics: Design of NMR pulse sequences by gradient ascent algorithms,” Journal of Magnetic Resonance 172, 296-305 (2005).
- S. J. Glaser, U. Boscain, T. Calarco, C. P. Koch, W. Kockenberger, R. Kosloff, I. Kuprov, B. Luy, S. Schirmer, T. Schulte-Herbruggen, D. Sugny, and F. K. Wilhelm, “Training Schrödinger’s cat: Quantum optimal control,” European Physical Journal D 69, 279 (2015).
- H. M. Wiseman and G. J. Milburn, Quantum Measurement and Control, Cambridge University Press (2010).
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, Cambridge University Press (2010).