Skip to main content
KetQat

Appearance

Algorithm · advanced

GRAPE (gradient ascent pulse engineering)

Optimal-control method that discretises the control fields into piecewise-constant amplitudes and climbs the gradient of a gate or state fidelity, which can be computed for all time slices from one forward and one backward propagation.

Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Problem. With uk(t)=uk,ju_k(t) = u_{k,j} on slice jj, the slice propagators are Uj=exp⁡ ⁣(−iΔt H(j))U_j = \exp\!\big(-i\Delta t\, H^{(j)}\big), H(j)=H0+∑kuk,jHkH^{(j)} = H_0 + \sum_k u_{k,j} H_k, and the total propagator is U=UN⋯U1U = U_N \cdots U_1. Maximise

Φ(u)=∣g∣2,g=1dTr⁡ ⁣(W†UN⋯U1),\Phi(u) = \abs{g}^2, \qquad g = \frac1d \tr\!\big(W\dagg U_N \cdots U_1\big),

over u∈RK×Nu \in \R^{K \times N}, possibly with amplitude bounds or penalty terms.

Gradient. Put Xj=Uj⋯U1X_j = U_j \cdots U_1 (forward propagation, X0=IX_0 = I) and Pj=Uj+1†⋯UN†WP_j = U_{j+1}\dagg \cdots U_N\dagg W (backward propagation, PN=WP_N = W). Then g=1dTr⁡(Pj†Xj)g = \tfrac1d \tr(P_j\dagg X_j) for every jj, and the exact derivative of a matrix exponential gives

∂Uj∂uk,j=−iΔt∫01e−isΔtH(j) Hk e−i(1−s)ΔtH(j) ds=−iΔt HkUj+O(Δt2),\frac{\partial U_j}{\partial u_{k,j}} = -i\Delta t \int_0^1 e^{-is\Delta t H^{(j)}}\, H_k\, e^{-i(1-s)\Delta t H^{(j)}}\, ds = -i\Delta t\, H_k U_j + O(\Delta t^2),

so that

∂Φ∂uk,j=2 Re(g∗ 1dTr⁡ ⁣(Pj† ∂Uj∂uk,j Xj−1))≈2Δt  Re(−i g∗ 1dTr⁡ ⁣(Pj†HkXj)).\frac{\partial \Phi}{\partial u_{k,j}} = 2\,\mathrm{Re}\Big( g^*\, \frac1d \tr\!\Big(P_j\dagg\, \frac{\partial U_j}{\partial u_{k,j}}\, X_{j-1}\Big)\Big) \approx 2\Delta t\; \mathrm{Re}\Big( -i\, g^*\, \frac1d \tr\!\big(P_j\dagg H_k X_j\big)\Big).

The integral form is exact (it can be evaluated in the eigenbasis of H(j)H^{(j)}); the first-order form is the one of Khaneja et al. and is accurate when Δt∥H(j)∥≪1\Delta t \norm{H^{(j)}} \ll 1.

Algorithm.

  1. Choose an initial guess uu (random or a smooth analytic pulse).
  2. Compute all UjU_j, then X1,…,XNX_1, \dots, X_N forwards and PN,…,P1P_N, \dots, P_1 backwards.
  3. Evaluate Φ\Phi and all KNKN partial derivatives from the formula above: the cost is O(N)O(N) matrix products, not O(KN2)O(KN^2).
  4. Update u←u+η ∇Φu \leftarrow u + \eta\, \nabla\Phi (or take a quasi-Newton step, e.g. L-BFGS), apply bounds, and repeat from step 2 until Φ\Phi stops improving.

Correctness. The first identity holds because Pj†Xj=W†UN⋯Uj+1Uj⋯U1P_j\dagg X_j = W\dagg U_N\cdots U_{j+1}U_j\cdots U_1. The derivative of gg with respect to uk,ju_{k,j} involves only UjU_j, so by the product rule ∂g=1dTr⁡(Pj† ∂Uj Xj−1)\partial g = \tfrac1d \tr(P_j\dagg\, \partial U_j\, X_{j-1}), and ∂∣g∣2=2 Re(g∗∂g)\partial\abs{g}^2 = 2\,\mathrm{Re}(g^*\partial g). The integral formula for the derivative of eA(u)e^{A(u)} with A′=−iΔtHkA' = -i\Delta t H_k follows from differentiating esA(u)e^{sA(u)} in uu and solving the resulting linear differential equation in ss (Duhamel's formula); replacing both exponentials inside by I+O(Δt)I + O(\Delta t) gives the first-order form, with HkUjH_k U_j and UjHkU_j H_k agreeing to that order.

GRAPE finds local optima only; the landscape, constraints, robustness to parameter spreads and open-system extensions are reviewed by Glaser et al..

Holds when

  • Closed, finite-dimensional system H(t)=H0+∑k=1Kuk(t)HkH(t) = H_0 + \sum_{k=1}^K u_k(t) H_k with Hermitian H0,HkH_0, H_k on Cd\C^d and real controls.
  • Controls piecewise constant on NN slices of length Δt=T/N\Delta t = T/N; the fidelity is the phase-insensitive gate overlap with a unitary target WW.
Part of
Stated in

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Navin Khaneja, Timo Reiss, Cindie Kehlet, … Steffen J. Glaser (2005). Optimal control of coupled spin dynamics: design of NMR pulse sequences by gradient ascent algorithms. Journal of Magnetic Resonance 172, 296-305. doi:10.1016/j.jmr.2004.11.004
  2. Steffen J. Glaser, Ugo Boscain, Tommaso Calarco, … Frank K. Wilhelm (2015). Training Schrödinger's cat: quantum optimal control. The European Physical Journal D 69, 279. doi:10.1140/epjd/e2015-60464-1arXiv:1508.00442

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Forward/backward propagator identity, product-rule derivative, Duhamel integral and first-order gradient re-derived. Numerical check with numpy/scipy: for a random 2-level problem (20 slices, dt = 0.05, controls X and Y) the first-order gradient formula agrees with central finite differences to 7e-4, within the expected O(dt^2) = 2.5e-3. Khaneja et al. (J. Magn. Reson. 172, 296, 2005) and Glaser et al. (EPJ D 69, 279, 2015) metadata checked on Crossref; Khaneja et al. full text not read (paywalled), the first-order form is the standard GRAPE gradient as reviewed in Glaser et al., arXiv 1508.00442.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e

Current revision 4937678c216a5912. Source file knowledge/records/algorithm/grape.md in the content repository (readable there once it is public).