Mid-Circuit Measurement and Feedforward
An adaptive quantum circuit is a quantum–classical execution process: a measurement produces a classical record, and that record can change which operation, measurement, or stopping rule is used later. An outcome probability alone therefore does not define the circuit. The full object includes the state on every branch, the causal availability of records, the types and lifetimes of branch outputs, and the rule for combining terminal histories.
We will follow finite circuits branch by branch, calculate reset and correction maps, and compare average costs with the longest possible execution. The numerical timing examples are hypothetical schedules, not measurements of a device.
Helpful background. Measurement in circuits introduces subnormalized outcome maps, classical records and the distinction between selected and unread states.
Dynamic Quantum–Classical Circuits
Section titled “Dynamic Quantum–Classical Circuits”A static unitary circuit denotes one linear operator, while a dynamic circuit denotes a causal family of quantum operations indexed by classical histories. If is the record available at one point in an execution, then a later instrument, channel, or stop decision may depend on . The history is data, not a coherent quantum label unless the circuit explicitly stores it in a quantum register.
Three objects must be kept distinct:
- a coherent controlled operation applies different target blocks while retaining off-diagonal control coherences;
- measurement-conditioned feedforward creates a classical record and then chooses a later channel from that record;
- postprocessing acts on data after the quantum job has ended and cannot change the already completed quantum evolution.
The first two can agree on a basis-state truth table while defining different channels on superpositions. Controlled Operations explains the coherent block-unitary case. Here the relevant object is a measured, classically indexed process.
Specify what the circuit returns. It may return a final quantum register, the full classical history, a coarsened success flag, a history-conditioned state, or only an unconditional mixture. Forgetting a history is a classical marginalization and a quantum mixture; it is never an amplitude sum over alternatives.
Instruments, Conditional Channels, and History Probabilities
Section titled “Instruments, Conditional Channels, and History Probabilities”Let label a classical history at an internal node and the next reported outcome. Let be the outcome map chosen at that node, and let be the subsequent conditional channel. Starting with , define
The trace is the joint probability of the complete history , not merely a probability conditional on reaching . When ,
At each reachable node, the instrument is complete and every subsequent conditional channel preserves trace. Include loss or abort explicitly among the recorded outcomes, with a suitable flag state if no qubit survives; an unexplained trace decrease would omit some executions. A zero-probability branch has a zero subnormalized state; it has no normalized posterior that can be used in a later calculation.
Let be a prefix-free set of terminal histories. Equivalently, one may compare all histories at one fixed depth, padding branches that have already terminated. If the classical history register encodes termination and record length, the final classical-quantum state and its history-forgotten quantum output are, assuming all returned quantum states have been placed in the same output space ,
A complete capped policy satisfies
Never sum both an internal history and any of its descendants. That double counts executions. A prefix-free set must also cover every possible exit: would omit history . A complete terminal set such as is valid because no member is a prefix of another; the set is not.
Classical Predicates, Dataflow, and Branch Merges
Section titled “Classical Predicates, Dataflow, and Branch Merges”A predicate may depend only on records that exist at that point in the causal schedule. For example, the rule “apply when ” presupposes a reported bit , a declared encoding of detector outcomes into that bit, and a path by which the bit reaches the conditional operation. Branching on an unobserved ideal detector variable while the controller receives a noisy reported code describes a different process.
At a branch merge, a later quantum operation must have a qubit to act on in every incoming branch. If one branch discards and another retains it, either return only classical data from both branches or explicitly prepare a replacement where needed. If the branches carry different Pauli corrections, keep the correction label with the qubit so later gates and measurements can interpret it consistently.
Circuit intermediate representations describes how programming languages represent this control flow.
Reset, Release, and Qubit Reuse
Section titled “Reset, Release, and Qubit Reuse”Reset is a channel with a declared postcondition. It is not an inverse of measurement and need not restore coherence with any system that was correlated with the measured qubit. For computational-basis measurement with , measurement followed by gives
This channel sends every normalized input to . It removes the input coherence and is many-to-one, so it is neither unitary nor invertible. If the bit was copied into a classical register, that record still contains the outcome distribution after the quantum reset.
Reset prepares a specified state; releasing a qubit means that the program will no longer use it; reuse assigns it a new task after any needed preparation. Reusing the same wire label does not restore a destructively measured system. Physical reset can also have errors or leakage that are absent from the ideal channel above.
Physical Corrections and Pauli-Frame Updates
Section titled “Physical Corrections and Pauli-Frame Updates”A physical correction applies a quantum operation. A Pauli-frame update instead stores a classical description of an outstanding Pauli and changes how later gates or measurements are interpreted. The two methods can implement the same logical output only if every later operation consumes the frame consistently.
Define the frame by . Write a one-qubit frame, up to phase, as
If the next physical gates are and then , conjugation gives
where denotes equality up to a global phase. A later physical -basis measurement is flipped by the exponent of the propagated frame, so, writing for the recorded bit rather than the eigenvalue ,
The frame must therefore remain associated with its branch. Merging two quantum values while discarding different outstanding frames generally corrupts later predictions. Across Clifford gates a Pauli frame remains Pauli, but across a non-Clifford gate it may not. Blindly updating two bits by XOR is then invalid; the circuit must change the correction strategy, adapt a later measurement, or enlarge the tracked object.
Deferred Measurement and Its Failure Conditions
Section titled “Deferred Measurement and Its Failure Conditions”The deferred-measurement principle compares specified final outputs; intermediate processes can still differ. In its familiar finite form, a measurement whose result only selects a later unitary can sometimes be replaced by coherent control, with the control measured at the end. The replacement must reproduce the declared final quantum state and classical record. A common phase multiplying one finally measured branch cancels from its outcome map; phases within a branch that affect interference must be preserved.
For this simple replacement to work:
- the removed record is not read, reported, or used by a host before the new terminal measurement;
- the would-be control system remains available and is not destructively measured, reset, released, or reused;
- no intervening noncommuting operation uses coherence that one formulation removes and the other retains;
- coherent controlled access to the required branch operation is part of the declared interface;
- the equivalence is claimed only for the compared outputs, not for latency, detector behavior, noise, or physical resource cost.
Early termination, repeated measurement, invalid-code handling, and a timeout can make a dynamic policy impossible to replace by a single deferred meter without adding further coherent storage and control. Even when the final ideal statistics agree, the physical implementations can have different exposure to noise and different timing constraints.
Measurement in Circuits proves the elementary deferred-CNOT example. The semiclassical Fourier-transform construction of Griffiths and Niu is an important positive example of feedforward, but it is not a blanket theorem that all adaptive measurements can be deferred.
Latency, Deadlines, and Branch-Aware Resources
Section titled “Latency, Deadlines, and Branch-Aware Resources”Timing claims require absolute events as well as durations. For a history , let be a specified event time before the reported-record processing path begins. Let include the declared acquisition, classification, decision, and dispatch path not already included in that event time, and let be the duration of the conditional branch operation. Then
If the declared jitter or safety guard is , the residual slack is
A complete schedule passes only if the minimum guarded slack over the relevant terminal branches is nonnegative. A mean latency cannot establish this result: a rare branch can miss a coherence-sensitive deadline even when the average branch is fast.
Resources in an adaptive circuit are random variables on terminal histories. For a resource count or duration ,
If a result is conditioned on success, use renormalized success-leaf weights and report the success probability separately. Measurement count, conditional gate count, quantum width, live classical memory, elapsed time, abstract query count, and physical duration measure different resources. They should not be collapsed into one unlabeled “cost.”
A fixed guard gives a hard deadline guarantee only if it bounds the possible extra delay. If it is instead chosen from a jitter quantile, the schedule has the corresponding probabilistic timing guarantee. Control, readout and calibration discusses physical acquisition paths and controller behavior.
Worked example: active reset and reuse
Section titled “Worked example: active reset and reuse”Take a qubit in
A computational Lüders measurement gives probabilities . Apply only after outcome one. The two corrected, subnormalized branches are
Consequently the reset output is pure, while the retained classical bit is still random:
Its record entropy is bits. Resetting the qubit has not erased the measurement record.
For a simple reuse test, apply and then measure . Correct reset gives the outcome with certainty. Omitting the conditional flip leaves before , so the same test gives . The two output distributions have total variation distance .
Suppose measurement ends at , the subsequent record path takes , and the conditional flip takes . The longest branch completes at . A deadline leaves , or after a guard. Every execution uses one measurement; the expected number of flips is and the maximum is one.
Worked example: at most two attempts
Section titled “Worked example: at most two attempts”Start in and measure , accepting outcome zero as success. After a first outcome one, apply and then to prepare a fresh and try once more. After a second failure, apply to reset the qubit and report exhaustion. The terminal histories are
Success has probability and exhaustion probability . Conditioned on success, histories and have weights and . All three final qubit states are , so the quantum state alone does not reveal whether the policy succeeded. Keep the success flag or the history when that distinction matters.
Only the terminal histories are summed. The probability of reaching the second measurement is , and its two conditional outcomes are each equally likely. Including the internal history as well as its descendants would count those executions twice.
Use the following hypothetical timing: first measurement ends at , followed by an report path. On failure, and take each. The second measurement then runs from to , with its report ready at . A final failure correction ends at .
| History | Probability | Measurements | gates | Retry gates | End time (ns) |
|---|---|---|---|---|---|
| 1 | 0 | 0 | 280 | ||
| 2 | 1 | 1 | 600 | ||
| 2 | 2 | 1 | 620 |
Weighting each row gives
A deadline with zero additional guard leaves only on the longest branch, even though the mean time is much shorter. The fair-attempt calculation relies on the explicit reset and re-preparation. In a general quantum repeat-until-success protocol, a failed attempt may disturb an unknown input; the failure map must be analyzed before assuming independent retries.
When retries measure the input
Section titled “When retries measure the input”The preceding preparation example can recreate its known input. To see what changes for an unknown input, consider a two-outcome instrument on the same qubit at every attempt:
They obey . Here “success” means only the reported label ; no target gate is presumed. After , apply the same instrument again without a correction or re-preparation, stopping at the first . The branch operator for stopping on attempt is . For an input density matrix , the survival probability and mean stopping time follow by summing the failure histories:
For , and , the first attempt succeeds with probability . After one failure the populations are , so the next conditional success probability is . Consequently , rather than from an unjustified fair-trial model. Termination occurs with probability one, but there is no finite worst-case attempt count in this example.
Eventual success also need not preserve the input. When the stopping record is forgotten, summing the successful branches gives
The off-diagonal factor is the geometric sum of the two branch amplitudes; whenever . The stopping time contains information about the computational-basis component. In the numerical example, , and the output has squared fidelity with the initial , despite eventual reported success being certain.
A standard unitary repeat-until-success construction instead arranges and failure branches , with known unitaries whose inverses are applied before retrying, , and . Each corrected failure restores the unknown input, including its correlations with a reference, so the success probability stays and the mean attempt count is . Recovery operations still contribute to physical cost. Paetznick and Svore give this construction; the general instrument description explains why a failure probability alone cannot establish it.
Exercises
Section titled “Exercises”Exercise 1: One Measurement-Conditioned Channel
Section titled “Exercise 1: One Measurement-Conditioned Channel”For
perform an -basis Lüders measurement, encode and , and apply . Find the outcome probabilities, corrected conditional outputs, cq state in order, and history-forgotten output.
Solution
With ,
The uncorrected branches are and . Since , applying gives
Both normalized conditional outputs are . Therefore
and forgetting gives .
Exercise 2: Normalize a Two-Stage Branch Tree
Section titled “Exercise 2: Normalize a Two-Stage Branch Tree”The first binary outcome is fair. Only after , a second measurement has . A zero terminates successfully. Find the terminal probabilities for , the success probability, the expected measurement count, and the success-conditioned history weights.
Solution
The prefix-free terminal probabilities are
They sum to one. Histories and are successful, so
One measurement is used on history and two on histories and :
Conditioning the two successful leaves on their total probability gives
Exercise 3: Prove the Active-Reset Channel
Section titled “Exercise 3: Prove the Active-Reset Channel”For
prove that computational-basis measurement followed by produces . Track the classical record and classify the resulting quantum channel.
Solution
The corrected branch Kraus operators may be written
They satisfy
so the map is completely positive and trace preserving. Its output is
The record has probabilities and ; the coherence is absent from both recorded branches. The quantum channel is constant-output, CPTP, nonunitary, and noninvertible. Retaining the bit preserves the classical distribution even though the quantum marginal is always .
Exercise 4: Propagate a Pauli Frame
Section titled “Exercise 4: Propagate a Pauli Frame”An outstanding frame is . Propagate it through physical followed by , up to global phase. How must a final physical -measurement bit be interpreted?
Solution
First use and :
Then and , so
The propagated exponent is , and an flips a physical -measurement outcome. Hence
The answer is a classical reinterpretation only if the frame remains tracked; otherwise the outstanding correction must be applied physically.
Exercise 5: Repair an Ill-Typed Branch Merge
Section titled “Exercise 5: Repair an Ill-Typed Branch Merge”Branch returns with live. Branch destructively measures or releases and returns only . Diagnose a later merged use of and give two valid repairs. What should be merged if both branches retain a qubit but carry different Pauli frames?
Solution
The merge is ill typed: one incoming edge supplies a live quantum value and the other does not. A later gate on a merged symbol therefore has no channel semantics on the branch.
One repair is to make both branches record-only and forbid later quantum use. A second is to prepare or reset an explicit replacement in branch , then return a qubit in the specified output space on each branch, with its preparation and any outstanding correction identified. The replacement is a new declared value; reusing the old wire label does not undo destructive measurement or release.
If both qubits remain live but their Pauli frames differ, merge . Dropping the frame would make later gates and measurement interpretations branch dependent without recording that dependence.
Exercise 6: Compute Deadline Slack
Section titled “Exercise 6: Compute Deadline Slack”A measurement interaction ends at . The subsequent acquisition, classification, decision, and dispatch take . The dependent operation must start by and the declared guard is . Find the earliest start time, raw slack, and residual slack. No gate duration is included in this start-time deadline. Repeat if classification takes .
Solution
For the first schedule, the record path lasts
so
The raw slack is , and subtracting the guard leaves . The guarded schedule passes.
Increasing classification from to adds :
Raw slack is now and residual slack is . The guarded schedule fails even though the unguarded operation arrives before the deadline.
Exercise 7: Cap a Geometric Retry Policy
Section titled “Exercise 7: Cap a Geometric Retry Policy”Independent attempts succeed with probability . At most four attempts are allowed. Find the probability of success by the cap, the exhaustion probability, the expected number of attempts, and the worst-case count.
Solution
The failure probability per attempt is . Four consecutive failures have probability
Therefore
The exhaustion probability is . This policy has no separate abort or timeout exit, so both of those probabilities are zero.
Attempt is reached only after the first failures, so
The worst case is four attempts. A state or statistic conditioned on the success event is postselected; the capped policy is not a deterministic transformation.
Exercise 8: Bell-branch correction
Section titled “Exercise 8: Bell-branch correction”Prepare in the order . Measure in the basis, encoding and . How can the result prepare logical on ? Compare a physical correction, a tracked frame, and omission of both.
Solution
The identity
shows that the two outcomes are equally likely and leave in or . Physical maps both to . After discarding , the corrected classical–quantum state is
Alternatively, keep the physical on branch one and record a frame. A later physical -measurement bit must be flipped on that branch. The logical outcome is then the same, though no corrective pulse was applied.
If both the correction and its frame are omitted and the outcome is forgotten, the output is . Its squared fidelity with is and its trace distance is ; its expectation is zero instead of one.
For an illustrative timing check, a measurement ending at , a report path and a correction give a longest completion time of . A deadline leaves before any extra guard. The expected physical count is ; the frame version has a different classical processing requirement.
Exercise 9: Keep the exhaustion branch
Section titled “Exercise 9: Keep the exhaustion branch”Cap the preceding unknown-input instrument at two attempts. For and input , find the success and exhaustion probabilities and the computational-basis populations after exhaustion. Show that including exhaustion gives a trace-preserving instrument for every input.
Solution
The three terminal operators are , , and . Since the diagonal operators commute,
Their probabilities on are , respectively. Thus success has probability and exhaustion . The exhausted state is , with populations ; the failed attempts have changed the unknown input. Dropping that branch leaves a trace-decreasing success operation. Normalizing it describes postselection, not the complete capped procedure.
References
Section titled “References”- D. Aharonov, A. Kitaev, and N. Nisan, “Quantum Circuits with Mixed States,” Proceedings of the 30th Annual ACM Symposium on Theory of Computing, 20–30 (1998), doi:10.1145/276698.276708.
- E. Bäumer et al., “Efficient Long-Range Entanglement Using Dynamic Circuits,” PRX Quantum 5, 030339 (2024), doi:10.1103/PRXQuantum.5.030339.
- C. H. Bennett, G. Brassard, C. Crépeau, R. Jozsa, A. Peres, and W. K. Wootters, “Teleporting an Unknown Quantum State via Dual Classical and Einstein–Podolsky–Rosen Channels,” Physical Review Letters 70, 1895–1899 (1993), doi:10.1103/PhysRevLett.70.1895.
- A. D. Córcoles et al., “Exploiting Dynamic Quantum Circuits in a Quantum Algorithm with Superconducting Qubits,” Physical Review Letters 127, 100501 (2021), doi:10.1103/PhysRevLett.127.100501.
- A. W. Cross et al., “OpenQASM 3: A Broader and Deeper Quantum Assembly Language,” ACM Transactions on Quantum Computing 3, article 12 (2022), doi:10.1145/3505636.
- D. Gottesman and I. L. Chuang, “Demonstrating the Viability of Universal Quantum Computation Using Teleportation and Single-Qubit Operations,” Nature 402, 390–393 (1999), doi:10.1038/46503.
- R. B. Griffiths and C.-S. Niu, “Semiclassical Fourier Transform for Quantum Computation,” Physical Review Letters 76, 3228–3231 (1996), doi:10.1103/PhysRevLett.76.3228.
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th Anniversary Edition, Cambridge University Press (2010), doi:10.1017/CBO9780511976667.
- A. Paetznick and K. M. Svore, “Repeat-Until-Success: Non-deterministic decomposition of single-qubit unitaries,” Quantum Information and Computation 14(15–16), 1277–1301 (2014), doi:10.26421/QIC14.15-16-2, arXiv:1311.1074.
- R. Raussendorf and H. J. Briegel, “A One-Way Quantum Computer,” Physical Review Letters 86, 5188–5191 (2001), doi:10.1103/PhysRevLett.86.5188.
- D. Ristè, C. C. Bultink, K. W. Lehnert, and L. DiCarlo, “Feedback Control of a Solid-State Qubit Using High-Fidelity Projective Measurement,” Physical Review Letters 109, 240502 (2012), doi:10.1103/PhysRevLett.109.240502.
- P. Selinger and B. Valiron, “A Lambda Calculus for Quantum Computation with Classical Control,” Mathematical Structures in Computer Science 16, 527–552 (2006), doi:10.1017/S0960129506005238.
- J. Watrous, The Theory of Quantum Information, Cambridge University Press (2018), doi:10.1017/9781316848142.