Quantum circuit equivalence checking
The verification that two circuit descriptions implement the same declared transformation or sufficiently close behavior.
On this page
Definition, purpose and input assumptions
Equivalence checking validates compilation or optimization by comparing semantics. The relevant notion may be exact unitary equality, equality up to global phase, channel equality or equality of selected output distributions. Choosing too weak a notion can miss a change that matters in the surrounding algorithm.
Mathematical mechanism
For unitary circuits U and V, exact equality up to global phase means U dagger V=exp(i alpha)I. Testing their action on every computational-basis vector can identify columns, but comparing only output probabilities loses relative phases between columns. Approximate checking needs a declared norm or operational error criterion.
Fully solved reference example
Take U=I and V=Z. On inputs |0> and |1>, both circuits have identical computational-basis measurement outcomes. Yet on |+>, U yields|+> and V yields|->; an X measurement distinguishes them perfectly. Basis-state probability checks therefore do not establish unitary equivalence.
For U=H and V=R_Y(pi/2)Z, direct multiplication gives identical matrices, so equality holds on every input by linearity. This algebraic proof is stronger than running a handful of samples. If one circuit contained measurements, a channel-level comparison would be needed instead.
Limitations and classical comparison
Dense unitary construction scales exponentially. Decision diagrams, tensor methods and structural cancellation can help on suitable circuits but have worst-case limitations. Hardware noise is outside an ideal equivalence proof unless explicitly included in the semantic model.
Scientific relationships
Equivalence checking verifies quantum circuit compilation and depends on phase conventions and output semantics. It is distinct from benchmarking hardware fidelity or merely checking sampled histograms.
Equivalence on a declared ancilla input space
Suppose a logical qubit uses one ancilla initialized to zero. Compare U1 = I on the two-qubit space with U2 = diag(1, -1, 1, i), using logical qubit first and ancilla second. Both act identically on every vector |psi> tensor |0>, because the relevant basis coordinates are 00 and 10. Both return the ancilla in zero. They are therefore equivalent under this clean-ancilla input contract even though their complete four-dimensional matrices are not equal up to global phase.
The distinction is an isometry restriction. If J maps a logical state to that state tensored with the prescribed ancilla, the relevant equality is U1 J = U2 J. Comparing full matrices would reject this valid restricted equivalence. Conversely, verifying only one logical input would be too weak, because the contract includes every superposition and any correlations with an external reference. The allowed input subspace must be specified before choosing the verification criterion.
Garbage can change the logical channel
Now consider an implementation that copies the computational-basis label to an ancilla through CNOT and then discards the ancilla. On input alpha|0> + beta|1>, the joint state is alpha|00> + beta|11>. Tracing out the ancilla removes the off-diagonal logical coherence, producing diag(|alpha| squared, |beta| squared). The induced logical channel is dephasing, not identity.
For input |+>, identity returns |+><+| while this channel returns I/2. Their trace distance is one half, and their X expectations are one and zero. Computational-basis probabilities agree on every input, so a checker restricted to those probabilities would miss the error. The ancilla is carrying information about the logical basis label; discarding it is a physical operation with observable consequences, not harmless workspace cleanup.
A channel-level reference uses an entangled input as well. Identity acting on half a Bell pair preserves its pure Bell density matrix. Dephasing produces an equal mixture of 00 and 11. Their trace-norm difference is one, again giving trace distance one half. This calculation exposes the missing coherence in a representation that includes a reference system, as required by stronger operational channel comparisons.
Approximate isometries and output guarantees
Let V and W be two isometries implementing the same logical input contract, with operator-norm difference at most epsilon. On every normalized pure input, including one entangled with an untouched reference, the output vector difference is at most epsilon. The trace distance between the corresponding pure output states is no larger than that vector difference. Discarding workspace cannot increase trace distance, so the same epsilon bounds the logical output-state distance.
This provides a useful sufficient guarantee without pretending that every simulation norm is interchangeable. A small average matrix error may fail to control the worst input. For example, take dimension d and compare identity with a diagonal unitary that changes only the first basis phase to minus one. Their operator-norm difference is two. Yet their Frobenius difference divided by sqrt(d) is 2/sqrt(d), becoming small as dimension grows.
The superposition of the first two basis states distinguishes those unitaries perfectly: it becomes the corresponding minus superposition under the phase flip. Thus a small normalized Frobenius residual can coexist with a maximally distinguishable input. At d = 1024, that residual is only 1/16. Reporting its value without its norm convention would obscure the operational limitation.
Global phase and structural verification
For two same-dimensional unitaries, the global phase minimizing Frobenius distance is determined by the phase of Tr(U dagger V), when that trace is nonzero. The minimized squared distance is 2d minus 2|Tr(U dagger V)|. This is a useful algebraic alignment, but it does not convert a Frobenius guarantee into an operator-norm guarantee or justify dropping a phase inside a coherently controlled subroutine.
Dense matrices give complete small-instance checks but grow exponentially. Structural cancellation, decision diagrams, and tensor contractions can certify larger cases when they exploit suitable redundancy. Numerical equality with a tolerance is different from exact symbolic equivalence, and randomized input tests give evidence under their sampling scheme rather than an automatic proof for all states. The chosen method should state which semantic relation and error guarantee it establishes.
Sources
Verification scope
Recorded source check ·
Full author paper indexed: 16 pages, 801 lines. Weighted diagrams, simulation, verification and representation limits inspected.
This is an author technical review and tool description, not the first decision-diagram proposal. Placeholder journal/DOI text in the PDF is not promoted to bibliographic metadata. New node counts use an explicitly specified independent representation convention.
Verification scope
Selected source text checked ·
Source anchors gate-decomposition conventions. New worked instances are independent mathematical constructions, not reported experiments.