From two XORs to an exact worst-case gate count
Suppose a quantum operation changes the phase of each binary input and treats every input just like its bitwise complement. How many controlled bit flips must a circuit use? Haobo Ma and Wenlin Zhang exhibit a specific difficult target and prove that on quantum wires some targets require at least
CNOT gates. X. Huang, T. Kosugi, H. Nishi and Y.-i. Matsushita had already given a construction with this count for every target in the class in 2024. Together the results determine the exact worst-case count, settling their Section 6 conjecture. The crucial cost is not just producing useful intermediate values: the circuit must also restore the original bit labels.
This reading explains version 4 of the paper. We start with two bits, then follow the proof through forcing labels, creating them, and returning the wires. The next chapter contains the precise statements and complete argument.
What is a phase, and why build a circuit?
Start with the four ordinary two-bit inputs . A quantum state assigns a complex amplitude to each input. Picture its phase as the direction of an arrow in the plane. Multiplication by turns the arrow through a quarter circle. A diagonal operation does not exchange and : it multiplies each input’s amplitude by a prescribed phase. Relative turns can affect subsequent interference, so these phases matter.
The paper’s target is simple: multiply the all-zero and all-one inputs by , and every other input by . For two bits its table is
| Input | Phase |
|---|---|
Complementing every bit exchanges with , and with , leaving the table unchanged. This is reflection symmetry here; it does not refer to rotating an object in space.
We have two tools. A CNOT preserves its control bit and changes its target bit to . The symbol means exclusive-or: equal bits give zero and different bits give one. A single-wire rotation multiplies zero by and one by . Angles are arbitrary real numbers; the cost counts CNOTs alone.
Implementation must be exact, allowing a common overall phase for all inputs. There are no extra qubits, measurements, approximations or other gates. Any two distinct wires can interact. Changing these rules changes the optimization problem.
Two bits: compute XOR, use it, and undo it
Use the first bit to control the second, so the second wire holds . Apply there, then repeat the same CNOT to restore . Equal inputs have XOR zero and receive ; unequal inputs receive . These are precisely the table’s entries multiplied by the common factor . Two CNOTs suffice, and the lower bound is exactly two.
The second CNOT matters. Leaving the XOR on the wire would change the input string, violating the diagonal target. On more wires, restoration still has a cost, but explaining that cost requires more careful counting.
Each wire carries a label
Write the bit on each wire as the XOR of a subset of the original inputs. For example, label means , and means . Four wires start with labels .
A CNOT replaces its target label by the XOR of target and control labels. A rotation changes phase without changing a label. A label is even or odd according to its number of ones. Initially every label is odd. Since CNOT is reversible, the labels always describe an invertible binary linear transformation, so none is zero. A diagonal target forces the final labels back to their original unit labels.
Which labels must appear when a rotation is applied?
A phase ratio forces every nonzero even label
Fix a nonzero label . Split the input strings by , meaning the XOR of the selected bits. Multiply the target phases with XOR zero and divide by the product of phases with XOR one. Call this ratio .
The ratio detects a chosen label. An overall phase occurs equally often above and below the fraction, so it cancels. A rotation using a different nonzero label also cancels: pair inputs with the same parity and opposite parity. The next chapter proves the cancellation lemma by constructing this pairing.
For the difficult target and any nonzero even , both the all-zero and all-one strings have parity zero. They contribute to the numerator; every other phase is one. If the circuit never rotates on label , every factor cancels and the ratio must instead be one. Contradiction! Thus every nonzero even label must occur on a rotated wire.
We multiply and divide complex numbers directly, without choosing real angles for their phases. Adding whole turns to an angle cannot evade this argument.
Why is there an extra linear term?
Put . There are even labels: choose the first bits freely, and the last bit is determined by parity. Removing zero leaves labels. None is present initially, so its first appearance must be a CNOT output. A CNOT creates just one target label. This gives at least that many even-output gates.
Call an odd-target, odd-control update a birth: it produces an even target. Every even label ever produced is an XOR combination of birth outputs. An even-plus-even update stays among these combinations; odd-plus-odd introduces a birth; a mixed update produces an odd label. Why independent directions? For each with , flip coordinate together with the last coordinate. XOR combinations of these even labels produce every even label. Looking at the first coordinates uniquely determines which flips were used. Thus there are independent directions, requiring at least births.
Now count the even labels currently on wires. A birth increases the count by one. An even-target, odd-control update decreases it by one; call this a return. The other two types leave it unchanged. The count starts and ends at zero, so returns equal births and number at least . Returns have odd outputs, separate from the even-output gates already counted. Hence
On four wires the six weight-two labels and make seven required nonzero even labels. At least three returns bring the total to ten. Counting just the six pairwise relations misses the four-bit label that this target also forces.
The short film connects the phase ratio, label creation and return count.
Why does visiting every even label leave a further restoration cost? English narration with aligned Chinese and English subtitles.
What does the answer tell us?
Huang and colleagues supply the upper bound, and the present paper supplies a target meeting it from below. Thus the largest, over targets, of the minimum circuit counts is exactly the formula. Individual targets can be easy: the identity needs zero gates. Optimal depth is a separate question, since disjoint gates may run in parallel.
Replacing by gives the full complement-symmetric class’s exact worst-case count on wires. Huang and colleagues’ radial interaction-potential family obeys additional restrictions. The difficult target has not been shown to belong to that narrower physical family, so this argument does not establish its matching lower bound.
Evidence and sources distinguish the existential lower bound stated by the public Lean theorem, the explicit target used inside its proof, and the public interfaces or upper-bound formalization still needed. Small finite searches are also separated from the all-parameter proof.
The academic presentation follows the same argument, with full speaker notes.
Precise statements and complete argument
Objects and allowed circuits
Let with XOR as addition. Index computational basis states by . Write for the all-one vector and . The dot product is computed in . Write for the number of ones.
For a real function , set . Reflection symmetry means . A circuit is a finite sequence on exactly wires, using CNOTs with distinct target and control, and rotations
Connectivity is unrestricted; ancillary qubits, other gates, measurements and approximation are excluded. Count only CNOTs. Realization means for . Since and are unitary, this equality automatically forces , in particular .
Two levels of the lower-bound statement
#block(breakable: false)[
For every integer , there exists a real function with such that, for every allowed circuit and every , if , then its CNOT count is at least .
]
This is the full quantifier structure of the public Lean conclusion. The next statement names the target in the source’s Theorem 1. It implies the existential conclusion and is the witness actually used inside the Lean proof, but that public conclusion does not name the witness.
#block(breakable: false)[
For every integer , put and define
Then . For every allowed circuit and every complex , if , then its CNOT count is at least
]
Multiplicative cancellation without phase branches
For a nowhere-zero , define
The exponents are integers or ; negative powers mean reciprocals. Finite multiplication gives .
#block(breakable: false)[
For every integer and nonzero , each constant satisfies . If also and , then every nowhere-zero satisfies
]
Source: Lemma 1, Section 2. Since , choose with . Pair with . This is a fixed-point-free involution reversing the exponent, so constant factors cancel.
For the second clause, distinct nonzero are linearly independent over . Thus maps onto : the two independent linear functionals have rank two. Choose with and . The same pairing preserves and reverses its exponent, so each pair contributes one. Nonvanishing makes reciprocals well-defined. At there is no nonzero ; at there is no pair of distinct nonzero . These boundaries agree with the hypotheses.
Proof for the hard target
We expand the proof of Theorem 1 in source Sections 2–3. Complementation exchanges and and preserves the remaining inputs, so is reflection-symmetric.
First force restoration. Label a wire by when its bit is . Initially the labels are . A CNOT replaces by ; rotations leave labels unchanged. Each update is an invertible row operation, so the label matrix remains invertible and its rows remain nonzero. Induction over the gates gives the form
where each is the nowhere-zero two-valued factor from one rotation. If , the nonzero output for input can occur only at index . Hence for every , so . The final labels are again, and .
Force every even label. Put
For any nonzero , both nontrivial phases have exponent , giving . If every rotation label differs from , Lemma 2.3 and multiplicativity give . But , and the same lemma gives , a contradiction. Every nonzero therefore occurs on a rotated wire.
Count even outputs. Total parity is a nonzero linear functional. Its kernel has dimension and size . Equivalently, freely choose the first coordinates and determine the last by parity. Initial labels are odd, so each required nonzero even label first appears as a CNOT target output. One CNOT produces one target label, forcing at least even-output gates.
Count additional returns. Call an odd-target, odd-control update a birth, and let be their number. Inductively, every even label ever produced lies in the span of the birth outputs produced so far. Initially no label is even. An odd-plus-odd update adds its output as a generator; an even-plus-even update adds two vectors already in the span; mixed updates produce odd labels; unchanged rows preserve the invariant. A label remains in this cumulative span even after disappearing from current wires. Since every nonzero vector of must appear, the birth outputs span . Thus .
Let count even labels currently on wires. The four update types are
| Target, control | Output | Change in |
|---|---|---|
| odd, odd | even | |
| even, odd | odd | |
| even, even | even | |
| odd, even | odd |
Let count updates of the second type. Initial and final labels are , so starts and ends at zero. Consequently . Returns have odd outputs, disjoint from the even-output gates already counted. Therefore
Births have not been added a second time: they already belong to the even-output count. The additional term counts returns. For , , one required even label and at least one return give two gates. There is no limiting passage or omitted endpoint.
Exact optimality using the literature construction
#block(breakable: false)[
For every integer , in the exact ancilla-free CNOT/ model above, the maximum over all reflection-symmetric diagonal targets on wires of their minimum CNOT counts is .
]
Source: Corollary 1. Algorithm 1 of Huang, Kosugi, Nishi and Matsushita (Section 4 and Appendix C) implements every target satisfying their Eq. (1), up to global phase. It has blocks each containing one CNOT, together with standalone CNOTs, totaling . Their Eq. (1) is precisely invariance under complementing all bits. Thus every target has a minimum count, bounded above by . The target in Theorem 2.2 needs at least , so its minimum equals that number. The maximum is attained and equals . The upper bound comes from the cited construction; it does not follow from the existential lower bound alone.
A synthesis identity and the finite checks
Put . Source Section 4 gives
If , every summand is one, giving . Otherwise choose with and pair indices ; their summands cancel. This proves the identity for all inputs.
A rotation with angle at each nonzero even label contributes . The product is , since the omitted zero label contributes the constant character one. The network must still return to identity.
The source reports exact shortest identity-return networks of lengths for , and checks of phases and character products for . These are the source’s finite checks. The general proof is the cancellation and birth–return argument above; the finite checks do not establish optimality in a broader model.
Evidence, sources and participation
What do the proof and formal evidence cover?
The public Lean source states that every positive even number of wires admits a reflection-symmetric target forcing every allowed circuit to meet the lower bound. This agrees with the existential theorem in the precise chapter. The proof actually chooses the target with phase at the all-zero and all-one strings.
The source’s explicit-target theorem specifies more than that public conclusion: it names the witness. Both parts of the cancellation lemma also have proofs inside the source. They need directly citable public interfaces, reusing those arguments. Worst-case equality additionally uses Huang and colleagues’ universal construction; the cited public lower-bound theorem does not state that upper bound. These distinctions leave the complete written argument in this reading intact.
The source’s small searches are finite evidence: shortest networks cover two and four wires; phase and character checks cover two, four, six and eight. The all- result follows from cancellation, the span of births, and return conservation, rather than extrapolating from those numbers.
References and the original question
- Haobo Ma and Wenlin Zhang, Reflection-symmetric diagonal synthesis: resolving a conjecture of Huang, Kosugi, Nishi and Matsushita, version 4, 2026. Exact-version DOI: 10.5281/zenodo.23885961, CC BY 4.0. Theorem 1 is in Section 1; Lemma 1 in Section 2; Corollary 1 in Section 3; Section 4 records the finite synthesis checks. Haobo Ma: ChronoAI Pte Ltd, Singapore. Wenlin Zhang: National University of Singapore and ChronoAI Pte Ltd, Singapore.
- X. Huang, T. Kosugi, H. Nishi and Y.-i. Matsushita, Optimized Synthesis of Circuits for Diagonal Unitary Matrices with Reflection Symmetry, J. Phys. Soc. Jpn. 93, 054002 (2024), DOI: 10.7566/JPSJ.93.054002, arXiv:2310.06676v2. Eq. (1) defines the symmetry; Algorithm 1, Section 4 and Appendix C give the upper bound; Section 6 poses worst-case gate-count and depth questions.
- M. Amy, P. Azimzadeh and M. Mosca, On the controlled-NOT complexity of controlled-NOT–phase circuits, Quantum Sci. Technol. 4, 015002 (2019), DOI: 10.1088/2058-9565/aad8ca, arXiv:1712.01859v2, Section 2: parity networks and their final linear map.
- Y. Cao, Y. Lu, J. Nie, X. Sun and G. Tian, Toward Minimum Graphic Parity Networks, arXiv:2509.10070v1 (2025), Theorem 1.1. For a connected graph the weight-two-label bound is . The complete graph on four vertices gives nine, while the present target also forces the weight-four label, giving ten.
- Trureturing repository contributors: lower-bound source and birth–return counting source. The paper attributes the lower-bound proof to this existing formalization; this reading retains that attribution.
Continuing the work
The shared requests track the explicit hard-target public interface, multiplicative cancellation public interface, and universal synthesis upper bound and worst-case equality. The first two reuse existing internal constructions and proofs. The third reuses the public existential lower bound and adds the literature upper bound; it does not require the explicit-witness interface.
Coordinate a focused contribution on the corresponding issue, develop a branch in your own fork, and submit directly to upstream dev under its contribution rules. Original mathematical authors, authors of the earlier question, and subsequent formalization contributors retain their distinct attribution. The unresolved depth and radial-potential questions are separate from interface work for already-proved results.
#pagebreak()
Verification ledger
Lean-verified results correspond to frozen declarations in trureturing. Written proofs and open items are listed separately below. The table lists the Lean correspondence; links are fixed to the pinned commit, so they do not drift with upstream changes.
Formal basis: trureturing commit 8a24ea4e79de · the-omega-institute/trureturing
| Item | Title | Lean declaration | Frozen state |
|---|---|---|---|
| Theorem 2.1 | Existential lower bound for reflection symmetry | D5.S3.Quantum.Magic.ReflectionDiagonalCNOTLowerBound.result | 372df8dafb |
Written proofs
These results cite DOI sources, book proofs and registered formalization requests. They are not kernel-verified and are excluded from LEAN ✓ counts.
- Theorem 2.2 — An explicit hard target · Proof · DOI: 10.5281/zenodo.23885961 · Theorem 1 · trureturing-requests#229
- Lemma 2.3 — Multiplicative character cancellation · Proof · DOI: 10.5281/zenodo.23885961 · Lemma 1 · trureturing-requests#230
- Corollary 2.4 — Exact worst-case CNOT count · Proof · DOI: 10.5281/zenodo.23885961 · Corollary 1 · trureturing-requests#231
Open problems and conjectures
The following items are explicitly marked open; the book does not treat them as proved.
(none)