Skip to main content
KetQat

Appearance

Theorem · advanced

Phase-polynomial form of CNOT+T circuits

A circuit of CNOT gates and powers of T maps each basis state |x> to |Lx> times a power of e^(iπ/4) given by a weighted sum of parities of x. Odd-weight parities each need a T gate, and minimising T-count over equivalent sums is a Reed–Muller decoding problem.

Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

(a) Normal form. Every such circuit CC satisfies, for all x∈F2nx \in \F_2^n,

C∣x⟩=ω p(x)∣Lx⟩,p(x)=∑a∈F2n∖{0}ca (a⋅x) mod 8,C \ket{x} = \omega^{\,p(x)} \ket{L x}, \qquad p(x) = \sum_{a \in \F_2^n \setminus \{0\}} c_a\, (a \cdot x) \bmod 8 ,

with LL an invertible n×nn \times n matrix over F2\F_2 and coefficients ca∈Z8c_a \in \Z_8.

(b) Counting odd terms. If CC contains tt gates TcT^{c} with cc odd, then the representation produced in (a) has at most tt parities with odd coefficient. Conversely, for any LL and any coefficients (ca)(c_a) with kk odd coefficients, there is a circuit of this form implementing ∣x⟩↦ωp(x)∣Lx⟩\ket{x} \mapsto \omega^{p(x)}\ket{Lx} that contains exactly kk gates TcT^{c} with cc odd.

(c) Non-uniqueness. Different coefficient vectors can define the same function p:F2n→Z8p : \F_2^n \to \Z_8; for example 4x1+4x2+4(x1⊕x2)≡0(mod8)4x_1 + 4x_2 + 4(x_1 \oplus x_2) \equiv 0 \pmod 8. Amy and Mosca proved that minimising the number of odd coefficients over representations of the same pp, and hence the T-count over CNOT+T circuits, is equivalent to minimum-distance decoding of the length-(2n−1)(2^n - 1) vector of odd coefficients in the punctured Reed–Muller code RM(n−4,n)∗\mathcal{RM}(n-4, n)^*. For n≤3n \le 3 that code contains only the zero word, so the number of odd coefficients is already minimal.

The representation is the basis of the T-par optimiser of Amy, Maslov and Mosca.

Holds when

  • The circuit acts on nn qubits and uses only CNOT and the diagonal gates Tc=diag⁡(1,ωc)T^{c} = \operatorname{diag}(1, \omega^{c}), ω=eiπ/4\omega = e^{i\pi/4}, c∈Z8c \in \Z_8 (so S=T2S = T^2, Z=T4Z = T^4); no ancillas or measurements.
  • A parity a⋅x=a1x1⊕⋯⊕anxna \cdot x = a_1 x_1 \oplus \cdots \oplus a_n x_n is read as the integer 0 or 1 when it appears in a phase.

Proof

Proof of the phase-polynomial formMachine-checked

(a) Invariant. After the first ss gates, claim that Cs∣x⟩=ωps(x)∣Lsx⟩C_s \ket{x} = \omega^{p_s(x)} \ket{L_s x} with LsL_s invertible over F2\F_2 and ps=∑aca(s)(a⋅x)p_s = \sum_a c^{(s)}_a (a \cdot x). Initially L0=IL_0 = I, p0=0p_0 = 0. Write ℓq\ell_q for row qq of LsL_s, so wire qq currently holds the parity ℓq⋅x\ell_q \cdot x; the rows are linearly independent and hence nonzero.

  • A CNOT with control qq and target rr replaces row rr by ℓr⊕ℓq\ell_r \oplus \ell_q. This is an invertible row operation, so Ls+1L_{s+1} is invertible; the phase is unchanged.
  • TcT^{c} on wire qq multiplies ∣Lsx⟩\ket{L_s x} by ωc (ℓq⋅x)\omega^{c\,(\ell_q \cdot x)}, so ps+1=ps+c (ℓq⋅x)p_{s+1} = p_s + c\,(\ell_q \cdot x), i.e. cℓq(s+1)=cℓq(s)+cc^{(s+1)}_{\ell_q} = c^{(s)}_{\ell_q} + c; LL is unchanged.

Induction over the gates gives (a), with the coefficients obtained by summing the powers applied whenever a wire carried each parity.

(b) Counting. By the construction in (a), the final coefficient cac_a is the sum of the powers cc of the gates applied while some wire carried parity aa. If cac_a is odd, at least one of those powers is odd. Distinct aa with odd cac_a therefore need distinct odd-power gates, so there are at most tt of them.

For the converse, let a(1),…,a(m)a^{(1)}, \dots, a^{(m)} be the parities with ca≠0c_a \ne 0, of which kk have odd coefficient. For each jj in turn: choose a wire qq such that a(j)a^{(j)} has a 1 in position qq; apply CNOTs from every other wire rr with ar(j)=1a^{(j)}_r = 1 onto qq, so wire qq holds a(j)⋅xa^{(j)} \cdot x; apply Tca(j)T^{c_{a^{(j)}}} to wire qq; then undo the CNOTs in reverse order. Each block contributes exactly ca(j)(a(j)⋅x)c_{a^{(j)}} (a^{(j)} \cdot x) to the phase and leaves the wires as they were. Finally apply a CNOT circuit implementing x↦Lxx \mapsto L x (any invertible matrix over F2\F_2 is a product of elementary row operations, each a CNOT, possibly after reordering wires, and a wire permutation is a product of SWAPs, each three CNOTs). The resulting circuit implements ∣x⟩↦ωp(x)∣Lx⟩\ket{x} \mapsto \omega^{p(x)} \ket{L x} with exactly one gate TcT^{c} for each nonzero cac_a, of which exactly kk have odd cc; the others are SS, ZZ or S†S\dagg, which are Clifford. This is the representation used by Amy, Maslov and Mosca.

Stated in
Mentioned in

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Matthew Amy, Dmitri Maslov, Michele Mosca (2014). Polynomial-time T-depth Optimization of Clifford+T circuits via Matroid Partitioning. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 33, 1476-1489. doi:10.1109/TCAD.2014.2341953arXiv:1303.2042
  2. Matthew Amy, Michele Mosca (2019). T-Count Optimization and Reed–Muller Codes. IEEE Transactions on Information Theory 65, 4771-4784. doi:10.1109/TIT.2019.2906374arXiv:1601.07363

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Normal form, odd-coefficient counting and its converse re-derived (parities prepared by CNOTs, one T^c per parity); the identity 4x1+4x2+4(x1 xor x2) = 0 mod 8 checked algebraically; Reed-Muller equivalence with RM(n-4,n)* of length 2^n - 1 compared with the Amy-Mosca abstract (arXiv:1601.07363); RM of negative order is the zero code for n <= 3. T-par attribution matches Amy-Maslov-Mosca arXiv:1303.2042 metadata.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 65b5558d4653ce27. Source file knowledge/records/theorem/phase-polynomial-form.md in the content repository (readable there once it is public).