Branch-Aware Quantum Constant Propagation
- BQCP is a branch-sensitive static analysis method that extends QCP by tracking mid-circuit measurement outcomes and corresponding post-measurement quantum states.
- It employs bounded branch and quantum state tracking to handle if-then-else conditionals, resets, and classical feedforward while preserving circuit semantics.
- Empirical evaluations show that BQCP significantly reduces circuit size, gate count, and dynamic overhead compared to traditional QCP, enhancing optimization in dynamic quantum circuits.
Branch-Aware Quantum Constant Propagation (BQCP) is a compile-time static analysis and optimization method for dynamic quantum circuits, i.e., circuits that mix quantum operations with real-time classical control. It extends Quantum Constant Propagation (QCP) by tracking the classical information produced by mid-circuit measurements together with the corresponding post-measurement quantum states across different execution branches. The defining objective is semantics-preserving simplification of dynamic circuits containing mid-circuit measurements, classical feedforward, resets, and if-then-else conditionals, while bounding both the size of the quantum-state representation and the number of tracked branches to keep the analysis scalable (Fulginiti et al., 1 Jun 2026).
1. Origin, scope, and optimization target
BQCP was introduced in "Branch-Aware Quantum Constant Propagation for Dynamic Quantum Circuits" (Fulginiti et al., 1 Jun 2026) as a response to a specific limitation of earlier quantum constant propagation methods: most prior methods target only unitary circuits and do not support dynamic circuits with mid-circuit measurements and classical feedforward. In dynamic circuits, optimization requires preserving the correlation between a measurement outcome and the corresponding post-measurement quantum state. BQCP addresses this by tracking a bounded set of abstract execution branches, each carrying both classical and quantum information, and then using that information for semantics-preserving simplification.
The problem setting is dynamic quantum circuits in which quantum and classical computation interleave during execution. Besides unitary gates, these circuits contain mid-circuit measurements, classical feedforward, conditional blocks typically of the form if (φ) then Pt else Pf, and often resets. These features are important in current NISQ and early fault-tolerant workflows, especially for quantum error correction, qubit reuse, and circuit cutting. They also introduce true dynamic control flow: after a measurement, different outcomes induce different reachable continuations (Fulginiti et al., 1 Jun 2026).
The optimization goal is to reduce circuit size, gate count, and depth, especially expensive multi-qubit operations and dynamic overhead such as measurements and conditionals, while preserving the concrete classical–quantum semantics. This emphasis distinguishes BQCP from purely structural rewriting and from branch-insensitive state propagation. A common misconception is that BQCP is merely QCP plus classical bits; the paper explicitly frames the difference as a disjunctive, path-sensitive extension of QCP to dynamic control flow (Fulginiti et al., 1 Jun 2026).
BQCP is closely related to the hybrid quantum-classical constant propagation framework of "Automatic De-Quantization of Quantum Programs Using Constant Propagation" (Remme et al., 21 May 2026). That earlier work formalized hybrid quantum-classical constant propagation for dynamic circuits with measurement and classically guarded gates, but it remained essentially sequential and not branch-aware in the compiler-analysis sense. BQCP can therefore be situated as direct prior-work continuation: it preserves the same general objective of de-quantizing unnecessary quantum behavior, but introduces explicit branch sensitivity for if-then-else conditionals and branch-specific post-measurement reasoning (Remme et al., 21 May 2026).
2. Concrete semantics and program model
BQCP considers a dynamic circuit over a quantum register
and a classical register
Instructions include unitary gates , measurements , resets , and conditionals of the form
where and are instruction sequences and is a guard over classical bits (Fulginiti et al., 1 Jun 2026).
The concrete semantics is formulated over the Hilbert space
with 0 denoting the set of density operators over 1. At a program point, the concrete state is not a single valuation but a finite set of classical–quantum branches: 2 A branch 3 means that the classical register has value 4 and the quantum register is in density state 5. Probabilities are intentionally ignored; only branch reachability matters for the static analysis (Fulginiti et al., 1 Jun 2026).
The guard language is Boolean over classical bits: 6 This restriction is central to the method’s branch discipline. It supports structured conditionals driven by measurement outcomes, rather than arbitrary classical computation. This also clarifies the scope of BQCP: it is a dynamic-circuit analysis for guarded quantum programs, not a general-purpose control-flow analysis for unrestricted hybrid languages (Fulginiti et al., 1 Jun 2026).
The paper denotes transfer along an instruction or program 7 by 8. For conditional blocks,
9
the effect is given by composition of instruction transfer functions. This structured formulation gives BQCP the character of an abstract interpretation over an imperative intermediate representation for dynamic circuits (Fulginiti et al., 1 Jun 2026).
3. Abstract state: disjunctive branches with bounded quantum tracking
The core abstraction in BQCP is branch-disjunctive. Each classical bit is abstracted by the flat lattice
0
where 1 means definitely 0, 2 means definitely 1, and 3 means unknown. The order is
4
with 5 and 6 incomparable. For the full classical register,
7
An abstract classical state is written 8, with bitwise update notation 9 (Fulginiti et al., 1 Jun 2026).
The quantum abstraction is inherited from refined QCP and is organized around exact tracking of small entanglement groups. A partition 0 of 1 records entanglement groups, with two qubits in the same group iff they are entangled in the refined variant cited by the paper. For each group 2, the concrete pure state is represented sparsely as a partial map from basis strings to amplitudes, bounded by a threshold 3 on support size. Formally,
4
Then
5
If applying an operation would increase the number of nonzero amplitudes beyond 6, the group becomes untracked (Fulginiti et al., 1 Jun 2026).
A single abstract branch is a pair
7
The full abstract state is a finite set of such branches: 8 This finite disjunction of branch-specific classical–quantum states is the defining innovation of BQCP. Unlike branch-insensitive analyses that collapse all post-measurement possibilities into one coarse abstraction, BQCP explicitly preserves multiple abstract continuations as long as the branch budget allows (Fulginiti et al., 1 Jun 2026).
Two bounds control scalability. The quantum-state bound 9 limits support size per entanglement group, and the branch bound 0 limits how many branches are represented explicitly: 1 A plausible implication is that BQCP’s precision is jointly constrained by entanglement growth and control-flow branching; the paper makes this explicit by tying quantum imprecision to 2 and branch imprecision to 3 (Fulginiti et al., 1 Jun 2026).
4. Transfer functions, guard evaluation, and branch management
Guard evaluation uses three-valued logic
4
with abstract evaluation function
5
For a classical bit 6,
7
Negation and Boolean connectives are interpreted compositionally over 8, using Kleene-style three-valued logic. This is what makes conditionals branch-sensitive: each branch’s guard can be definitely true, definitely false, or unknown (Fulginiti et al., 1 Jun 2026).
For a unitary instruction 9, the classical state is unchanged, and the quantum abstraction is updated branchwise using the QCP transformer 0: 1 Measurements are the crucial extension. If the measured qubit is a tracked singleton group 2 in an exact basis state 3, the measurement is deterministic and only the classical bit is updated. Otherwise, the analysis may generate two successor branches, one for each outcome 4, updating the classical state, setting the singleton measured qubit to 5, and conditioning the residual state of the remaining qubits when that information is tracked (Fulginiti et al., 1 Jun 2026).
When a non-deterministic measurement would exceed the global branch budget, BQCP applies a conservative fallback: 6 If there is no room to split, the measured classical bit becomes unknown and the entire group containing the measured qubit is forgotten. This is the main branch-bounding approximation (Fulginiti et al., 1 Jun 2026).
Reset transfer preserves the classical state. If 7 is already a singleton group, its abstract state is overwritten with 8, representing 9. If it belongs to a larger entangled group, reset breaks entanglement, places 0 in its own singleton group set to 1, and conservatively discards information about the remainder by marking it untracked (Fulginiti et al., 1 Jun 2026).
Conditionals are handled by partitioning incoming branches according to guard evaluation: 2
3
Definitely true branches go only to the then-block, definitely false branches go only to the else-block, and unknown branches go to both. The two sides are propagated independently and then rejoined conservatively under a reduction operator 4 that repeatedly merges branches until at most 5 remain (Fulginiti et al., 1 Jun 2026).
For branches
6
their merge is
7
The classical part uses bitwise join,
8
while the quantum part preserves only groups appearing identically in both partitions and keeps exact information only when the tracked state agrees; otherwise it degrades to 9 or to a residual untracked group. This deliberately conservative design retains only information common to both branches (Fulginiti et al., 1 Jun 2026).
5. Semantics-preserving simplifications and formal soundness
BQCP computes abstract states at program points and uses them to simplify circuits. The paper presents all rewrites as semantics-preserving (Fulginiti et al., 1 Jun 2026).
The first family is control reduction under branching. A control can be dropped only if it is redundant in every branch in the current abstract state 0, and a controlled gate can be removed if its control condition is unsatisfiable in every branch. This branchwise universal condition is central: it preserves soundness under disjunctive abstract states while enabling branch-local reasoning inside conditionals (Fulginiti et al., 1 Jun 2026).
The second family is elimination of redundant unitary gates. Let 1 act on qubits 2. For each branch,
3
let
4
A sufficient condition for 5 to be redundant under 6 is: 7 If this holds in every branch, the operation is deleted (Fulginiti et al., 1 Jun 2026).
The third and fourth families eliminate redundant resets and redundant measurements. Reset 8 is removed if, in every branch, 9 is a singleton group and its state is exactly 0, representing 1. Measurement 2 is removed if, in every branch, 3 is a singleton group, 4 is exactly 5 for some 6, and 7. In those cases, the operation changes neither the quantum nor the classical state (Fulginiti et al., 1 Jun 2026).
The fifth family simplifies conditionals themselves. Given abstract branch sets 8 and 9, if
0
the conditional is replaced by 1; if
2
it is replaced by 3. Even when both sides remain reachable, the then- and else-blocks are analyzed under restricted branch sets, enabling distinct simplifications on the two sides (Fulginiti et al., 1 Jun 2026).
The formal soundness argument is built on an explicit representation relation. The concrete classical configurations compatible with 4 are
5
For a quantum abstract state 6,
7
where
8
A single abstract branch represents
9
and an abstract state represents
00
The representation relation is
01
On this basis, the paper proves soundness of abstract guard evaluation, soundness of branch merge, soundness of branch reduction, soundness of instruction transfer functions, and the main theorem: 02 It also gives a soundness criterion for rewrites: 03 for every concrete 04 represented by the abstract state under which the rewrite is applied (Fulginiti et al., 1 Jun 2026).
6. Empirical results, complexity, and relation to prior methods
The paper evaluates BQCP on an application-driven circuit-cutting case study and on synthetic random dynamic circuits (Fulginiti et al., 1 Jun 2026).
In the circuit-cutting case study, Qdislib’s gate-cutting procedure generates dynamic subcircuits with measurements and conditionals from three input circuits: GHZ-4, QAOA-6, and BV-7. The compared methods are Qiskit HoareOptimizer, QCP with 05, and BQCP with 06. Reported aggregated operation counts across all subcircuits are:
- GHZ-4: 1-qubit gates 07, 2-qubit gates 08, measurements 09, conditionals 10.
- QAOA-6: 1-qubit gates 11, 2-qubit gates 12, measurements 13, conditionals 14.
- BV-7: 1-qubit gates 15, 2-qubit gates 16, measurements 17, conditionals 18.
The format is HoareOptimizer / QCP / BQCP. The paper’s stated conclusion is that BQCP achieves the strongest reductions overall and is the only method among those compared that also removes measurements and conditionals (Fulginiti et al., 1 Jun 2026).
For random dynamic circuits, the authors extend Qiskit’s random circuit generator to produce circuits with random subsets of qubits measured, conditional blocks with up to 10 operations in then and optionally 10 in else, and random resets. The size parameter is
19
with 20 qubits, depth 21 excluding measurements and conditional contents, and 10 independent circuits per 22. They compare original circuits, QCP 23, and BQCP 24, and report that BQCP consistently outperforms QCP in total operation reduction across all tested circuit sizes (Fulginiti et al., 1 Jun 2026).
The paper also reports mean multi-qubit gate counts for QCP versus BQCP, shown with 25:
- 26: 2-qubit 27, 3-qubit 28, 4-qubit 29.
- 30: 2-qubit 31, 3-qubit 32, 4-qubit 33.
- 34: 2-qubit 35, 3-qubit 36, 4-qubit 37.
- 38: 2-qubit 39, 3-qubit 40, 4-qubit 41.
Again, the format is QCP / BQCP. This suggests that BQCP’s path-sensitive reasoning remains useful even under bounded branch tracking, although the paper also notes that highly entangled random circuits often quickly reduce the usefulness of larger 42, since the quantum information may become too imprecise to enable many more simplifications (Fulginiti et al., 1 Jun 2026).
The stated complexity is
43
time and
44
space, where 45 is the number of instructions, 46 the number of qubits, 47 the number of classical bits, and 48 the maximum guard size. If 49 and 50 are treated as constants, overall complexity is linear in program size: 51 time and
52
space. Runtime increases with circuit size and 53; moderate 54 values are reported to provide a good tradeoff (Fulginiti et al., 1 Jun 2026).
Relative to prior work, BQCP extends rather than replaces earlier hybrid constant propagation. "Automatic De-Quantization of Quantum Programs Using Constant Propagation" (Remme et al., 21 May 2026) formalized a hybrid machine state
55
over hybrid states 56, supported classically guarded unitary application, measurement into registers, reset, and semantics-preserving rewrites such as removing impossible controls, removing always-true controls, replacing qubit controls with classical controls, exploiting implications among controls, and deleting diagonal gates that contribute only a global phase. Its method was flow-sensitive over a sequential instruction list, but not path-sensitive in the compiler-analysis sense: measurement outcomes coexisted in one distribution, there was no explicit branch-local abstract environment, and no predicate domain or symbolic guard tracking. BQCP’s principal advance is therefore not merely hybridization, but explicit representation of different execution branches and branch-restricted propagation through conditionals (Remme et al., 21 May 2026).
The limitations stated by the BQCP paper are correspondingly specific. It handles if-then-else constructs, but not richer dynamic control flow like loops or function calls; probabilities are ignored; branch selection and reduction use a fixed deterministic order rather than an optimization-aware heuristic; branch precision is bounded by 57; and quantum precision is bounded by 58 and degrades when entanglement causes support growth beyond the tracked threshold (Fulginiti et al., 1 Jun 2026). These limitations define the current boundary of the method rather than a contradiction of its goals: BQCP is a branch-disjunctive, path-sensitive constant propagation pass for structured dynamic circuits, not a general analysis for arbitrary hybrid quantum-classical programs.