Phase-polynomial circuit representation
An algebraic description of diagonal phase functions composed with reversible binary-linear transformations.
On this page
Definition, purpose and input assumptions
Circuits made from CNOT gates and diagonal phase rotations can often be described through binary parities and their associated angles. This representation makes some cancellations and sharing opportunities visible without expanding a full 2^n by 2^n matrix. It applies to a restricted circuit structure, not arbitrary quantum dynamics without transformation.
Mathematical mechanism
A parity function is p_S(x)=XOR_(j in S) x_j. Applying a phase exp(i theta p_S(x)) means computing that parity into a selected wire or ancilla, applying a phase gate, then undoing the parity computation. A sum of such phase contributions becomes a product of commuting diagonal operators.
Modulo-two arithmetic belongs inside the parity, while phase angles add as ordinary real numbers modulo 2pi. Confusing these two arithmetic systems produces incorrect simplifications.
Fully solved reference example
On two bits, compute parity into the second wire with CNOT, apply P(theta)=diag(1,exp(i theta)) to it, and apply CNOT again. The diagonal action in order 00,01,10,11 is (1,exp(i theta),exp(i theta),1), because the odd-parity strings acquire phase. This equals exp(i theta/2)exp(-i theta ZZ/2).
For theta=pi, the diagonal is (1,-1,-1,1)=ZZ, which factorizes into local Z gates. For theta=pi/2, it can entangle |++>. Thus a parity-controlled phase is not automatically nonlocal in every angle specialization. The algebra identifies an exact simplification at pi.
Limitations and classical comparison
A shorter symbolic phase expression need not produce a lower-depth circuit on a limited-connectivity device. Computing shared parities can save gates but extend lifetimes of intermediate information. Classical optimization over representations must preserve phase exactly when controlled contexts require it.
Scientific relationships
Phase-polynomial representations are used in quantum circuit compilation and parity networks. They depend on controlled-X and phase gates and explain how some Pauli-string rotations are implemented.
Deriving a seven-term phase polynomial for CCZ
For Boolean values a,b,c interpreted as integers zero or one, the identity 4abc=a+b+c-(a XOR b)-(a XOR c)-(b XOR c)+(a XOR b XOR c) holds over the integers. It can be obtained by substituting a XOR b=a+b-2ab and expanding the three-bit parity. Terms linear and quadratic in the bits cancel, leaving 4abc. Multiplying by π/4 converts the right-hand side into a collection of parity-dependent phases whose combined phase is πabc.
The corresponding diagonal unitary is CCZ: it multiplies |111> by -1 and leaves all other computational basis vectors unchanged. A positive unit coefficient in the phase polynomial is a T phase on the indicated parity; a negative coefficient is a T† phase. There are four positive terms, on a,b,c,a XOR b XOR c, and three negative terms, on the pairwise parities. This derivation determines the signs, which are essential: seven unsigned T phases implement a different diagonal operation.
The integer identity can also be checked by Hamming weight. Weight zero gives exponent zero. Weight one gives one positive singleton, two negative pair parities, and one positive triple parity, again totaling zero. Weight two gives two positive singletons and two negative pair parities, totaling zero. Weight three gives three positive singletons, zero pair parities, and one positive triple parity, totaling four. Thus every basis phase is accounted for without assuming symmetry in an unverified circuit.
A complete parity-computation network
Start with T on each of the three wires. Then perform, in chronological order: CNOT b→c; T† on c; CNOT a→c; T on c; CNOT b→c; T† on c; CNOT a→c; CNOT a→b; T† on b; CNOT a→b. During the first target-wire sequence, c stores b XOR c, then a XOR b XOR c, then a XOR c, and finally its original value. During the last two CNOTs, b stores a XOR b and is then restored.
All three output bits equal their input values. The accumulated phases are exactly the seven terms in the identity, so the full unitary is CCZ rather than merely a circuit with matching final bitstrings. The construction uses six CNOTs, four T gates, and three T† gates, with no additional qubit. The first three T operations act on different wires and can share a logical layer, but the subsequent parity dependencies constrain the schedule. A non-Clifford count alone does not specify total depth or device duration.
As an explicit basis path, start from abc=110. The initial T phases contribute exponent two in units of π/4. The first stored pair parity b XOR c is one and subtracts one. The triple parity is zero and contributes nothing. The next stored pair parity a XOR c is one and subtracts one. The final pair parity a XOR b is zero. The total exponent is zero, and the restored basis state is |110>. For |111>, only the three singleton terms and the triple term contribute, producing exponent four and phase -1.
From a diagonal gate to a nonlinear reversible map
Conjugating the target wire of CCZ by H gives a Toffoli operation because HZH=X. The resulting computational-basis map is |a,b,c>→|a,b,c XOR ab>. The middle diagonal representation involves only phases of linear Boolean parities, whereas the final reversible bit map contains the nonlinear product ab. The basis change is responsible for translating phase interference into that nonlinear update. A CNOT-only circuit cannot perform the same transformation because it preserves linearity over binary variables.
The phase polynomial is specified modulo eight when its units are π/4: adding eight times any integer-valued function changes each phase by an integer multiple of 2π. This modular freedom creates algebraic identities between different parity lists. It does not permit dropping arbitrary terms whose parity values happen to agree on one input. A circuit intended for an arbitrary superposition must preserve the phase function on every allowed basis component.
A coefficient four on a parity has a simpler form. Since (-1)^{a XOR b}=(-1)^a(-1)^b, a π phase on a XOR b equals the product of local Z phases on a and b. The corresponding parity-compute and uncompute network can then be replaced by those local operations. Coefficients one or two behave differently: the phase e^{iπ(a XOR b)/4} cannot generally be replaced by the product of the corresponding singleton phases without adding a correction for the overlap term.
Sources
Verification scope
Selected source text checked ·
Source anchors gate-decomposition conventions. New worked instances are independent mathematical constructions, not reported experiments.