Two complementary pulse-level control techniques for quantum state transfer on NISQ hardware. Both are implemented in Python with optional Rust acceleration (1,665× and 44×), parity-checked to 4.97×10−14.
Python module: scpn_quantum_control.phase.pulse_shaping (432 lines)
Rust module: scpn_quantum_engine/src/pulse_shaping.rs (3 PyO3 functions)
References:
Optimal STIREP with ICI pulse sequences.
Unified (α, β)-hypergeometric adiabatic pulse shapes.arXiv:2504.08031 (2025).
Pulse shaping is the art of choosing the time-dependent Rabi frequency $\Omega(t)$ (and detuning $\Delta(t)$) so that a target quantum state is reached with maximal fidelity under a given noise model. The space of possible pulses is infinite; useful pulse families are the ones that (a) have analytic or semi-analytic solutions, (b) cover a physically meaningful parameter range, and (c) can be calibrated on hardware.
The two families on this page are complementary: ICI (Intuitive–Counterintuitive–Intuitive) is derived from Pontryagin's Maximum Principle (PMP) for a three-level STIRAP system with explicit Lindblad decay on the intermediate state. (α, β)-hypergeometric pulses are a unified analytically-solvable family parameterised by the Gauss hypergeometric function $_2F_1$; they subsume Allen–Eberly, STIRAP, and Demkov–Kunike as special cases.
Consider a three-level $\Lambda$-system with ground $|g\rangle$, intermediate (lossy) $|e\rangle$, and target $|t\rangle$. The state is driven by a pump pulse $\Omega_P(t)$ (coupling $|g\rangle \leftrightarrow |e\rangle$) and a Stokes pulse $\Omega_S(t)$ (coupling $|e\rangle \leftrightarrow |t\rangle$). The intermediate state decays with rate $\gamma$.
The goal is to maximise $|\langle t | \psi(T) \rangle|^2$ starting from $|\psi(0)\rangle = |g\rangle$, subject to a peak Rabi constraint $\max_t \{|\Omega_P(t)|, |\Omega_S(t)|\} \le \Omega_0$ and a fixed total time $T$.
PMP converts the optimal-control problem into a Hamiltonian boundary-value problem. Liu et al. showed that the optimal solution in the strong-decay regime has a characteristic three-segment structure:
This I-C-I structure is the PMP-optimal trade-off between the non-adiabatic penalty of fast transfer and the dissipative penalty of spending time near the lossy intermediate state.
The fidelity evaluation requires forward-integrating a $3 \times 3$ complex density matrix under the full Lindblad master equation for the ICI control Hamiltonian. The Python reference uses a simple forward-Euler integrator; the Rust version ici_three_level_evolution_batch hand-inlines the complex-matrix update with fixed-size local arrays.
Benchmark. At $n_\text{points} = 2000$: Python forward-Euler 68.30 ms, Rust 0.04 ms. Speedup: 1,665×. Parity verified against the Python reference at $n_\text{points} = 500$: maximum absolute difference $4.97 \times 10^{-14}$ (double-precision rounding noise).
Ventura Meinersen et al. (arXiv:2504.08031) introduced a two-parameter family of pulse envelopes whose corresponding two-level Schrödinger equation is analytically solvable via the Gauss hypergeometric function $_2F_1(a, b; c; z)$. The envelope is
with two shape parameters $\alpha, \beta$ and one time-scale $\gamma$.
| Classical pulse | $\alpha$ | $\beta$ | Key property |
|---|---|---|---|
| Allen–Eberly | 1 | 0 | rapid adiabatic passage with chirp |
| STIRAP (Stokes-Pump) | 0 | 1 | dark-state transfer, robust to intermediate loss |
| Demkov–Kunike | 1 | 1/2 | finite-pulse-area population transfer |
| Rosen–Zener | 1/2 | 0 | sech profile, smooth frequency sweep |
All four historical pulse families are single points in the unified $(\alpha, \beta)$ plane, which means they can be smoothly interpolated. An optimiser can sweep $(\alpha, \beta)$ continuously to find the best pulse for a given noise model without switching between discrete families.
The naive Python implementation calls scipy.special.hyp2f1(a, b, c, z) in a tight loop over the time grid. This is slow because scipy's hyp2f1 is a generic double-precision routine with expensive branch selection.
The Rust implementation hypergeometric_envelope_batch uses a direct series expansion
truncated at the first term whose magnitude drops below $10^{-15}$. For the physically relevant range $|z| < 0.95$, typically 20–40 terms suffice.
Benchmark. 44× faster than the scipy hyp2f1 loop on a 2048-point time grid. Parity verified bit-for-bit against scipy at double-precision.
The ICI mixing angle $\theta(t)$ is the direction of the dressed dark state in the $(|g\rangle, |t\rangle)$ plane and satisfies $\tan \theta(t) = \Omega_P(t) / \Omega_S(t)$. Computing it on a 1000-point grid is not performance-critical, but the Rust implementation ici_mixing_angle_batch is still a convenient drop-in.
Benchmark. At 1000 points: Python 0.05 ms, Rust 0.04 ms. Speedup is trivial but the parity check (max abs diff $< 10^{-15}$) ensures the unit tests use consistent reference values across both paths.
On IBM Heron r2 hardware, the scpn_quantum_control.phase.pulse_shaping module builds pulse schedules at the pulse level (not at the gate level), which are then lowered to the hardware's native drive line through Qiskit's pulse scheduler. This bypasses some of the default single-qubit gate decompositions and can improve fidelity on specific transitions by up to 15 % at moderate circuit depths, at the cost of requiring calibration data for each qubit.
For the Phase 1 DLA parity campaign, pulse shaping was not used — the campaign used the default Qiskit pulse scheduler to keep the result clean and attributable to the Hamiltonian structure rather than to clever pulse engineering. Phase 2 will include a small ICI-pulse sub-experiment to quantify the incremental improvement over the default gate-level compilation.
| Test file | Tests | Scope |
|---|---|---|
tests/test_pulse_shaping.py | 25 STRONG tests | ICI and hypergeometric pulse construction, PMP solver convergence, Lindblad evolution, parity between Python and Rust paths, boundary conditions. |
tests/test_pipeline_wiring_performance.py | ICI + hypergeometric | Benchmark regression: asserts Rust speedup remains > 500× for ICI and > 30× for hypergeometric, ensures Python parity within $10^{-13}$. |
scpn_quantum_engine/src/pulse_shaping.rs | Rust unit tests | Inner function parity tests that do not require a Python interpreter; run under cargo test --release. |