MAGICARP: Quantum Control for Gate Synthesis
- MAGICARP is a quantum optimal control method that reparameterizes the problem via Pontryagin’s Maximum Principle to optimize a single traceless Hermitian adjoint matrix.
- It reduces the high-dimensional control search to a d²-1 parameter space, producing smoother, energy-efficient pulses compared to traditional methods like GRAPE.
- The drift-aware extension generalizes the method to closed systems with constant drift, revealing a weak-driving quantum speed limit while maintaining robust spectral properties.
MAGICARP is a specific quantum optimal control algorithm for synthesizing quantum gates. It combines the structure provided by Pontryagin’s Maximum Principle (PMP) with the robustness of gradient ascent techniques, and is formulated as a shooting technique that determines an initial adjoint momentum sufficient to realize a target gate. In its original formulation, MAGICARP merges PMP with gradient-based optimization by optimizing a single traceless Hermitian adjoint matrix , rather than optimizing thousands of discretized control amplitudes directly; in a later drift-aware extension, the same basic idea is generalized to closed systems with a constant drift Hamiltonian, including two exchange-coupled spins in an external magnetic field (Janković et al., 27 May 2025, Janković et al., 20 Jun 2026).
1. Conceptual position within quantum optimal control
In quantum optimal control, the objective is to design time-dependent fields that steer a unitary propagator according to
with
so that approximates a desired target gate at some final time . The standard objectives are gate fidelity and resource constraints such as total time, speed, energy, or amplitude (Janković et al., 27 May 2025).
MAGICARP was introduced against the background of methods such as GRAPE, which discretize time into slices, treat all amplitudes as optimization variables, and use analytic gradients with respect to those amplitudes. The original exposition identifies four resulting issues: dimensionality, local minima or landscape complexity, the difficulty of integrating time- or energy-optimality directly into the cost functional, and the absence of built-in analytic structure in the pulse ansatz (Janković et al., 27 May 2025).
The defining move in MAGICARP is therefore a reparameterization of the optimization problem. Instead of searching over the full space of discretized pulses, it searches over a finite-dimensional adjoint object whose dynamics determine the entire pulse shape through PMP. In the driftless formulation, this reduces the optimization variables from to 0, the number of real degrees of freedom in a traceless Hermitian 1 matrix 2 (Janković et al., 27 May 2025).
| Algorithm | Number of optimization parameters |
|---|---|
| GRAPE | 3 |
| MAGICARP | 4 |
This parameter reduction is not merely a numerical convenience. It encodes the claim that, for the cost functionals considered, optimal controls can be represented through a constant adjoint matrix whose conjugation by the evolving unitary specifies the control direction at every time. A plausible implication is that MAGICARP should be most advantageous when time discretization is fine and the control grid is large, but the physical Hilbert-space dimension remains moderate (Janković et al., 27 May 2025).
2. PMP formulation and the adjoint matrix 5
The original derivation distinguishes Mayer, Lagrange, and Bolza cost functionals. For gate synthesis, the discussion centers on two Lagrange-type resource costs and a separate Mayer-type fidelity objective (Janković et al., 27 May 2025).
The time-optimal cost is written as
6
while the quadratic energy cost is
7
The gate fidelity is defined as
8
In practice, the paper also uses the gate cost
9
These ingredients are combined by first deriving the PMP control structure from the resource functional and then optimizing fidelity over the adjoint parameter 0 (Janković et al., 27 May 2025).
Within PMP, the state is 1, the adjoint variable is a matrix 2, and for the chosen Lagrangians the adjoint equation simplifies to
3
A central consequence is that one may write
4
where 5 is a constant skew-Hermitian matrix, and then define
6
so that 7 is a constant traceless Hermitian matrix. This constant matrix is the shooting parameter that MAGICARP optimizes (Janković et al., 27 May 2025).
For the quadratic energy cost, the optimal controls take the explicit PMP form
8
For the time-like cost, the controls are proportional to the same inner product but normalized by the control norm. The distinction is important: in the quadratic case the control is linear in the adjoint, whereas in the time-like case the control direction is fixed by the adjoint and the magnitude is normalized (Janković et al., 27 May 2025).
This induces a two-point boundary-value problem. One chooses 9, propagates 0 forward under the PMP-structured controls, evaluates the final gate fidelity, and then updates 1 by gradient ascent. In control-theoretic language, this is a shooting method over the initial adjoint momentum (Janković et al., 27 May 2025).
3. Algorithmic realization as self-iterative pulse construction
MAGICARP is described as iteratively refining an adjoint matrix 2 to optimize the target quantum operation. In the driftless implementation, 3 is represented as a traceless Hermitian matrix, or equivalently as a real vector of length 4 on a basis of 5 generators (Janković et al., 27 May 2025).
For a given 6, the algorithm proceeds by computing initial controls from 7, propagating the unitary on a discrete time grid, and recomputing control amplitudes at each step through the conjugated adjoint 8. In the energy-optimal variant used for the simplified implementation,
9
and at subsequent steps
0
The propagator is updated piecewise-constantly as
1
After evolving to 2, the algorithm evaluates
3
and updates 4 with a gradient-based optimizer (Janković et al., 27 May 2025).
The implementation is therefore hybrid in a precise sense. PMP provides a structured pulse ansatz, while gradient ascent supplies the outer optimization loop. In the original paper, gradients with respect to 5 are described as computable numerically by finite differences or via chain-rule-based derivations; in the later drift-aware formulation, gradients with respect to the generator parameters are evaluated by automatic differentiation in JAX, and L-BFGS-B is used under box constraints on those parameters (Janković et al., 27 May 2025, Janković et al., 20 Jun 2026).
No separate ODE for the costate is integrated in the basic MAGICARP realization, because the adjoint is implicit in the transported object 6, or equivalently in the fixed matrix 7 conjugated by 8. This is one of the reasons the method can be implemented as a self-iterative forward construction rather than as a simultaneous forward-backward scheme (Janković et al., 27 May 2025).
4. Pulse structure, constraints, and driftless numerical behavior
A notable feature of MAGICARP is that constraints are embedded in the pulse structure rather than imposed only through penalties. For time minimization, the controls are normalized versions of 9, which naturally enforces maximal driving under the chosen norm. For energy minimization, the controls are linear in the same quantity. The original paper states that this tends to produce smooth, continuous pulses with a specific shape close to time- or energy-optimal trajectories under the specified norm and Hamiltonian set (Janković et al., 27 May 2025).
The physical interpretation given there is that the pulses are continuous functions of time, determined by how the adjoint matrix 0 is transported by the unitary evolution and projected onto the control Hamiltonians: 1 They are explicitly characterized as not bang-bang in the strict sense. Rather, their shape is governed by the evolving projection of 2 under conjugation by 3, which provides a controlled alternative to arbitrary piecewise-constant search over all time slices (Janković et al., 27 May 2025).
The initial numerical examples focus on constrained gate synthesis. For a single-qubit Hadamard gate with controls 4 and 5, the MAGICARP pulses are reported to be more continuous than the GRAPE-constrained pulses taken from previous work. The durations are given in units of the quantum speed limit 6: approximately 7 for the GRAPE-constrained pulse and approximately 8 for the MAGICARP-constrained pulse (Janković et al., 27 May 2025).
The method is also extended to 9 using 0 generalized Pauli operators 1 and 2 as controls and the multi-level Hadamard or QFT gate as target. For each 3, the study reports 300 runs from random initial 4. The observed trend is that fidelity decreases on average with increasing dimension, the minimal duration achieving cost 5 increases, and the scatter of results becomes larger as local minima become more frequent. For 6, the minimal duration achieving cost 7 is approximately 8, or approximately 9 (Janković et al., 27 May 2025).
These examples establish the main numerical profile of the method in the driftless setting: dimension reduction, structured smooth pulses, and competitive or shorter durations than constrained GRAPE in the cases considered. They also identify the main scaling caveat: while the search space is much smaller than a dense time-grid parameterization, it still grows as 0, which becomes large for systems where 1 (Janković et al., 27 May 2025).
5. Drift-aware generalization and transported-generator formalism
The 2026 extension reformulates MAGICARP for closed systems with a fixed, non-negligible drift Hamiltonian, and uses two exchange-coupled spins in an external magnetic field as the main testbed (Janković et al., 20 Jun 2026). The drift Hamiltonian is
2
with a single global transverse control
3
The total lab-frame Hamiltonian is
4
Because the drift is always on, the paper adopts the drift-aware target
5
so the gate is defined on top of the free drift evolution (Janković et al., 20 Jun 2026).
In this formulation, MAGICARP is written in terms of an anti-Hermitian generator
6
with real coefficients 7. The transported generator is
8
and the control law is
9
This is explicitly identified as structurally analogous to a PMP costate transported along the trajectory (Janković et al., 20 Jun 2026).
The drift-aware method is implemented in two stages. First, the drift Hamiltonian is diagonalized to obtain dressed eigenstates and dressed transition frequencies 0. For each transition 1, the one-way operator 2 defines Hermitian quadratures
3
Stage 1 then performs MAGICARP shooting in the rotating-wave frame, where the interaction-frame Hamiltonian is constructed from slowly varying quadratures on the retained dressed transitions. Stage 2 refines the same generator parameters in the exact laboratory frame, reconstructing the physical pulse as a sum of carriers at the dressed transition frequencies (Janković et al., 20 Jun 2026).
The extension also formalizes post-optimization control metrics. The integrated pulse energy is
4
the pulse area is
5
and the peak amplitude is 6. The paper emphasizes that the optimization objective itself is only gate infidelity; energy, area, spectral power concentration, and robustness are diagnostic quantities used for benchmarking and interpretation (Janković et al., 20 Jun 2026).
6. Benchmarks, weak-driving quantum speed limits, and open questions
The drift-aware study benchmarks MAGICARP against GRAPE and Krotov under a fair-halting protocol: same drift, same control Hamiltonian, same time grid, same dressed target gate, independent verified fidelity evaluation, and a common stopping rule at verified infidelity 7 or 8 depending on the test (Janković et al., 20 Jun 2026).
For the moderate-coupling two-qubit QFT at 9 and strict 0 halt, the reported values are:
- MAGICARP: 1, 2, 3;
- GRAPE: 4, 5, 6;
- Krotov: 7, 8, 9 (Janković et al., 20 Jun 2026).
| Method | 00 QFT benchmark |
|---|---|
| MAGICARP | 01, 02, 03 |
| GRAPE | 04, 05, 06 |
| Krotov | 07, 08, 09 |
The same comparison also shows strong differences in spectral concentration. For the QFT, MAGICARP places approximately 10 of spectral power on the four dressed transitions, GRAPE approximately 11, and Krotov approximately 12 (Janković et al., 20 Jun 2026). The paper’s interpretation is explicit: GRAPE independently converges onto essentially the same low-energy, spectrally concentrated pulses that MAGICARP generates by design, whereas Krotov incurs an order-of-magnitude energy premium. A plausible implication is that the low-energy solution is a genuine feature of the control landscape rather than an artifact of the MAGICARP ansatz.
Robustness is examined through static fractional errors in the exchange coupling 13. For the moderate-coupling QFT at 14, MAGICARP and GRAPE are reported as the most robust; at 15 error, the fidelities are approximately 16 for MAGICARP, 17 for GRAPE, and 18 for Krotov (Janković et al., 20 Jun 2026).
A major conceptual result of the drift-aware paper is the identification of a weak-driving quantum speed limit. A statistical sweep of 19 MAGICARP runs over gate times 20 and four bounds on generator parameters is used to probe the existence of low-amplitude solutions for the dressed two-qubit QFT. A run is classified as converged if the verified infidelity is 21. The study reports that no run converges for 22, and the first converged run appears at 23 (Janković et al., 20 Jun 2026).
The minimum energy among converged runs is fitted by the two-parameter area-pole law
24
with fitted values
25
The first term is identified as the time-optimal area cost, while the second is a pole at the weak-driving speed limit (Janković et al., 20 Jun 2026). The same paper relates this threshold to a single-axis interaction bound of approximately 26 derived from the QFT’s Cartan coordinates and the exchange rate 27.
The open questions are also stated with some precision across the two papers. The original formulation points to mapping stability of 28, convergence as 29, the cost of gradient computation with respect to 30, and the scaling of the 31 search space for large systems (Janković et al., 27 May 2025). The drift-aware extension adds that the analysis is limited to closed systems, studies only static robustness to misspecified 32, and is demonstrated on a two-qubit setting even though the method is conceptually more general (Janković et al., 20 Jun 2026).
Taken together, these works define MAGICARP as a hybrid PMP-gradient family of shooting methods in which a single adjoint object generates the full control trajectory. In the driftless formulation, this yields a low-dimensional, resource-aware route to gate synthesis. In the drift-aware formulation, it becomes a transported-generator framework that produces smooth, low-energy, spectrally concentrated pulses and can expose a weak-driving quantum speed limit that is obscured by unconstrained high-amplitude optimization (Janković et al., 27 May 2025, Janković et al., 20 Jun 2026).