Chapter 31 — Key Takeaways (Pulse-Level Programming, and What Replaced It)

Part V closes here. The chapter was planned as a qiskit.pulse tutorial; the probe script failed on its first import.

★ The pulse API is gone

   qiskit 2.5.1
     qiskit.pulse                        GONE: ModuleNotFoundError
     QuantumCircuit.calibrations         REMOVED
     QuantumCircuit.add_calibration      REMOVED
     backend.defaults                    REMOVED
     backend.instruction_schedule_map    REMOVED
     backend.drive_channel               REMOVED

Deprecated through 1.x, removed in Qiskit 2.0. Every tutorial written against it — and there are many, some still linked from current docs — describes something you cannot import.

Why: the abstraction did not port across hardware (a pulse schedule is meaningless on another backend and absurd on trapped ions); the user base was tiny and largely internal to vendors; and fractional gates plus richer Target metadata now cover most of what needed it.

⚠️ An API being present, documented, tutorialized, and built upon by published research is not a commitment that it will exist next year.

Fourth instance in this book: Ch. 19 mcx(mode="v-chain"), Ch. 24 PennyLane's shots=, Ch. 28 basis_gates=['h','barrier'], Ch. 31 an entire subsystem.

The defence is Chapter 27's, and it costs nothing: a test that imports what you depend on tells you at upgrade time rather than in production.

What a gate physically is

A shaped microwave pulse near the qubit's transition frequency. Area sets the angle, phase sets the axis, envelope shape controls leakage into $|2\rangle$ (which is what DRAG corrections are for).

   target.dt = 0.2222 ns    -- every duration is an integer multiple of this
   rz         0.0 ns   (all qubits)
   sx / x    56.9 ns   (all qubits, uniform)
   ecr      341.3 - 881.8 ns, median 533.3
   measure 1216.0 ns

⚛️ rz takes ZERO time. A $Z$ rotation is not performed — it is absorbed into the phase of every subsequent pulse. The control software redefines what "the $X$ axis" means. Exact, instantaneous, error-free.

This is the virtual Z gate, and it is why Chapter 28's transpiled circuits are full of rz and nobody minds: Chapter 29's ansatz has 83 of them, costing literally nothing. The basis $\{$rz, sx, x, ecr$\}$ is one free gate, two fixed 56.9 ns pulses, and one expensive entangler.

And measure costs 1,216 ns — 2.3× the median two-qubit gate. The slowest operation on the device, which is one reason Chapter 25 §25.7's syndrome cycle is hard: it is measurement-bound.

★ The coherence budget

   median T1 = 278.4 us    median T2 = 170.0 us
   T1 / ecr  = 522 two-qubit gates fit inside T1
   ...but (1 - 0.0075)^522 = 0.020 at Chapter 12's measured error rate

Gate error, not decoherence, is the binding constraint on this device. You lose the signal to imperfect gates long before running out of coherence time.

This is device-specific and it has shifted historically — early superconducting devices were decoherence-limited, trapped ions still have long coherence and slow gates. Check which regime you are in before optimizing for the wrong one.

Scheduling Chapter 29's ansatz:

   circuit duration ~ 7.10 us   =  4.17% of the T2 budget
   qubit-time IDLE: 873.40 us of 901.30 us  (97%)

Enormous coherence headroom, and almost all qubit-time spent waiting.

What you can still control

   ASAPScheduleAnalysis      start everything as soon as its inputs are ready
   ALAPScheduleAnalysis      delay everything as long as possible
   PadDelay                  make idle time explicit as delay instructions
   PadDynamicalDecoupling    fill idle time with refocusing pulses

ASAP/ALAP decide where the idle time goes. For a circuit ending in measurement, ALAP means less idle immediately before readout — which is when it hurts most.

★★ Dynamical decoupling, measured

   configuration                     x added   delays     1-TVD      std
   no DD                                   0        0    0.9288   0.0017
   XX  dynamical decoupling               20      159    0.9235   0.0025
   XY4 dynamical decoupling               36      175    0.9231   0.0023

   XX  vs no DD:  -0.0053 +/- 0.0012   SIGNIFICANT
   XY4 vs no DD:  -0.0057 +/- 0.0012   SIGNIFICANT

Both made it significantly worse, and a deliberate 20 μs idle window widened the gap.

The obvious reading — DD costs more in gate error than it saves — is arithmetically correct and the wrong conclusion.

★★★ Why the simulator cannot answer this

   AerSimulator.from_backend: thermal relaxation (T1/T2), depolarizing, readout

Every channel is Markovian — memoryless, each instant independent of every other.

DD works by refocusing: flip the qubit halfway through the idle window so the phase accumulated in the second half cancels the first. That requires the accumulation rate to be correlated across the window — $1/f$ flux noise, slow frequency drift, static spectator coupling.

A memoryless channel has none of it. Nothing to refocus; DD can only add the error of its own $X$ gates, and it does, every time.

🔬 The result is a property of the SIMULATOR, not of DD. A Markovian simulator reports DD as harmful every single time, at every idle length, for every sequence, with tight error bars and perfect reproducibility — and the report is meaningless.

DD is the one technique in this book that cannot be evaluated on a noise model, because the thing it fixes is not in the model. Evaluate on hardware, or with explicitly correlated noise.

And the uncomfortable part: every quality marker of a good measurement was present — six seeds, a standard error, multiple idle lengths, 2σ significance, two sequences agreeing. Statistical rigour cannot rescue a model that lacks the phenomenon.

The pattern Part V kept finding

   Ch. 25   a QEC test storing an eigenstate of its own failure mode
   Ch. 26   a bisection whose default input could not see the bug
   Ch. 27   three of four oracle-free properties passing a broken circuit
   Ch. 29   a layout chosen by connectivity alone, routing through dead edges
   Ch. 30   a benchmark robust to readout error, silent when readout broke everything
   Ch. 31   a simulator with no correlated noise, judging correlated-noise cancellation

The recurring failure is not wrong code. It is trusting an instrument without reading what it is insensitive to — and in every case the blindness was documented, deliberate, and stated plainly in the method's own description.

Chapter 26's rule was debug on a simulator, validate on hardware. The corollary: some questions cannot be asked of a simulator at all.

★ What Part V adds up to

   Ch. 29  SHAPE      match the circuit to the chip          +0.1658
   Ch. 28  OPTIMIZE   let the transpiler work                +0.0262
   Ch. 31  SCHEDULE   place the idle time                    measurable, not
                                                             evaluable in simulation
   Ch. 13  MITIGATE   correct what remains                   -79% with right ordering

Each layer is worth roughly an order of magnitude less than the one above — and each is attempted, in practice, in the opposite order, because mitigation is a library call and shape is a design decision.

Underneath all four:

   Ch. 26  DEBUG      exactly, on a simulator, before touching hardware
   Ch. 27  TEST       with properties a bug can violate, and shots enough to see it
   Ch. 30  BENCHMARK  your circuit, not the device

Common pitfalls

  • Planning around an API without checking it still exists.
  • Reading a well-executed measurement of the wrong model as a partial answer.
  • Applying dynamical decoupling because the idle fraction is high, without asking whether your evaluation can see its benefit.
  • Optimizing for decoherence on a gate-error-limited device (or vice versa).
  • Forgetting that rz is free and measure is expensive when reasoning about circuit cost.
  • Pinning a version for reproducibility and treating the pin as permanent.

Project piece added this chapter

vqelab/timing.pyREMOVED_IN_QISKIT_2 and pulse_api_replacement turning a removal into a pointer; gate_durations (documenting rz = 0); coherence_budget reporting which constraint binds; schedule_with_dd and circuit_timing for the busy/idle split; and evaluate_dynamical_decoupling, which returns NOT_EVALUABLE on a Markovian model rather than a number, quoting the measurement it declines to trust and naming where the question can be answered. 19 tests pass, including test_the_pulse_api_is_gone, test_rz_takes_zero_time, test_gate_error_binds_before_decoherence, test_almost_all_qubit_time_is_idle, and test_evaluate_dynamical_decoupling_REFUSES_on_a_markovian_model.