Papers
Topics
Authors
Recent
Search
2000 character limit reached

Branch-Aware Quantum Constant Propagation

Updated 5 July 2026
  • 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

Q={q0,,qn1},Q=\{q_0,\dots,q_{n-1}\},

and a classical register

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.

Instructions include unitary gates UU, measurements MqjciM_{q_j \to c_i}, resets RqjR_{q_j}, and conditionals of the form

if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,

where PtP_t and PfP_f are instruction sequences and φ\varphi is a guard over classical bits (Fulginiti et al., 1 Jun 2026).

The concrete semantics is formulated over the Hilbert space

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},

with C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.0 denoting the set of density operators over C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.1. At a program point, the concrete state is not a single valuation but a finite set of classical–quantum branches: C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.2 A branch C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.3 means that the classical register has value C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.4 and the quantum register is in density state C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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: C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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 C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.7 by C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.8. For conditional blocks,

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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

UU0

where UU1 means definitely 0, UU2 means definitely 1, and UU3 means unknown. The order is

UU4

with UU5 and UU6 incomparable. For the full classical register,

UU7

An abstract classical state is written UU8, with bitwise update notation UU9 (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 MqjciM_{q_j \to c_i}0 of MqjciM_{q_j \to c_i}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 MqjciM_{q_j \to c_i}2, the concrete pure state is represented sparsely as a partial map from basis strings to amplitudes, bounded by a threshold MqjciM_{q_j \to c_i}3 on support size. Formally,

MqjciM_{q_j \to c_i}4

Then

MqjciM_{q_j \to c_i}5

If applying an operation would increase the number of nonzero amplitudes beyond MqjciM_{q_j \to c_i}6, the group becomes untracked (Fulginiti et al., 1 Jun 2026).

A single abstract branch is a pair

MqjciM_{q_j \to c_i}7

The full abstract state is a finite set of such branches: MqjciM_{q_j \to c_i}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 MqjciM_{q_j \to c_i}9 limits support size per entanglement group, and the branch bound RqjR_{q_j}0 limits how many branches are represented explicitly: RqjR_{q_j}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 RqjR_{q_j}2 and branch imprecision to RqjR_{q_j}3 (Fulginiti et al., 1 Jun 2026).

4. Transfer functions, guard evaluation, and branch management

Guard evaluation uses three-valued logic

RqjR_{q_j}4

with abstract evaluation function

RqjR_{q_j}5

For a classical bit RqjR_{q_j}6,

RqjR_{q_j}7

Negation and Boolean connectives are interpreted compositionally over RqjR_{q_j}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 RqjR_{q_j}9, the classical state is unchanged, and the quantum abstraction is updated branchwise using the QCP transformer if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,0: if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,1 Measurements are the crucial extension. If the measured qubit is a tracked singleton group if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,2 in an exact basis state if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,3, the measurement is deterministic and only the classical bit is updated. Otherwise, the analysis may generate two successor branches, one for each outcome if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,4, updating the classical state, setting the singleton measured qubit to if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,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: if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,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 if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,7 is already a singleton group, its abstract state is overwritten with if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,8, representing if (φ) then Pt else Pf,\mathbf{if}\ (\varphi)\ \mathbf{then}\ P_t\ \mathbf{else}\ P_f,9. If it belongs to a larger entangled group, reset breaks entanglement, places PtP_t0 in its own singleton group set to PtP_t1, 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: PtP_t2

PtP_t3

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 PtP_t4 that repeatedly merges branches until at most PtP_t5 remain (Fulginiti et al., 1 Jun 2026).

For branches

PtP_t6

their merge is

PtP_t7

The classical part uses bitwise join,

PtP_t8

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 PtP_t9 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 PfP_f0, 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 PfP_f1 act on qubits PfP_f2. For each branch,

PfP_f3

let

PfP_f4

A sufficient condition for PfP_f5 to be redundant under PfP_f6 is: PfP_f7 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 PfP_f8 is removed if, in every branch, PfP_f9 is a singleton group and its state is exactly φ\varphi0, representing φ\varphi1. Measurement φ\varphi2 is removed if, in every branch, φ\varphi3 is a singleton group, φ\varphi4 is exactly φ\varphi5 for some φ\varphi6, and φ\varphi7. 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 φ\varphi8 and φ\varphi9, if

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},0

the conditional is replaced by HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},1; if

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},2

it is replaced by HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},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 HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},4 are

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},5

For a quantum abstract state HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},6,

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},7

where

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},8

A single abstract branch represents

HQ=(C2)n,\mathcal{H}_Q = (\mathbb{C}^2)^{\otimes n},9

and an abstract state represents

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.00

The representation relation is

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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: C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.02 It also gives a soundness criterion for rewrites: C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.03 for every concrete C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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 C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.05, and BQCP with C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.06. Reported aggregated operation counts across all subcircuits are:

  • GHZ-4: 1-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.07, 2-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.08, measurements C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.09, conditionals C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.10.
  • QAOA-6: 1-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.11, 2-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.12, measurements C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.13, conditionals C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.14.
  • BV-7: 1-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.15, 2-qubit gates C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.16, measurements C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.17, conditionals C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.19

with C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.20 qubits, depth C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.21 excluding measurements and conditional contents, and 10 independent circuits per C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.22. They compare original circuits, QCP C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.23, and BQCP C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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 C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.25:

  • C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.26: 2-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.27, 3-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.28, 4-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.29.
  • C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.30: 2-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.31, 3-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.32, 4-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.33.
  • C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.34: 2-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.35, 3-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.36, 4-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.37.
  • C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.38: 2-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.39, 3-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.40, 4-qubit C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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 C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.42, since the quantum information may become too imprecise to enable many more simplifications (Fulginiti et al., 1 Jun 2026).

The stated complexity is

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.43

time and

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.44

space, where C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.45 is the number of instructions, C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.46 the number of qubits, C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.47 the number of classical bits, and C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.48 the maximum guard size. If C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.49 and C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.50 are treated as constants, overall complexity is linear in program size: C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.51 time and

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.52

space. Runtime increases with circuit size and C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.53; moderate C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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

C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.55

over hybrid states C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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 C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.57; and quantum precision is bounded by C={c0,,cm1}.C=\{c_0,\dots,c_{m-1}\}.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.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Branch-Aware Quantum Constant Propagation (BQCP).