Abstract
Equivalence checking of quantum circuits is an essential element in quantum program compilation, in which a quantum program can be synthesized into different quantum circuits that may vary in the number of qubits, initialization requirements, and output states. Verifying the equivalences among the implementation variants requires proper generality. Although different notions of quantum circuit equivalence have been defined, prior methods cannot check observational equivalence between two quantum circuits whose qubits are partially initialized, which is referred to as partial equivalence. In this work, we prove a necessary and sufficient condition for two circuits to be partially equivalent. Based on the condition, we devise algorithms for checking quantum circuits whose partial equivalence cannot be verified by prior approaches. Experiment results confirm the generality and demonstrate the efficiency and effectiveness of our method. Our result may unleash the optimization power of quantum program compilation to take more aggressive steps.
Introduction
In classical computing, circuit equivalence is typically determined by comparing truth tables. Quantum computing presents a more complex challenge. Standard "total equivalence" requires two circuits to produce identical quantum states up to a global phase. However, this definition is often too restrictive for practical quantum compilation. Compilers frequently introduce ancilla (extra) qubits, vary the number of measured qubits, or produce "garbage" outputs that do not affect the final result.
While previous notions like m-equivalence or q-equivalence addressed specific scenarios, they lacked a unified theoretical foundation. This paper introduces partial equivalence, or observational equivalence: two circuits are equivalent if they yield the same measurement probability distributions for any valid input state, regardless of internal state differences or qubit counts.
Theoretical Framework and Methods
The core of this work is a mathematical characterization of partial equivalence based on the probability $P(t|\psi, C)$ of observing an outcome $t$ given an input state $\psi$ and circuit $C$.
Formal Characterization
The authors define a general circuit structure involving $d$ data qubits, $k$ ancilla qubits, and $m$ measured qubits.
The primary theoretical contribution is Theorem 1, which provides a necessary and sufficient condition for partial equivalence. It states that two circuits are partially equivalent if and only if specific inner products of their unitary sub-matrices are identical. This condition effectively isolates the "observable" components of the quantum state, ignoring parts that do not influence the final measurement.
BDD-based Algorithms
To manage the exponential state space of quantum circuits, the authors employ Reduced Ordered Binary Decision Diagrams (ROBDDs) alongside a bit-sliced algebraic representation for complex numbers.
- Algorithm 1 & 2 (PEC): These general-purpose algorithms utilize matrix manipulation to verify the partial equivalence condition.
- Algorithm 3 (Zero-Ancilla): A specialized, high-efficiency variant for circuits without extra ancilla qubits. It simplifies the verification process to a single merged circuit comparison ($C_1 C_2^{-1}$).
Key Insights: A Unified Theory
A critical insight of this research is that measurement is non-linear; checking basis states is insufficient to guarantee equivalence for all possible superpositions. Instead, the focus must be on the geometric relationships (inner products) of sub-matrix slices.
As shown in the diagram above, partial equivalence serves as a "super-set" that subsumes existing definitions, including total equivalence, functional equivalence of reversible circuits, and m/q-equivalence, into a single, comprehensive framework.
Experimental Evaluation
The proposed methods were evaluated across several benchmarks including period-finding oracles, random Clifford+T circuits, and Grover search instances.
Key Results
- Generality: The tool successfully verified period-finding circuits that were previously unverifiable by state-of-the-art tools like SliQEC due to lack of total equivalence.
- Scalability: The Zero-Ancilla algorithm (Algorithm 3) verified circuits with 100 qubits in under 300 seconds.
- Efficiency: The general algorithm (Algorithm 2) handled up to 20 qubits with ancilla. While more computationally intensive, it is currently the only method capable of this specific verification.
- Low Overhead: For circuits that are totally equivalent, the new algorithm's performance is comparable to specialized total-equivalence checkers.
Discussion and Future Directions
While the current framework is powerful, the computational cost of handling ancilla qubits in the general case remains a challenge as the BDD size grows. Future work may explore "approximate partial equivalence" to accommodate noise in Noisy Intermediate-Scale Quantum (NISQ) devices. Integrating this checker into quantum compilers could enable more aggressive, verifiable optimizations, significantly improving the efficiency of synthesized quantum programs.
Summary updated