Alphabeta Math
Pipeline-generated
How statement and proof provenance work

The first chip identifies the source of the statement or construction; the second identifies the source of its local proof or verification.

  • Literature-sourced: the exact statement appears in a cited source; only wording and notation differ.
  • AI-adapted: a semantically identical restatement of literature-sourced material, modulo indexing, notation, and boundary cases adopted by the library.
  • AI-generated: a genuinely novel statement formulated by AI, with no source for the claim itself.

These labels describe origin, not correctness: citations and verification chips remain separate evidence.

Continuous-Gate Universality and Exact Synthesis

1 · Prerequisites

2 · Summary

This page develops exact matrix synthesis from continuous one-qubit rotations and CNOT gates. Exact matrix equality, including scalar phase, is kept distinct from equality up to global phase. The CNOT upper bound uses a no-ancilla model; the multicontrol trade-off separately states when one clean work bit is supplied and returned. The generic lower bound is an almost-everywhere statement, not a per-unitary bound. Gate counts do not assert numerical decomposition time or finite-precision bit complexity.

The one-qubit rotation signs follow the QC7 convention. The terminal-diagonal lemma proves exact two-CNOT extraction and migration across QSD separators. The borrowed-bit lemma proves the linear multicontrolled-X ladder and exact restoration of arbitrary borrowed states.

3 · Logical flowchart

4 · Definitions, theorems and proofs

DefinitionDefinition: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Global Phase Equivalence

Definition

For square matrices U,V of the same size, write U∼phaseV when U=λV for some λ∈C with ∣λ∣=1. This relation is kept distinct from exact matrix equality.

Facts & Assumptions

Given: Square complex matrices U,V,W of the same size.

Proof

1.1givenalgebra

Taking λ=1 gives U=1⋅U, so U∼phaseU.

1.2givenalgebra

If U=λV and ∣λ∣=1, then V=λ‾U because λλ‾=1; also ∣λ‾∣=1. Hence U∼phaseV implies V∼phaseU.

2.1step 1.1step 1.2algebra

If U=λV and V=μW, then U=(λμ)W and ∣λμ∣=1. Thus U∼phaseV and V∼phaseW imply U∼phaseW. This proves transitivity; together the three properties establish an equivalence relation.

3.1givenstep 2.1algebra∎

The 1×1 matrices [1] and [−1] are phase-equivalent by the scalar −1, but they are not equal because their entries differ. Thus phase equivalence is distinct from exact equality.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Demultiplexing a Two-Block Unitary

Statement

Let H be a finite-dimensional complex inner-product space and let U0,U1 be unitary endomorphisms of H. On the control-first direct sum H⊕H, the block unitary diag⁡(U0,U1) factors as diag⁡(U0,U1)=(I⊗V)diag⁡(D,D∗)(I⊗W) for unitary V,W on H and a diagonal unitary D in an orthonormal eigenbasis; I⊗V denotes diag⁡(V,V) under C2⊗H≅H⊕H.

Facts & Assumptions

Given: A finite-dimensional complex inner-product space H and unitary U0,U1 on H.

[F1]

Complex spectral theorem: a normal endomorphism of a finite-dimensional complex inner product space has an orthonormal eigenbasis, and conversely: a normal endomorphism of a finite-dimensional complex inner-product space has an orthonormal eigenbasis.

[F2]

Every nonzero complex number has a unique polar form r(cos⁡θ+isin⁡θ) with r>0 and −π<θ≤π: every unit complex number is eit for some real t, and therefore has a unit-modulus square root.

Proof

1.1givenF1F2F3choose

The product Q:=U0U1∗ is unitary by [F3] and hence normal. By [F1], choose a unitary V and diagonal unitary D with Q=VD2V∗: diagonalize Q, write each eigenvalue as eitj by [F2], and put eitj/2 on the corresponding diagonal of D.

2.1step 1.1algebra

Set W:=D∗V∗U0. Then VDW=U0. Also VD∗W=VD−2V∗U0. Taking adjoints in U0U1∗=VD2V∗ gives U1U0∗=VD−2V∗, so VD−2V∗U0=U1. Thus the two diagonal blocks in the displayed factorization are respectively U0 and U1.

3.1step 1.1step 2.1given∎

The factors V,D,W are unitary, and the two block products agree with U0,U1; hence the asserted exact block factorization holds, including repeated eigenvalues. Only a finite orthonormal eigenbasis and finitely many square roots are chosen.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Cayley Charts on the Unitary Matrix Group

Statement

For N≥1, define U(N)={Q∈MN(C):Q∗Q=QQ∗=I} and u(N)={X∈MN(C):X∗=−X}, both regarded as real spaces where appropriate. Then U(N) is a compact smooth real manifold of dimension N2. Near I, the Cayley map X⟼(I+X)(I−X)−1 is a smooth chart from u(N); left translates give a finite atlas. The Frobenius inner product induces a smooth Riemannian metric. Under ACω, its volume density defines a normalized Borel volume probability μF; a Borel subset is μF-null exactly when its intersection with every chart has Lebesgue-null coordinate image. Under AC, μF is the normalized Haar probability, so this also gives the Haar-null criterion in that branch.

Facts & Assumptions

Given: An integer N≥1 and the matrix definitions in the Statement.

[F2]

Smooth manifolds and their smooth charts: a smooth manifold is specified by a compatible smooth atlas.

[F3]

Riemannian metric and riemannian manifold: a Riemannian metric is a smooth symmetric positive-definite inner product on each tangent space.

[F4]

Riemannian volume density: in coordinates, the Riemannian volume density is det⁡Gx ∣dx1⋯dxN2∣.

[F5]

The riemannian volume density is coordinate independent: these local positive smooth densities agree on chart overlaps and define one global density.

[F6]

Positive smooth densities give Radon volume: under ACω, a finite-valued positive smooth density defines a regular Borel measure finite on compact sets, hence a Radon measure.

[F7]

Riemannian volume is the radon measure of the riemannian density: under ACω, the Riemannian density gives the compact-finite Radon volume measure, and integration agrees with the smooth density integral.

[F8]

Normalized Haar probability on a compact group: under full AC a compact Hausdorff group has a unique normalized left Haar probability.

[A1]

Assume ACω for the Borel volume measure; full AC implies ACω (The Axiom of Countable Choice (ACω), The Axiom of Choice, The Axiom of Choice implies countable choice).

[A2]

Assume full AC only for the optional identification of normalized Frobenius volume with normalized Haar probability (The Axiom of Choice).

Proof

1.1givenalgebra

A skew-Hermitian matrix has purely imaginary diagonal entries, giving N real parameters. For each i<j, its (i,j) entry is an arbitrary complex number and the (j,i) entry is then forced to be its negative conjugate, giving two real parameters. Thus u(N) has real dimension N+2(N2)=N2.

2.1givenstep 1.1algebra

If (I−X)v=0 for X∗=−X, then Xv=v. But v∗Xv is purely imaginary because X∗=−X, while this equality gives v∗Xv=v∗v>0 for nonzero v. Hence I−X is invertible. Direct multiplication, using that I−X and I+X commute, shows (I+X)(I−X)−1 is unitary.

3.1step 1.1step 2.1algebra

On the open set of unitary matrices Q near I where Q+I is invertible, the inverse formula is X=(Q−I)(Q+I)−1. The factors are polynomials in Q, so they commute; using Q∗=Q−1 gives X∗=−X. The forward and inverse formulas are smooth rational matrix maps, and therefore define a chart of dimension N2 near I.

4.1givenF1F2step 3.1algebra

Left translation by any fixed Q0∈U(N) sends a Cayley neighborhood of I to a chart neighborhood of Q0, so these translates cover U(N). The group is closed, since Q∗Q=I is a closed matrix equation, and bounded, since every column has norm one. Identifying MN(C) with R2N2, [F1] makes U(N) compact. Its subspace topology is Hausdorff and second-countable: the Euclidean metric restricts to a separating metric, and intersections with rational Euclidean balls form a countable base. On overlaps, translated Cayley transition maps are compositions of the forward and inverse rational formulas from step 3.1 with fixed matrix multiplication; matrix inversion is smooth on its open domain, so the transitions are smooth. Thus a finite subcover of these neighborhoods is a finite smooth atlas on a topological N2-manifold, and [F2] supplies its smooth structure.

5.1givenF3F4F5step 4.1algebra

The Frobenius inner product is left invariant because Re⁡tr⁡((Q0A)∗Q0B)=Re⁡tr⁡(A∗B). By [F3] it defines a Riemannian metric; [F4] and [F5] give its global positive smooth volume density. In each of the finitely many charts from step 4.1, take all rational coordinate balls whose closed balls lie in the chart domain. These balls form a countable cover without making pointwise choices. Compactness gives a finite subcover. On each selected closed ball the smooth density coefficient is bounded, so its integral is finite; every nonempty coordinate ball has positive integral. The total smooth volume is therefore finite and positive, so it can be normalized.

6.1F6F7A1step 5.1algebra

Under [A1], [F6] and [F7] make the associated Borel measure a regular left-invariant Radon measure; the normalization from step 5.1 makes it a probability. In each chart the density coefficient is smooth and strictly positive, so a Borel set is μF-null exactly when its coordinate image is Lebesgue-null.

7.1A2F8step 6.1algebra∎

Under [A2], this normalized left-invariant probability on the compact group agrees with normalized Haar probability by uniqueness in [F8]. This proves only the optional Haar branch; the volume-null statement was proved in step 6.1.

TheoremStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Cosine-Sine Block Decomposition

Statement

Let k≥1 and let U∈U(2k) be partitioned into k×k blocks U=(ABCD). There are block-diagonal unitaries L=diag⁡(L0,L1) and R=diag⁡(R0,R1) and nonnegative real diagonal matrices C0,S0 such that U=L(C0−S0S0C0)R,C02+S02=I,0≤C0,S0≤I. The singular values at 0 and 1 are allowed, with no nondegeneracy assumption.

Facts & Assumptions

Given: An integer k≥1 and a unitary matrix U∈M2k(C) partitioned as in the Statement.

[F1]

Every linear map between finite-dimensional real or complex inner product spaces admits a singular value decomposition: a linear map between finite-dimensional real or complex inner-product spaces has orthonormal bases in which it is diagonal with nonnegative singular values, including zero values.

[F2]

Every linear map between finite-dimensional inner product spaces has a unique adjoint: every linear map between finite-dimensional inner-product spaces has a unique adjoint.

[F3]

Every finite-dimensional real or complex inner product space has an orthonormal basis: every finite-dimensional real or complex inner-product space has an orthonormal basis.

Proof

1.1givenF1F2algebra

Apply [F1] to A to obtain unitary L0,R0 and C0=diag⁡(c1,…,ck) with A=L0C0R0∗ and ci≥0. Since A is the compression of the unitary U to the first block, ∥Av∥≤∥v∥ for every v, so each singular value satisfies ci≤1. Put S0=diag⁡(si) with si=1−ci2.

2.1F3step 1.1algebra

The first block row of UU∗=I gives AA∗+BB∗=I, hence (L0∗B)(L0∗B)∗=S02. For every i with si>0, the row si−1ei∗L0∗B has norm one, and these rows are mutually orthogonal by the displayed Gram identity. Extend them to an orthonormal basis using [F3], and choose the signs of the completed rows so that a unitary W satisfies L0∗B=−S0W∗.

3.1F3step 1.1step 2.1algebra

The first block column of U∗U=I gives A∗A+C∗C=I, hence (CR0)∗(CR0)=S02. For every i with si>0, the column si−1CR0ei has norm one, and these columns are mutually orthogonal. Extend them to an orthonormal basis using [F3]; the resulting unitary Z satisfies CR0=ZS0. Therefore U~:=diag⁡(L0∗,Z∗)Udiag⁡(R0,W)=(C0−S0S0E) for some E.

4.1step 3.1algebra

The upper-right block of U~U~∗=I gives S0E∗=C0S0. Thus, for each i with si>0, column i of E is ciei. The lower-right blocks of U~U~∗=I and U~∗U~=I give EE∗=E∗E=C02. For such i, the prescribed entry Eii=ci already contributes ci2 to row i's squared norm, so EE∗=C02 forces every other entry in that row to vanish. Thus both the rows and columns indexed by P={i:si>0} have no cross-block entries. On K={i:si=0} one has ci=1; the K×K block of E has orthonormal rows and columns and is therefore unitary. This also covers ci=0, where the corresponding row and column are zero, and ci=1, where the index belongs to K.

5.1step 4.1step 3.1algebra∎

Let Q be that unitary K×K block and replace Z by Z′=Zdiag⁡(I,Q). Since Q acts only where S0=0 and C0=I, this leaves CR0=Z′S0 unchanged and changes the lower-right block to C0. Hence U=diag⁡(L0,Z′)(C0−S0S0C0)diag⁡(R0∗,W∗). Both outside factors are unitary, and C02+S02=I by definition. The argument includes ci=0, ci=1, repeated values, and empty positive or zero supports.

DefinitionDefinition: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Two-Level Unitary

Definition

Let a finite ordered register have an orthonormal computational basis (∣z⟩)z∈X, using the root convention that the inner product is linear in its first argument. For distinct labels x,y∈X, choose V∈U(2), where U(2)={M∈M2(C):M∗M=MM∗=I2}. The two-level unitary Tx,y(V) acts by the matrix V in the ordered basis (∣x⟩,∣y⟩) and acts as the identity on span⁡{∣x⟩,∣y⟩}⊥. Its action is exact matrix equality: any scalar phase contained in V is retained.

Facts & Assumptions

Given: The finite-dimensional complex inner-product space, its ordered orthonormal computational basis, distinct labels x,y, and V∈U(2).

[F1]

For a subspace W of a finite-dimensional inner product space, V=W⊕W⊥: a subspace S of a finite-dimensional inner-product space has the orthogonal direct sum decomposition H=S⊕S⊥.

[F3]

The computational basis is orthonormal: the computational basis vectors of the finite ordered register form an orthonormal basis.

Verification

1.1givenF1F3algebra

Put S=span⁡{∣x⟩,∣y⟩}. By [F3], the selected pair is orthonormal. By [F1], H=S⊕S⊥, and relative to this sum the defined operator is V⊕IS⊥.

2.1step 1.1F2algebra∎

The direct sum preserves norms because V is unitary on S and the identity preserves norms on S⊥. Its inverse is V∗⊕IS⊥, so it is an invertible isometry and hence unitary by [F2]. The scalar phase in V is part of this exact direct-sum matrix.

AlgorithmAlgorithm: Literature-sourcedProof: Not applicableOpen item page →

Exact Two-Level Elimination of a Unitary

Definition

Input: an exact-arithmetic representation of U∈U(N), N≥1, supporting addition, multiplication, conjugation, nonnegative square roots, exact zero tests, and exact division by nonzero positive real scalars. Output: a finite ordered factorization into two-level unitaries and a diagonal unitary. This is an exact algebraic procedure; no claim of a bit-time algorithm for arbitrary real input is made.

Initialize M:=U and an empty chronological list. For each column j=0,…,N−2, and for r=N−1,N−2,…,j+1, set a=Mr−1,j and b=Mr,j. If b=0, do nothing. Otherwise set h=∣a∣2+∣b∣2>0 and left-multiply rows (r−1,r) by G=1h(a‾b‾−ba), recording this two-level unitary in the order applied. Let the resulting matrix be D. Return the factorization U=G1∗⋯Gs∗D. In chronological circuit order, apply D first and then Gs∗,…,G1∗.

TheoremStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Correctness and Termination of Two-Level Elimination

Statement

For U∈U(N), the elimination procedure of Exact Two-Level Elimination of a Unitary terminates after at most N(N−1)/2 Givens steps and returns an exact factorization of U into the recorded two-level adjoints followed by a diagonal unitary. The number of diagonal entries is N; entries equal to 1 need no phase gate.

Facts & Assumptions

Given: U∗U=UU∗=IN and the exact-arithmetic operations, zero tests, loop bounds, and update matrices specified in Exact Two-Level Elimination of a Unitary.

[F1]

Exact Two-Level Elimination of a Unitary defines the descending row updates and records each embedded G in chronological order; it returns the formal product of their adjoints and the terminal matrix.

Proof

1.1givenF1algebra

If b≠0, then h>0 and direct multiplication gives G∗G=I2 and G(a,b)T=(h,0)T. Thus the row operation is defined and left multiplication by its coordinate embedding preserves unitarity of M. If b=0, skipping the operation leaves the desired entry zero.

2.1step 1.1induction

Inductively, before processing column j, columns 0,…,j−1 have zero entries below their diagonal positions. Each row pair used for column j has indices at least j, so both entries in every earlier column are zero and the row operation preserves those zeros. Descending r therefore makes column j zero below its diagonal without undoing a zero already made in that column.

3.1step 2.1giveninduction

After the finite loops, D=Gs⋯G1U is upper triangular and unitary. Its first column has only its first entry nonzero, which has modulus one. Orthogonality with every later column forces the first entry of each later column to be zero. Removing the first row and column leaves an upper-triangular unitary block; induction proves that D is diagonal with unit-modulus diagonal entries.

4.1step 3.1algebra∎

Rearranging D=Gs⋯G1U gives U=G1∗⋯Gs∗D exactly. The finite loops have ∑j=0N−2(N−j−1)=N(N−1)/2 iterations (zero for N=1), with at most one row elimination per iteration, so they terminate with at most that many eliminations and at most N diagonal phases; the zero tests skip any already-zero entry. Under the convention that a matrix product acts on column states from right to left, the same identity orders the actions as D first and then Gs∗,…,G1∗.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

One-Qubit Euler Decomposition

Statement

Use the rotation convention of Exact one-qubit gates and rotations and define Ry(θ):=R(0,1,0)(θ): Rz(α)=(e−iα/200eiα/2),Ry(θ)=(cos⁡(θ/2)−sin⁡(θ/2)sin⁡(θ/2)cos⁡(θ/2)). For every U∈U(2) there are real δ,α,θ,β with U=eiδRz(α)Ry(θ)Rz(β). If det⁡U=1, the scalar factor is unnecessary and U=Rz(α)Ry(θ)Rz(β).

Facts & Assumptions

Given: A unitary matrix U∈M2(C) and the rotation conventions in the Statement.

[F1]

Every nonzero complex number has a unique polar form r(cos⁡θ+isin⁡θ) with r>0 and −π<θ≤π: every nonzero complex number has polar form r(cos⁡t+isin⁡t) with r>0.

[F2]

t↦(cos⁡t,sin⁡t) is a bijection from [0,2π) onto the real unit circle: every point of the real unit circle is (cos⁡t,sin⁡t) for some t∈[0,2π).

[F3]

Signs, monotonicity intervals, and ranges of sine and cosine gives the monotonicity intervals of sine and cosine and their range [−1,1]. Quarter-turn values and shifts by pi/2 and pi gives the quarter-turn values and the identities sin⁡(t+π)=−sin⁡t and cos⁡(t+π/2)=−sin⁡t.

[F4]

For n≥1, the determinant over a commutative ring by the Leibniz formula, and ∣det⁡A∣ for a real matrix: determinant is the Leibniz sum over permutations, and conjugating every entry conjugates that sum.

[F5]

For every square matrix over a commutative ring, det⁡(AT)=det⁡(A): det⁡(AT)=det⁡(A) for every square matrix over a commutative ring.

[F6]

For same-sized finite square matrices over a commutative ring, det⁡(AB)=det⁡(A)det⁡(B): det⁡(AB)=det⁡(A)det⁡(B) for same-sized square matrices over a commutative ring.

[F7]

Exact one-qubit gates and rotations: Rn(t)=exp⁡(−it n⋅σ/2) and Rz=R(0,0,1).

[F8]

The Pauli matrices: Y=(0−ii0) and Z=(100−1) in the ordered computational basis.

Proof

1.1F7F8algebra

Direct multiplication of the matrices in [F8] gives Y2=Z2=I2. Grouping the even and odd terms of the exponential series in [F7] then gives Rz(t)=diag⁡(e−it/2,eit/2) and Ry(t)=(cos⁡(t/2)−sin⁡(t/2)sin⁡(t/2)cos⁡(t/2)). Thus the matrices used in the Statement match the QC7 convention exactly.

1.2givenF4F5F6algebra

The Leibniz formula [F4] gives det⁡(U‾)=det⁡U‾; by [F5], det⁡(U∗)=det⁡(U‾T)=det⁡U‾. Thus [F6] and U∗U=I give ∣det⁡U∣2=det⁡(U∗U)=1.

2.1step 1.2F1F4F6choosealgebra

By [F1], choose δ∈R with det⁡U=e2iδ and put W=e−iδU. The scalar has modulus one and [F4],[F6] give det⁡W=e−2iδdet⁡U=1, so W is unitary with determinant one.

3.1step 2.1F2F3choose

Write the first column of W as (a,c)T. Its norm is one, so (∣a∣,∣c∣) is on the unit circle in the closed first quadrant. By [F2], choose t∈[0,2π) with ∣a∣=cos⁡t and ∣c∣=sin⁡t. By [F3], sine is positive on (0,π): it increases from 0 to 1 on [0,π/2] and decreases to 0 on [π/2,π]. Its π-shift makes it negative on (π,2π), so sin⁡t≥0 forces t∈[0,π]. Cosine decreases strictly on [0,π] and vanishes at π/2, so cos⁡t≥0 then forces t∈[0,π/2]. Set θ=2t. This also covers either zero coordinate.

4.1step 2.1step 3.1F1choosealgebra

The unit vector orthogonal to (a,c)T is a unit scalar multiple of (−c‾,a‾)T. If its scalar is s, the determinant of the matrix with these columns is s(∣a∣2+∣c∣2)=s; since det⁡W=1, the second column is exactly (−c‾,a‾)T. Choose phases γ,η so a=e−iγcos⁡t and c=eiηsin⁡t; when one modulus is zero choose its phase arbitrarily.

5.1step 4.1algebrastep 1.1

Put α=γ+η and β=γ−η. Direct multiplication of the matrices obtained in step 1.1 gives Rz(α)Ry(θ)Rz(β)=(e−iγcos⁡t−e−iηsin⁡teiηsin⁡teiγcos⁡t)=W. The phase choices in step 4.1 make this exactly the two columns of W, including the cases t=0 and t=π/2.

6.1step 2.1step 3.1step 5.1givenalgebra∎

Restoring the scalar from step 2.1 proves the formula for arbitrary U. If det⁡U=1, choose δ=0 in step 2.1, so W=U, and apply steps 3.1–5.1.

TheoremStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Exact Two-Qubit Cartan Decomposition

Statement

For every U∈U(4) there are A,B,C,D∈SU(2), real a,b,c,δ, and the matrices X=(0110),Y=(0−ii0),Z=(100−1) such that U=eiδ(A⊗B)exp⁡ ⁣(i(aX⊗X+bY⊗Y+cZ⊗Z))(C⊗D). The equality is exact; the scalar eiδ is displayed.

Facts & Assumptions

Given: U is a 4×4 unitary, and the Pauli matrices and magic-basis vectors below are in the stated order.

[F1]

One-Qubit Euler Decomposition: every SU(2) unitary is exactly Rz(α)Ry(θ)Rz(β) for real angles in the QC7 convention.

[F2]

Real spectral theorem: a self-adjoint endomorphism of a finite-dimensional real inner product space has an orthonormal eigenbasis: a real self-adjoint operator on a finite-dimensional real inner-product space has an orthonormal eigenbasis.

[F3]

Every nonzero complex number has a unique polar form r(cos⁡θ+isin⁡θ) with r>0 and −π<θ≤π: every unit complex number is eit for some real t, and every unit complex number has a unit-modulus square root.

[F4]

The Pauli matrices: X=(0110), Y=(0−ii0), and Z=(100−1).

[F5]

For n≥1, the determinant over a commutative ring by the Leibniz formula, and ∣det⁡A∣ for a real matrix: determinant is the alternating permutation sum; conjugating every matrix entry conjugates the value of that sum.

Proof

1.1givenF3F5F6F7choosealgebra

By [F5] and [F7], det⁡(U∗)=det⁡(U‾T)=det⁡(U‾)=det⁡U‾. Then [F6] and U∗U=I give ∣det⁡U∣2=det⁡(U∗U)=1. Choose δ with det⁡U=e4iδ and put W=e−iδU; applying the permutation formula to a scalar multiple of a 4×4 matrix gives det⁡W=e−4iδdet⁡U=1, so W∈SU(4). Use the magic basis e1=(∣00⟩+∣11⟩)/2, e2=i(∣00⟩−∣11⟩)/2, e3=i(∣01⟩+∣10⟩)/2, e4=(∣01⟩−∣10⟩)/2, and let Q have these columns. Direct inner products show each vector has norm one and distinct vectors are orthogonal, so Q is unitary. Then W^=Q∗WQ is unitary with determinant one. The matrix S=W^TW^ is symmetric; since S∗=S‾ and W^ is unitary, S∗S=I, so S is unitary.

2.1step 1.1F2F3F6F7choosealgebra

Direct calculation from the definition of S gives ST=S and S∗S=I. Write S=P+iR with P,R real symmetric. From SS‾=I we obtain P2+R2=I and PR=RP. Apply [F2] first to P. If Pv=λv, then P(Rv)=R(Pv)=λRv, so every eigenspace Eλ of P is invariant under R. The restriction R∣Eλ is self-adjoint for the inherited inner product, since ⟨Ru,v⟩=⟨u,Rv⟩. Apply [F2] separately on each such finite-dimensional eigenspace; the union of these orthonormal eigenbases is an orthonormal common eigenbasis because distinct P eigenspaces are orthogonal. Its columns form a real orthogonal O simultaneously diagonalizing P,R, so OTSO=diag⁡(ζj) with ∣ζj∣=1. If det⁡O=−1, change the sign of one column; the diagonalization is unchanged and now O∈SO(4). Choose unit square roots dj of each ζj. By [F6]–[F7] and det⁡W^=1, det⁡S=det⁡(W^T)det⁡(W^)=1, so ∏jdj is either 1 or −1; if it is −1, change the sign of one root. Then D0=diag⁡(dj) and K=OD0OT satisfy KT=K, K2=S, and det⁡K=1.

3.1step 2.1algebra

Put R0=W^K−1. It is unitary and R0TR0=K−1W^TW^K−1=K−1SK−1=I. Thus R0T=R0∗, which entrywise says R0 is real. Also det⁡R0=1, so R0∈SO(4), and W^=R0OD0OT.

4.1givenF1F4step 3.1algebra

Direct multiplication gives X2=Y2=Z2=I2, and the matrices in [F4] are traceless and Hermitian. In the magic basis let Jij be the real skew-symmetric generator with Jijei=ej, Jijej=−ei, and zero on the other basis vectors. Direct action on the four displayed vectors gives the six local generators iX⊗I↦J13+J24,iY⊗I↦J14−J23,iZ⊗I↦J12−J34, I⊗iX↦J13−J24,I⊗iY↦−J14−J23,I⊗iZ↦J12+J34. These are a basis of the six-dimensional real space so(4) of skew-symmetric matrices. Thus every Jij is the magic-basis image of some real linear combination A⊗I+I⊗B of local generators, where A,B are traceless skew-Hermitian 2×2 matrices. The two summands commute, so its exponential is eA⊗eB. A traceless skew-Hermitian 2×2 matrix has eigenvalues ir,−ir for some real r, so eA,eB∈SU(2). Hence each plane rotation etJij is a local image. Conversely, [F1] expresses every local SU(2) factor as a product of Rz and Ry rotations; their magic-basis images are exponentials of the displayed real skew generators and hence real orthogonal. Finally, Givens elimination writes every R∈SO(4) as a finite product of plane rotations: for a unit first column, successively rotate coordinate pairs to zero its last three entries and make the first entry 1; orthogonality then leaves a lower-right SO(3) block, to which the same procedure applies recursively. Therefore the local image is all of SO(4), and in particular R0O and OT are local images.

5.1step 2.1step 3.1step 4.1F4algebra∎

In the same basis, direct action of the Pauli products gives the diagonal sign lists (+,−,+,−), (−,+,+,−), and (+,+,−,−) for X⊗X, Y⊗Y, and Z⊗Z, respectively. These mutually orthogonal trace-zero lists form a basis of the three-dimensional real trace-zero diagonal subspace. Since D0 is diagonal unitary with determinant one, choose arguments for its four diagonal entries; their sum is a multiple of 2π, so adjusting one argument by that multiple gives phases summing exactly to zero. Therefore those phases are a real linear combination of the three sign lists, and D0=exp⁡(i(aX⊗X+bY⊗Y+cZ⊗Z)) in the magic basis. Conjugating W^=R0OD0OT back by Q, using the local representations from step 4.1, and restoring eiδ gives the stated exact factorization.

LemmaStatement: Literature-sourcedProof: AI-adaptedjudge pass (gpt-6-luna)Open item page →

Global Phase Under Control

Statement

Let H be a nonzero finite-dimensional target space, let U be unitary on H, and let ∣λ∣=1. In control-first order put C(U)=(IH00U),Pλ=(100λ). Then C(λU)=(Pλ⊗IH)C(U). A scalar multiplying an entire output leaves every defined finite-POVM outcome law unchanged, whereas a scalar attached to a target matrix inside a control gives a phase on only the active control block; applying Pλ‾ on the control restores the exact controlled matrix.

Facts & Assumptions

Given: The target space and unitary, a unit scalar λ, control-first ordering, and—when considering the measurement clause—any density operator ρ on the output space and any finite POVM (Ea)a∈Ω. An unconditional output scalar acts on the density by (λI)ρ(λI)∗.

[F1]

Controlled Unitary Access: controlled access is the block operator C(U)=diag⁡(IH,U) on the control-first register.

[F2]

Global Phase Equivalence: matrices are phase-equivalent when one is a scalar multiple of the other by a unit-modulus complex number; this is distinct from exact matrix equality.

[F3]

Density operator: a density operator is a nonnegative endomorphism of trace one on a nonzero finite-dimensional complex inner-product space.

[F4]

Finite POVMs and their outcome law: for a density operator ρ and a finite POVM (Ea), the outcome weight is pρ(a)=tr⁡(ρEa).

[F5]

POVM outcome weights are probabilities: when its density and finite complete-effect-family hypotheses hold, the defined POVM outcome weights form a probability distribution.

Proof

1.1givenF1algebra

The diagonal blocks of C(λU) are IH and λU. Multiplying the blocks of (Pλ⊗IH)C(U) gives IH and λU, so the two full matrices are equal exactly.

1.2givenF3algebra

Under the whole-output update specified in the Given, (λI)ρ(λI)∗=λλ‾ρ=ρ because ∣λ∣=1. Hence the whole-output scalar leaves the density operator unchanged.

2.1givenF2step 1.1algebra

By [F2], U and λU are phase-equivalent as target matrices. If λ≠1, Pλ is not a scalar multiple of the identity: its diagonal entries are 1 and λ. Thus step 1.1 places a phase on only the active control block. Left multiplication by Pλ‾⊗IH changes the blocks back to IH,U, so it restores C(U) exactly. For λ=1 no correction is needed.

3.1F4F5step 1.2step 1.1algebra∎

By [F4], each defined measurement weight is tr⁡(ρEa). The equality of density operators in step 1.2 makes these weights identical for every outcome a. Under the normalized-law conclusion [F5], the two probability distributions therefore agree. The global scalar in step 1.2 preserves the whole measurement law, while the controlled target scalar in step 1.1 does not become a whole-output scalar.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Parameter Count for a Fixed CNOT Skeleton

Statement

Assume ACω to form normalized Frobenius volume on U(2n). For fixed n≥1 and a fixed ordered CNOT skeleton with m CNOTs, arbitrary exact one-qubit gates, and no ancillas, the set of exact circuit matrices is contained in a finite union of smooth images of real parameter spaces of dimension at most 3n+4m+1. If 3n+4m+1<4n, this fixed skeleton has measure zero. Under full AC, it is Haar-null.

Facts & Assumptions

Given: The exact one-qubit/CNOT gate model, a fixed list of CNOT locations on n wires, and ACω for the normalized smooth volume.

[F1]

One-Qubit Euler Decomposition: each U(2) gate is a scalar phase times an SU(2) matrix parameterized by three real Euler angles.

[F2]

CNOT and Control-Target Order: the first-wire-control CNOT maps ∣a,t⟩ to ∣a,t⊕a⟩; the reverse orientation is the same permutation with wires interchanged.

[F3]

The Euclidean inverse function theorem: a smooth map between equal-dimensional Euclidean neighborhoods with invertible derivative is a local diffeomorphism.

[F4]

Morse-Sard for Euclidean maps: for a Cr map from an a-dimensional Euclidean open set to a b-dimensional one, with a<b and r>b−a, its image has Lebesgue measure zero.

[F5]

Cayley Charts on the Unitary Matrix Group: U(2n) is a smooth real manifold of dimension 4n; under ACω, a Borel subset has normalized Frobenius volume zero exactly when it is Lebesgue-null in every chart. Under full AC this is normalized Haar measure.

[F6]

The Pauli matrices: X,Y,Z are the displayed Pauli matrices in the ordered computational basis.

[F8]

Denotational semantics of a finite layered circuit: chronological circuit layers L1,…,Ld denote the exact matrix product ULd⋯UL1.

[F9]

Finite circuit resource accounting: the operation model declares the allowed gate alphabet and counts only the named gate occurrences.

[F10]

The computational basis is orthonormal: the ordered computational basis of a register is orthonormal.

[A1]

ACω is assumed to construct the normalized smooth volume; the optional Haar wording assumes full AC (The Axiom of Countable Choice (ACω), The Axiom of Choice, The Axiom of Choice implies countable choice).

Proof

1.1givenF1F6F7F8F9algebra

A matrix in SU(2) has the form (ab−bˉaˉ) with ∣a∣2+∣b∣2=1: its first column is a unit vector, orthogonality and determinant one fix the second column, as in the two-column calculation in the Euler proof. Conversely, direct multiplication verifies that every displayed matrix is unitary with determinant one. Thus SU(2) is S3⊂R4. On each of the eight open sets where one real coordinate is positive or negative, solve that coordinate as ±1−u12−u22−u32; these smooth charts show SU(2) is a real 3-manifold. It is closed and bounded, hence compact by [F7]. The tangent Lie algebra is the three-dimensional span in [F6]. Thus G=SU(2)n is a compact smooth real manifold of dimension 3n. Collecting consecutive one-qubit gates into local layers and moving every scalar factor to the front writes each circuit with the fixed skeleton as eiϕKmCmKm−1⋯C1K0, where Kj∈G. The scalar phases commute with all gates and combine into one real parameter ϕ; [F1] parameterizes each one-qubit special-unitary factor by three real angles. The chronological matrix convention is [F8], and [F9] fixes the counted gate alphabet.

1.2givenF2F6F10algebra

Direct inspection of the matrices in [F6] shows that every traceless skew-Hermitian 2×2 matrix is a unique real combination of iX,iY,iZ: its diagonal entries are ir,−ir and its off-diagonal entries are z,−zˉ, with r∈R,z∈C. Fix one CNOT Cj with control c and target t. Applying its basis action [F2] to the four affected basis vectors gives CjZcCj=Zc and CjXtCj=Xt. By [F10], the CNOT basis permutation is unitary. Its local commuting subgroup Hj≤G therefore consists of arbitrary SU(2) factors on the n−2 other wires, rotations eisZ on c, and rotations eirX on t. This product has real dimension 3(n−2)+1+1=3n−4. A complementary subspace mj of su(2)n is spanned by iXc,iYc,iYt,iZt and has dimension four.

2.1step 1.1step 1.2F3algebra

Give mj×Hj and G local coordinates from the S3 charts in step 1.1 and angle charts on the two circles in Hj. The local product map Φj:mj×Hj→G, (X,h)↦eXh, has derivative at (0,I) equal to (X,Y)↦X+Y. The direct sum mj⊕hj=su(2)n makes this derivative an isomorphism between 3n-dimensional coordinate spaces, so [F3] gives neighborhoods on which every nearby local factor is eXh with four real coordinates in X and h∈Hj. The group G is compact: each SU(2) is the closed bounded set of matrices (ab−bˉaˉ) with ∣a∣2+∣b∣2=1, and a finite product of compact sets is compact. Translating the neighborhood and using compactness gives a finite cover of G by such local product charts.

2.2step 1.1step 1.2F1F2algebra

Starting with Km and proceeding downwards, use a finite chart to write the current local factor as gℓeXjhj, where gℓ is one of finitely many fixed local translations and Xj has four real coordinates. Since hj commutes with Cj, move it through Cj and multiply it into the next local factor; that product remains in G. Repeating this for all m CNOTs leaves m four-parameter factors and one arbitrary local layer K0 with 3n parameters. Each chart choice has finitely many possibilities, and the global phase adds one parameter, so the exact image is contained in a finite union of smooth images with dimension 4m+3n+1.

3.1step 1.1step 2.2F4F5F7A1algebra∎

The exact circuit set is compact, hence Borel: by step 1.1 it is the continuous image of the compact space S1×Gm+1. Each open Euclidean parameter domain has a countable compact exhaustion, so each smooth parameter image is a countable union of compact, hence closed, subsets of U(2n) and is Borel. If 4m+3n+1<4n, every point of each parameter domain is critical for the smooth map into a target chart of U(2n), since its derivative has rank at most the smaller domain dimension. Apply [F4] on the open preimages of the finitely many target charts from [F5]; each Borel image is Lebesgue-null there, hence volume-null by [F5]. A finite union over parameter-chart choices is still null. Under full AC, [F5] identifies that null set as Haar-null. Thus the fixed skeleton has the claimed null image.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Gray-Code Synthesis of a Multiplexed Axis Rotation

Statement

Let k≥0 controls have computational labels x∈{0,1}k, and let θx∈R. Fix a∈{x,y,z}. On one target qubit define M=∑x∈{0,1}k∣x⟩⟨x∣⊗Ra(θx),Ra(t)=exp⁡(−itσa/2). Then M is exactly synthesized with 2k CNOTs for k>0 (the final CNOT restores the parity network). For a=y,z it uses 2k target rotations Ra(βj); for a=x it uses 2k Ry rotations in the fixed target basis described below; for k=0 it is one rotation and no CNOT. For a=x and k>0 the implementation also uses two fixed target basis-change gates; the y,z implementations need none. One may replace the cyclic Gray traversal by a traversal that omits the final restoration and absorb that final parity into the next block only when that block is explicitly specified.

Facts & Assumptions

Given: The real angles (θx), the computational-basis order on the controls, and the rotation convention Ra(t)=exp⁡(−itσa/2). For a control bit xr and target bit b, define CNOTr→t∣x,b⟩=∣x,b⊕xr⟩, extending linearly; its matrix is a permutation and is self-inverse.

[F1]

Big-endian encoding of ordered bit strings: the ordered n-qubit basis assigns bit word x the big-endian index enc⁡n(x)=∑r<nxr2n−1−r, so the first wire is the most significant bit.

[F2]

Pauli formula for an axis rotation: Rn(t)=cos⁡(t/2)I−isin⁡(t/2)(n⋅σ) for real unit n.

[F3]

The Pauli matrices: Y=(0−ii0) in the ordered computational basis.

[F4]

CNOT and Control-Target Order: the first-wire-control CNOT maps ∣a,t⟩ to ∣a,t⊕a⟩ and is self-inverse.

[F5]

Denotational semantics of a finite layered circuit: later-applied gates multiply on the left of earlier gates in the circuit denotation.

[F6]

Finite circuit resource accounting: the declared gate count is the number of occurrences from the operation model's allowed alphabet.

[F7]

The computational basis is orthonormal: the ordered computational basis is orthonormal.

Proof

1.1givenF1choosealgebra

For k>0, construct the reflected list G1=(0,1) and Gk=(0Gk−1,1rev⁡(Gk−1)) for k≥2. Induction shows that each mask occurs once, adjacent masks differ in one coordinate, and the last mask differs from the first in one coordinate. Enumerate these 2k masks as pj, beginning at p0=0. For k=0, take the singleton list containing the empty mask and use no coordinate transition. Set Hxj=(−1)pj⋅x and choose βj=2−k∑yHyjθy. For z=x⊕y, summing over all masks factors as ∑p(−1)p⋅z=∏r=0k−1(1+(−1)zr), which equals 2k when z=0 and 0 otherwise. Substituting the chosen βj therefore gives ∑jHxjβj=θx.

2.1step 1.1F2F3F4F5F6F7algebra

Assume k>0. Substitute n=(0,1,0) in [F2] and use [F3]; this gives Ry(t)=(cos⁡(t/2)−sin⁡(t/2)sin⁡(t/2)cos⁡(t/2)). Apply Ry(β0), then toggle the single control coordinate taking p0 to p1 with a CNOT and apply Ry(β1), continuing through p2k−1 and using one final CNOT to restore mask 0. On a fixed control basis state ∣x⟩, the accumulated target bit flip before the jth rotation is pj⋅x modulo two by [F4]. The CNOT network consists of basis permutations and hence is unitary by [F7]. Conjugation by X gives XRy(t)X=Ry(−t) by direct multiplication of the displayed matrix, so that rotation acts as Ry((−1)pj⋅xβj). Its ordered application agrees with [F5], and [F6] counts these gate occurrences.

3.1step 1.1step 2.1F2F3algebra

Direct multiplication of the Ry matrices from step 2.1 gives Ry(s)Ry(t)=Ry(s+t). Thus on branch x the target product is Ry(∑jHxjβj)=Ry(θx) by step 1.1. The final CNOT returns the parity network to zero and hence leaves no extra control-dependent permutation. This proves the exact block action for every computational branch; linearity proves it on every superposition. For k=0, there is one branch and the circuit is just Ry(θ0).

4.1step 1.1step 2.1step 3.1F2algebra∎

For a=z, use exactly the same masks and angles with Rz in place of Ry: the diagonal formula Rz(t)=diag⁡(e−it/2,eit/2) gives XRz(t)X=Rz(−t) and Rz(s)Rz(t)=Rz(s+t), proving the same branch calculation. For a=x, put B=Rz(−π/2). Direct Pauli multiplication gives BYB∗=X, hence BRy(t)B∗=Rx(t) by [F2]. Conjugate the entire y circuit by the two target gates B∗,B in chronological order. Its branch action is BRy(θx)B∗=Rx(θx). This implementation retains the original y network unchanged between the two external basis changes, so it has exactly 2k CNOTs, 2k Ry rotations, and those two additional one-qubit gates. For k=0, directly apply Ra(θ0).

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Exact Controlled One-Qubit Unitary with Two CNOTs

Statement

For every U∈U(2), the exact controlled matrix C(U)=diag⁡(I2,U) is realized with two CNOTs and one-qubit gates only. The scalar phase of U is implemented as a phase gate on the control and is not discarded.

Facts & Assumptions

Given: Control-first order, the exact controlled-unitary convention, and U∈U(2).

[F1]

One-Qubit Euler Decomposition: U=eiδRz(α)Ry(θ)Rz(β) for real parameters, with δ=0 possible when det⁡U=1.

[F2]

Exact one-qubit gates and rotations: axis rotations are Rn(t)=exp⁡(−it n⋅σ/2) and Rz=R(0,0,1).

[F3]

CNOT and Control-Target Order: the first-wire-control CNOT maps ∣a,t⟩ to ∣a,t⊕a⟩ and is the block C(X)=diag⁡(I,X).

[F4]

Controlled Unitary Access: C(U)=diag⁡(I,U) in control-first order.

[F5]

Denotational semantics of a finite layered circuit: later-applied gates multiply on the left of earlier gates.

[F6]

Finite circuit resource accounting: the declared gate count counts only the named gate occurrences from the operation model.

[F7]

The computational basis is orthonormal: the ordered computational basis of a register is orthonormal.

Proof

1.1givenF1F2algebra

Put V=Rz(α)Ry(θ)Rz(β)∈SU(2), and define A=Rz(α)Ry(θ/2),B=Ry(−θ/2)Rz(−(α+β)/2),C=Rz((β−α)/2). Using additivity of same-axis rotations gives ABC=I. The rotations in [F1] follow the axis convention [F2]. Direct multiplication with the matrices in [F1] gives XRy(t)X=Ry(−t) and XRz(t)X=Rz(−t); therefore AXBXC=Rz(α)Ry(θ)Rz(β)=V.

2.1step 1.1F3F4F5F7algebra

The displayed matrix product (I⊗A) CNOT (I⊗B) CNOT (I⊗C) has chronological gate order I⊗C, CNOT, I⊗B, CNOT, I⊗A by [F5]. By [F3] and [F7], each CNOT is a unitary basis permutation, and the full product is block diagonal in the control basis. On control value 0 its target block is ABC=I; on value 1 the two CNOTs apply X between the target factors, so the block is AXBXC=V. Hence the product is exactly C(V) by [F4].

3.1step 2.1F1F4F6algebra∎

Since U=eiδV, block multiplication gives C(U)=(Peiδ⊗I)C(V), where Peiδ=diag⁡(1,eiδ). This is one additional one-qubit control gate and preserves the exact scalar phase. By [F6], it adds no CNOT occurrences, so the exact count remains two for every U∈U(2).

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Exact Three-CNOT Synthesis of Two-Qubit Unitaries

Statement

Every U∈U(4) has an exact circuit with no ancillas, at most three CNOT gates, and arbitrary one-qubit gates. The scalar phase is implemented as a one-qubit scalar gate and is not discarded.

Facts & Assumptions

Given: Exact matrix semantics, both CNOT orientations, and the Cartan decomposition.

[F1]

Exact Two-Qubit Cartan Decomposition: U=eiδ(A⊗B)N(a,b,c)(C⊗D), where N(a,b,c)=ei(aX⊗X+bY⊗Y+cZ⊗Z) and A,B,C,D∈SU(2).

[F2]

One-Qubit Euler Decomposition: every SU(2) factor and every scalar one-qubit unitary has an exact Euler realization using the QC7 rotation convention.

[F3]

Pauli formula for an axis rotation: Rn(t)=cos⁡(t/2)I−isin⁡(t/2)(n⋅σ) for real unit n.

[F4]

The Pauli matrices: X,Y,Z are the displayed Pauli matrices in the ordered computational basis.

[F5]

CNOT and Control-Target Order: the first-wire-control CNOT maps ∣a,t⟩ to ∣a,t⊕a⟩; its wire order is part of the definition.

[F6]

Denotational semantics of a finite layered circuit: chronological circuit layers L1,…,Ld denote the exact matrix product ULd⋯UL1.

[F7]

Finite circuit resource accounting: size and gate costs count the occurrences declared in the explicit operation model; gate access is not inferred from a matrix alone.

[F8]

The computational basis is orthonormal: the ordered two-qubit computational basis is orthonormal.

Proof

1.1givenF1F2F3F4F5F8algebra

The Pauli matrices in [F4] give commuting products XX,YY,ZZ. On the even-parity subspace with ordered basis (∣00⟩,∣11⟩), XX and YY restrict to X and −X, while ZZ restricts to I. Hence N restricts there to eicei(a−b)X, whose entries are eiccos⁡(a−b) on the diagonal and ieicsin⁡(a−b) off diagonal. On the odd-parity basis (∣01⟩,∣10⟩), XX and YY both restrict to X and ZZ restricts to −I, so the block is e−icei(a+b)X. These two blocks give N(a,b,c)=(eiccos⁡(a−b)00ieicsin⁡(a−b)0e−iccos⁡(a+b)ie−icsin⁡(a+b)00ie−icsin⁡(a+b)e−iccos⁡(a+b)0ieicsin⁡(a−b)00eiccos⁡(a−b)). In basis 00,01,10,11, the two CNOT orientations are C12=(1000010000010010),C21=(1000000100100100). Here C12 is the gate from [F5] and C21 is obtained by interchanging the wire names. Both displayed permutations are unitary because they permute the orthonormal basis in [F8]. Using [F3] with the Pauli matrices [F4] gives the QC7 rotation convention in [F2]; multiplication of those rotations and the displayed CNOT permutations gives exactly N(a,b,c)=eiπ/4(Rz(π/2)⊗I)C21(I⊗Ry(π/2−2b))C12(Rz(π/2−2c)⊗Ry(2a−π/2))C21(I⊗Rz(−π/2)). All entries agree with the two parity blocks above; thus this is an exact identity, including its scalar.

2.1step 1.1F1F2F6F7algebra∎

The factorization in step 1.1 uses three CNOTs and otherwise one-qubit rotations. By [F2], the local factors A,B,C,D and the scalar eiδ in [F1] have exact one-qubit implementations; eiδI4=(eiδI2)⊗I2. The circuit product [F6] therefore equals the written factorization exactly, and [F7] counts three CNOT occurrences and no additional wires.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Two-CNOT Synthesis up to a Migrating Terminal Diagonal

Statement

Every U∈U(4) factors exactly as U=ΔV, where Δ is diagonal in the ordered two-qubit computational basis and V has a no-ancilla circuit with at most two CNOTs and arbitrary one-qubit gates. Scalar phases are retained. Consequently, if a chronological circuit has N≥1 arbitrary two-qubit slots all on the same two wires and each separator preserves every computational label on those two wires, the slots can be synthesized using at most 2(N−1)+3 CNOTs in total, leaving the separator operations unchanged. This counts only the slots' CNOTs.

Facts & Assumptions

Given: Exact matrices, arbitrary one-qubit gates, and both orientations of CNOT. In the second assertion each separator S has the form ∑x∈{0,1}2∣x⟩⟨x∣⊗Sx after grouping the two slot wires first.

[F1]

Exact Two-Qubit Cartan Decomposition gives U=eiδ(A⊗B)N(a,b,c)(C⊗E), with local SU(2) factors and N(a,b,c)=exp⁡(i(aXX+bYY+cZZ)); here XX=X⊗X, and similarly for YY,ZZ.

[F2]

The Pauli matrices specifies X,Y,Z; they square to identity and satisfy XY=iZ, YZ=iX, ZX=iY by matrix multiplication.

[F3]

Pauli formula for an axis rotation gives Rj(t)=cos⁡(t/2)I−isin⁡(t/2)σj.

[F4]

CNOT and Control-Target Order gives C∣a,b⟩=∣a,b⊕a⟩ for first-wire control.

[F5]

Exact Three-CNOT Synthesis of Two-Qubit Unitaries gives an exact three-CNOT synthesis for the last arbitrary slot, including its scalar phase.

[F6]

Denotational semantics of a finite layered circuit places later chronological operations to the left in a matrix product.

[F7]

Finite circuit resource accounting counts the stated gate occurrences and wires.

Proof

1.1givenF1F2F8algebrachoose

Normalize U to U0=λ−1U∈SU(4) with ∣λ∣=1: unitarity and the determinant permutation formula give ∣det⁡U∣=1, so choose λ=eiarg⁡(det⁡U)/4 using [F8]. Put J=YY and γ(W)=WJWTJ. For a 2×2 matrix A, direct multiplication gives AYAT=(det⁡A)Y. Therefore local K=A⊗B with A,B∈SU(2) satisfies KJKT=J. It follows by substitution and cyclicity of trace that tr⁡γ(K1WK2)=tr⁡γ(W) for local SU(2) matrices K1,K2. This identity uses transpose, not adjoint.

2.1step 1.1F2F8algebrachoose

Put P=ZZ and D(t)=eitP=cos⁡t I+isin⁡t P. Since P is diagonal with two +1 and two −1 entries, D(t) is diagonal unitary with determinant one. Also JP=PJ and D(t)T=D(t). Hence tr⁡γ(D(t)U0)=tr⁡(D(t)2γ(U0))=cos⁡(2t)tr⁡γ(U0)+isin⁡(2t)tr⁡(Pγ(U0)). Its imaginary part is a0cos⁡(2t)+b0sin⁡(2t), with real a0=Im⁡tr⁡γ(U0) and b0=Re⁡tr⁡(Pγ(U0)). If both vanish, take t=0. Otherwise choose cos⁡(2t)=b0/(a02+b02)1/2, sin⁡(2t)=−a0/(a02+b02)1/2, possible by [F8]. Thus V=D(t)U0∈SU(4) has real tr⁡γ(V).

3.1step 1.1step 2.1F1F2F8algebra

Apply [F1] to V. The determinant of each local factor and of N(a,b,c) is one: the latter follows from the simultaneous Pauli eigenvalue sign lists (+,−,+,−), (−,+,+,−) and (+,+,−,−) in the Cartan proof, each with sum zero. Thus e4iδ=1 and e2iδ∈{1,−1}. The commuting symmetric matrices XX,YY,ZZ commute with J, so γ(N)=N2. Expand their exponentials using [F2]. Since XX YY ZZ=−I and all nonconstant products except this triple are traceless, tr⁡γ(V)=e2iδ4(cos⁡(2a)cos⁡(2b)cos⁡(2c)+isin⁡(2a)sin⁡(2b)sin⁡(2c)). Its imaginary part is zero, so at least one Cartan coordinate is an integer multiple of π/2.

4.1step 3.1F2F3algebra

If, for example, c=kπ/2, its factor is eicZZ=ik(ZZ)k, a scalar times a product of one-qubit Pauli gates. It commutes with the other Cartan factors and can be absorbed into the exterior local factors. The same applies to a or b. Simultaneous conjugation on both qubits by a one-qubit rotation permuting the Pauli axes moves the absent coordinate to ZZ. Such permutations are obtained from Rx(π/2),Ry(π/2),Rz(π/2) in [F3]; their conjugations exchange the other two axes up to signs, and each sign is squared in a Pauli product. Thus V is a scalar times exterior local gates and N(α,β,0) for real α,β. All scalar factors are retained as one-qubit scalar gates.

5.1step 2.1step 4.1F2F3F4F7algebra

Let L=Rx(π/2)⊗Rx(π/2) and let C be [F4]. Its basis action gives C(X⊗I)C=XX and C(I⊗Z)C=ZZ. Formula [F3] gives LXXL∗=XX and LZZL∗=YY (each rotated Z is −Y). Therefore the exact identity N(α,β,0)=LC(Rx(−2α)⊗Rz(−2β))CL∗ follows by exponentiating the commuting generators. This uses two CNOTs and one-qubit gates only. Combined with step 4.1 it synthesizes V with two CNOTs. Since V=D(t)λ−1U, the required diagonal is Δ=λD(t)−1 and U=ΔV exactly. No CNOT is spent implementing Δ in this factorization assertion.

6.1step 5.1F5F6F7inductionalgebra∎

Write the first two chronological slots as U1,S1,U2. By step 5.1, U1=Δ1V1, so the product in [F6] is U2S1Δ1V1. The separator hypothesis gives S1(Δ1⊗I)=(Δ1⊗I)S1 branch by branch, even if its S1,x act on several other wires. The product becomes (U2Δ1)S1V1. The next slot is still an arbitrary unitary on the same two wires. Factor it again and continue. Each of the first N−1 slots now uses at most two CNOTs; the final accumulated slot uses at most three by [F5]. All diagonals are absorbed, every separator is unchanged, and no wire is added. For N=1 the process performs no migration and uses only the three-CNOT base case. This proves the count 2(N−1)+3 and exact equality.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Exact Central Controlled-Z Absorption at a QSD Node

Statement

Let k≥1, let the first of k+1 wires be the target, and let L=diag⁡(L0,L1) and R=diag⁡(R0,R1) be generic block-diagonal unitaries in that target's basis. Let M be a multiplexed Ry on that target, selected by the other k wires. The exact matrix LMR can be represented by four generic k-qubit slots, two multiplexed Rz factors and a central network with only 2k−1 controlled-Z gates and arbitrary one-qubit rotations. Each controlled-Z costs one CNOT. Thus one CNOT is saved relative to demultiplexing L,R and using a full 2k-CNOT central rotation. The exact rewritten factors add no workspace, preserve scalar phases, and keep every non-target wire a select wire within the central network.

Facts & Assumptions

Given: The target-first ordered basis, k≥1, and L,M,R as stated.

[F1]

Gray-Code Synthesis of a Multiplexed Axis Rotation supplies the cyclic Gray masks and Walsh angles for M.

[F2]

One-Qubit Euler Decomposition gives the QC7 matrix Ry(t)=(cos⁡(t/2)−sin⁡(t/2)sin⁡(t/2)cos⁡(t/2)).

[F3]

Demultiplexing a Two-Block Unitary factors each generic two-block unitary into two smaller unitaries and a diagonal two-block factor.

[F4]

CNOT and Control-Target Order supplies the exact controlled-X matrix; Denotational semantics of a finite layered circuit puts later chronological gates to the left.

[F5]

Finite circuit resource accounting counts declared CNOT occurrences and all wires.

Proof

1.1givenF1F2F4algebra

Direct multiplication of [F2] gives ZRy(t)Z=Ry(−t), with Z=diag⁡(1,−1). In the cyclic Gray construction [F1], replace each select-to-target controlled-X by select-to-target controlled-Z. On select word x, the parity accumulated at mask pj is now Zpj⋅x, so conjugation changes the jth rotation angle to (−1)pj⋅xβj. The same Walsh inversion proves the final target angle is θx, and the final Gray edge restores the accumulated Z exponent to zero. Thus this network equals M exactly and contains 2k controlled-Z gates. All select bits are unchanged.

2.1step 1.1F4algebra

Let its final chronological controlled-Z use select wire r, and put Zr for Z on that select wire and identity on the other k−1 select wires. In target-first block order this last gate is Er=diag⁡(I2k,Zr). If T is the chronological network with this last gate deleted, [F4] gives the exact identities M=ErT and LMR=(LEr)TR=diag⁡(L0,L1Zr) T diag⁡(R0,R1). Both L0 and L1Zr remain arbitrary k-qubit unitaries. This is a block multiplication identity and does not commute Er through L.

3.1step 2.1F2F3algebra

Apply [F3] separately to LEr and R. These two generic block-diagonal factors still produce four arbitrary k-qubit slots and two diagonal two-block factors. A diagonal factor diag⁡(D,D∗) is a multiplexed Rz on the first wire: if Dxx=eiαx, its two target entries are eiαx,e−iαx and hence equal Rz(−2αx). The central T has 2k−1 controlled-Z gates. Therefore the rewritten circuit has exactly the required shape and retains the identity in step 2.1.

4.1step 1.1step 2.1step 3.1F4F5algebra∎

Set H=2−1/2(111−1). Direct multiplication gives H2=I and HXH=Z, so a controlled-Z on a select-target pair equals (I⊗H)CNOT⁡(I⊗H) in that pair's control-first order. Each costs one CNOT and two one-qubit gates, with no added wire. Thus deleting the terminal Er saves exactly one CNOT in the central network. Every remaining central gate still acts on the first-wire target or reads other wires only as unchanged selects. The block products in steps 2.1–3.1 are ordinary exact matrix products, so no scalar phase or workspace promise has been suppressed.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Generic No-Ancilla CNOT Lower Bound

Statement

Assume ACω to form normalized Frobenius volume. For n≥1, almost every n-qubit unitary with respect to that measure requires at least ⌈4n−3n−14⌉ CNOT gates in an exact circuit with arbitrary one-qubit gates and no ancillas. Under full AC, normalized Frobenius volume is normalized Haar measure, so the same is a Haar-almost-everywhere bound. This is a generic lower bound and is not a per-unitary assertion.

Facts & Assumptions

Given: ACω, fixed n, exact matrix equality, no ancillas, and the stated one-qubit/CNOT gate model.

[F1]

Parameter Count for a Fixed CNOT Skeleton: each fixed m-CNOT skeleton has a normalized-Frobenius-volume-null image whenever 3n+4m+1<4n; under AC this is Haar-null.

[A1]

Assume ACω for normalized Frobenius volume; the Haar wording assumes full AC (The Axiom of Countable Choice (ACω), The Axiom of Choice, The Axiom of Choice implies countable choice).

Proof

1.1givenalgebraalgebra

If n=1, the claimed lower bound is ⌈(4−3−1)/4⌉=0 and holds because gate counts are nonnegative. Suppose n≥2 and put M=⌈(4n−3n−1)/4⌉, which is positive. For every integer m<M, the ceiling property gives 4m<4n−3n−1, hence 3n+4m+1<4n.

2.1step 1.1F1A1algebra

For fixed n,m, only finitely many CNOT skeletons exist: at each of the m positions one chooses an ordered pair of distinct wires from a finite set. By [F1], each skeleton image is null for normalized Frobenius volume; a finite union is null. For n≥2, the finite union over m=0,…,M−1 remains null. Under full AC, [A1] and [F1] identify this as a Haar-null union.

3.1step 1.1step 2.1algebra∎

For n≥2, outside the null union in step 2.1 no exact circuit with fewer than M CNOTs exists, so almost every unitary needs at least M CNOTs. For n=1, step 1.1 proves the zero bound directly. Since a null exceptional set may contain individual unitaries, the conclusion does not assert a positive lower bound for every unitary.

LemmaStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Linear Multicontrolled X with One Borrowed Wire

Statement

For every integer r≥1, an r-controlled X on r control wires and one target has an exact circuit of O(r) arbitrary one-qubit gates and CNOTs when one additional borrowed wire is available. The circuit equals Cr(X)⊗I on the entire register: the borrowed wire is returned unchanged for every state, including states entangled with the controls, target, or an external register. No wire is initialized or measured.

Facts & Assumptions

Given: Distinct wires, arbitrary one-qubit gates, exact CNOTs, and an additional wire with arbitrary initial state. Boolean addition is XOR, written ⊕, and multiplication is AND.

[F1]

Exact Controlled One-Qubit Unitary with Two CNOTs supplies an exact controlled one-qubit unitary with two CNOTs and four arbitrary one-qubit gates: its proof uses target gates A,B,C and one control phase gate.

[F2]

CNOT and Control-Target Order specifies (a,t)↦(a,t⊕a).

[F3]

Clean and dirty ancillas requires exact return of a borrowed wire.

[F4]

Denotational semantics of a finite layered circuit composes chronological gates in reverse matrix order.

[F5]

Finite circuit resource accounting counts gate occurrences.

[F6]

The computational basis is orthonormal gives a basis of all bit words; equality on it implies equality of linear maps.

Proof

1.1givenF1F2F4algebra

An exact Toffoli has constant cost. Let V=12((1+i)I+(1−i)X). The orthogonal projectors (I+X)/2,(I−X)/2 show V is unitary and V2=X. With controls a,b, apply chronologically Cb(V) to the target, CNOTa→b, Cb(V∗), CNOTa→b, and Ca(V). The bit b returns, and the target exponent is b−(b⊕a)+a=2ab, so its action is Xab. By [F1] the three controlled gates and two CNOTs cost at most eight CNOTs and twelve one-qubit gates. No relative phase is discarded.

2.1givenstep 1.1F2F4construct

First construct an s-controlled X with s−2 borrowed wires, for s≥3. Call the controls c1,…,cs, the borrowed bits a1,…,as−2, and the target t. Let T1 toggle a1 under c1,c2; for 2≤j≤s−2, let Tj toggle aj under cj+1,aj−1. Let Q toggle t under cs,as−2. Apply the list T1,…,Ts−2,Q,Ts−2,…,T1, followed by T2,…,Ts−2,Q,Ts−2,…,T2; for s=3 the second list is just Q. Each list restores every borrowed bit, since Q changes only t and the compute list is reversed afterward.

3.1step 2.1step 1.1F5algebrainduction

Let uj,vj be the values of aj immediately before Q in the first and second lists. Both lists begin with the same borrowed values. We have u1=a1⊕c1c2, v1=a1 and, for j≥2, uj=aj⊕cj+1uj−1, vj=aj⊕cj+1vj−1. Thus uj⊕vj=∏h=1j+1ch by induction. The two target toggles add to cs(us−2⊕vs−2)=∏h=1sch. Controls and borrowed bits are unchanged. The two lists contain (2s−3)+(2s−5)=4s−8 exact Toffolis. For s=2 use one Toffoli; for s=1 use one CNOT. This auxiliary construction therefore costs O(s) and uses at most max⁡{s−2,0} borrowed wires.

4.1givenstep 3.1constructalgebra

For r≥3, partition the controls into A,B of sizes p=⌈r/2⌉, q=⌊r/2⌋, and call the extra wire z. Put a=∏j∈Acj, b=∏j∈Bcj. Apply an A-controlled X into z, a (B∪{z})-controlled X into t, and repeat these two calls in that order. The first kind can borrow from B∪{t} because q+1≥p−2; the second can borrow from A because p≥q−1. Step 3.1 restores these temporary borrowed wires after each call, for their actual arbitrary values at that call. No wire beyond the original r+2 is used.

5.1step 4.1step 3.1step 1.1F2F3F5F6algebra∎

The four ideal calls send z to z⊕a and back, while toggling t by b(z⊕a)⊕bz=ab. Thus their action is precisely Cr(X) with z and every control returned. The two calls of each kind cost O(p)+O(q+1)=O(r). For r=1,2, use [F2] or step 1.1 and leave z untouched. Equality on every basis word extends by [F6] to Cr(X)⊗Iz; tensoring with an external identity also proves the entangled-input claim and the return condition [F3].

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Exact QSD CNOT Upper Bound

Statement

For n≥2, every n-qubit unitary has an exact no-ancilla circuit with arbitrary one-qubit gates and at most 23484n−322n+43 CNOTs. For n=1, no CNOT is needed. For n=0, a circuit on the empty register realizes a scalar unitary exactly if and only if it is 1; the empty circuit realizes this identity with no gates. This is a gate-count bound; it makes no numerical decomposition-time or finite-precision bit-complexity claim.

Facts & Assumptions

Given: Exact n-qubit matrix semantics, no ancillas, arbitrary one-qubit gates, and CNOT count as the resource.

[F1]

Cosine-Sine Block Decomposition: an even-dimensional unitary factors into block-diagonal unitaries and one central cosine-sine rotation with exact boundary sectors.

[F2]

Demultiplexing a Two-Block Unitary: each two-block unitary factors into two smaller unitaries and a diagonal two-block factor.

[F3]

Gray-Code Synthesis of a Multiplexed Axis Rotation: for either fixed axis a=y,z, a multiplexed Ra with k>0 select bits has an exact cyclic Gray construction with 2k CNOTs; for k=0 it is one rotation with no CNOT.

[F4]

Exact Three-CNOT Synthesis of Two-Qubit Unitaries: an arbitrary two-qubit terminal block has a three-CNOT exact synthesis.

[F5]

One-Qubit Euler Decomposition: Ry(t)=(cos⁡(t/2)−sin⁡(t/2)sin⁡(t/2)cos⁡(t/2)) in the QC7 convention.

[F6]

Denotational semantics of a finite layered circuit: chronological circuit layers L1,…,Ld denote ULd⋯UL1.

[F7]

Finite circuit resource accounting: the declared gate count counts occurrences of the allowed gates in the explicit operation model.

[F8]

CNOT and Control-Target Order: a CNOT is the exact controlled-X permutation with the stated wire order.

[F9]

The computational basis is orthonormal: the computational basis on the CNOT wires is orthonormal.

[F10]

Exact Central Controlled-Z Absorption at a QSD Node proves the exact identity LMR=diag⁡(L0,L1Zr)TR when the terminal Gray controlled-Z is deleted from the central rotation, leaving four generic recursive slots and two multiplexed Rz factors.

[F11]

Finite circuit syntax and ordered wire labels: every gate has positive arity, and a gate occurrence requires that many distinct wires.

[A1]

Two-CNOT Synthesis up to a Migrating Terminal Diagonal proves that every two-qubit unitary is exactly a diagonal times a two-CNOT circuit, and that these diagonals migrate through separators which preserve the two slot-wire labels, saving one CNOT in every slot except the last.

Proof

1.1givenF1F2F6F7algebra

Split off the first wire and recurse on the remaining contiguous wire interval. Apply [F1] to split an n-qubit unitary into a central multiplexed Ry and two block-diagonal factors. Apply [F2] to each side factor: each produces two recursive (n−1)-qubit unitaries and one diagonal two-block factor, which is a multiplexed Rz. Thus the recursive stage contains four (n−1)-qubit calls and three multiplexed rotations, interpreted with exact chronological composition [F6] and the declared no-ancilla width [F7].

2.1step 1.1F3F4F7inductionalgebra

Each of the three multiplexed rotations has n−1 select bits, so [F3] uses at most 2n−1 CNOTs per rotation. With c2=3 from [F4], the recurrence is cn≤4cn−1+3⋅2n−1 for n≥3. Induction gives the unoptimized bound cn≤(9/16)4n−(3/2)2n: it equals 3 at n=2, and substituting the expression for cn−1 into the recurrence gives the expression for cn. The counts are gate occurrences in [F7].

3.1step 1.1step 2.1F2F3F5F7F8F9F10algebra

For the central multiplexed Ry, use the Gray traversal of [F3] with controlled-Z in place of CNOT. Indeed ZRy(t)Z=Ry(−t) by [F5], so the same Walsh angles give branch sign (−1)pj⋅x at mask pj and the final cyclic edge restores the accumulated Z parity. This is exactly the desired multiplexed rotation. Each controlled-Z costs one CNOT: CZ=(I⊗Ry(−π/2)) CNOT (I⊗Ry(π/2)), since the active block is Ry(−π/2)XRy(π/2)=Z; [F8]–[F9] justify the CNOT matrix and unitarity. Take the last Gray edge as a terminal controlled-Z and absorb it into the neighboring generic block-diagonal factor before demultiplexing that factor. In its first-wire control blocks it multiplies the lower-register branch by I or by the single-wire Z on its select wire. Both branches remain arbitrary unitaries, so [F2] still gives four recursive children and two multiplexed Rz factors. The full block identity is LMR=(LEr)TR=diag⁡(L0,L1Zr)TR by [F10], where M=ErT and T omits the terminal controlled-Z. Thus one CNOT is saved at each nonterminal recursive node. There are (4n−2−1)/3 such nodes, zero when n=2. Subtracting this from step 2.1 gives cn≤13244n−322n+13.

4.1step 1.1step 3.1F4F6F7A1algebra

Each recursive call removes the first wire of its contiguous interval, so all N=4n−2 terminal slots act on the same last two wires. Every nonterminal multiplexed rotation targets a wire strictly before these two. Its select operations preserve the computational labels of the last two wires: branch by branch in those labels, its rotations and controlled-X or controlled-Z gates act on other wires. Products of these separator operations therefore have exactly the block form required by [A1]. The preceding controlled-Z absorption only changes the arbitrary child matrices before their recursive decomposition and does not change this target/select invariant. Apply [A1] to the complete ordered slot list: the first N−1 slots now use two CNOTs, and the last uses three, instead of three in every slot. No diagonal is synthesized separately and no wire is added. The additional saving is N−1=4n−2−1. Consequently cn≤(1324−116)4n−322n+13+1=23484n−322n+43. When n=2, N=1, so there is no migration or saving and the formula is the three-CNOT base case.

5.1givenF6F11step 4.1algebra∎

For n=1, the unitary is itself one allowed one-qubit gate and uses zero CNOTs. For n=0, [F11] permits no gate occurrence, so every layer is empty and [F6] makes every circuit denote 1 on C. Conversely, the empty circuit realizes 1. Thus an arbitrary scalar unitary has an exact zero-wire circuit precisely when it equals 1. The bound for n≥2 follows from step 4.1; these gate counts imply no arithmetic or precision bound.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Multicontrolled Unitaries with and without a Clean Work Bit

Statement

For m≥1 controls and exact U∈U(2), define Cm(U)=∑x≠1m∣x⟩⟨x∣⊗I2+∣1m⟩⟨1m∣⊗U. This controlled operation has (i) a no-workspace exact construction with O(m2) one-qubit and CNOT gates, and (ii) an exact construction using one clean work bit, initially 0 and returned to 0, with O(m) such gates. For nonscalar U, every exact circuit needs at least m two-qubit gates, also when auxiliary wires are allowed with data-independent initial state and exact clean or dirty return. Clean auxiliary wires start at 0 and return to 0 for every data input; dirty auxiliary wires may start in any state and the full operation is Cm(U)⊗I on them, including correlated inputs. A fixed auxiliary state may be internally entangled but is initially independent of the data. These are upper/lower bounds; the quadratic no-work construction is not asserted optimal.

Facts & Assumptions

Given: Exact matrix equality, the controlled block above, arbitrary one-qubit gates and CNOTs, and the clean-work-bit initialization when clause (ii) is used.

[F1]

Exact Controlled One-Qubit Unitary with Two CNOTs: an exact controlled V∈U(2) is implemented using two CNOTs and one-qubit gates, retaining its scalar phase.

[F2]
[F3]

Every nonzero complex number has a unique polar form r(cos⁡θ+isin⁡θ) with r>0 and −π<θ≤π gives λ=cos⁡t+isin⁡t for every unit complex number λ. The addition formulas for sine and cosine gives the sine and cosine double-angle identities by taking equal arguments.

[F4]

Clean and dirty ancillas: a clean work bit starts in ∣0⟩ and an exact clean construction returns it to ∣0⟩ for every input; a dirty bit may start arbitrarily but must be returned unchanged.

[F5]

Controlled Unitary Access: the exact controlled block is C(U)=diag⁡(I,U) in control-first order.

[F6]

Finite circuit resource accounting: one-qubit and CNOT costs count the gate occurrences declared in the operation model.

[F7]

Denotational semantics of a finite layered circuit: the denotation of chronological gates G1,…,Gk is Gk⋯G1.

[F8]

CNOT and Control-Target Order: one CNOT is an exact one-control X gate in the stated control-target order.

[F9]

The computational basis is orthonormal: the computational basis on the gate wires is orthonormal.

[A1]

Linear Multicontrolled X with One Borrowed Wire supplies an exact r-controlled X with O(r) elementary gates and one borrowed wire; the complete operator is Cr(X)⊗I on all states, including correlated inputs.

Proof

1.1givenF2F3choosealgebra

By [F2], choose an orthonormal eigenbasis of U. For a unit eigenvector v of eigenvalue λ, 1=∥Uv∥=∣λ∣, so [F3] writes λ=cos⁡t+isin⁡t. Set μ=cos⁡(t/2)+isin⁡(t/2). The double-angle identities give μ2=λ, and hence ∣μ∣2=∣λ∣=1. Putting these unit-modulus roots on the diagonal in that eigenbasis and conjugating back gives a unitary V with V2=U.

1.2givenF1F4F5F6A1algebra

For the clean-bit branch, let w start at 0. An m-controlled X into w, using the data target as the returned borrowed wire, changes w to the AND of the controls. Apply C(U) controlled by w and reverse the same X circuit. On each computational-basis input this applies U exactly on the all-one control branch by [F5] and restores w=0 by [F4]; linearity gives the same exact operator on superpositions. The two X calls and one controlled-U call cost O(m) in the model [F6] by [A1].

1.3givenF2algebra

For the lower bound, make an undirected graph with one vertex for every circuit wire, including controls, target, and any workspace, and one edge for each two-qubit gate joining its two wires. If some control were disconnected from the target, the full circuit factors across the graph components. Choose the same data-independent auxiliary state for both test inputs (for the dirty contract a fixed product state is permitted). Even if that auxiliary state has correlations between components, a unitary on the disconnected component cannot change the reduced state of the target component: taking the partial trace cancels that unitary with its adjoint. The target reduced state would therefore be unchanged when that control alone is toggled. Since nonscalar unitary U has two orthogonal eigenvectors u,v with distinct eigenvalues λ,μ, the state ψ=(u+v)/2 obeys Uψ=(λu+μv)/2, which is not a scalar multiple of ψ. Set all other controls to 1 and the target to ψ; toggling the disconnected control changes the required target ray from [ψ] to [Uψ], a contradiction. Thus the target component contains all m controls and has at least m+1 vertices. A connected component on at least m+1 vertices has at least m edges, so at least m two-qubit gates are needed.

2.1givenstep 1.1F1F5F6F7F8F9A1algebra

For m≥2, write A for the AND of the first m−1 control bits and b for the last control. In chronological order [F7], the recursive controlled-V construction applies V to the target under b, toggles b by an (m−1)-controlled X under the first controls, applies V∗ under the changed b, toggles b back, then applies V under the first controls. On a basis branch the exponent of V on the target is b−(b⊕A)+A: it is 0 when A=0, 0 when (A,b)=(1,0), and 2 when (A,b)=(1,1). Thus the ideal branch matrices are I,I,V2=U, exactly the required Cm(U) action by [F5]. Implementing the two controlled-X calls with the data target as borrowed wire, and the final recursive controlled-V call with the restored b as borrowed wire, yields qm≤qm−1+2xm−1+O(1), where xr is the borrowed-bit controlled-X cost. By [F8]–[F9], x1=1; [A1] gives xr=O(r) for r≥2, so summing the recurrence from the constant one-control base [F1] gives qm=O(m2) in the gate model [F6]. Every borrowed-wire call is the required controlled operation tensored with identity, so using the data target as its borrowed wire is valid even when it is entangled with the controls. The recursive call uses only its own controls and target; the restored b is available but is not needed as an extra wire.

3.1step 2.1step 1.2step 1.3A1algebra∎

The lower bound is linear and the no-work upper bound is quadratic, so no quadratic optimality claim follows. The no-workspace recursion and clean-bit compute/apply/uncompute construction prove the two upper bounds, with exact work-bit return supplied by [A1].

AlgorithmAlgorithm: Literature-sourcedProof: Not applicableOpen item page →

Gray-Path Synthesis of a Two-Level Gate

Definition

Input distinct x,y∈{0,1}n, n≥1, exact V∈U(2), and for each controlled call a choice between the no-workspace and clean-bit constructions of Multicontrolled Unitaries with and without a Clean Work Bit. If any call selects the clean-bit construction, supply one clean bit initialized to 0. Output: the chronological elementary-gate list on the n data wires and, if selected, that one clean work wire.

Let g0=x,…,gd=y be the path that flips the differing bit positions once in increasing order, where d is the Hamming distance. For j=0,…,d−2, swap gj and gj+1 by an X on their differing bit controlled on the other n−1 bits matching their common pattern. Apply V to the final pair gd−1,y by a one-qubit target gate controlled on their common other bits, reversing the ordered 2×2 block if gd−1 has target bit 1. Undo the swaps in reverse order. Expand every multi-control using its selected construction; implement negative controls by conjugating that control wire with X.

Expand the calls by the following procedures. Every list below is chronological; concatenation means execute the left list first. Order control wires and available spare wires by their register positions. All parameter selections are exact mathematical operations: use exact matrix arithmetic, a finite-dimensional unitary eigendecomposition, polar arguments and the Euler parameter selection of One-Qubit Euler Decomposition. The input representation must support these selections and exact zero tests; no finite-precision bit-time claim is made. Fix each selection when its call is first expanded and retain the resulting list for an inverse call.

For one control c, target t and matrix W, choose W=eiδRz(α)Ry(θ)Rz(β) as in One-Qubit Euler Decomposition. Form the three matrices A=Rz(α)Ry(θ/2), B=Ry(−θ/2)Rz(−(α+β)/2) and C=Rz((β−α)/2). Define S(c,t;W) to be the list Ct, CNOTc→t, Bt, CNOTc→t, At, diag⁡(1,eiδ)c. Each of A,B,C is one arbitrary one-qubit gate, as in Exact Controlled One-Qubit Unitary with Two CNOTs. Define T(a,b;t) by setting J=((1+i)I+(1−i)X)/2 and concatenating S(b,t;J), CNOTa→b, S(b,t;J∗), CNOTa→b, S(a,t;J).

Define the ladder list L(c1,…,cs;t) with an ordered supply of at least max⁡{s−2,0} distinct spare wires. For s=1 emit one CNOT; for s=2 emit T(c1,c2;t). For s≥3, use the first s−2 spares a1,…,as−2. Set T1=T(c1,c2;a1), Tj=T(cj+1,aj−1;aj) for 2≤j≤s−2, and H=T(cs,as−2;t). Concatenate T1,…,Ts−2,H,Ts−2,…,T1 and then T2,…,Ts−2,H,Ts−2,…,T2; the latter list is just H when s=3. This is the borrowed ladder used in Linear Multicontrolled X with One Borrowed Wire.

Define D(C;t;z) for an ordered nonempty control set C and a distinct borrowed wire z. With one or two controls use the corresponding ladder base case and leave z unused. With r≥3 controls split C into its first p=⌈r/2⌉ controls A and the remaining q=⌊r/2⌋ controls B. Let F=L(A;z) use spares from B∪{t}, and let G=L(B∪{z};t) use spares from A. Emit F,G,F,G, using the same parameter choices for repeated lists. The stated spare supplies have at least p−2 and q−1 wires, respectively.

Define the positive-control no-workspace expansion N(C;t;W) recursively. If C is empty, emit Wt. If it has one wire c, emit S(c,t;W). Otherwise write C=A∪{b}, with b its last control. Choose an orthonormal eigendecomposition W=Rdiag⁡(λ1,λ2)R∗ by Complex spectral theorem: a normal endomorphism of a finite-dimensional complex inner product space has an orthonormal eigenbasis, and conversely, choose polar angles λj=cos⁡uj+isin⁡uj by Every nonzero complex number has a unique polar form r(cos⁡θ+isin⁡θ) with r>0 and −π<θ≤π, and set Z=Rdiag⁡(cos⁡(u1/2)+isin⁡(u1/2),cos⁡(u2/2)+isin⁡(u2/2))R∗. The addition formulas of The addition formulas for sine and cosine specify these half-angle roots. Emit S(b,t;Z), D(A;b;t), S(b,t;Z∗), D(A;b;t), N(A;t;Z). The last call has one fewer control and uses only its indicated wires.

For the positive-control clean-bit expansion with nonempty C and clean wire w, emit D(C;w;t), S(w,t;W), and the reversed adjoint of that same D list. With no controls emit Wt and leave w unused. These are the two constructions analyzed in Multicontrolled Unitaries with and without a Clean Work Bit. For a pattern control, conjugate the selected whole positive-control list by one X on each zero-valued control, ordering each set of these X gates by wire position. Reverse the ordered middle block by using XVX as its single matrix parameter, not by adding target X occurrences.

Use the selected literal elementary gate list for each call without deleting identity gates or cancelling neighboring gates. In the one-control base use the three target matrices and one control phase as four arbitrary one-qubit gates. Use the same choices and reversed adjoint gate lists for the return swaps. Reuse the supplied clean bit sequentially; each selected clean-bit construction returns it to 0.

TheoremStatement: Literature-sourcedProof: AI-adaptedOpen item page →

Correctness of Gray-Path Two-Level Synthesis

Statement

The algorithm of Gray-Path Synthesis of a Two-Level Gate realizes the exact two-level unitary on the ordered selected pair (x,y) and fixes every other computational-basis vector. Write d for their Hamming distance and m=n−1. Before expansion there are 2(d−1) pattern-controlled swaps and one pattern-controlled target block.

Here are exact post-expansion counts for its literal circuits. A cost pair (c,q) counts CNOTs and arbitrary one-qubit gates, respectively; pairs are added componentwise and identity gate occurrences are retained. Define E1=(1,0),E2=(8,12),Es=(4s−8)(8,12)(s≥3), B1=(1,0),B2=(8,12),Br=2E⌈r/2⌉+2E⌊r/2⌋+1(r≥3). For a positive m-controlled one-qubit call the no-workspace cost is Q0=(0,1),Q1=(2,4),Qm=Qm−1+2Bm−1+(4,8)(m≥2), and the selected one-clean-bit cost is Km=2Bm+(2,4) for m≥1 (use K0=Q0 with no work bit). For each forward swap j, choose Sj∈{Qm,Km}, and for the middle block choose T∈{Qm,Km}. If zj and zV are the numbers of zero-valued controls in their patterns, the exact total pair is 2∑j=0d−2(Sj+(0,2zj))+T+(0,2zV). Its sum of coordinates is the exact elementary gate count. All-no-workspace selection uses n wires and O(dn2) gates; all-clean selection uses at most n+1 wires and O(dn) gates. For mixed selections one clean bit suffices and is reused sequentially, returned to zero after each call. When n=1, the circuit is one arbitrary one-qubit gate with cost (0,1) and no work bit.

Facts & Assumptions

Given: Distinct labels x,y, block V, and the path and literal expansion choices of Gray-Path Synthesis of a Two-Level Gate.

[F1]

Two-Level Unitary: the desired two-level operator applies V on the ordered pair (∣x⟩,∣y⟩) and is identity on its orthogonal complement.

[F2]

Big-endian encoding of ordered bit strings: a computational basis word is identified with its ordered bitstring, so individual wire values and bit flips determine the corresponding basis label.

[F3]

CNOT and Control-Target Order: a CNOT flips its target bit exactly when its named control bit is 1.

[F4]

Denotational semantics of a finite layered circuit: chronological circuit layers L1,…,Ld denote ULd⋯UL1.

[F5]

Finite circuit resource accounting: costs count declared gate occurrences under the explicit operation model.

[F6]

The computational basis is orthonormal: the ordered computational basis of the register is orthonormal.

[F7]

Multicontrolled Unitaries with and without a Clean Work Bit gives exact no-workspace O(m2) and one-clean-bit O(m) elementary constructions; each clean call returns its work bit to zero.

[F8]

Linear Multicontrolled X with One Borrowed Wire supplies an exact O(r) elementary implementation of Cr(X) with one borrowed wire, whose full operator is Cr(X)⊗I even on correlated inputs.

[F9]

Exact Controlled One-Qubit Unitary with Two CNOTs supplies an exact two-CNOT realization of each controlled one-qubit matrix with arbitrary one-qubit gates, retaining its scalar phase.

[F10]

Gray-Path Synthesis of a Two-Level Gate specifies the forward path swaps, the final controlled block with the ordered-block reversal when needed, their reversed adjoints, and the chosen literal expansions.

[F11]

One-Qubit Euler Decomposition gives the exact eiδRz(α)Ry(θ)Rz(β) decomposition and the displayed matrices for Rz and Ry.

Proof

1.1givenF1F2F3F6algebra

By [F2] and [F3], each path swap is an X controlled on the other bits' fixed values, so it exchanges exactly the two indicated basis labels and fixes every other basis vector. Each swap is a permutation of the orthonormal computational basis [F6], hence a unitary. Their chronological product P sends x=g0 to gd−1 and fixes y=gd, because the last path edge is deliberately omitted.

1.2F9F10F11algebra

For the algorithm's single-control list S, direct multiplication of the rotation matrices in [F11] gives ABC=I and AXBXC=e−iδW. Its two control branches therefore have target blocks I and e−iδW; the final phase gate makes them I,W exactly, as required by [F9]. The list in [F10] contains exactly two CNOTs and four one-qubit occurrences, even when one is the identity. For the fixed matrix J, the orthogonal projectors (I+X)/2 and (I−X)/2 give J2=X and unitarity. The list T(a,b;t) restores b and applies target exponent b−(b⊕a)+a=2ab of J, hence is exactly Toffoli. Its cost is 3(2,4)+(2,0)=(8,12).

2.1F10step 1.2algebrainduction

For the ladder L of [F10] with s≥3, each of its two compute/target/uncompute lists restores all spares, since the central H changes only the target. Let uj,vj be the values of aj just before H in the first and second lists. The common initial spare values give u1=a1⊕c1c2, v1=a1 and uj=aj⊕cj+1uj−1, vj=aj⊕cj+1vj−1 for j≥2. Induction yields uj⊕vj=∏h=1j+1ch, so the two target toggles sum to cs(us−2⊕vs−2)=∏h=1sch. Thus L is the exact controlled X and restores its arbitrary spares. Its lists contain 2s−3 and 2s−5 Toffolis, giving Es=(4s−8)(8,12); the CNOT and Toffoli base cases give E1,E2.

2.2step 1.1F1F4algebra

At the level of ideal data gates, let M be the middle operation and P the forward swap permutation. The middle gate acts only on (gd−1,gd); using XVX when the target bit of gd−1 is 1 makes its ordered action exactly V. By [F4], the data product is P∗MP. Since P sends (x,y) to (gd−1,gd) and no other basis vector into this active pair, the conjugate acts by V on (x,y) and fixes every other data basis vector. Thus the ideal data circuit is the exact two-level unitary, including its scalar phase.

3.1F6F8F10step 2.1algebra

For the balanced list D in [F10], put a=∏c∈Ac and b=∏c∈Bc. The ideal actions of F,G,F,G send z to z⊕a and back and toggle t by b(z⊕a)⊕bz=ab. Step 2.1 restores the temporary spares after each ladder, so this is valid even when the spares include the other call's controls or target. The inequalities q+1≥p−2 and p≥q−1 ensure enough spares. Two calls of each size have pair 2Ep+2Eq+1=Br; the one- and two-control cases have pairs B1,B2. Equality on every basis word extends by [F6] to the full operator Cr(X)⊗Iz, including entangled inputs, so these literal lists meet the borrowed-wire contract of [F8]. All spares are existing wires in each invocation of D.

4.1F10F12step 1.2step 3.1algebrainduction

For the no-workspace list N, [F12] gives the unitary square root Z prescribed in [F10]: each eigenvalue has modulus one, its half-angle scalar squares to it by the double-angle identities, and that scalar has modulus one. For at least two controls, put A0=∏c∈Ac. The two D(A;b;t) calls restore their borrowed data target exactly by step 3.1. Thus on a basis control branch the target exponent of Z in the five-call list is b−(b⊕A0)+A0=2A0b. Induction on the number of controls, with the one-control case of step 1.2 and the zero-control gate as bases, proves its exact Cm(W) action. No new wire is used. Its literal cost is Qm−1+2Bm−1+2(2,4), with Q1=(2,4) and Q0=(0,1); the recursion decreases the number of controls and terminates.

4.2F10step 1.2step 3.1algebra

In the clean branch, D(C;w;t) computes the controls' AND into w, restoring the borrowed data target by step 3.1. The list S(w,t;W) applies W precisely on that branch, and the reversed adjoint D list restores w=0 for every data input. Linearity extends this basis calculation to superposed or entangled data. This gives the exact clean-input data operation and pair 2Bm+(2,4)=Km for m≥1; with no controls the sole gate has pair K0=Q0. No claim about the other initial workspace sector is required.

5.1step 2.2step 4.1step 4.2F5F7F10algebra

There are d−1 swaps, their d−1 inverses, and one controlled-V call. Each zero-valued pattern control is implemented by an X before and after the positive-control call, adding exactly two one-qubit occurrences under [F5]. Steps 4.1–4.2 prove that these selected expansions implement the ideal data gates exactly and each clean-bit call returns its work bit to zero, in the model of [F7]. Sequential composition therefore permits reuse of that bit.

6.1step 1.1step 2.2step 4.1step 4.2step 5.1F7algebra

If d=1, the swap lists are empty and the single controlled target block acts on (x,y) directly. If n=1, there are no controls and the construction is one gate on the sole wire: its matrix is V when x=0,y=1, and XVX when x=1,y=0, so its action on the selected ordered pair is V in both cases. For the other cases, steps 4.1–4.2 supply the elementary expansions used in step 5.1 with the stated work-bit return, consistently with [F7]. Thus every case is an exact elementary implementation.

7.1step 5.1step 6.1step 3.1step 4.1step 4.2F5F7F10algebra∎

A zero control adds two one-qubit X gates, independently of the selected positive-control circuit. The reversed adjoint list has the same pair as its forward list. Adding all forward, reverse, and middle lists therefore gives the claimed total pair. Since Br=O(r), the recurrence sums to Qm=O(m2), whereas Km=O(m). There are 2d−1 calls, and at most m negative controls per call, giving the two claimed total bounds for n≥2. Sequential exact clean return permits reuse of one bit even on superposed data. The empty swap lists when d=1 and the direct ordered one-qubit block when n=1 give the stated boundary cases.

5 · Examples, counterexamples and false statements

None yet.

Sources