Papers
Topics
Authors
Recent
Search
2000 character limit reached

Branch-Aware Quantum Constant Propagation for Dynamic Quantum Circuits

Published 1 Jun 2026 in quant-ph and cs.ET | (2606.02018v1)

Abstract: Compile-time optimization is important for improving the efficiency and reliability of quantum circuits on current noisy hardware. While many existing methods simplify circuits using structural patterns or quantum-state information, most of them target only unitary circuits and do not support dynamic circuits with mid-circuit measurements and classical feedforward. In this work, we present Branch-Aware Quantum Constant Propagation (BQCP), a compile-time analysis for dynamic circuits. BQCP 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. This enables path-sensitive reasoning inside conditional blocks and more precise information propagation than QCP. To keep the analysis scalable, we bound both the size of the quantum-state representation and the number of tracked branches. Using the information inferred by the analysis, we apply semantics-preserving simplifications to circuit operations. We prove the soundness of both the analysis and the simplifications. Experimental results on both application-driven and synthetic benchmarks show that, on dynamic circuits, our method consistently achieves larger reductions than other existing passes including QCP.

Summary

  • The paper introduces BQCP, a compile-time pass that generalizes constant propagation to handle mid-circuit measurements and classical controls in dynamic quantum circuits.
  • It employs an abstract state representation with branch splitting and merging to conservatively track multiple execution paths while ensuring a bounded computational complexity.
  • Experimental results demonstrate significant reductions in gate and operation counts, improving mapping, routing, and overall circuit reliability for noise-sensitive applications.

Branch-Aware Quantum Constant Propagation for Dynamic Quantum Circuits

Problem Statement and Context

Dynamic quantum circuits, which interleave unitary operations with mid-circuit measurements, resets, and classical control flow, are intrinsic to advanced quantum computing protocols, including quantum error correction, qubit reuse, and circuit cutting. The increasing support for such features in hardware and quantum programming languages (e.g., OpenQASM 3, Cirq) accentuates the need for compile-time optimization passes that can efficiently handle the hybrid classical–quantum control flow inherent in dynamic circuits.

Current static analysis and optimization techniques, such as Quantum Constant Propagation (QCP) [qcp], are predominantly designed for unitary circuits and lack expressivity to reason about the path-sensitive classical–quantum correlations and dynamic branches introduced by mid-circuit measurements and classical controls. This limits the achievable simplifications, resulting in unnecessarily complex circuits that are ill-suited for execution on error-prone, resource-constrained quantum hardware.

Branch-Aware Quantum Constant Propagation (BQCP): Approach

The paper introduces Branch-Aware Quantum Constant Propagation (BQCP), a compile-time pass that generalizes classical constant propagation to the mixed classical–quantum semantics required by dynamic circuits.

Abstract State Representation

BQCP models the program state as a finite set of abstract execution branches, each pairing an abstract quantum state (modeled as in QCP by entanglement groupings and a sparse support over computational basis for each group, up to a configurable support bound nmaxn_{\max}) with an abstract classical state (bitwise constant/unknown lattice per classical bit). The overall state is an over-approximation of the reachable (classical, quantum) pairs after any instruction point. The number of explicit execution branches is bounded by bmaxb_{\max}, ensuring polynomial complexity.

Transfer Semantics

  • Unitary Gates: Operations apply QCP transfer functions branch-wise, modifying only the quantum state.
  • Measurements: If the measured qubit is in a basis state, the classical result is determined and the quantum remains unchanged. If not, the branch splits (up to bmaxb_{\max}) to conservatively track both possible outcomes with the corresponding post-measurement quantum state (including refined entanglement).
  • Resets: The entanglement structure is partitioned, the reset qubit is set to 0\ket{0}, and quantum information for non-singleton groups is dropped.
  • Conditionals: The set of branches is partitioned according to the three-valued logic evaluation of the predicate; then and else blocks are analyzed independently under their input branch subsets. At join points, branches are conservatively merged to maintain the bmaxb_{\max} bound.

Optimization Rules

BQCP enables several semantics-preserving optimizations not feasible in QCP or assertion-based passes:

  • Branch-aware control reduction: Controlled gates with unsatisfiable or constant controls can be removed exactly when the control condition is unreachable or constant in all branches.
  • Redundant operation elimination: If measurements, resets, or unitaries provably leave the global classical–quantum state invariant across all branches, they are omitted.
  • Conditional simplifications: Conditionals with statically determined outcomes are eliminated; block-local optimizations inside branches are enabled by the maintenance of path-specific constants.

All rewrites are proven to preserve the concrete classical–quantum semantics, under a formal over-approximate abstract interpretation framework.

Theoretical Analysis

The soundness of BQCP is established by showing that for all programs PP, the set of concrete (classical, quantum) states reachable at every program location is contained in the set over-approximated by the abstract propagation, irrespective of nmaxn_{\max} or bmaxb_{\max}. All simplification transformations applied at the IR level are semantics-preserving due to this over-approximation property.

The analysis operates in O(bmaxg(n+m+))O(b_{\max} \cdot g \cdot (n+m+\ell)) time for a gg-instruction circuit over bmaxb_{\max}0 qubits and bmaxb_{\max}1 classical bits with control logic of size bmaxb_{\max}2, assuming bmaxb_{\max}3 and bmaxb_{\max}4 are constant.

Experimental Results

Application to Circuit Cutting

The methodology was tested on circuits arising from gate-cutting algorithms, which generate subcircuits laden with measurements, resets, and classical controls [gate_cutting_alg_qdislib]. BQCP outperforms both Qiskit's HoareOptimizer (assertion-based) and QCP in reducing all classes of operations, including conditionals and measurements—crucially, optimizations unique to dynamic circuits and not accessible to QCP or assertion-based approaches.

For instance, in GHZ and QAOA instances, BQCP reduced the total operation count notably, eliminating all redundant gates, measurements, and control structures that standard passes leave intact.

Random Dynamic Circuits

On large, randomly-generated dynamic quantum circuits, BQCP shows consistently greater reductions in all gate classes (n-qubit gates, measurement, resets, and conditionals) compared to QCP, across all tested circuit scales. Crucially, the reduction in multi-qubit gate count is substantial, improving subsequent mapping and decomposition [routing_1, rosa2025quantumgatedecompositionstudy]. The analysis further demonstrates that a moderate value of bmaxb_{\max}5 achieves most of the benefit with manageable compute cost, as demonstrated by the runtime scaling results.

Implications and Future Directions

The introduction of BQCP establishes a formal, scalable, and path-sensitive framework for quantum circuit optimization, addressing the full classical–quantum semantics of modern quantum programming. This unlocks semantically justified, aggressive reductions in dynamic circuits that were previously unattainable, directly translating to lower-depth and more reliable circuits for NISQ platforms.

Practical implications include:

  • Enhanced optimization of quantum compilation pipelines for noise-sensitive applications, e.g., error correction and large-scale simulation via circuit cutting.
  • Improved downstream performance of mapping, routing, and gate-synthesis passes due to the removal of redundant dynamic operations.

Theoretically, BQCP suggests multiple extensions:

  1. Generalization to support loop constructs and recursive function calls.
  2. Heuristic strategies for branch merging to optimize the precision/complexity trade-off beyond naive merges.
  3. Integration into quantum compiler toolchains to quantify actual fidelity improvements on hardware.

Conclusion

Branch-Aware Quantum Constant Propagation (BQCP) bridges a significant gap in the static analysis and optimization of dynamic quantum circuits by providing a bounded, formal, and efficiently computable means to propagate and exploit classical–quantum correlations and path-dependent information. The technique dominates existing passes on all key axes—type of supported operations, achievable simplifications, and total gate reductions—and opens clear paths for further compiler and programming language advances in the quantum software stack.

Reference: "Branch-Aware Quantum Constant Propagation for Dynamic Quantum Circuits" (2606.02018).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

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

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 2 tweets with 4 likes about this paper.