Mid-Circuit Measurement and Classical Feedforward in OpenQASM 3
How to use mid-circuit measurements, classical conditionals, and real-time feedback in OpenQASM 3 dynamic circuits.
Circuit diagrams
What Are Dynamic Circuits
A static quantum circuit applies a fixed sequence of gates followed by measurement at the end. Every qubit follows a predetermined path, and the classical output only becomes available once the entire circuit has finished. A dynamic circuit breaks this restriction: it can measure qubits in the middle of execution, feed those classical results into logic, and use the outcomes to decide which gates to apply next. This capability is called classical feedforward.
OpenQASM 3 was designed specifically to support dynamic circuits. Unlike OpenQASM 2, where all classical logic was resolved offline after the circuit completed, QASM 3 conditionals execute in real time on the hardware control system. This distinction is not cosmetic. It changes what algorithms you can run.
Why Mid-Circuit Measurement Matters
Static circuits, where all measurements happen at the end, cannot implement several critical quantum computing primitives:
-
Quantum error correction requires syndrome measurements that happen during computation. You measure ancilla qubits to detect whether an error has occurred, then apply correction gates based on the result, all while the logical qubits remain coherent. Without mid-circuit measurement, error correction is impossible.
-
Adaptive state preparation uses measurement to verify that a preparation step succeeded. If the ancilla measurement indicates failure, the protocol resets and retries. This pattern appears throughout fault-tolerant quantum computing.
-
Quantum teleportation transfers a quantum state from one qubit to another using entanglement and two classical bits. The receiving qubit must have correction gates applied based on the sender’s measurement outcomes, and those corrections must happen during the circuit, not after.
-
Magic state distillation prepares high-fidelity non-Clifford resource states (such as the T-state) by running a distillation circuit and postselecting on a specific measurement outcome. Failed attempts are discarded and the protocol restarts. This is a core subroutine in fault-tolerant architectures.
None of these protocols can be expressed as a static circuit. They all require the ability to measure, reason about the result, and act on it before the remaining qubits lose coherence.
The Hardware Timing Challenge
Mid-circuit measurement and feedforward impose a strict timing requirement on the hardware. The sequence of events is:
- The target qubit is measured (this takes 300-1000 ns on superconducting hardware).
- The measurement result propagates from the quantum processor to the classical controller.
- The classical controller evaluates the conditional expression.
- The conditional gate instruction is dispatched back to the quantum processor.
- The conditional gate executes on the target qubit.
All of this must complete before the remaining qubits decohere. On IBM Eagle and Heron processors, the full round-trip for a single feedforward operation takes roughly 100-300 nanoseconds for the classical portion alone. Qubit T2 times (the coherence window for phase information) on these processors range from 50 to 200 microseconds. That gives a comfortable margin for a small number of feedforward steps, but each successive feedforward operation eats into the decoherence budget.
For trapped-ion systems like Quantinuum’s H-series, measurement takes longer (hundreds of microseconds), but coherence times are also much longer (seconds), so the ratio remains favorable.
The practical takeaway: you can use feedforward freely in near-term circuits, but deeply nested feedforward chains (many sequential measure-then-act steps) will eventually run into coherence limits on any hardware platform.
Mid-Circuit Measurement Syntax
In OpenQASM 3, measurement can appear anywhere in the program, not just at the end:
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
h q[0];
cx q[0], q[1];
// Measure qubit 0 in the middle of the circuit
c[0] = measure q[0];
// Continue operating on qubit 1
h q[1];
c[1] = measure q[1];
After c[0] = measure q[0], qubit 0 has collapsed to a definite classical state (either |0> or |1>), but qubit 1 remains a valid quantum register that you can continue to manipulate with gates. The measurement result is stored in the classical bit c[0] and is immediately available for use in conditional logic.
Measurement in Different Bases
All measurement in OpenQASM 3 is performed in the computational (Z) basis. To measure in a different basis, you apply a basis-change unitary before the measure instruction. This rotates the qubit so that the desired measurement basis aligns with the Z axis.
X-basis measurement applies a Hadamard gate before measuring. This distinguishes |+> from |->:
OPENQASM 3.0;
include "stdgates.inc";
qubit q;
bit c;
// Prepare |+>
h q;
// Measure in X basis: apply H then measure in Z
h q;
c = measure q; // Returns 0 for |+>, 1 for |->
Y-basis measurement applies S-dagger followed by Hadamard. This distinguishes |+i> from |-i>:
OPENQASM 3.0;
include "stdgates.inc";
qubit q;
bit c;
// Measure in Y basis: apply Sdg then H, then measure in Z
sdg q;
h q;
c = measure q;
Bell-basis measurement applies CNOT then Hadamard to two qubits, then measures both. This is the measurement step used in quantum teleportation:
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit[2] c;
// Assume q[0] and q[1] are in some two-qubit state
// Bell basis measurement:
cx q[0], q[1];
h q[0];
c[0] = measure q[0];
c[1] = measure q[1];
The Bell measurement projects the two qubits onto one of the four Bell states. The two classical bits identify which Bell state was observed: 00 maps to |Phi+>, 01 to |Psi+>, 10 to |Phi->, and 11 to |Psi->.
Reset and Qubit Reuse
The reset statement projects a qubit to |0>, regardless of its current state. Combined with mid-circuit measurement, this lets you reuse qubits as fresh ancillae:
OPENQASM 3.0;
include "stdgates.inc";
qubit q;
bit c;
// First use
h q;
c = measure q;
// Reuse the same qubit
reset q;
x q;
c = measure q; // Will always yield 1
On hardware, reset is typically implemented as a measurement followed by a conditional X gate. If the measurement returns |1>, the X gate flips the qubit to |0>. If it already returned |0>, no gate is applied. This means reset costs roughly two gate times and introduces a feedforward step internally, even though it appears as a single instruction in the source code.
Qubit reuse matters because quantum processors have a fixed number of physical qubits. If a circuit needs 10 ancilla measurements but you can reuse 2 ancilla qubits by resetting them between rounds, you need only 2 ancilla qubits instead of 10. This is critical for error correction circuits, where syndrome qubits are measured repeatedly across many rounds.
Qubit Reuse in a Repetition Code
The following example demonstrates qubit reuse in a 3-qubit bit-flip repetition code. Two syndrome qubits are measured and reset in each round, then reused for the next round of syndrome extraction:
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] data; // Data qubits encoding |0> = |000> or |1> = |111>
qubit[2] syn; // Syndrome qubits (reused each round)
bit[2] s; // Syndrome measurement results
// Encode logical |0> as |000> (already in |000> by default)
// --- Round 1: syndrome extraction ---
// Measure parity of data[0] and data[1]
cx data[0], syn[0];
cx data[1], syn[0];
s[0] = measure syn[0];
// Measure parity of data[1] and data[2]
cx data[1], syn[1];
cx data[2], syn[1];
s[1] = measure syn[1];
// Decode syndrome and apply correction
// s = 00: no error
// s = 10: error on data[0]
// s = 11: error on data[1]
// s = 01: error on data[2]
if (s[0] == 1 && s[1] == 0) {
x data[0];
}
if (s[0] == 1 && s[1] == 1) {
x data[1];
}
if (s[0] == 0 && s[1] == 1) {
x data[2];
}
// Reset syndrome qubits for reuse
reset syn[0];
reset syn[1];
// --- Round 2: syndrome extraction (identical, reusing syn qubits) ---
cx data[0], syn[0];
cx data[1], syn[0];
s[0] = measure syn[0];
cx data[1], syn[1];
cx data[2], syn[1];
s[1] = measure syn[1];
// Apply correction again
if (s[0] == 1 && s[1] == 0) {
x data[0];
}
if (s[0] == 1 && s[1] == 1) {
x data[1];
}
if (s[0] == 0 && s[1] == 1) {
x data[2];
}
Without qubit reuse, each round of syndrome extraction would need two fresh ancilla qubits. For d rounds, you would need 2d ancillae. With reuse, you always need exactly 2.
Classical Conditionals with if
The if statement branches on classical bit values in real time:
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
bit c;
h q[0];
c = measure q[0];
// Apply X to qubit 1 only if qubit 0 measured as 1
if (c == 1) {
x q[1];
}
This is fundamentally different from OpenQASM 2’s if statement. In QASM 2, the condition was evaluated after the entire circuit finished, during post-processing on a classical computer. The quantum hardware executed every gate unconditionally, and the if statement simply filtered which measurement results to keep. In QASM 3, the hardware controller evaluates the condition during execution and physically applies (or skips) the conditional gates in real time. This means the quantum state of the remaining qubits is genuinely different depending on the branch taken.
You can also use if/else:
if (c == 0) {
h q[1];
} else {
x q[1];
}
The body of an if or else block can contain multiple gates, measurements, resets, and even nested conditionals.
Quantum Teleportation: The Complete Example
Quantum teleportation transfers the state of one qubit to another using a shared Bell pair and two classical bits of communication. It is the canonical example of a dynamic circuit because the receiver must apply corrections based on the sender’s measurement results during execution.
The Setup
The protocol uses three qubits:
- q[0]: The source qubit, holding the state we want to teleport (call it |psi>).
- q[1]: Alice’s half of a shared Bell pair.
- q[2]: Bob’s half of the shared Bell pair. At the end, this qubit will hold |psi>.
Step-by-Step Walkthrough
Step 1: Prepare the state to teleport. We place an arbitrary state on q[0]. For demonstration purposes, we prepare |+> = H|0>, but in a real protocol this could be any unknown quantum state.
Step 2: Create the Bell pair. Alice and Bob share a Bell state |Phi+> = (|00> + |11>) / sqrt(2) on qubits q[1] and q[2]. This entanglement is the “quantum channel” that enables teleportation.
Step 3: Alice performs a Bell measurement. Alice applies CNOT from q[0] to q[1], then Hadamard on q[0], and measures both. This projects the three-qubit system into a product state: Alice’s two classical bits identify one of four cases, and Bob’s qubit is left in a state that differs from |psi> by at most a known Pauli operation.
Step 4: Bob applies corrections. Based on Alice’s two measurement bits, Bob applies the appropriate correction gate to recover |psi> exactly.
Why These Specific Corrections?
The Bell measurement on Alice’s side maps the original state through the four Bell states. The algebra works out to:
| Alice’s result (c[0], c[1]) | Bob’s qubit state before correction | Correction Bob applies |
|---|---|---|
| 0, 0 | |psi> | I (no correction) |
| 0, 1 | X|psi> | X |
| 1, 0 | Z|psi> | Z |
| 1, 1 | ZX|psi> | ZX (first X, then Z) |
The c[1] bit controls the X correction because it corresponds to the CNOT outcome, which detects whether a bit-flip is needed. The c[0] bit controls the Z correction because it corresponds to the Hadamard-then-measure step, which detects whether a phase-flip is needed.
If you forget the corrections, Bob’s qubit still receives a state, but it is the wrong state. Specifically, it is |psi> with a random Pauli applied, which is equivalent to a maximally mixed state when averaged over the measurement outcomes. Teleportation without correction is useless.
The Complete QASM 3 Code
OPENQASM 3.0;
include "stdgates.inc";
// Three qubits: source (q[0]), Alice's half of Bell pair (q[1]),
// Bob's half of Bell pair (q[2])
qubit[3] q;
bit[2] c;
// Step 1: Prepare the state to teleport on q[0]
// For demonstration, prepare |+> = H|0>
h q[0];
// Step 2: Create a Bell pair between q[1] (Alice) and q[2] (Bob)
h q[1];
cx q[1], q[2];
// Step 3: Alice's Bell measurement on q[0] and q[1]
// The CNOT entangles the source with Alice's half
cx q[0], q[1];
// The Hadamard maps the Bell basis to the computational basis
h q[0];
c[0] = measure q[0];
c[1] = measure q[1];
// Step 4: Bob applies corrections based on Alice's results
// c[1] == 1 means a bit-flip error: correct with X
if (c[1] == 1) {
x q[2];
}
// c[0] == 1 means a phase-flip error: correct with Z
if (c[0] == 1) {
z q[2];
}
// q[2] now holds the original state of q[0]
// Verify by measuring in the X basis (should give 0 for |+>)
h q[2];
bit result;
result = measure q[2];
The key point is that the if blocks execute during the circuit run. Bob’s corrections happen conditionally based on Alice’s measurement outcomes, which is exactly how teleportation works in theory. On hardware without feedforward support, you would have to defer the corrections to post-processing and discard runs where corrections were needed, dramatically reducing your effective sampling rate.
3-Qubit Bit-Flip Error Correction Code
This section presents a complete quantum error correction example using mid-circuit measurement. The 3-qubit repetition code protects against single bit-flip (X) errors.
Encoding
The code encodes one logical qubit into three physical qubits using majority voting:
- Logical |0> is encoded as |000>
- Logical |1> is encoded as |111>
To encode an arbitrary state alpha|0> + beta|1>, apply CNOT gates from the first qubit to the other two:
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] data;
qubit[2] ancilla;
bit[2] syndrome;
bit result;
// Prepare the logical state: alpha|0> + beta|1>
// For demonstration, encode logical |+> = (|000> + |111>) / sqrt(2)
h data[0];
// Encode: spread the state across all three data qubits
cx data[0], data[1];
cx data[0], data[2];
// State is now alpha|000> + beta|111>
Syndrome Measurement
Two ancilla qubits measure the parity between adjacent pairs of data qubits. If all three data qubits agree, both parities are even (0). If one qubit has flipped, the parities reveal which one.
The syndrome extraction circuit uses CNOT gates to copy parity information onto the ancillae:
- Ancilla 0 measures the parity of data[0] and data[1]
- Ancilla 1 measures the parity of data[1] and data[2]
Syndrome Lookup Table
| Syndrome (s[0], s[1]) | Meaning | Correction |
|---|---|---|
| 0, 0 | No error detected | None |
| 1, 0 | data[0] differs from data[1], data[1] agrees with data[2] | X on data[0] |
| 1, 1 | data[1] differs from both neighbors | X on data[1] |
| 0, 1 | data[2] differs from data[1], data[0] agrees with data[1] | X on data[2] |
Complete Error Correction Code
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] data;
qubit[2] ancilla;
bit[2] syndrome;
bit result;
// Encode logical |+> into the repetition code
h data[0];
cx data[0], data[1];
cx data[0], data[2];
// --- Syndrome extraction ---
// Parity of data[0] XOR data[1]
cx data[0], ancilla[0];
cx data[1], ancilla[0];
syndrome[0] = measure ancilla[0];
// Parity of data[1] XOR data[2]
cx data[1], ancilla[1];
cx data[2], ancilla[1];
syndrome[1] = measure ancilla[1];
// --- Correction based on syndrome ---
if (syndrome[0] == 1 && syndrome[1] == 0) {
x data[0];
}
if (syndrome[0] == 1 && syndrome[1] == 1) {
x data[1];
}
if (syndrome[0] == 0 && syndrome[1] == 1) {
x data[2];
}
// --- Decode and measure the logical qubit ---
cx data[0], data[2];
cx data[0], data[1];
h data[0];
result = measure data[0];
This circuit can correct any single bit-flip error on any of the three data qubits. If no error occurs, the syndrome is 00 and no correction is applied. If a bit-flip hits data[1], the syndrome reads 11, and the conditional X gate on data[1] restores the correct state. The entire error detection and correction process happens during the circuit, enabled by mid-circuit measurement and classical feedforward.
While Loops for Repeat-Until-Success
OpenQASM 3 supports while loops, which enable repeat-until-success (RUS) protocols. These protocols are used for non-deterministic state preparation, where each attempt succeeds with some probability and the circuit retries on failure.
A practical application is preparing the T-state |T> = T|+>, a non-Clifford resource state used in magic state distillation for fault-tolerant quantum computing. Certain RUS decompositions can implement non-Clifford rotations using only Clifford gates plus measurement, with a known probability of success per attempt.
OPENQASM 3.0;
include "stdgates.inc";
qubit q;
bit c = 1;
int count = 0;
// Repeat until we measure |0>, indicating success
while (c == 1) {
reset q;
h q;
t q;
h q;
c = measure q;
count += 1;
}
// q is now in the post-selected state
// Expected number of iterations depends on the success probability
In this example, each iteration applies H-T-H and measures. The probability of measuring |0> (success) is cos^2(pi/8), which is approximately 0.85. So the expected number of iterations before success is roughly 1.18. For more complex RUS sequences, the success probability may be lower, but it is always known analytically, which lets you bound the expected runtime.
Be aware that while loops with measurement-dependent termination run for a variable number of iterations. Hardware systems impose a maximum execution time or iteration count, so you should verify that your expected iteration count is well within the hardware limits. If the success probability is very low (say, below 10%), the loop may time out on hardware, and you should restructure the protocol or increase the success probability through circuit design.
Classical Registers and Integer Arithmetic
OpenQASM 3 supports typed classical variables and a range of operations on them. This goes well beyond the simple bit and creg types available in QASM 2.
Supported Types
bitandbit[n]: Single bits and bit registers (arrays of bits)int[n]anduint[n]: Signed and unsigned integers with n-bit widthfloat[n]: Floating-point numbersbool: Boolean values
Supported Operations
- Arithmetic:
+,-,*,/,% - Bitwise:
&(AND),|(OR),^(XOR),~(NOT),<<(left shift),>>(right shift) - Comparison:
==,!=,<,>,<=,>= - Assignment:
=,+=,-=
Practical Example: Syndrome Decoding with Integer Index
Instead of writing separate if statements for each syndrome pattern, you can pack the syndrome bits into an integer and use it as a lookup index. This approach scales better for larger codes:
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] data;
qubit[2] ancilla;
bit[2] s;
uint[8] syndrome_index;
// Assume data qubits are encoded and syndrome extraction is done
cx data[0], ancilla[0];
cx data[1], ancilla[0];
s[0] = measure ancilla[0];
cx data[1], ancilla[1];
cx data[2], ancilla[1];
s[1] = measure ancilla[1];
// Pack syndrome bits into an integer
// s[0] is the least significant bit, s[1] is shifted left by 1
syndrome_index = s[0] + 2 * s[1];
// Now syndrome_index is 0, 1, 2, or 3
// 0: no error
// 1: error on data[0]
// 2: error on data[2]
// 3: error on data[1]
if (syndrome_index == 1) {
x data[0];
}
if (syndrome_index == 3) {
x data[1];
}
if (syndrome_index == 2) {
x data[2];
}
This pattern generalizes to larger stabilizer codes, where the syndrome may be 4, 6, or more bits wide. Packing into an integer makes the conditional logic more systematic and mirrors how classical decoders work in software. However, keep in mind that the classical computation capabilities of QASM 3 are limited compared to a full programming language. Complex decoding logic (such as minimum-weight perfect matching) is typically handled by the classical controller firmware rather than being expressed directly in the QASM source.
Delay Instruction for Timing Control
OpenQASM 3 includes a delay instruction that inserts a specified wait time on one or more qubits:
delay[100ns] q[0];
This instruction tells the hardware to idle the specified qubit for the given duration. It does not apply any gate; the qubit simply waits. This is useful for synchronizing operations across qubits when some qubits need to wait for others to complete a measurement or feedforward step.
Delay in Teleportation
In the teleportation protocol, Bob’s qubit (q[2]) must wait while Alice performs her Bell measurement and the classical result propagates. On real hardware, this delay happens automatically because the feedforward path introduces latency. But in some contexts, you may want to make the delay explicit for clarity or to insert dynamical decoupling pulses:
OPENQASM 3.0;
include "stdgates.inc";
qubit[3] q;
bit[2] c;
h q[0];
h q[1];
cx q[1], q[2];
// Alice's Bell measurement
cx q[0], q[1];
h q[0];
c[0] = measure q[0];
c[1] = measure q[1];
// Bob's qubit waits during measurement and classical processing
// The delay accounts for measurement and feedforward latency
delay[500ns] q[2];
// Now apply corrections
if (c[1] == 1) {
x q[2];
}
if (c[0] == 1) {
z q[2];
}
The exact delay duration depends on the hardware platform. On superconducting processors, measurement typically takes 300-1000 ns, and the classical round-trip adds another 100-300 ns. In practice, the compiler often inserts these delays automatically, but explicit delay statements give you precise control when needed.
Compilation: Static vs. Dynamic Circuits
When you submit a dynamic QASM 3 circuit to a compiler like Qiskit’s transpiler, the compilation process differs from static circuits in important ways.
Gate optimization across measurement boundaries. In a static circuit, the compiler can freely cancel adjacent inverse gates (such as H-H or X-X) anywhere in the circuit. In a dynamic circuit, the compiler cannot always optimize gates across a measurement boundary, because the measurement collapses the quantum state and creates a classical dependency. Gates before the measurement may affect the measurement outcome, and gates after the measurement may depend on it.
Classical data flow. The compiler must respect the classical data flow graph. If a gate is conditioned on a measurement result, the compiler cannot reorder that gate to execute before the measurement, even if doing so would reduce circuit depth. The classical dependency is a hard constraint.
Transpilation in Qiskit. When using Qiskit’s transpile() function for dynamic circuits, the transpiler recognizes control-flow operations (if/else, while, switch) and handles them correctly. The key consideration is that optimization passes designed for static circuits may not apply. Qiskit’s pass manager automatically adjusts when it detects dynamic circuit constructs.
Practical advice: Always test your dynamic circuit on a simulator before submitting to hardware. Dynamic circuits have more ways to go wrong (incorrect classical logic, timing issues, unsupported operations) than static circuits, and simulator testing catches most of these issues.
Hardware Support
Not all quantum hardware supports the full range of dynamic circuit features. The following table summarizes support as of early 2026:
| Hardware | Mid-circuit measurement | Classical feedforward (if/else) | While loops | Qubit reuse (reset) |
|---|---|---|---|---|
| IBM Eagle/Heron | Yes | Yes | No | Yes |
| Quantinuum H-series | Yes | Yes | Yes | Yes |
| IonQ Forte | Yes | Yes | No | Yes |
| Rigetti | Limited | Limited | No | No |
IBM Eagle and Heron processors support mid-circuit measurement and if/else feedforward through Qiskit Runtime. While loops are not natively supported; circuits with while loops must be unrolled or rejected. Reset and qubit reuse work reliably.
Quantinuum H-series trapped-ion processors provide the most complete dynamic circuit support, including while loops with measurement-dependent termination. The longer coherence times of trapped ions make deep feedforward chains practical.
IonQ Forte supports mid-circuit measurement and basic feedforward. While loop support varies by system configuration.
Rigetti processors have limited mid-circuit measurement support. Classical feedforward capabilities are restricted, and qubit reuse via reset is generally not available.
When a backend does not support a dynamic circuit feature, the compiler may reject the program, silently defer classical logic to post-processing (which changes the semantics), or raise an error at runtime. Always verify your target backend’s capabilities before relying on real-time feedforward.
Common Mistakes
Applying Gates After Measurement Without Reset
After measuring a qubit, it collapses to either |0> or |1>. If you apply gates to it without resetting first, you are operating on a qubit in a known classical state, not a fresh |0>. This is sometimes intentional (the qubit is in a definite state and you want to manipulate it further), but often it is a bug where the programmer assumed the qubit was back in |0>. Always use reset explicitly when you need a fresh ancilla.
Confusing QASM 2 and QASM 3 if Semantics
In OpenQASM 2, the if statement was a post-processing filter. The hardware executed every gate unconditionally, and the if controlled which shots were included in the final result. In OpenQASM 3, the if statement is a real-time branch: the hardware physically applies or skips the conditional gates based on the measurement result. If you port a QASM 2 circuit to QASM 3 and assume the if behavior is identical, you will get incorrect results. The semantics are fundamentally different.
Unbounded While Loops
A while loop that depends on a measurement outcome will run for a random number of iterations. If the success probability per iteration is very low (for example, 1%), the loop may run for hundreds of iterations before terminating. Most hardware platforms impose a maximum execution time or iteration count, and exceeding it will cause the job to fail. Before using a while loop, compute the expected number of iterations and verify that it is well within hardware limits.
Underestimating the Cost of Reset
The reset instruction is not free. On superconducting hardware, it is implemented as a measurement followed by a conditional X gate. This means each reset takes roughly the same time as a measurement plus feedforward step, typically 500-1500 ns. In circuits with many resets (such as repeated syndrome extraction), the cumulative cost of resets can be a significant fraction of the total circuit time.
Ignoring Feedforward Latency in Depth Estimates
Circuit depth is often used as a proxy for execution time and decoherence. But in dynamic circuits, feedforward steps introduce dead time that does not appear in the gate count. A circuit with 50 gates and 3 feedforward steps may take longer to execute than a circuit with 100 gates and no feedforward, because each feedforward step adds hundreds of nanoseconds of classical processing latency. When estimating whether a dynamic circuit will fit within the coherence window, account for feedforward latency explicitly.
Was this tutorial helpful?