Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Parity networks

CNOT networks that compute specified binary parities as intermediate or final wire values.

Edition released Coverage: Overview · Technical
On this page

Definition, purpose and input assumptions

A parity network transforms computational-basis bit labels through invertible linear algebra over the binary field. Each CNOT adds one wire into another modulo two. Such networks support phase gadgets, parity measurements and reversible data transformations. They preserve arbitrary coherent superpositions by linear extension.

Mathematical mechanism

Represent the current wire values as y=Mx over GF(2). Initially M=I. A CNOT with control c and target t adds row c into row t. Since that row operation is invertible, every CNOT network represents an invertible binary matrix. The corresponding quantum operation permutes basis amplitudes without directly adding phases.

Fully solved reference example

For three input bits x0,x1,x2, apply CNOT0->2 then CNOT1->2. The wire values become y0=x0, y1=x1, y2=x0 XOR x1 XOR x2. The matrix is [[1,0,0],[0,1,0],[1,1,1]]. Applying the same two CNOTs in reverse order restores x2, because each added parity is removed.

For input 101, the final values are 100 since 1 XOR 0 XOR 1=0. For superposition (|000>+|101>)/sqrt(2), the output is (|000>+|100>)/sqrt(2). The mapping is coherent; it has not measured or learned the input parity.

Limitations and classical comparison

Not every Boolean function is linear over GF(2); AND requires additional reversible nonlinear logic such as Toffoli. An invertible matrix description also excludes erasing an input wire without preserving information. Routing can substantially increase the physical cost of the same algebraic map.

Scientific relationships

Parity networks implement phase-polynomial circuits and are distinct from nonlinear reversible arithmetic. Controlled-X supplies their elementary row operations; uncomputation restores temporary parity wires.

Synthesizing a specified binary linear map

Let the input bits be the column vector x=(x0,x1,x2)^T, and prescribe y=Mx over the binary field, where M has rows (1,1,0), (0,1,1), and (1,1,1). The required outputs are y0=x0 XOR x1, y1=x1 XOR x2, and y2=x0 XOR x1 XOR x2. A CNOT from wire i to wire j adds row i into row j of the current linear map. This permits synthesis through Gaussian elimination using only reversible row operations.

To reduce M to identity, first add row zero into row two, leaving row two equal to (0,0,1). Add that new row two into row one, producing (0,1,0). Finally add row one into row zero, producing (1,0,0). Reversing these self-inverse row operations gives the circuit from identity to M: CNOT 1→0, CNOT 2→1, and CNOT 0→2. Tracking the wires confirms the result. After the first step they contain x0 XOR x1, x1, x2; after the second, x0 XOR x1, x1 XOR x2, x2; after the third, the prescribed outputs.

For input x=101, the output is 110. Solving the equations backward gives x0=y1 XOR y2, x1=y0 XOR y1 XOR y2, and x2=y0 XOR y2. Thus M^{-1} has rows (0,1,1), (1,1,1), and (1,0,1). Substituting y=110 recovers 101. These calculations verify both the forward map and the reversible decoding; they also establish that the matrix is invertible without relying on a real-valued determinant calculation.

Coherent action and Pauli propagation

The quantum circuit U_M acts as U_M|x>=|Mx>. Since an invertible binary matrix permutes all basis labels, this is a unitary operation. It preserves arbitrary superpositions and their phases, not only classical bit strings. For example, |+00> becomes (|000>+|101>)/√2. The original input is a product state, while the output entangles q0 and q2. Classical linearity of the bit map therefore does not imply that the corresponding quantum operation preserves product states.

Pauli propagation supplies another exact description. Write X^a for a product of X operators with binary support a, and Z^b for the analogous Z product. Directly applying the operators to basis states gives U_M X^a U_M†=X^{Ma} and U_M Z^b U_M†=Z^{M^{-T}b}. The inverse transpose in the second identity is forced by the requirement that the phase b·x be expressed in output coordinates. Using M rather than its inverse transpose for Z operators would generally give the wrong observable.

For the present matrix, X0 becomes X0X2 because column zero of M is (1,0,1). Z0 becomes Z1Z2 because column zero of M^{-T}, equivalently row zero of M^{-1}, is (0,1,1). These transformed operators still anticommute: X0X2 and Z1Z2 overlap with different Pauli axes on exactly one wire. This preserves the original anticommutation of X0 and Z0 and provides a structural consistency check beyond truth-table evaluation.

Connectivity, parity phases, and a contrasting nonlinear map

The three-CNOT circuit assumes the interaction 0→2 is directly available. On a line with edges 0–1 and 1–2, a remote CNOT can instead use the chronological sequence CNOT 0→1, CNOT 1→2, CNOT 0→1, CNOT 1→2. If the intermediate values are a,b,c, this sequence returns the middle wire to b and changes the last wire to c XOR a. It needs no initialized intermediary. Replacing only the remote operation produces a six-CNOT implementation before any whole-circuit simplification. The count is an upper bound for this routing choice, not an optimality statement for the complete linear transformation.

If a phase P(α) is inserted while a wire contains a parity, then the circuit no longer implements only a binary linear map. Computing a parity, phasing it, and uncomputing leaves a diagonal phase polynomial. The matrix M still describes the bit labels, but a second data structure is needed for accumulated phases. For example, phasing the final y2 wire before applying U_M† produces e^{iα(x0 XOR x1 XOR x2)} on the original basis state. That function can entangle states even though the final binary map is identity.

In contrast, the transformation that changes x2 by x0x1 is not representable by any three-by-three binary matrix. It fails additivity: applying it to 100 and 010 separately produces no target change, whereas applying it to their binary sum 110 flips the target. Such a map needs a nonlinear reversible primitive or a phase-and-basis-change construction. This test separates the algebraic capabilities of CNOT networks from general reversible circuits.

Sources

  • A. Barenco et al. · · Research paper · Publication status unspecified · arXiv · DOI 10.1103/PhysRevA.52.3457
    Verification scope

    Selected source text checked ·

    Source anchors gate-decomposition conventions. New worked instances are independent mathematical constructions, not reported experiments.