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
- Absolute and Conditional Convergence; Rearrangement; Products
- Algebraic Closure, Embeddings, and Separability
- Algebraic Extensions, Extension Degree, and Finite Fields
- Arc Length and Rectifiable Curves
- Areas of Elementary Plane Figures
- Binary Operations, Monoids, Groups and Subgroups
- Bounded Linear Operators and Quotient Spaces
- Circuit Syntax, Denotational Semantics, and Measurement
- Compactness
- Compactness in Metric Spaces
- Completeness, Completion, and Uniform Continuity
- Complex Norms and Realification
- Complexification, Realification and Real Structures
- Composition Series, the Jordan–Hölder Theorem and Solvable Groups
- Congruences, the Integers Modulo n and the Chinese Remainder Theorem
- Connectedness
- Construction of the Natural Numbers
- Construction of the Real Numbers via Cauchy Sequences
- Construction of the Real Numbers via Dedekind Cuts
- Continuity, IVT, EVT, and Uniform Continuity
- Controlled Gates, Phase, and Entanglement
- Cosets, Index and Lagrange's Theorem
- Countability and Uncountability
- Countability Axioms and Cardinal Functions
- Cyclic Groups and Direct Products
- Darboux, L'Hôpital, and Taylor's Theorem
- Determinants of Matrices over a Commutative Ring
- Diagonalisation and the Minimal Polynomial
- Divisibility, Euclidean Domains, Principal Ideal Domains and Unique Factorisation
- Divisibility, Greatest Common Divisors and Bézout's Identity
- Dual Spaces, Bilinear and Quadratic Forms, and Sylvester's Law of Inertia
- Eigenvalues, Eigenvectors and the Characteristic Polynomial
- Euclidean Surface Measure, Divergence, and Green Identities
- Exterior Powers, Orientation and Hodge Duality
- Filters and Ultrafilters
- Finite Counting, Factorials and Binomial Coefficients
- Finite Dimensional Normed Spaces and Riesz Lemma
- Finite-Dimensional Complex Inner-Product Spaces and Matrix Interfaces
- Foundations of the Real Numbers for Analysis
- Free Modules, Exact Sequences, Projective and Injective Modules
- Fubini and Change of Variables
- Fundamental Trigonometric Identities
- Gaussian Elimination, Elementary Matrices and Reduced Row Echelon Form
- Group Actions, Orbits, Stabilisers and Cayley's Theorem
- Group Homomorphisms and the Isomorphism Theorems
- Haar Measure Existence and Uniqueness
- Hausdorff via the Diagonal
- Hereditary and Productive Behaviour of the Separation Axioms
- Hilbert Space Geometry and Riesz Representation
- Ideals, Quotient Rings and the Isomorphism Theorems for Rings
- Improper and Parameter-Dependent Multiple Integrals
- Inner Product Spaces, Gram-Schmidt, Projections and Adjoints
- Integration of Forms and the General Stokes Theorem
- Lebesgue Measure on Euclidean Space
- Limits of Real Functions
- limsup, liminf, and Subsequential Limits
- Line Integrals and the Gradient Theorem
- Linear Independence, Bases and Dimension
- Linear Transformations, Rank-Nullity and Quotient Spaces
- Manifolds with Boundary Collars and Orientations
- Matrices, the Matrix of a Linear Map, and Change of Basis
- Measurable Densities and Radon Volume on Manifolds
- Measurable Functions and Simple Approximation
- Measurements, POVMs, and Instruments
- Measures and Their Basic Properties
- Metric Spaces
- Mixed Partials, Taylor Formulae, and Extrema
- Modules, Submodules, Quotient Modules and the Isomorphism Theorems
- Monotone Functions, Discontinuities, and Continuity Sets
- Monotone Sequences, Bolzano-Weierstrass, and Cauchy Completeness
- Normal Subgroups and Quotient Groups
- Normed and Banach Spaces
- Norming and Separation under Hahn–Banach
- Order, Zorn's Lemma, and the Axiom of Choice
- Outer Measure and the Caratheodory Extension Theorem
- Partitions of Unity and Paracompactness
- Pointwise Extended-Real Function Products
- Polynomial Rings, the Division Algorithm and Roots
- Power Series and Real-Analytic Functions
- Primes, Euclid's Lemma and the Fundamental Theorem of Arithmetic
- Properties of the Integral and the Working FTC
- Pure and Mixed States, Ensembles, and Schmidt Decomposition
- Qubits, Bloch Sphere, Pauli Algebra, and One-Qubit Gates
- Radon Measures and the Riesz Markov Kakutani Theorem
- Rank Theorems and Embedded Submanifolds
- Reeb Stability and Global Foliation Constructions
- Registers, Tensor Products, and Partial Trace
- Relations, Functions, and Quotients
- Reversible Computation, Ancillas, and Coherent Oracles
- Riemannian Metrics Length Distance and Volume
- Rings, Subrings, Integral Domains and Fields
- Rⁿ as a Normed Space; Vector-Valued Functions
- Roots, Rational Powers, and Classical Inequalities
- Sard Theorem and Transversality
- Separation Axioms: the Hierarchy
- Sequences and Limits
- Sequences and Series of Functions; Uniform Convergence
- Series: Convergence and the Nonnegative Tests
- Sigma Algebras and Borel Sets
- Simple Field Extensions and the Construction of the Complex Numbers
- Sine, Cosine, and the Definition of Pi
- Smooth Manifolds and Smooth Maps
- Smooth Partitions of Unity and Exhaustions
- Smooth Vector Bundles and Sections
- Splitting Fields
- Strongly Continuous Semigroups and Hille Yosida
- Subspaces, Products, and Quotients
- Suprema and Infima
- Sylow's Theorems, p-Groups and Nilpotent Groups
- Symmetric Groups, Cycle Decomposition and the Sign Homomorphism
- Tangent Cotangent and the Differential
- Tensor Fields Exterior Algebra and Differential Forms
- Tensor Products of Modules
- The Cantor Set, Baire Category, and Measure Zero in ℝ
- The Complex Exponential and Euler's Formula
- The Derivative and the Mean Value Theorems
- The Determinant of a Linear Operator, Cofactors and Cramer's Rule
- The Divergence Theorem and Classical Stokes
- The Exponential Function
- The Fundamental Theorem of Algebra
- The Fundamental Theorem of Finite Abelian Groups
- The Fundamental Theorems of Calculus
- The Galois Correspondence
- The Inverse and Implicit Function Theorems
- The Inverse Function Theorem Completed
- The Lebesgue Integral and the Convergence Theorems
- The Riemann Integral in Rᵐ and Jordan Content
- The Riemann Integral: Definition and Integrability
- The Spectral Theorem, Positive Operators and Singular Value Decomposition
- The Topology of Euclidean Space
- The Total Derivative in ℝᵐ → ℝⁿ
- The ZFC Axioms and the Basic Set Constructions
- Topological Spaces and Continuity
- Topology of ℝ
- Triangularisation, Generalised Eigenspaces and Jordan Canonical Form
- Urysohn's Lemma and the Tietze Extension Theorem
- Vector Spaces, Linear Subspaces, Span and Direct Sums
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
Global Phase Equivalence
Definition
For square matrices of the same size, write when for some with . This relation is kept distinct from exact matrix equality.
Facts & Assumptions
Given: Square complex matrices of the same size.
Proof
Taking gives , so .
If and , then because ; also . Hence implies .
If and , then and . Thus and imply . This proves transitivity; together the three properties establish an equivalence relation.
The matrices and are phase-equivalent by the scalar , but they are not equal because their entries differ. Thus phase equivalence is distinct from exact equality.
Demultiplexing a Two-Block Unitary
Statement
Let be a finite-dimensional complex inner-product space and let be unitary endomorphisms of . On the control-first direct sum , the block unitary factors as for unitary on and a diagonal unitary in an orthonormal eigenbasis; denotes under .
Facts & Assumptions
Given: A finite-dimensional complex inner-product space and unitary on .
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.
Every nonzero complex number has a unique polar form with and : every unit complex number is for some real , and therefore has a unit-modulus square root.
Orthogonal and unitary operators form groups, and their determinants have modulus one: products and adjoints of unitary maps are unitary.
Proof
The product is unitary by [F3] and hence normal. By [F1], choose a unitary and diagonal unitary with : diagonalize , write each eigenvalue as by [F2], and put on the corresponding diagonal of .
Set . Then . Also . Taking adjoints in gives , so . Thus the two diagonal blocks in the displayed factorization are respectively and .
The factors are unitary, and the two block products agree with ; hence the asserted exact block factorization holds, including repeated eigenvalues. Only a finite orthonormal eigenbasis and finitely many square roots are chosen.
Cayley Charts on the Unitary Matrix Group
Statement
For , define and , both regarded as real spaces where appropriate. Then is a compact smooth real manifold of dimension . Near , the Cayley map is a smooth chart from ; 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 ; a Borel subset is -null exactly when its intersection with every chart has Lebesgue-null coordinate image. Under AC, is the normalized Haar probability, so this also gives the Haar-null criterion in that branch.
Facts & Assumptions
Given: An integer and the matrix definitions in the Statement.
Heine-Borel in : with the Euclidean metric a subset of is compact if and only if it is closed and bounded, and the proof by bisection uses no choice principle; the same holds on the real line: a closed bounded subset of a finite-dimensional real Euclidean space is compact.
Smooth manifolds and their smooth charts: a smooth manifold is specified by a compatible smooth atlas.
Riemannian metric and riemannian manifold: a Riemannian metric is a smooth symmetric positive-definite inner product on each tangent space.
Riemannian volume density: in coordinates, the Riemannian volume density is .
The riemannian volume density is coordinate independent: these local positive smooth densities agree on chart overlaps and define one global density.
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.
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.
Normalized Haar probability on a compact group: under full AC a compact Hausdorff group has a unique normalized left Haar probability.
Assume AC for the Borel volume measure; full AC implies AC (The Axiom of Countable Choice (), The Axiom of Choice, The Axiom of Choice implies countable choice).
Assume full AC only for the optional identification of normalized Frobenius volume with normalized Haar probability (The Axiom of Choice).
Proof
A skew-Hermitian matrix has purely imaginary diagonal entries, giving real parameters. For each , its entry is an arbitrary complex number and the entry is then forced to be its negative conjugate, giving two real parameters. Thus has real dimension .
If for , then . But is purely imaginary because , while this equality gives for nonzero . Hence is invertible. Direct multiplication, using that and commute, shows is unitary.
On the open set of unitary matrices near where is invertible, the inverse formula is . The factors are polynomials in , so they commute; using gives . The forward and inverse formulas are smooth rational matrix maps, and therefore define a chart of dimension near .
Left translation by any fixed sends a Cayley neighborhood of to a chart neighborhood of , so these translates cover . The group is closed, since is a closed matrix equation, and bounded, since every column has norm one. Identifying with , [F1] makes 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 -manifold, and [F2] supplies its smooth structure.
The Frobenius inner product is left invariant because . 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.
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 -null exactly when its coordinate image is Lebesgue-null.
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.
Cosine-Sine Block Decomposition
Statement
Let and let be partitioned into blocks There are block-diagonal unitaries and and nonnegative real diagonal matrices such that The singular values at and are allowed, with no nondegeneracy assumption.
Facts & Assumptions
Given: An integer and a unitary matrix partitioned as in the Statement.
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.
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.
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
Apply [F1] to to obtain unitary and with and . Since is the compression of the unitary to the first block, for every , so each singular value satisfies . Put with .
The first block row of gives , hence . For every with , the row 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 satisfies .
The first block column of gives , hence . For every with , the column has norm one, and these columns are mutually orthogonal. Extend them to an orthonormal basis using [F3]; the resulting unitary satisfies . Therefore for some .
The upper-right block of gives . Thus, for each with , column of is . The lower-right blocks of and give . For such , the prescribed entry already contributes to row 's squared norm, so forces every other entry in that row to vanish. Thus both the rows and columns indexed by have no cross-block entries. On one has ; the block of has orthonormal rows and columns and is therefore unitary. This also covers , where the corresponding row and column are zero, and , where the index belongs to .
Let be that unitary block and replace by . Since acts only where and , this leaves unchanged and changes the lower-right block to . Hence Both outside factors are unitary, and by definition. The argument includes , , repeated values, and empty positive or zero supports.
Two-Level Unitary
Definition
Let a finite ordered register have an orthonormal computational basis , using the root convention that the inner product is linear in its first argument. For distinct labels , choose , where . The two-level unitary acts by the matrix in the ordered basis and acts as the identity on . Its action is exact matrix equality: any scalar phase contained in is retained.
Facts & Assumptions
Given: The finite-dimensional complex inner-product space, its ordered orthonormal computational basis, distinct labels , and .
For a subspace of a finite-dimensional inner product space, : a subspace of a finite-dimensional inner-product space has the orthogonal direct sum decomposition .
Linear isometries, and orthogonal or unitary operators on finite-dimensional inner product spaces: a unitary endomorphism is an invertible linear isometry.
The computational basis is orthonormal: the computational basis vectors of the finite ordered register form an orthonormal basis.
Verification
Put . By [F3], the selected pair is orthonormal. By [F1], , and relative to this sum the defined operator is .
The direct sum preserves norms because is unitary on and the identity preserves norms on . Its inverse is , so it is an invertible isometry and hence unitary by [F2]. The scalar phase in is part of this exact direct-sum matrix.
Exact Two-Level Elimination of a Unitary
Definition
Input: an exact-arithmetic representation of , , 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 and an empty chronological list. For each column , and for , set and . If , do nothing. Otherwise set and left-multiply rows by recording this two-level unitary in the order applied. Let the resulting matrix be . Return the factorization . In chronological circuit order, apply first and then .
Correctness and Termination of Two-Level Elimination
Statement
For , the elimination procedure of Exact Two-Level Elimination of a Unitary terminates after at most Givens steps and returns an exact factorization of into the recorded two-level adjoints followed by a diagonal unitary. The number of diagonal entries is ; entries equal to need no phase gate.
Facts & Assumptions
Given: and the exact-arithmetic operations, zero tests, loop bounds, and update matrices specified in Exact Two-Level Elimination of a Unitary.
Exact Two-Level Elimination of a Unitary defines the descending row updates and records each embedded in chronological order; it returns the formal product of their adjoints and the terminal matrix.
Proof
If , then and direct multiplication gives and . Thus the row operation is defined and left multiplication by its coordinate embedding preserves unitarity of . If , skipping the operation leaves the desired entry zero.
Inductively, before processing column , columns have zero entries below their diagonal positions. Each row pair used for column has indices at least , so both entries in every earlier column are zero and the row operation preserves those zeros. Descending therefore makes column zero below its diagonal without undoing a zero already made in that column.
After the finite loops, 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 is diagonal with unit-modulus diagonal entries.
Rearranging gives exactly. The finite loops have iterations (zero for ), with at most one row elimination per iteration, so they terminate with at most that many eliminations and at most 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 first and then .
One-Qubit Euler Decomposition
Statement
Use the rotation convention of Exact one-qubit gates and rotations and define : For every there are real with If , the scalar factor is unnecessary and .
Facts & Assumptions
Given: A unitary matrix and the rotation conventions in the Statement.
Every nonzero complex number has a unique polar form with and : every nonzero complex number has polar form with .
is a bijection from onto the real unit circle: every point of the real unit circle is for some .
Signs, monotonicity intervals, and ranges of sine and cosine gives the monotonicity intervals of sine and cosine and their range . Quarter-turn values and shifts by pi/2 and pi gives the quarter-turn values and the identities and .
For , the determinant over a commutative ring by the Leibniz formula, and for a real matrix: determinant is the Leibniz sum over permutations, and conjugating every entry conjugates that sum.
For every square matrix over a commutative ring, : for every square matrix over a commutative ring.
For same-sized finite square matrices over a commutative ring, : for same-sized square matrices over a commutative ring.
The Pauli matrices: and in the ordered computational basis.
Proof
Direct multiplication of the matrices in [F8] gives . Grouping the even and odd terms of the exponential series in [F7] then gives and . Thus the matrices used in the Statement match the QC7 convention exactly.
The Leibniz formula [F4] gives ; by [F5], . Thus [F6] and give .
By [F1], choose with and put . The scalar has modulus one and [F4],[F6] give , so is unitary with determinant one.
Write the first column of as . Its norm is one, so is on the unit circle in the closed first quadrant. By [F2], choose with and . By [F3], sine is positive on : it increases from to on and decreases to on . Its -shift makes it negative on , so forces . Cosine decreases strictly on and vanishes at , so then forces . Set . This also covers either zero coordinate.
The unit vector orthogonal to is a unit scalar multiple of . If its scalar is , the determinant of the matrix with these columns is ; since , the second column is exactly . Choose phases so and ; when one modulus is zero choose its phase arbitrarily.
Put and . Direct multiplication of the matrices obtained in step 1.1 gives The phase choices in step 4.1 make this exactly the two columns of , including the cases and .
Restoring the scalar from step 2.1 proves the formula for arbitrary . If , choose in step 2.1, so , and apply steps 3.1–5.1.
Exact Two-Qubit Cartan Decomposition
Statement
For every there are , real , and the matrices such that The equality is exact; the scalar is displayed.
Facts & Assumptions
Given: is a unitary, and the Pauli matrices and magic-basis vectors below are in the stated order.
One-Qubit Euler Decomposition: every unitary is exactly for real angles in the QC7 convention.
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.
Every nonzero complex number has a unique polar form with and : every unit complex number is for some real , and every unit complex number has a unit-modulus square root.
The Pauli matrices: , , and .
For , the determinant over a commutative ring by the Leibniz formula, and for a real matrix: determinant is the alternating permutation sum; conjugating every matrix entry conjugates the value of that sum.
Proof
By [F5] and [F7], . Then [F6] and give . Choose with and put ; applying the permutation formula to a scalar multiple of a matrix gives , so . Use the magic basis and let have these columns. Direct inner products show each vector has norm one and distinct vectors are orthogonal, so is unitary. Then is unitary with determinant one. The matrix is symmetric; since and is unitary, , so is unitary.
Direct calculation from the definition of gives and . Write with real symmetric. From we obtain and . Apply [F2] first to . If , then , so every eigenspace of is invariant under . The restriction is self-adjoint for the inherited inner product, since . Apply [F2] separately on each such finite-dimensional eigenspace; the union of these orthonormal eigenbases is an orthonormal common eigenbasis because distinct eigenspaces are orthogonal. Its columns form a real orthogonal simultaneously diagonalizing , so with . If , change the sign of one column; the diagonalization is unchanged and now . Choose unit square roots of each . By [F6]–[F7] and , , so is either or ; if it is , change the sign of one root. Then and satisfy , , and .
Put . It is unitary and Thus , which entrywise says is real. Also , so , and .
Direct multiplication gives , and the matrices in [F4] are traceless and Hermitian. In the magic basis let be the real skew-symmetric generator with , , and zero on the other basis vectors. Direct action on the four displayed vectors gives the six local generators These are a basis of the six-dimensional real space of skew-symmetric matrices. Thus every is the magic-basis image of some real linear combination of local generators, where are traceless skew-Hermitian matrices. The two summands commute, so its exponential is . A traceless skew-Hermitian matrix has eigenvalues for some real , so . Hence each plane rotation is a local image. Conversely, [F1] expresses every local factor as a product of and rotations; their magic-basis images are exponentials of the displayed real skew generators and hence real orthogonal. Finally, Givens elimination writes every 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 ; orthogonality then leaves a lower-right block, to which the same procedure applies recursively. Therefore the local image is all of , and in particular and are local images.
In the same basis, direct action of the Pauli products gives the diagonal sign lists , , and for , , and , respectively. These mutually orthogonal trace-zero lists form a basis of the three-dimensional real trace-zero diagonal subspace. Since is diagonal unitary with determinant one, choose arguments for its four diagonal entries; their sum is a multiple of , 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 in the magic basis. Conjugating back by , using the local representations from step 4.1, and restoring gives the stated exact factorization.
Global Phase Under Control
Statement
Let be a nonzero finite-dimensional target space, let be unitary on , and let . In control-first order put Then . 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 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 . An unconditional output scalar acts on the density by .
Controlled Unitary Access: controlled access is the block operator on the control-first register.
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.
Density operator: a density operator is a nonnegative endomorphism of trace one on a nonzero finite-dimensional complex inner-product space.
Finite POVMs and their outcome law: for a density operator and a finite POVM , the outcome weight is .
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
The diagonal blocks of are and . Multiplying the blocks of gives and , so the two full matrices are equal exactly.
Under the whole-output update specified in the Given, because . Hence the whole-output scalar leaves the density operator unchanged.
By [F2], and are phase-equivalent as target matrices. If , is not a scalar multiple of the identity: its diagonal entries are and . Thus step 1.1 places a phase on only the active control block. Left multiplication by changes the blocks back to , so it restores exactly. For no correction is needed.
By [F4], each defined measurement weight is . The equality of density operators in step 1.2 makes these weights identical for every outcome . 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.
Parameter Count for a Fixed CNOT Skeleton
Statement
Assume AC to form normalized Frobenius volume on . For fixed and a fixed ordered CNOT skeleton with 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 . If , 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 wires, and AC for the normalized smooth volume.
One-Qubit Euler Decomposition: each gate is a scalar phase times an matrix parameterized by three real Euler angles.
CNOT and Control-Target Order: the first-wire-control CNOT maps to ; the reverse orientation is the same permutation with wires interchanged.
The Euclidean inverse function theorem: a smooth map between equal-dimensional Euclidean neighborhoods with invertible derivative is a local diffeomorphism.
Morse-Sard for Euclidean maps: for a map from an -dimensional Euclidean open set to a -dimensional one, with and , its image has Lebesgue measure zero.
Cayley Charts on the Unitary Matrix Group: is a smooth real manifold of dimension ; 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.
The Pauli matrices: are the displayed Pauli matrices in the ordered computational basis.
Heine-Borel in : with the Euclidean metric a subset of is compact if and only if it is closed and bounded, and the proof by bisection uses no choice principle; the same holds on the real line: a closed bounded subset of a finite-dimensional real Euclidean space is compact.
Denotational semantics of a finite layered circuit: chronological circuit layers denote the exact matrix product .
Finite circuit resource accounting: the operation model declares the allowed gate alphabet and counts only the named gate occurrences.
The computational basis is orthonormal: the ordered computational basis of a register is orthonormal.
AC is assumed to construct the normalized smooth volume; the optional Haar wording assumes full AC (The Axiom of Countable Choice (), The Axiom of Choice, The Axiom of Choice implies countable choice).
Proof
A matrix in has the form with : 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 is . On each of the eight open sets where one real coordinate is positive or negative, solve that coordinate as ; these smooth charts show 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 is a compact smooth real manifold of dimension . Collecting consecutive one-qubit gates into local layers and moving every scalar factor to the front writes each circuit with the fixed skeleton as where . 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.
Direct inspection of the matrices in [F6] shows that every traceless skew-Hermitian matrix is a unique real combination of : its diagonal entries are and its off-diagonal entries are , with . Fix one CNOT with control and target . Applying its basis action [F2] to the four affected basis vectors gives and . By [F10], the CNOT basis permutation is unitary. Its local commuting subgroup therefore consists of arbitrary factors on the other wires, rotations on , and rotations on . This product has real dimension . A complementary subspace of is spanned by and has dimension four.
Give and local coordinates from the charts in step 1.1 and angle charts on the two circles in . The local product map , , has derivative at equal to . The direct sum makes this derivative an isomorphism between -dimensional coordinate spaces, so [F3] gives neighborhoods on which every nearby local factor is with four real coordinates in and . The group is compact: each is the closed bounded set of matrices with , and a finite product of compact sets is compact. Translating the neighborhood and using compactness gives a finite cover of by such local product charts.
Starting with and proceeding downwards, use a finite chart to write the current local factor as , where is one of finitely many fixed local translations and has four real coordinates. Since commutes with , move it through and multiply it into the next local factor; that product remains in . Repeating this for all CNOTs leaves four-parameter factors and one arbitrary local layer with 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 .
The exact circuit set is compact, hence Borel: by step 1.1 it is the continuous image of the compact space . 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 and is Borel. If , every point of each parameter domain is critical for the smooth map into a target chart of , 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.
Gray-Code Synthesis of a Multiplexed Axis Rotation
Statement
Let controls have computational labels , and let . Fix . On one target qubit define Then is exactly synthesized with CNOTs for (the final CNOT restores the parity network). For it uses target rotations ; for it uses rotations in the fixed target basis described below; for it is one rotation and no CNOT. For and the implementation also uses two fixed target basis-change gates; the 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 , the computational-basis order on the controls, and the rotation convention . For a control bit and target bit , define , extending linearly; its matrix is a permutation and is self-inverse.
Big-endian encoding of ordered bit strings: the ordered -qubit basis assigns bit word the big-endian index , so the first wire is the most significant bit.
Pauli formula for an axis rotation: for real unit .
The Pauli matrices: in the ordered computational basis.
CNOT and Control-Target Order: the first-wire-control CNOT maps to and is self-inverse.
Denotational semantics of a finite layered circuit: later-applied gates multiply on the left of earlier gates in the circuit denotation.
Finite circuit resource accounting: the declared gate count is the number of occurrences from the operation model's allowed alphabet.
The computational basis is orthonormal: the ordered computational basis is orthonormal.
Proof
For , construct the reflected list and for . 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 masks as , beginning at . For , take the singleton list containing the empty mask and use no coordinate transition. Set and choose . For , summing over all masks factors as , which equals when and otherwise. Substituting the chosen therefore gives .
Assume . Substitute in [F2] and use [F3]; this gives . Apply , then toggle the single control coordinate taking to with a CNOT and apply , continuing through and using one final CNOT to restore mask . On a fixed control basis state , the accumulated target bit flip before the th rotation is modulo two by [F4]. The CNOT network consists of basis permutations and hence is unitary by [F7]. Conjugation by gives by direct multiplication of the displayed matrix, so that rotation acts as . Its ordered application agrees with [F5], and [F6] counts these gate occurrences.
Direct multiplication of the matrices from step 2.1 gives . Thus on branch the target product is 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 , there is one branch and the circuit is just .
For , use exactly the same masks and angles with in place of : the diagonal formula gives and , proving the same branch calculation. For , put . Direct Pauli multiplication gives , hence by [F2]. Conjugate the entire circuit by the two target gates in chronological order. Its branch action is . This implementation retains the original network unchanged between the two external basis changes, so it has exactly CNOTs, rotations, and those two additional one-qubit gates. For , directly apply .
Exact Controlled One-Qubit Unitary with Two CNOTs
Statement
For every , the exact controlled matrix is realized with two CNOTs and one-qubit gates only. The scalar phase of 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 .
One-Qubit Euler Decomposition: for real parameters, with possible when .
Exact one-qubit gates and rotations: axis rotations are and .
CNOT and Control-Target Order: the first-wire-control CNOT maps to and is the block .
Controlled Unitary Access: in control-first order.
Denotational semantics of a finite layered circuit: later-applied gates multiply on the left of earlier gates.
Finite circuit resource accounting: the declared gate count counts only the named gate occurrences from the operation model.
The computational basis is orthonormal: the ordered computational basis of a register is orthonormal.
Proof
Put , and define Using additivity of same-axis rotations gives . The rotations in [F1] follow the axis convention [F2]. Direct multiplication with the matrices in [F1] gives and ; therefore .
The displayed matrix product has chronological gate order , CNOT, , CNOT, 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 its target block is ; on value the two CNOTs apply between the target factors, so the block is . Hence the product is exactly by [F4].
Since , block multiplication gives , where . 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 .
Exact Three-CNOT Synthesis of Two-Qubit Unitaries
Statement
Every 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.
Exact Two-Qubit Cartan Decomposition: , where and .
One-Qubit Euler Decomposition: every factor and every scalar one-qubit unitary has an exact Euler realization using the QC7 rotation convention.
Pauli formula for an axis rotation: for real unit .
The Pauli matrices: are the displayed Pauli matrices in the ordered computational basis.
CNOT and Control-Target Order: the first-wire-control CNOT maps to ; its wire order is part of the definition.
Denotational semantics of a finite layered circuit: chronological circuit layers denote the exact matrix product .
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.
The computational basis is orthonormal: the ordered two-qubit computational basis is orthonormal.
Proof
The Pauli matrices in [F4] give commuting products . On the even-parity subspace with ordered basis , and restrict to and , while restricts to . Hence restricts there to , whose entries are on the diagonal and off diagonal. On the odd-parity basis , and both restrict to and restricts to , so the block is . These two blocks give In basis , the two CNOT orientations are Here is the gate from [F5] and 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 All entries agree with the two parity blocks above; thus this is an exact identity, including its scalar.
The factorization in step 1.1 uses three CNOTs and otherwise one-qubit rotations. By [F2], the local factors and the scalar in [F1] have exact one-qubit implementations; . The circuit product [F6] therefore equals the written factorization exactly, and [F7] counts three CNOT occurrences and no additional wires.
Two-CNOT Synthesis up to a Migrating Terminal Diagonal
Statement
Every factors exactly as , where is diagonal in the ordered two-qubit computational basis and 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 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 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 has the form after grouping the two slot wires first.
Exact Two-Qubit Cartan Decomposition gives , with local factors and ; here , and similarly for .
The Pauli matrices specifies ; they square to identity and satisfy , , by matrix multiplication.
CNOT and Control-Target Order gives for first-wire control.
Exact Three-CNOT Synthesis of Two-Qubit Unitaries gives an exact three-CNOT synthesis for the last arbitrary slot, including its scalar phase.
Denotational semantics of a finite layered circuit places later chronological operations to the left in a matrix product.
Finite circuit resource accounting counts the stated gate occurrences and wires.
Every nonzero complex number has a unique polar form with and supplies real arguments for unit complex scalars; is a bijection from onto the real unit circle supplies an angle for each real unit-circle pair; For same-sized finite square matrices over a commutative ring, supplies multiplicativity of determinants.
Proof
Normalize to with : unitarity and the determinant permutation formula give , so choose using [F8]. Put and . For a matrix , direct multiplication gives . Therefore local with satisfies . It follows by substitution and cyclicity of trace that for local matrices . This identity uses transpose, not adjoint.
Put and . Since is diagonal with two and two entries, is diagonal unitary with determinant one. Also and . Hence . Its imaginary part is , with real and . If both vanish, take . Otherwise choose , , possible by [F8]. Thus has real .
Apply [F1] to . The determinant of each local factor and of is one: the latter follows from the simultaneous Pauli eigenvalue sign lists , and in the Cartan proof, each with sum zero. Thus and . The commuting symmetric matrices commute with , so . Expand their exponentials using [F2]. Since and all nonconstant products except this triple are traceless, . Its imaginary part is zero, so at least one Cartan coordinate is an integer multiple of .
If, for example, , its factor is , 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 or . Simultaneous conjugation on both qubits by a one-qubit rotation permuting the Pauli axes moves the absent coordinate to . Such permutations are obtained from in [F3]; their conjugations exchange the other two axes up to signs, and each sign is squared in a Pauli product. Thus is a scalar times exterior local gates and for real . All scalar factors are retained as one-qubit scalar gates.
Let and let be [F4]. Its basis action gives and . Formula [F3] gives and (each rotated is ). Therefore the exact identity follows by exponentiating the commuting generators. This uses two CNOTs and one-qubit gates only. Combined with step 4.1 it synthesizes with two CNOTs. Since , the required diagonal is and exactly. No CNOT is spent implementing in this factorization assertion.
Write the first two chronological slots as . By step 5.1, , so the product in [F6] is . The separator hypothesis gives branch by branch, even if its act on several other wires. The product becomes . The next slot is still an arbitrary unitary on the same two wires. Factor it again and continue. Each of the first 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 the process performs no migration and uses only the three-CNOT base case. This proves the count and exact equality.
Exact Central Controlled-Z Absorption at a QSD Node
Statement
Let , let the first of wires be the target, and let and be generic block-diagonal unitaries in that target's basis. Let be a multiplexed on that target, selected by the other wires. The exact matrix can be represented by four generic -qubit slots, two multiplexed factors and a central network with only controlled- gates and arbitrary one-qubit rotations. Each controlled- costs one CNOT. Thus one CNOT is saved relative to demultiplexing and using a full -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, , and as stated.
Gray-Code Synthesis of a Multiplexed Axis Rotation supplies the cyclic Gray masks and Walsh angles for .
One-Qubit Euler Decomposition gives the QC7 matrix .
Demultiplexing a Two-Block Unitary factors each generic two-block unitary into two smaller unitaries and a diagonal two-block factor.
CNOT and Control-Target Order supplies the exact controlled- matrix; Denotational semantics of a finite layered circuit puts later chronological gates to the left.
Finite circuit resource accounting counts declared CNOT occurrences and all wires.
Proof
Direct multiplication of [F2] gives , with . In the cyclic Gray construction [F1], replace each select-to-target controlled- by select-to-target controlled-. On select word , the parity accumulated at mask is now , so conjugation changes the th rotation angle to . The same Walsh inversion proves the final target angle is , and the final Gray edge restores the accumulated exponent to zero. Thus this network equals exactly and contains controlled- gates. All select bits are unchanged.
Let its final chronological controlled- use select wire , and put for on that select wire and identity on the other select wires. In target-first block order this last gate is . If is the chronological network with this last gate deleted, [F4] gives the exact identities and . Both and remain arbitrary -qubit unitaries. This is a block multiplication identity and does not commute through .
Apply [F3] separately to and . These two generic block-diagonal factors still produce four arbitrary -qubit slots and two diagonal two-block factors. A diagonal factor is a multiplexed on the first wire: if , its two target entries are and hence equal . The central has controlled- gates. Therefore the rewritten circuit has exactly the required shape and retains the identity in step 2.1.
Set . Direct multiplication gives and , so a controlled- on a select-target pair equals in that pair's control-first order. Each costs one CNOT and two one-qubit gates, with no added wire. Thus deleting the terminal 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.
Generic No-Ancilla CNOT Lower Bound
Statement
Assume AC to form normalized Frobenius volume. For , almost every -qubit unitary with respect to that measure requires at least 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 , exact matrix equality, no ancillas, and the stated one-qubit/CNOT gate model.
Parameter Count for a Fixed CNOT Skeleton: each fixed -CNOT skeleton has a normalized-Frobenius-volume-null image whenever ; under AC this is Haar-null.
Assume AC for normalized Frobenius volume; the Haar wording assumes full AC (The Axiom of Countable Choice (), The Axiom of Choice, The Axiom of Choice implies countable choice).
Proof
If , the claimed lower bound is and holds because gate counts are nonnegative. Suppose and put , which is positive. For every integer , the ceiling property gives , hence .
For fixed , only finitely many CNOT skeletons exist: at each of the 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 , the finite union over remains null. Under full AC, [A1] and [F1] identify this as a Haar-null union.
For , outside the null union in step 2.1 no exact circuit with fewer than CNOTs exists, so almost every unitary needs at least CNOTs. For , 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.
Linear Multicontrolled X with One Borrowed Wire
Statement
For every integer , an -controlled on control wires and one target has an exact circuit of arbitrary one-qubit gates and CNOTs when one additional borrowed wire is available. The circuit equals 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.
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 and one control phase gate.
CNOT and Control-Target Order specifies .
Clean and dirty ancillas requires exact return of a borrowed wire.
Denotational semantics of a finite layered circuit composes chronological gates in reverse matrix order.
Finite circuit resource accounting counts gate occurrences.
The computational basis is orthonormal gives a basis of all bit words; equality on it implies equality of linear maps.
Proof
An exact Toffoli has constant cost. Let . The orthogonal projectors show is unitary and . With controls , apply chronologically to the target, , , , and . The bit returns, and the target exponent is , so its action is . By [F1] the three controlled gates and two CNOTs cost at most eight CNOTs and twelve one-qubit gates. No relative phase is discarded.
First construct an -controlled with borrowed wires, for . Call the controls , the borrowed bits , and the target . Let toggle under ; for , let toggle under . Let toggle under . Apply the list , followed by ; for the second list is just . Each list restores every borrowed bit, since changes only and the compute list is reversed afterward.
Let be the values of immediately before in the first and second lists. Both lists begin with the same borrowed values. We have , and, for , , . Thus by induction. The two target toggles add to . Controls and borrowed bits are unchanged. The two lists contain exact Toffolis. For use one Toffoli; for use one CNOT. This auxiliary construction therefore costs and uses at most borrowed wires.
For , partition the controls into of sizes , , and call the extra wire . Put , . Apply an -controlled into , a -controlled into , and repeat these two calls in that order. The first kind can borrow from because ; the second can borrow from because . Step 3.1 restores these temporary borrowed wires after each call, for their actual arbitrary values at that call. No wire beyond the original is used.
The four ideal calls send to and back, while toggling by . Thus their action is precisely with and every control returned. The two calls of each kind cost . For , use [F2] or step 1.1 and leave untouched. Equality on every basis word extends by [F6] to ; tensoring with an external identity also proves the entangled-input claim and the return condition [F3].
Exact QSD CNOT Upper Bound
Statement
For , every -qubit unitary has an exact no-ancilla circuit with arbitrary one-qubit gates and at most CNOTs. For , no CNOT is needed. For , a circuit on the empty register realizes a scalar unitary exactly if and only if it is ; 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 -qubit matrix semantics, no ancillas, arbitrary one-qubit gates, and CNOT count as the resource.
Cosine-Sine Block Decomposition: an even-dimensional unitary factors into block-diagonal unitaries and one central cosine-sine rotation with exact boundary sectors.
Demultiplexing a Two-Block Unitary: each two-block unitary factors into two smaller unitaries and a diagonal two-block factor.
Gray-Code Synthesis of a Multiplexed Axis Rotation: for either fixed axis , a multiplexed with select bits has an exact cyclic Gray construction with CNOTs; for it is one rotation with no CNOT.
Exact Three-CNOT Synthesis of Two-Qubit Unitaries: an arbitrary two-qubit terminal block has a three-CNOT exact synthesis.
One-Qubit Euler Decomposition: in the QC7 convention.
Denotational semantics of a finite layered circuit: chronological circuit layers denote .
Finite circuit resource accounting: the declared gate count counts occurrences of the allowed gates in the explicit operation model.
CNOT and Control-Target Order: a CNOT is the exact controlled- permutation with the stated wire order.
The computational basis is orthonormal: the computational basis on the CNOT wires is orthonormal.
Exact Central Controlled-Z Absorption at a QSD Node proves the exact identity when the terminal Gray controlled- is deleted from the central rotation, leaving four generic recursive slots and two multiplexed factors.
Finite circuit syntax and ordered wire labels: every gate has positive arity, and a gate occurrence requires that many distinct wires.
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
Split off the first wire and recurse on the remaining contiguous wire interval. Apply [F1] to split an -qubit unitary into a central multiplexed and two block-diagonal factors. Apply [F2] to each side factor: each produces two recursive -qubit unitaries and one diagonal two-block factor, which is a multiplexed . Thus the recursive stage contains four -qubit calls and three multiplexed rotations, interpreted with exact chronological composition [F6] and the declared no-ancilla width [F7].
Each of the three multiplexed rotations has select bits, so [F3] uses at most CNOTs per rotation. With from [F4], the recurrence is for . Induction gives the unoptimized bound : it equals at , and substituting the expression for into the recurrence gives the expression for . The counts are gate occurrences in [F7].
For the central multiplexed , use the Gray traversal of [F3] with controlled- in place of CNOT. Indeed by [F5], so the same Walsh angles give branch sign at mask and the final cyclic edge restores the accumulated parity. This is exactly the desired multiplexed rotation. Each controlled- costs one CNOT: , since the active block is ; [F8]–[F9] justify the CNOT matrix and unitarity. Take the last Gray edge as a terminal controlled- 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 or by the single-wire on its select wire. Both branches remain arbitrary unitaries, so [F2] still gives four recursive children and two multiplexed factors. The full block identity is by [F10], where and omits the terminal controlled-. Thus one CNOT is saved at each nonterminal recursive node. There are such nodes, zero when . Subtracting this from step 2.1 gives .
Each recursive call removes the first wire of its contiguous interval, so all 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- or controlled- gates act on other wires. Products of these separator operations therefore have exactly the block form required by [A1]. The preceding controlled- 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 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 . Consequently . When , , so there is no migration or saving and the formula is the three-CNOT base case.
For , the unitary is itself one allowed one-qubit gate and uses zero CNOTs. For , [F11] permits no gate occurrence, so every layer is empty and [F6] makes every circuit denote on . Conversely, the empty circuit realizes . Thus an arbitrary scalar unitary has an exact zero-wire circuit precisely when it equals . The bound for follows from step 4.1; these gate counts imply no arithmetic or precision bound.
Multicontrolled Unitaries with and without a Clean Work Bit
Statement
For controls and exact , define This controlled operation has (i) a no-workspace exact construction with one-qubit and CNOT gates, and (ii) an exact construction using one clean work bit, initially and returned to , with such gates. For nonscalar , every exact circuit needs at least 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 and return to for every data input; dirty auxiliary wires may start in any state and the full operation is 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.
Exact Controlled One-Qubit Unitary with Two CNOTs: an exact controlled is implemented using two CNOTs and one-qubit gates, retaining its scalar phase.
Complex spectral theorem: a normal endomorphism of a finite-dimensional complex inner product space has an orthonormal eigenbasis, and conversely: a unitary on a finite-dimensional complex inner-product space has an orthonormal eigenbasis.
Every nonzero complex number has a unique polar form with and gives for every unit complex number . The addition formulas for sine and cosine gives the sine and cosine double-angle identities by taking equal arguments.
Clean and dirty ancillas: a clean work bit starts in and an exact clean construction returns it to for every input; a dirty bit may start arbitrarily but must be returned unchanged.
Controlled Unitary Access: the exact controlled block is in control-first order.
Finite circuit resource accounting: one-qubit and CNOT costs count the gate occurrences declared in the operation model.
Denotational semantics of a finite layered circuit: the denotation of chronological gates is .
CNOT and Control-Target Order: one CNOT is an exact one-control gate in the stated control-target order.
The computational basis is orthonormal: the computational basis on the gate wires is orthonormal.
Linear Multicontrolled X with One Borrowed Wire supplies an exact -controlled with elementary gates and one borrowed wire; the complete operator is on all states, including correlated inputs.
Proof
By [F2], choose an orthonormal eigenbasis of . For a unit eigenvector of eigenvalue , , so [F3] writes . Set . The double-angle identities give , and hence . Putting these unit-modulus roots on the diagonal in that eigenbasis and conjugating back gives a unitary with .
For the clean-bit branch, let start at . An -controlled into , using the data target as the returned borrowed wire, changes to the AND of the controls. Apply controlled by and reverse the same circuit. On each computational-basis input this applies exactly on the all-one control branch by [F5] and restores by [F4]; linearity gives the same exact operator on superpositions. The two calls and one controlled- call cost in the model [F6] by [A1].
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 has two orthogonal eigenvectors with distinct eigenvalues , the state obeys , which is not a scalar multiple of . Set all other controls to and the target to ; toggling the disconnected control changes the required target ray from to , a contradiction. Thus the target component contains all controls and has at least vertices. A connected component on at least vertices has at least edges, so at least two-qubit gates are needed.
For , write for the AND of the first control bits and for the last control. In chronological order [F7], the recursive controlled- construction applies to the target under , toggles by an -controlled under the first controls, applies under the changed , toggles back, then applies under the first controls. On a basis branch the exponent of on the target is : it is when , when , and when . Thus the ideal branch matrices are , exactly the required action by [F5]. Implementing the two controlled- calls with the data target as borrowed wire, and the final recursive controlled- call with the restored as borrowed wire, yields , where is the borrowed-bit controlled- cost. By [F8]–[F9], ; [A1] gives for , so summing the recurrence from the constant one-control base [F1] gives 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 is available but is not needed as an extra wire.
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].
Gray-Path Synthesis of a Two-Level Gate
Definition
Input distinct , , exact , 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 . Output: the chronological elementary-gate list on the data wires and, if selected, that one clean work wire.
Let be the path that flips the differing bit positions once in increasing order, where is the Hamming distance. For , swap and by an on their differing bit controlled on the other bits matching their common pattern. Apply to the final pair by a one-qubit target gate controlled on their common other bits, reversing the ordered block if has target bit . Undo the swaps in reverse order. Expand every multi-control using its selected construction; implement negative controls by conjugating that control wire with .
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 , target and matrix , choose as in One-Qubit Euler Decomposition. Form the three matrices , and . Define to be the list , , , , , . Each of is one arbitrary one-qubit gate, as in Exact Controlled One-Qubit Unitary with Two CNOTs. Define by setting and concatenating , , , , .
Define the ladder list with an ordered supply of at least distinct spare wires. For emit one CNOT; for emit . For , use the first spares . Set , for , and . Concatenate and then ; the latter list is just when . This is the borrowed ladder used in Linear Multicontrolled X with One Borrowed Wire.
Define for an ordered nonempty control set and a distinct borrowed wire . With one or two controls use the corresponding ladder base case and leave unused. With controls split into its first controls and the remaining controls . Let use spares from , and let use spares from . Emit , using the same parameter choices for repeated lists. The stated spare supplies have at least and wires, respectively.
Define the positive-control no-workspace expansion recursively. If is empty, emit . If it has one wire , emit . Otherwise write , with its last control. Choose an orthonormal eigendecomposition by Complex spectral theorem: a normal endomorphism of a finite-dimensional complex inner product space has an orthonormal eigenbasis, and conversely, choose polar angles by Every nonzero complex number has a unique polar form with and , and set . The addition formulas of The addition formulas for sine and cosine specify these half-angle roots. Emit , , , , . The last call has one fewer control and uses only its indicated wires.
For the positive-control clean-bit expansion with nonempty and clean wire , emit , , and the reversed adjoint of that same list. With no controls emit and leave 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 on each zero-valued control, ordering each set of these gates by wire position. Reverse the ordered middle block by using as its single matrix parameter, not by adding target 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 .
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 and fixes every other computational-basis vector. Write for their Hamming distance and . Before expansion there are pattern-controlled swaps and one pattern-controlled target block.
Here are exact post-expansion counts for its literal circuits. A cost pair counts CNOTs and arbitrary one-qubit gates, respectively; pairs are added componentwise and identity gate occurrences are retained. Define For a positive -controlled one-qubit call the no-workspace cost is and the selected one-clean-bit cost is for (use with no work bit). For each forward swap , choose , and for the middle block choose . If and are the numbers of zero-valued controls in their patterns, the exact total pair is Its sum of coordinates is the exact elementary gate count. All-no-workspace selection uses wires and gates; all-clean selection uses at most wires and gates. For mixed selections one clean bit suffices and is reused sequentially, returned to zero after each call. When , the circuit is one arbitrary one-qubit gate with cost and no work bit.
Facts & Assumptions
Given: Distinct labels , block , and the path and literal expansion choices of Gray-Path Synthesis of a Two-Level Gate.
Two-Level Unitary: the desired two-level operator applies on the ordered pair and is identity on its orthogonal complement.
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.
CNOT and Control-Target Order: a CNOT flips its target bit exactly when its named control bit is .
Denotational semantics of a finite layered circuit: chronological circuit layers denote .
Finite circuit resource accounting: costs count declared gate occurrences under the explicit operation model.
The computational basis is orthonormal: the ordered computational basis of the register is orthonormal.
Multicontrolled Unitaries with and without a Clean Work Bit gives exact no-workspace and one-clean-bit elementary constructions; each clean call returns its work bit to zero.
Linear Multicontrolled X with One Borrowed Wire supplies an exact elementary implementation of with one borrowed wire, whose full operator is even on correlated inputs.
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.
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.
One-Qubit Euler Decomposition gives the exact decomposition and the displayed matrices for and .
Complex spectral theorem: a normal endomorphism of a finite-dimensional complex inner product space has an orthonormal eigenbasis, and conversely diagonalizes a unitary in an orthonormal eigenbasis; Every nonzero complex number has a unique polar form with and supplies polar angles for its unit eigenvalues, and The addition formulas for sine and cosine gives the double-angle identities.
Proof
By [F2] and [F3], each path swap is an 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 sends to and fixes , because the last path edge is deliberately omitted.
For the algorithm's single-control list , direct multiplication of the rotation matrices in [F11] gives and . Its two control branches therefore have target blocks and ; the final phase gate makes them 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 , the orthogonal projectors and give and unitarity. The list restores and applies target exponent of , hence is exactly Toffoli. Its cost is .
For the ladder of [F10] with , each of its two compute/target/uncompute lists restores all spares, since the central changes only the target. Let be the values of just before in the first and second lists. The common initial spare values give , and , for . Induction yields , so the two target toggles sum to . Thus is the exact controlled and restores its arbitrary spares. Its lists contain and Toffolis, giving ; the CNOT and Toffoli base cases give .
At the level of ideal data gates, let be the middle operation and the forward swap permutation. The middle gate acts only on ; using when the target bit of is makes its ordered action exactly . By [F4], the data product is . Since sends to and no other basis vector into this active pair, the conjugate acts by on and fixes every other data basis vector. Thus the ideal data circuit is the exact two-level unitary, including its scalar phase.
For the balanced list in [F10], put and . The ideal actions of send to and back and toggle by . 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 and ensure enough spares. Two calls of each size have pair ; the one- and two-control cases have pairs . Equality on every basis word extends by [F6] to the full operator , including entangled inputs, so these literal lists meet the borrowed-wire contract of [F8]. All spares are existing wires in each invocation of .
For the no-workspace list , [F12] gives the unitary square root 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 . The two calls restore their borrowed data target exactly by step 3.1. Thus on a basis control branch the target exponent of in the five-call list is . 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 action. No new wire is used. Its literal cost is , with and ; the recursion decreases the number of controls and terminates.
In the clean branch, computes the controls' AND into , restoring the borrowed data target by step 3.1. The list applies precisely on that branch, and the reversed adjoint list restores for every data input. Linearity extends this basis calculation to superposed or entangled data. This gives the exact clean-input data operation and pair for ; with no controls the sole gate has pair . No claim about the other initial workspace sector is required.
There are swaps, their inverses, and one controlled- call. Each zero-valued pattern control is implemented by an 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.
If , the swap lists are empty and the single controlled target block acts on directly. If , there are no controls and the construction is one gate on the sole wire: its matrix is when , and when , so its action on the selected ordered pair is 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.
A zero control adds two one-qubit 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 , the recurrence sums to , whereas . There are calls, and at most negative controls per call, giving the two claimed total bounds for . Sequential exact clean return permits reuse of one bit even on superposed data. The empty swap lists when and the direct ordered one-qubit block when give the stated boundary cases.
5 · Examples, counterexamples and false statements
None yet.
Sources
- Ronald de Wolf, Quantum Computing: Lecture Notes, arXiv:1907.09415v6
- Adriano Barenco et al., Elementary gates for quantum computation, arXiv:quant-ph/9503016v1
- Vivek V. Shende, Stephen S. Bullock, and Igor L. Markov, Synthesis of Quantum Logic Circuits, arXiv:quant-ph/0406176v5
- Vivek V. Shende, Igor L. Markov, and Stephen S. Bullock, Minimal Universal Two-Qubit CNOT-Based Circuits, arXiv:quant-ph/0308033v3
- Farrokh Vatan and Colin Williams, Optimal quantum circuits for general two-qubit gates, arXiv:quant-ph/0308006v2
- Vivek S. Shende, Igor L. Markov, and Stephen S. Bullock, Minimal Universal Two-Qubit CNOT-Based Circuits, arXiv:quant-ph/0308033v3
- Vivek V. Shende, Igor L. Markov, and Stephen S. Bullock, Smaller Two-Qubit Circuits for Quantum Communication and Computation, NIST full-text publication
- Vivek V. Shende, Stephen S. Bullock, and Igor L. Markov, Synthesis of Quantum Logic Circuits, Theorem 14 and Appendix A.2
- Vivek V. Shende, Igor L. Markov, and Stephen S. Bullock, Smaller Two-Qubit Circuits for Quantum Communication and Computation
- Shende, Bullock, and Markov, Synthesis of Quantum Logic Circuits, Appendix A.1
- Adriano Barenco et al., Elementary gates for quantum computation, Lemmas 6.1, 7.2–7.3 and Corollary 7.4