Location

Python module: scpn_quantum_control.phase.pulse_shaping (432 lines)

Rust module: scpn_quantum_engine/src/pulse_shaping.rs (3 PyO3 functions)

References:

  • Liu et al. (2023) — Optimal STIREP with ICI pulse sequences.
  • Ventura Meinersen et al., Unified (α, β)-hypergeometric adiabatic pulse shapes. arXiv:2504.08031 (2025).

Why Two Families?

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.

1. ICI Pulses — PMP-Optimal Three-Level Control

1.1 The control problem

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$.

1.2 Pontryagin-optimal ICI sequence

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:

  1. Intuitive (I) — pump first, Stokes follows. Populates the intermediate level.
  2. Counterintuitive (C) — Stokes first, pump follows. Uses the standard STIRAP dark state to avoid the intermediate.
  3. Intuitive (I) — pump then Stokes again, to complete the transfer.

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.

1.3 Implementation: Rust integrator

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.

# scpn_quantum_engine/src/pulse_shaping.rs
pub fn ici_three_level_evolution_batch(
    times: &[f64],
    omega_p: &[f64],
    omega_s: &[f64],
    gamma: f64,
    n_points: usize,
) -> PyResult<Array2<f64>>

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).

2. (α, β)-Hypergeometric Pulses — Unified Family

2.1 The envelope

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

$$\Omega(t) = \Omega_0 \, \mathrm{sech}^\alpha(\gamma t) \cdot \left[ _2F_1\!\left(a, b; c; \tanh^2(\gamma t)\right)\right]^\beta$$

with two shape parameters $\alpha, \beta$ and one time-scale $\gamma$.

2.2 Known pulses as special cases

Classical pulse$\alpha$$\beta$Key property
Allen–Eberly10rapid adiabatic passage with chirp
STIRAP (Stokes-Pump)01dark-state transfer, robust to intermediate loss
Demkov–Kunike11/2finite-pulse-area population transfer
Rosen–Zener1/20sech 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.

2.3 Implementation: custom series expansion in Rust

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

$$_2F_1(a, b; c; z) = \sum_{k=0}^{\infty} \frac{(a)_k (b)_k}{(c)_k \, k!} z^k$$

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.

3. Mixing Angle — Another Rust Win

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.

4. Integration with the SCPN Quantum Pipeline

Where pulse shaping fits

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.

5. When to Use Which Family

Use ICI when...
• You have a three-level $\Lambda$-system (qudit transmon, trapped-ion optical clock)
• The intermediate level has significant decay
• You need a PMP-optimal trade-off under a peak-Rabi constraint
• You care about the full density-matrix evolution, not just unitaries
Use (α, β)-hypergeometric when...
• You have a two-level system (or can reduce to one)
• You want to smoothly interpolate between classical pulse families
• You want closed-form analytic expressions, not numerical integration
• You want to optimise over a continuous two-parameter family

6. Tests & Benchmarks

Test fileTestsScope
tests/test_pulse_shaping.py25 STRONG testsICI and hypergeometric pulse construction, PMP solver convergence, Lindblad evolution, parity between Python and Rust paths, boundary conditions.
tests/test_pipeline_wiring_performance.pyICI + hypergeometricBenchmark regression: asserts Rust speedup remains > 500× for ICI and > 30× for hypergeometric, ensures Python parity within $10^{-13}$.
scpn_quantum_engine/src/pulse_shaping.rsRust unit testsInner function parity tests that do not require a Python interpreter; run under cargo test --release.

Related Pages

Full algorithm catalogue including pulse-level and gate-level techniques.
Complete Rust-vs-Python speedup table across all 37 PyO3 functions.
The symmetry structure that pulse shaping respects in the XY Hamiltonian.