Manuscript Offprint
arXiv:2610.06231Unitary RQL Equals RQL
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Intermediate measurements let quantum computations discard information and reuse their workspace. Deferring all measurements can require storing their entire history, which need not preserve logarithmic space. Fefferman and Remscrim proved that measurements can nevertheless be eliminated with two-sided bounded error, and asked whether the same holds with one-sided error [FR21].
We prove for the standard gate set , preserving polynomial time, logarithmic space, and exactly zero acceptance on no-instances. Our proof extends the density-matrix doubling method of Girish, Raz and Zhan [GRZ21] to general channels, including resets and classical memory. We also prove measurement elimination for broader finite gate sets with exact inverses, including suitable gates with transcendental entries, and establish gate-set independence for a specified family of algebraic gate sets.
A separate history-checking construction proves under explicit gate assumptions: measurements can also be eliminated from logarithmic-space quantum verification while preserving perfect completeness.
1 Introduction
Measurements allow a quantum computation to extract classical information, discard information, and reuse its workspace. In polynomial time, these operations can be simulated by a unitary circuit that retains the discarded information in ancillary qubits and measures only at the end [AKN98, NC10]. This construction need not preserve a space bound: recording T single-qubit measurement outcomes can require T additional qubits. We ask whether measurements can be eliminated while retaining logarithmic workspace and a one-sided error guarantee.
The class BQL allows intermediate measurements and classical control. It requires acceptance probability at least 2/3 on yes-instances and at most 1/3 on no-instances. Its unitary counterpart, BQUL, allows only a final measurement. Fefferman and Remscrim proved BQL = BQUL, preserving logarithmic space and polynomial time [FR21, Theorem 1].
The one-sided class RQL instead requires acceptance probability exactly zero on no-instances; RQUL is its unitary counterpart. Both models here are absolutely halting: every branch on every input halts within a common polynomial bound. An additive approximation preserves a two-sided
*CWI, Amsterdam, The Netherlands. Email: qmtupker@gmail.com gap but can change zero acceptance into a small positive probability. Fefferman and Remscrim therefore left RQL = RQ_U L as a separate question [FR21, Open Problem 1].
Girish, Raz and Zhan independently eliminated measurements for unital computations, whose channels preserve the maximally mixed state [GRZ21, Section 5]. Their density-matrix doubling method represents a mixed state by a vector on two registers. Unitality bounds the norms of the resulting operators, but excludes a qubit reset. We extend this construction to general channels while preserving zero acceptance on no-instances.
Exact acceptance conditions also make the gate convention important. Approximate gate synthesis need not preserve a zero probability [vMW12, LGLW23]. We therefore state the gate assumptions explicitly. Figure 1 summarizes prior logarithmic-space results under the cited gate conventions; Appendix C gives further background.

Exact decision: L ⊆ EQ_UL ⊆ EQL ⊆ RQL ∩ coRQL;
EQ_UL ⊆ RQ_UL ∩ coRQ_UL. These are definitional containments.
Figure 1: Ordinary logarithmic space. An arrow means , not necessarily strict. Unlabelled arrows follow from the definitions and displayed equalities; crossing lines are not junctions. Transitive edges and some classes are omitted. The subscript means unitary until the final measurement. means bounded error with perfect soundness, means positive acceptance on yes-instances and zero on no-instances, and PrQL means two-sided unbounded error (often denoted QL). Post allows postselection; is the zero-test class for GapL functions. has perfect completeness. : use and closure of BQL under complement. We use polynomial-time, logspace-uniform models and the standard algebraic gate conventions of the cited results. In particular, no arbitrary-gate-set invariance for exact or one-sided error is claimed. This figure summarizes prior results. The reverse inclusion proved in Theorems 3.3 and 3.5 holds under their stated gate assumptions and is not added to this prior-work diagram. The layout follows the containment-map convention of Watrous [Wat99, Fig. 9].
1.2 Main results
Put , where . For the two RQL results below, we use fixed finite sets of one- and two-qubit gates; all computations have polynomial time and logarithmic classical and quantum workspace, with every branch on every input halting within a common polynomial bound. An exact gate implementation is a fixed finite circuit whose extra qubits start and end in zero on every input. Unless we explicitly allow a global phase, its action is exactly the specified matrix , rather than a scalar multiple . We write for the Hermitian conjugate (conjugate transpose) of a matrix. For a unitary gate, is its inverse. For the standard gate set, Theorem 3.1 proves
Thus an adaptive Clifford+T computation with one-sided bounded error can be simulated with only a final measurement, preserving polynomial time, logarithmic space, and exactly zero acceptance on no-instances. The two theorems below extend this conclusion to broader gate sets.
- Gate sets with exact inverses (Theorem 3.3). Suppose the entries of every gate in can be approximated to error in deterministic space and time . This condition concerns computing numerical descriptions of the gates; the primitive gates themselves are applied exactly. If circuits over implement every gate of and every inverse , for , exactly in this sense, then
Exact conjugates and controlled versions of the additional gates are unnecessary. In particular, this covers for any fixed family whose entries satisfy these bounds, even when they are transcendental. This statement eliminates measurements within the given gate set; it does not identify the classes defined by different gate sets.
- CM-field gate-set independence (Theorem 3.5). A number field is a field obtained from Q by adjoining finitely many algebraic numbers. It is totally real if every element has only real algebraic conjugates, meaning that all roots of its minimal polynomial over Q are real. For example, is totally real. A CM field has the form , where K is totally real and every conjugate of is positive. For example, is a CM field containing the Clifford+T entries. Section 3.4 gives the equivalent formal definition. Suppose that, after multiplying each primitive gate by its own fixed phase, all entries lie in one fixed CM field. If circuits over G implement the gates of exactly with extra qubits returned to zero, now allowing a global phase, then
The additional gates need not have exact implementations of their inverses, complex conjugates, or controlled versions. The field and all phases are fixed independently of input length.
The first result places no algebraic restriction on the entries but requires exact inverses; the second removes that requirement under a field restriction and identifies the resulting class with the Clifford+T class. Both preserve zero acceptance exactly, despite approximation in the circuits implementing the right Kraus factors. The proofs use the established two-sided measurement-elimination theorem to implement the right Kraus factors. Accordingly, the bounded-error application in Appendix B is conditional on that implementation and is not an independent proof of BQL = BQUL.
Perfect completeness with quantum witnesses (Theorem 4.1). There is also an exact history-checking construction for quantum Merlin–Arthur verification. Here Merlin supplies an arbitrary quantum witness, and its size counts towards the total logarithmic space bound. For any fixed finite gate set G of constant arity whose entries satisfy the bounds in item 1, implementing H, X, and Toffoli exactly, and each primitive inverse up to a global phase, we prove
The subscript 1 means that some witness is accepted with certainty on each yes-instance; every witness is accepted with probability at most 1/3 on no-instances. All fixed gate implementations return their extra qubits to zero. Section 4 defines the models and proves the theorem. The construction propagates the rejection observable backwards and tests a history certificate supplied by Merlin. Paired calls to a gate and its inverse give the necessary doubled coefficients exactly, without controlled or conjugated versions of the gate. This construction requires neither reweighting nor the two-sided measurement-elimination theorem, but retains a quantum witness.
1.3 Proof idea: preserve zero acceptance and retain a signal
Density-matrix doubling represents by . For a channel , its doubled operator is . The two registers use twice the original number of qubits.
The one-sided argument starts from a simple observation. If is the product of Kraus operators along history h, and projects onto acceptance, then
Consequently, changing only the right factor in each doubled term cannot create acceptance: every accepting term still contains the same zero left vector. Accuracy is needed to retain acceptance on yes-instances.
The difficulty is normalization. A doubled qubit reset has operator norm , so normalizing every step separately can lose an exponential factor. We use reference states that follow the source channels, with a small maximally mixed contribution added at each step. Their square roots and inverse square roots reweight the right factors. Each reweighted step has norm at most one, consecutive weights cancel, and the final accepting probability remains inverse polynomial. These weights are related to Petz recovery [Pet86, Pet88, BK02, GLM 22]; Section 3.1 explains the relation precisely.
A unitary circuit implements an approximation to each reweighted step in the part selected by zero scratch registers, while retaining the left Kraus factors exactly. A logarithmic counter selects the product of those parts without storing all outcomes. Unitary amplification then raises the accepting probability to a constant. Figure 2 summarizes the construction.
- Write the original computation on two registers
- Reweight the right Kraus factors
acceptance on yes-instances remains inverse polynomial.
- Implement each step with a unitary circuit
Exact left factors; approximate right factors using BQL = BQ_U L [FR21].
- Record failures coherently and amplify
Reuse the scratch registers; use the implemented circuit and its inverse.
- Measure once at the end: a RQ_U L_G computation
Constant acceptance on yes-instances; zero acceptance on no-instances.
Figure 2: The direct RQL simulation under the gate assumptions of Theorem 3.1 and its extension in Theorem 3.3. The first two stages describe matrices; the last three implement the simulation in logarithmic space and polynomial time. Exact left Kraus factors preserve perfect soundness throughout, while reweighting and accurate right factors retain acceptance on yes-instances. The use of two-sided measurement elimination is a dependency of the construction. The CM-field theorem first converts the source computation to the standard gate set, then applies this simulation.
Section 3.2 proves the Clifford+T case by following this algorithm. Sections 3.3 and 3.4 then address broader gate sets. The implementation of the right factors uses the established two-sided measurement-elimination theorem: reference-entry estimates are converted into unitary circuits before the one-sided simulation is constructed. There is no dependence on the one-sided conclusion. The bounded-error application in Appendix B uses the same implementation and is not an independent proof of BQL = BQ_U L.
Section 4 gives a separate construction for quantum witnesses with perfect completeness. It tests a history of rejection observables supplied by Merlin and uses neither reweighting nor two-sided measurement elimination. Supporting mathematical lemmas are checked in Lean; Appendix D states the scope.
Use of generative AI. AI tools were used in drafting this article. They were also used in developing and checking parts of the mathematical arguments, searching and checking the literature, revising the exposition, and constructing formal proofs of supporting lemmas. The Lean proofs of supporting mathematical lemmas are available at https://github.com/ExampleOne/unitary-rql-lean.
2 Preliminaries
2.1 Quantum Turing machines
We use the classically controlled model of space-bounded quantum computation, in which a classical Turing machine directs operations on a tape of qubits [TS13, FR21]. The cited works use this model. Watrous' earlier model allows the entire machine configuration to be in superposition [Wat99].
Definition 2.1 (Quantum Turing machine over ). Let be a finite set of one- and two-qubit unitaries, for example . A quantum Turing machine over , or , is a deterministic Turing machine with a finite set of states , a read-only input tape, and a classical work tape. It also has a quantum work tape, scanned by two heads. Each cell of this tape holds a qubit initialized to . The set contains a halting accepting state , a halting rejecting state , a state for each gate , and a measurement state . In each step behaves as an ordinary Turing machine, except that:
-
on entering , the gate g is applied to the qubit(s) under the quantum heads (a one-qubit gate acts on the qubit under the first head);
-
on entering , the qubit under the first quantum head is measured in the computational basis, and the outcome is made available to the finite control, which determines the next step.
Measurement outcomes are the only way information flows from the quantum tape to the classical control. M accepts if it halts in ; the acceptance probability accepts] is taken over the measurement outcomes.
M runs in space if on every input of length n and every sequence of measurement outcomes it visits at most cells of each work tape. We require absolute halting: every computation branch halts. A time bound means that every branch on every input of length n halts within steps, including inputs outside the promise. Thus time is bounded in the worst case over both inputs and measurement outcomes. Throughout this paper, space-s machines satisfy such a bound ; for logarithmic space this is polynomial.
We distinguish two kinds of QTM according to how they may use measurements.
Definition 2.2 (General and unitary QTMs).
-
A general QTM may enter any number of times, so its subsequent classical and quantum operations may depend on intermediate measurement outcomes.
-
A unitary QTM , or UQTM , enters exactly once, as the last step of its computation: it measures a designated output qubit and then immediately halts, in if the outcome is 1 and in otherwise.
Every UQTM is in particular a general QTM . When we write QTM without qualification we mean a general one.
The classical control of a UQTM never depends on the quantum tape, so on input x it deterministically applies a fixed sequence of gates to qubits, followed by a single measurement. In other words, space-s UQTM s are equivalent to DSPACE(s)-uniform families of unitary circuits of width and size [FL18, FR21]. Likewise, general QTM s correspond to uniform circuits with intermediate measurements whose outcomes classically control later gates. Under the usual universality and gate-computability assumptions, the space-efficient Solovay–Kitaev theorem makes two-sided bounded-error classes such as BQL independent of the gate set [FR21]. This argument does not extend directly to one-sided error, since approximating gates can make a rejecting computation accept with small nonzero probability, which is why we make the gate set explicit.
We define the following complexity classes.
Throughout, a machine solves a promise problem with one-sided error if its acceptance probability is at least 2/3 on and is exactly zero on . All machines below are absolutely halting: there is a polynomial such that, for every input , every computation branch halts within steps. This requirement also applies outside the promise, where no correctness condition is imposed.
Definition 2.3. The class RQL consists of promise problems solved with the one-sided error specified above by an absolutely halting, polynomial-time QTM using qubits and classical work bits.
Definition 2.4. The class RQU is the class of promise problems that can be solved with the one-sided error specified above by an absolutely halting, polynomial-time UQTM using qubits and classical work bits.
3 Removing measurements from RQL computations
3.1 The reweighted doubling framework
We first develop the linear-algebraic construction shared by the bounded- and one-sided-error simulations. Let , let be the dimension of the source configuration register, and, for , write
Each is trace preserving. The source acceptance probability is for a computational-basis acceptance projector . For logarithmic-space, polynomial-time computations, the register includes the retained classical configuration and quantum workspace, and .
Vectorization and normalization. Use row vectorization
This doubles the number of qubits used to index a matrix. It is a linear representation of , rather than a purification of it: , and its normalized first-register reduced state is . The vector is the canonical purification.
The matrices need not be contractions. For example, resetting a qubit gives , with operator norm . Normalizing every step separately to obtain a unitary clean block can lose an exponential factor over steps. This loss concerns the implementation normalization; the density-vector norm itself is always at least .
Reference states and contractive steps. We start the reference computation in the maximally mixed state. At each step, we apply the original channel and then mix in a small maximally mixed contribution. Following the channel adapts the reference to the computation; the added contribution keeps every eigenvalue bounded away from zero, so the inverse square roots below are controlled. Set
These are density operators satisfying ; every eigenvalue is at least . Define
(3)
The reference recurrence gives
Thus is an isometry: it preserves vector lengths. Choose a unitary dilation of the Kraus operators and an abstract unitary extension of , padding the label space as needed and setting . On doubled registers and label register ,
It is therefore a compression of a unitary, and in Euclidean operator norm. This identity does not assume exact synthesis of the abstract extension over a finite gate set.
Keeping the left factors exact. Trace preservation ensures that the original left preparation preserves vector lengths: . The preparation for the unweighted right factor would use Hermitian conjugates, which need not satisfy the same condition: may differ from . The factors and the extra branch correct this second normalization, as the identity shows. Figure 3(a) places both reference-state weights on the right register. In the implementation of Section 3.2, the original circuit remains exact while the circuit for the right factors is approximated, as shown in Figure 3(b).
Cancellation of weights and acceptance bounds. Vectorization gives
Consecutive square roots cancel, yielding
Let
In the unitary implementation, this is the joint probability that the first register indicates acceptance and the scratch registers and failure counter are zero. This probability satisfies
For the lower bound, use the Frobenius inner product:
(a) Matrix factors for one Kraus label a

Common scalar factor:
(b) Unitary implementation with approximate right factors

Figure 3: Keeping the left Kraus factors exact while approximating the right factors. Read both diagrams from left to right. Panel (a) is an algebraic factorization: its matrix boxes need not be unitary. Both reference-state weights act on , and summing over gives . Panel (b) is a unitary circuit. The exact source circuit writes the Kraus label into ; acts only on and supplies the approximate right factors. Its implemented inverse is exact. In particular, , so approximation leaves every left factor unchanged. The green conditions select the component with zero scratch; they are not intermediate measurements. The full simulation uses the failure counter described in Section 3.3. Appendix A gives the detailed circuits.
(a) One reset: growth before reweighting, contraction after it
(b) Repeated resets: probability before amplification

Figure 4: Reweighting a qubit reset . In (a), and , where . Substitution into the definition of gives the displayed contraction. In (b), the source starts in , applies resets, and accepts with certainty. Normalizing each doubled step as gives probability . With , the reference state is the same after every reset; for , . Thus reweighting gives , tending to . The curves compare exact matrix products before compilation and amplification. The vector in (a) tests the operator norm; it is not the initial vector used in (b).
Cauchy–Schwarz and give the result.
For the upper bound, positivity of the channels and imply . Put and . Then , so . Congruence by gives . Taking the trace against proves . Neither bound requires the operators to commute.
Example: repeated qubit resets. Figure 4 makes the normalization issue explicit for . Starting in and accepting after resets gives . Dividing each unweighted doubled step by leaves acceptance probability . In contrast, our reference recurrence gives . Indeed, for every , so and for . The stated lower bound follows from and .
Relation to Petz recovery. The square-root reweighting has a precise connection with the Petz (or transpose) recovery map [Pet86, Pet88, BK02]. For a channel and full-rank reference states and , this map is
(7) where is the Hermitian conjugate of , acting backwards on observables: for Kraus operators of . The recovery Kraus operators are . Their squared products sum to , and . Recovering arbitrary other states is an additional property, not a consequence of this identity.
For the references in (2), set
This is a channel; the trace in its replacement term is essential. Its Kraus family consists of and . The original-channel Kraus operators of are exactly the in (3). Its replacement-branch Kraus operators are instead
Since , they satisfy
Thus our retains the Petz original-channel factors and uses a single Kraus operator with the same remaining normalization contribution. It generally induces a different channel: the two completion maps are respectively
One can instead use the full Petz isometry by replacing the label * with the labels and assigning all their left Kraus factors zero. The doubled operator is unchanged. This requires only additional label qubits, so the total remains . Neither version asserts that itself is a recovery channel: it is a contraction on vectorized matrices.
Gilyén, Lloyd, Marvian, Quek and Wilde give an algorithm for Petz recovery using block encodings, quantum singular value transformation, and oblivious amplitude amplification . Their isometry construction combines reference square roots, the inverse of a unitary dilation of the channel, and an inverse square root of the output reference; these are also the ingredients of Appendix A.4. Their access assumptions do not by themselves establish the logarithmic-space uniform reference access required here, nor exact preservation of a zero accepting amplitude. We establish those properties separately.
Section 3.2 implements the approximate clean blocks coherently in logarithmic space while keeping the left Kraus factors exact. Each accepting history remains zero on no-instances, and unitary amplification raises the inverse-polynomial acceptance probability to a constant. Appendix B records the separate conditional bounded-error application.
3.2 The Clifford+T case
We first give the complete simulation for the standard gate set . This case contains the main argument: keep the original Kraus operators exact, approximate only the right factors, and amplify without introducing acceptance on no-instances. The later subsections extend the available gate sets.
Theorem 3.1 (Measurement elimination over Clifford+T). For absolutely halting, polynomial-time computations with logarithmic space,
We use the following implementation result. Its proof in Appendix A.4 uses the established two-sided measurement-elimination theorem [FR21] and unitary error reduction [FKL 16], independently of our one-sided theorem. Thus the result below isolates the numerical work needed to implement the reweighted operators.
Lemma 3.2 (Uniform implementation of the right Kraus factors). Let . Suppose the source channels have exact unitary dilations , given by polynomial-size, logspace-uniform circuits over on qubits, including their environment. For each inverse-polynomial , there are polynomial-size, logspace-uniform unitary circuits over on qubits such that
The data register is implicit. The labels include * and any unused labels in (3); there are polynomially many. The same statement holds with replaced throughout by any fixed finite constant-arity gate set satisfying conditions (1)–(4) of Appendix A.1.
Proof of Theorem 3.1. The inclusion is immediate. For the converse, fix a source machine and an input of length . We describe its unitary simulation in five steps.
- Implement each original step exactly. Include the retained classical configuration, head positions and quantum work tape in the -qubit data register. Pad unused basis configurations so is a power of two, and pad halting configurations with idle steps to a polynomial time bound . This gives the channels and acceptance projector of Section 3.1. Each channel has an exact dilation
For a unitary step, apply the gate. For a computational-basis measurement, copy the measured bit into E using CNOT. For a reset, copy the old bit into E and XOR that copy back into the data qubit. Classically controlled steps are handled by copying the old classical configuration and any measurement outcome into E, then reversibly computing the new configuration. These saved registers ensure that the update is reversible; tracing them out gives the original channel on every reachable source state. Enumerating the polynomially many configurations and tape positions gives polynomial-size, logspace-uniform circuits. One step needs only environment qubits.
All gates used here have exact Clifford+T circuits. In particular, , and ; complex-conjugated gates also have exact circuits over . Toffoli is exact: the identity
implements CCZ using parity computations and T gates, after which conjugating the target by H gives Toffoli. Controlled-T computes the AND of control and target into zero scratch, applies T, and uncomputes. Controlled-CNOT is Toffoli. Finally, with and , the identity gives an exact controlled-H using controlled-Z. Further controls reduce to a reversible AND. Every extra qubit in these fixed gate circuits is returned to zero.

Figure 5: Perfect soundness holds history by history. The histories are , with . Zero original acceptance forces every accepting left vector to vanish. Changing its right factor therefore leaves the whole tensor-product term zero. The final scratch and counter tests select the displayed sum.
- Approximate the right Kraus factors. Use the reference states from (2) and apply Lemma 3.2 with . On doubled data registers A, B, first apply to A, E, and then apply the inverse of the actual circuit to B, E, Z. The block with E, Z initialized and returned to zero is exactly
Set and use zero left Kraus factors on all padding labels. The contraction bound holds because this is a block of a unitary. The error bound follows by composing the difference between the implemented right block and its target isometry with the exact left isometry and projecting onto zero scratch. No implementation of an exact matrix square root is required. Figure 3 shows this separation.
- Preserve perfect soundness and enough acceptance. For a history , write . The source probability satisfies
On a no-instance , so every vector is zero. Expanding the product in (10) therefore gives
This conclusion holds for any right factors, with no accuracy assumption; Figure 5 illustrates why. For yes-instances, the ideal signal from Section 3.1 satisfies
Telescoping the products of contractions gives
Since and , the actual accepting norm is at least . Its square is therefore at least .
- Compose the steps with logarithmic space. Let be the full unitary used in step 2 and let project its scratch registers onto zero. Reuse these registers at every step. Add a counter of modulus , where is a power of two, and write . Apply
Thus we apply unconditionally, then increment the counter if its scratch is nonzero. These operations are unitary and the increment uses only a computational-basis predicate. To verify the selected block, put , and expand:
Starting and ending with counter zero selects exactly the term , since . With initial scratch zero, the selected operation is exactly , with final scratch zero. The final good predicate requires counter zero, scratch zero and acceptance in . Its probability is zero on no-instances and at least on yes-instances. All failure components remain in the circuit; no intermediate measurement or postselection occurs.
- Amplify with exact reflections. Append a Hadamard coin and include coin one in the good predicate. Call the resulting preparation A and its good projector . Its success probability is . Use the Grover iterate [BHMT02]
The inverse reverses the actual implemented circuit, including its approximations. Both reflections are exact Boolean predicates. Moreover, for an external control,
On control zero the preparations cancel; on control one this applies Q. Thus only the reflections need controls, including the displayed sign of .
Prepare and retain a uniform choice with , a power of two. Apply Q conditioned on for , using (14). The choice and comparison registers remain outside . For , success is
On yes-instances , so and the result is at least 1/4. On no-instances every iterate has zero good amplitude. Four independent coherent copies, followed by a reversible OR of their good predicates, accept with probability at least on yes-instances and zero on no-instances. Only this final OR qubit is measured.
Each register has qubits, and the number of complete copies is constant. Circuit lengths and loop bounds are polynomial. The lemma supplies logspace-uniform right-factor circuits; the remaining gates, reversed circuits and loops also have logspace-uniform descriptions. The simulator is absolutely halting.
Steps 3–5 apply to any exact left dilations and approximate right circuits satisfying (10), provided their actual inverses and the Clifford+T gates are available exactly. They use neither controlled versions nor complex conjugates of the additional source gates. The next subsection reuses these steps after constructing the required left and right circuits for more general gate sets.
3.3 Exact inverses suffice
We now extend Theorem 3.1 to gate sets whose entries can be computed within the bounds below and that implement Clifford+T and each gate's inverse exactly. An exact implementation is a fixed finite circuit over the gate set, with a constant number of extra qubits initialized and returned to zero on every input; the circuit must implement the specified matrix exactly, including its phase.
Theorem 3.3 (Measurement elimination with exact inverses). Let G be a fixed finite set of one-and two-qubit unitaries. Suppose that:
-
every entry of every can be approximated to error in deterministic space and time ;
-
circuits over G implement H, T, CNOT exactly;
-
for every , a circuit over implements its inverse exactly.
Then . Neither exact conjugation nor exact controlled versions of the additional gates are required.
Proof. Put . We construct exact left circuits over and approximate right circuits over . Steps 3–5 of Theorem 3.1 then give perfect soundness, coherent composition and amplification. The only new issues are implementing adaptive source steps without controlled source gates and obtaining the right circuits without exact conjugation.
Implementing the original channel without controlled source gates. Pad the quantum tape to at least two cells, and copy the old classical configuration into the environment. For each gate symbol , allocate a separate dummy register of the same arity as , initially zero. There is only one dummy per gate symbol, not one per classical configuration, so their total width is constant. Reversible Boolean routing, controlled by the copied configuration, moves the target qubit or ordered pair of target qubits to a fixed port. On configurations not requesting , choose any fixed valid target port. Let be the swap of this port with its dummy, and put , . If precisely when is inactive, apply
Here is applied unconditionally to the port. For this is ; for it is . Undo the routing and retain the dummy in the environment. Thus the active branch applies to the data, and every inactive branch leaves the data unchanged while placing the normalized state in the dummy. The controlled swaps and routing permutations are exact reversible Boolean circuits over .
Perform this operation for each of the finitely many gate symbols. For a measurement step, copy the measured basis bit into an environment register. Reversible updates compute the new classical configuration while retaining the old configuration and measurement outcome in the environment. For example, the working configuration can be cleared by XOR with its saved copy and then filled with the new configuration. Polynomial enumeration of configurations and wire positions supplies logspace-uniform routing and input access. Unused configurations receive any fixed valid extension of these reversible operations.
Tracing out the environment gives exactly the source transition on states whose classical configuration is diagonal, which includes every reachable source state. Copying c deliberately dephases different classical configurations: we have constructed the required channel, not a coherent controlled-U gate. Use this chosen channel extension when defining and its reference states. Its exact dilation acts on qubits and uses no controlled source gate. All registers used to retain discarded information, including the dummies, are included in the Kraus label. The source acceptance probability is unchanged.
Right Kraus factors over the fixed standard gate set. We claim that Lemma 3.2 still supplies , now as a circuit over , for the original chosen dilations and their original Kraus labels. To prove this, introduce a virtual finite constant-arity gate set containing , the gates
and their singly controlled versions. This virtual gate set has the exact inverse and conjugation operations used in Appendix A.4. Further controls reduce to computing an AND into scratch and using a singly controlled gate. Controls of the standard gates have exact circuits over by step 1 of Theorem 3.1. The appendix construction therefore produces a circuit over this virtual gate set for the right Kraus factors, with labelled-block error at most and length at most a polynomial . This is an intermediate circuit description, not an enlargement of the source machine's gate set.
The entries of each gate B in this virtual set can also be computed within the stated time and space bounds. To approximate it with its phase intact, specify the constant-dimensional matrix
This is a target matrix for synthesis; its definition assumes no physical controlled-B gate. Space-efficient Solovay–Kitaev synthesis for fixed dimension [vMW12, Theorem 4.5] approximates in operator norm over , including its phase. For completeness, the determinant-one subgroup of the group generated by fixed-width Clifford+T circuits has finite index and is finitely generated. Projective universality [BMP 99] and connectedness imply that its closure is the full special unitary group. A fixed finite inverse-closed generating set of gate sequences therefore meets that theorem's hypotheses: compactness supplies its fixed constant-accuracy net. This extends the one-qubit argument in Appendix A.4. Only constant dimensions occur here.
Use error per gate in the virtual set and one shared extra qubit for the embedding , initially zero. The ideal embedded gates preserve this qubit's zero state and act on that subspace as the virtual circuit. Their approximations may leave this qubit nonzero. We retain it coherently and include it among the registers required to be zero in the selected block. A telescoping bound on the full circuits bounds their difference by , even with this reuse. Compression to the labelled block cannot increase the error. Thus the resulting circuit has error at most relative to , without changing the target reference states or assuming exact conjugation over . The required precision is bits; entry computation and synthesis take polynomial time and logarithmic space to generate the circuit. The embedding uses only this one extra qubit.
Substitute the exact implementations of the gates only after compiling the circuit for the right Kraus factors. Keep the original exact on the first doubled register. The full step unitary is followed by the actual on the second register and shared labels, so its clean block remains exactly
With this is precisely the setting of steps 3–5 of Theorem 3.1. The history argument preserves zero accepting amplitude on no-instances, and the product has squared accepting norm at least on yes-instances. The unconditional counter construction (13) composes these blocks without controlling a source gate. Its inverse is available by assumption (3). The identity (14) also avoids controlling the preparation circuit: only exact Boolean reflections need controls. The same amplification therefore gives acceptance at least on yes-instances and zero on no-instances.
The fixed number of dummy registers, shared helper and reused scratch require qubits. Routing, entry approximation and synthesis have polynomial running time and logarithmic generation space. Thus the simulator satisfies the resource and absolute-halting requirements of . The reverse inclusion follows from the definitions.
Corollary 3.4 (Adding gates together with their inverses). For any fixed finite family of one- and two-qubit unitaries whose entries satisfy condition 1 of Theorem 3.3, the gate set
satisfies RQL = RQ L . The entries may be transcendental.
Proof. The inverses of the added gates are already present, while and CNOT are self-inverse and .
Inverses need not be separate primitives. For example, also satisfies the theorem when
has entries satisfying condition 1: and . This includes , whose entries are transcendental. The conclusion here is an equality over the same gate set . It does not by itself identify that class with the class over ; the next subsection establishes such gate-set independence under a different, algebraic hypothesis.
3.4 Gate-set independence over CM fields
Put . A number field is a finite extension of . An embedding into is an injective map preserving addition, multiplication, and rational numbers; it consistently replaces algebraic numbers by conjugates. A number field is totally real if every such embedding takes values in , or equivalently if every element's minimal polynomial over has only real roots. It is totally imaginary if no such embedding takes all its values in .
A CM field is a totally imaginary quadratic extension of a totally real field : it has dimension two as a vector space over . Equivalently, for some positive under every embedding of ; for example, has and [Mil20, Proposition 1.4]. Its complex conjugation satisfies
The same identity holds for totally real fields. CM fields are also closed under finite composita: the smallest field containing finitely many CM fields is again CM. See [Mil20, Proposition 1.4 and Corollary 1.5].
Theorem 3.5 (Algebraic gate-set independence). Let G be a fixed finite gate set in the local machine model of the preliminaries. Suppose:
-
there is a fixed CM field such that, for each , some fixed scalar of modulus one makes every entry of belong to ;
-
for each , there is a fixed finite circuit over which, with a constant number of extra qubits initialized to zero, implements and returns those ancillas to zero on every input, for some fixed scalar .
Then
The additional gates of G need not have exact implementations of their inverses, complex conjugates, or controlled versions.
The field and the gate set are fixed independently of input length. The proof uses two lemmas. The first replaces field-valued gates by an intermediate finite gate set of rational orthogonal gates of constant arity; the second compiles those gates into the original one- and two-qubit gate set .
Lemma 3.6 (Exact rational simulation of a fixed field). Let F be a fixed totally real or CM field of degree m. A polynomial-time, logarithmic-space computation over a fixed finite gate set with entries in F can be simulated over a fixed finite rational orthogonal gate set, using additional qubits. If its acceptance probability is p, the simulator's probability is
where is the acceptance probability with applied entrywise to the original gates. Computational-basis measurements and classical control are retained in this intermediate simulation.
Proof. Choose a rational basis of , and write for the coefficient vector of . Define the normalized trace matrix
It is rational and symmetric, with . It is positive definite because the embedding matrix is nonsingular. In particular,
There is a fixed rectangular rational matrix with . Indeed, rational elimination writes with rational and positive rational diagonal. Each diagonal entry is a sum of four rational squares: apply Lagrange's four-square theorem to the integer and divide the four integers by . Combining these four-square vectors gives a rational factor of , hence of . Pad the row dimension of to a power of two and put
Then and is the orthogonal projector onto the image of . All these matrices are fixed constants; no uniform four-square algorithm for growing inputs is being assumed.
For a k-dimensional gate U over F, let be its rational regular representation: its block is multiplication by on field coefficient vectors. This representation preserves products. By (15), each is unitary, so
Set , , and
This is rational orthogonal and . For verification, if , then , while the cross terms between and vanish. Hence .
Use one shared r-dimensional field register for the entire computation, initialized to . This is a rational unit vector. It can be prepared from by the fixed rational Householder gate
with the identity used if . Replace each source gate by (20) on its physical wires and this same field register. Measurements, resets, and classical control act on the physical registers as before. Each lifted primitive has constant arity.
For an unnormalized source history , write for its amplitude at physical basis coordinate . Induction on gates and measurement outcomes shows that the corresponding simulator coordinate is exactly . Thus
This proves (17). If , every accepting amplitude is zero under the original embedding , hence is the zero field element and vanishes under every embedding. The summand for the original embedding also gives . The loss of occurs once for the entire computation.
The coefficient encoding is Q-linear and preserves the norm defined by the trace matrix B; it is not asserted to be a complex-linear isometry on arbitrary unknown source states. The known initial basis state and unnormalized histories are what make this simulation valid. Since F, the basis, and the gate set are fixed, all rational lifted gates and the preparation gate are finite data that can be hardwired. The extra field register has qubits, and gate substitution preserves polynomial time and logarithmic-space uniformity.
Lemma 3.7 (Implementing a rational gate exactly up to a scalar). Fix a rational orthogonal gate U of constant arity. For every integer , put . There is a unitary circuit over whose clean block is exactly hU for a scalar h satisfying . Its size is polynomial in b; its generator, given b, uses space. The number of extra qubits is constant, depending on U.
Proof. Choose a positive integer with integral, and a power of two . These are constants. Each matrix unit is a clean block of a fixed reversible basis circuit: flag every input label other than , then apply a basis permutation sending to . Signs are exact phase gates; a zero block is obtained by flipping a clean flag. Using signed copies of the appropriate matrix units and padding with zero blocks gives such blocks. Prepare a uniform selector, apply the selected unitary, and unprepare the selector. Hadamards and reversible Boolean circuits over give a fixed unitary with clean block
All temporary scratch registers must be zero in the selected block.
Choose a fixed integer such that , and put
Phase-sensitive one-qubit synthesis from Appendix A.4, using [vMW12, Theorem 4.5], supplies a circuit with . Writing , the unitary has clean block exactly szU, including any complex phase of .
Let be the clean-scratch projector tensored with the identity on the data, and use oblivious amplitude amplification with V and its inverse:
The standard two-dimensional amplitude-amplification calculation [BHMT02], applied to each singular vector, gives
with if . All singular values of are equal, so the same scalar multiplies every input direction. The reflections and the inverse of the implemented circuit are exact over .
For the ideal rotation , the amplified clean block is exactly . There are calls to or in the amplified circuit. Unitary telescoping therefore gives
The error estimate is used only to bound the scalar magnitude; the proportionality in (21) holds exactly for the actual synthesized circuit. Since s and are constants, the claimed resource bounds follow from the one-qubit synthesis bound.
Proof of Theorem 3.5. Take a machine for a promise problem in RQL . Replacing each primitive U by changes each complete classically selected history by a phase and leaves all outcome probabilities unchanged. Apply Lemma 3.6 to the resulting field-valued gate set. It gives an intermediate rational-gate simulation with acceptance zero on no-instances and at least on yes-instances, where .
Let be a polynomial upper bound on the number of rational gate applications in one such trial, including preparation of the field register. Apply Lemma 3.7 to each of the finitely many rational gates with and . After each compiled gate, test whether all its scratch qubits are zero. Reject if they are not; otherwise reuse them. This is an ordinary measured computation over . The successful block is exactly proportional to the intended rational gate on every input, including inputs entangled with the rest of the workspace. Therefore an accepting history's probability is multiplied by a product of at most factors, each at least . Consequently its total acceptance satisfies
On yes-instances this is at least . Run 6m independent trials with reused measured workspace and accept if any trial accepts. Their success is at least , while no-instance success is zero. The field and compiler scratch require only constant extra quantum space. Their finite gate generators and repetition counters use classical space, and the running time is polynomial. This proves using only the stated gate assumptions.
By Theorem 3.1, . Finally take the completed unitary circuit, expand every control and inverse into an elementary circuit, and only then substitute the gate implementations from condition (2). The product of their phases is a single global phase, so this substitution preserves acceptance exactly and gives . Together with the defining reverse inclusion, the chain is
which proves (16).
Corollary 3.8 (Algebraic extensions and alternative standard gates). The equality (16) holds for augmented by any fixed finite collection of one- and two-qubit unitary gates over totally real or CM fields. In particular, it holds for finite collections of root-of-unity phase gates or rational orthogonal gates, without adjoining their inverses or controls. It also holds for when , where , and for .
Proof. Take the compositum of the fields of the extra gates with . It is CM: totally real fields can first be adjoined to , and finite composita of CM fields are CM. For the displayed alternative gate sets, and , respectively. Thus both hypotheses of Theorem 3.5 hold.
For an example whose entries cannot all lie in a cyclotomic field (a field generated by a root of unity), let be a root of and adjoin
to . The cubic is irreducible by the rational-root test and has positive nonsquare discriminant 229. Hence is totally real and non-Galois, and cannot be a subfield of a cyclotomic field, whose subfields are abelian Galois over . Moreover, , so the gate entries themselves cannot all lie in a cyclotomic field. Nevertheless Corollary 3.8 applies.
Remark 3.9 (Scope of the field hypothesis). Theorem 3.5 is an equality for fixed gate sets, not a uniform algorithm over input-dependent number fields. Its use of primitive global phases is compatible with classical control; relative phases inside a controlled gate supplied as a primitive must still satisfy the field hypothesis for that full matrix. For arbitrary algebraic fields, conjugate gates need not be unitary and the positive trace form used above need not be available. Thus this proof does not establish the same conclusion for every algebraic gate set.
4 Perfect completeness with quantum witnesses
For two-sided bounded error, the known equality QMAL = QU MAL = BQL already eliminates both intermediate measurements and logarithmic-size witnesses [FR21, Theorem 1]. We ask whether measurements can be eliminated while preserving perfect completeness: some witness must still be accepted with probability exactly one on each yes-instance. Doubling provides such a construction under the gate assumptions below. Here we propagate the final rejection observable backwards and ask Merlin to supply a state encoding its history. Checking the history avoids preparing reference states or implementing matrix inverse square roots. We first state the gate assumptions, illustrate the construction for Clifford+T, and then give the general construction and its soundness proof.
4.1 Model and theorem
We use the witness-size convention of Fefferman and Remscrim [FR21, Definition 8]: the witness and all stored workspace together have qubits, including classical memory represented in the computational basis. The verifier is a logspace-uniform, polynomial-time computation over a fixed finite gate set G, with computational-basis measurements, resets, and classical control allowed. It is absolutely halting: every branch, on every input and for every witness, halts within a common polynomial bound. The classical input is read-only and does not count towards the space bound. The witness may be any state; no circuit-size or gate-set restriction is imposed on Merlin's preparation.
Write QMAL for the resulting promise class with acceptance probability one for some witness on each yes-instance and at most 1/3 for every witness on each no-instance. The class QU MAL restricts the verifier to unitary operations until one final computational-basis measurement. In this section we also allow primitive gates of any fixed constant arity. This explicitly extends the one-and two-qubit convention used earlier; the theorem includes that convention as a special case. We retain the paper's convention that gate entries can be computed to error in deterministic space and time . This fixes the computational model; it is not an approximation step in this proof. The primitive gates are applied exactly, and the construction below never evaluates their entries. In particular, the exact circuit construction in Lemma 4.3 needs only symbolic access to the gate names and wire indices.
Theorem 4.1 (Measurement elimination with perfect completeness). Let G be a fixed finite set of constant-arity unitaries whose entries satisfy the preceding time and space bounds. Suppose that:
-
Fixed circuits over G implement H, X, and Toffoli exactly, with a constant number of extra qubits that start and end in zero for every input state.
-
For every , a fixed circuit over implements for some fixed real , again returning its constant number of extra qubits to zero.
Then
No exact controlled, conjugated, or transposed versions of the additional gates are required, and their entries need not be algebraic.
The proof below shows why the phase allowed in condition 2 remains global even when a circuit chooses between different matrix entries. The reverse containment is immediate; we prove the forward containment.
4.2 The Clifford+T case: checking a rejection history
For , the theorem gives
The gate assumptions hold exactly: , and CNOT are self-inverse, , and Toffoli has an exact Clifford+T circuit (Section 3.2). Here is how the unitary verifier works.
-
Describe rejection. Let be the original verifier's rejection operator on its witness space: a normalized witness is rejected with probability . Since is positive semidefinite, perfect completeness means that some nonzero satisfies .
-
Ask Merlin for a history. Work backwards from the final rejection projector. Write for the observable after backward steps, and . For elementary channels, Merlin supplies a normalized version of
The parentheses denote a direct sum: these are amplitudes in distinct labelled parts of one state, not separately supplied copies of v. The history has polynomial dimension, so it fits in qubits. The verifier does not prepare it. Section 4.3 constructs a matrix F that checks the final rejection projector, every backward propagation equation, and zero rejection on v. In particular, .
- Test all the equations exactly. Pad by an identity matrix to a power-of-two dimension , obtaining . Lemma 4.3 constructs an exact Clifford+T unitary whose matrix block between zero-workspace states is . The preliminary test rejects exactly when the verifier workspace is all zero after . For a normalized certificate , this probability is
The circuit applies the full unitary V and retains every component; it does not postselect. An honest history, extended by zero in the padding coordinates, is never rejected. On a no-instance, Lemma 4.2 gives an inverse-polynomial lower bound on this rejection probability for every certificate, including certificates that do not describe a valid history.
- Amplify using the same witness. Alternate coherent tests of acceptance and initialized workspace, using V and its actual inverse. A logarithmic-size register records the first failed test. Section 4.5 shows that polynomially many tests reduce soundness to at most 1/3, while an honest certificate passes every test with certainty. Only the final failure indicator is measured. This uses one supplied certificate and no approximation of the exact rejection test.
A one-qubit example. Apply H to the witness, measure in the computational basis and discard the outcome, then measure again and accept outcome zero. The backward observables are
Thus is accepted with certainty, and its normalized history is . The exact history test never rejects this certificate. The first measurement is redundant in this small example; it illustrates the encoding of an honest history. The general no-instance bound is proved below. Unlike the RQL simulation, this construction needs no reference-state preparation or reweighting: Merlin supplies the history, and the verifier checks it exactly.
4.3 Encoding the rejection observables in a history
We now give the construction for any gate set G satisfying Theorem 4.1. We describe rejection by an operator at each stage of the computation. Starting with the final rejection projector, we propagate this operator backwards through the verifier. Its expectation at any stage equals the probability that the rest of the original computation rejects. Merlin supplies one state encoding a candidate witness together with the vectorized rejection operators at all stages. The verifier checks equations fixing the final rejection projector, relating consecutive operators, and requiring zero rejection on the candidate witness. An honest certificate satisfies all equations exactly. On a no-instance, the bound proved below forces every normalized certificate to violate the combined equations by an inverse-polynomial amount.
Elementary channels and adaptive control. Fix a source verifier. It can be represented by a logspace-uniform sequence of polynomially many elementary channels on qubits, each either a primitive unitary gate, single-qubit dephasing, or a single-qubit reset. This representation preserves the acceptance probability on every witness. Here is why it needs no controlled-U assumption. Store classical configurations in basis registers, copy a measured bit to the appropriate classical register after dephasing it, and implement deterministic updates using reversible Boolean gates followed by resets of discarded registers. For a classically conditional , use a zero dummy register of its arity. On the inactive classical branch, swap the target with the dummy; apply U unconditionally; undo the swap; then reset the dummy. The active branch applies U to the target, and the inactive branch leaves the target unchanged. Classical configurations are diagonal, so discarding the dummy gives precisely the desired source channel.
Equality tests, wire routing, and Boolean updates use X and Toffoli (a fixed helper in state also supplies CNOT). Enumerating the polynomially many configurations gives logspace-uniform circuits of polynomial length and logarithmic width; an update can retain the old configuration until the new one has been computed and then reset the old register. Expand the fixed Boolean-gate circuits into primitives of G, and include their helper qubits in the total register. Absolute halting permits padding the source evolution to a fixed length with an absorbing classical output. The final rejection projector is diagonal and its diagonal entries are logspace computable. Thus every chosen elementary map is a channel on the full register, even on states that are not reachable in the source computation.
Let be the total register dimension after this conversion, the original witness dimension, and the basis embedding . Define
Here is the Hermitian conjugate with respect to the trace inner product. It propagates observables backwards, with . For every channel, this backward map is unital and completely positive, so and . The original rejection probability on is . Consequently the promise gives
where one may take . The proof also works for any known inverse-polynomial rejection lower bound . Positivity is essential to the first implication: holds exactly when .
Use row vectorization , and set . If is the matrix of in this representation, then
Unless stated otherwise, matrix norms below are Euclidean operator norms; is the Frobenius norm and the operator norm of an observable. A unital completely positive map is contractive in the latter norm: the Schwarz inequality gives . Therefore
Every consecutive product of the represents such a map. Hence
The bound on whole products, rather than a separate normalization at each step, prevents an exponential loss in time.
Define a linear map C : \mathbb{C}^D^2 \otimes \mathbb{C}^d \longrightarrow \mathbb{C}^d by
The original verifier evolves states to the right


Rejection observables propagate to the left


Start with
An honest certificate is the single state
Fix the endpoint
Check consecutive steps
Require zero
rejection
Figure 6: The backward history for QMAL₁. For a candidate witness v, the original verifier starts in and applies . The aligned observable is , so is the same rejection probability at every time j. The tuple denotes an unnormalized vector in a direct sum; its normalized encoding uses qubits, not a separate copy of every operator. For a general certificate , the three sets of equations are precisely . They force and . An honest witness on a yes-instance satisfies them exactly; the gap bound of Lemma 4.2 controls their combined violation for every normalized certificate on a no-instance.
Then , , and . In particular, this map is not a contraction when . On the direct sum
write a vector as and define a square matrix by its output blocks:
Domain and codomain have the same dimension, although the -dimensional block comes first in the domain and last in the codomain. Set . Then , and the first zero constraints force every kernel vector of to have this form. Thus
Although encodes a polynomial number of coefficients, its normalization is a state on only qubits. Merlin supplies this state; the verifier need not prepare it. Dishonest witnesses need not factor into history and witness registers. The following estimate applies to every vector .
Figure 6 aligns the backward observables with the original computation and summarizes the equations checked on the certificate.
Lemma 4.2 (History constraint gap). On a no-instance, the smallest singular value of F satisfies
Proof. Put and write the output in (24) as . Let and . The recurrence for and (23), also using the identity for an empty product, give
Since and ,
Also . Combining the bounds yields
The last inequality uses and .
4.4 An exact test using the original gates
Pad by the identity to dimension , the least power of two at least , and put . Identity padding preserves the kernel and the lower bound ; zero padding would introduce spurious accepting witnesses.
Lemma 4.3 (Exact matrix test from paired gate entries). Assume the two exact gate-implementation conditions in Theorem 4.1. Let , , and suppose a deterministic logspace procedure identifies each entry of an N-by-N matrix A as 0, 1, -1, or
for a named gate and local basis indices . Then there is a logspace-uniform circuit over , using additional qubits and gates, such that
The phase may depend on the input circuit but is common to all entries. The constants in the resource bounds depend only on the fixed gate set and its fixed implementation circuits. No controlled version of U, no entrywise conjugate gate, and no numerical evaluation of a matrix entry are required.
The matrix satisfies the symbolic-entry hypothesis, as we now check before proving the circuit assertion.
Which coefficients occur? The blocks in (24) occupy disjoint matrix positions. For a primitive unitary the backwards step is , with local entries
Untouched wires contribute only Kronecker deltas. Dephasing has a diagonal matrix with entries in in the vectorized representation; the backward map for qubit reset sends B to locally and also has only 0–1 entries. The entries of , C, and the padding are 0 or 1. Thus every entry of A is either 0, 1, -1, or a signed coefficient in (27). Given row and column indices, a logspace machine identifies this form and its indices by inspecting the source circuit. It need not decide whether a gate coefficient is numerically zero or compute its value.
Proof of Lemma 4.3. We first select an entry coherently, then combine the entries into the matrix block.
Selecting a coefficient without a controlled source gate. For one such coefficient use registers , each of the arity of U, and a bit q specifying whether this coefficient is selected. Perform the following operations in order:
-
If , XOR into and into .
-
Apply the available inverse of U, up to global phase, to .
-
If , swap and .
-
Apply U to .
-
If , swap and again.
-
If , XOR into and into .
Only reversible Boolean operations are controlled. For , the amplitude from zero scratch to zero scratch is . For , writing for the swap, the entire scratch operation is
Thus the inactive branch is a scalar identity on all coefficient scratch states, and the active branch has exactly the same scalar. This remains true with implementation helpers: keep those helpers separate from , initialize them to zero, and return them to zero after each fixed gate circuit. Their zero subspace is invariant, even when the coefficient scratch is entangled with the address registers.
Enumerate all row-column pairs. At each pair compute its address equality bit q, apply the appropriate circuit, then uncompute q. Use shared coefficient scratch of constant width. A zero entry flips a separate scratch flag on its selected address; 1 does nothing, and a minus sign uses on q. At any fixed address exactly one circuit is active. All the other circuits are scalar identities on the coefficient scratch, including any nonzero scratch left by the active circuit. Moreover, each paired gate circuit is executed on every address and contributes its phase on both branches. Their product is therefore a common phase independent of the address, not a relative phase between entries. The resulting address-preserving unitary W satisfies
Each address test uses Boolean gates and additional qubits returned to zero. There are tests, and the coefficient circuit at each address has constant size. Thus the gate count is . The circuit generator enumerates addresses and computes their symbolic entry descriptions in logarithmic space; it never stores or approximates a complex matrix entry.
From entries to a matrix block. Figure 7(a) shows the circuit described here. Start with a certificate in a column register J and a zero row register I, both of qubits. Apply to I, apply W controlled by the two addresses as just constructed, apply to J, and swap I, J. Selecting zero coefficient scratch and zero old-column register gives
which proves (26). Here “selecting” specifies a subspace, not an intermediate measurement or postselection. The Hadamard layers and final swap add gates.
Define rejection to be the event that all this workspace is zero. For a normalized certificate h, the rejection probability is exactly
A reversible Boolean computation can put this zero test in a final output bit if desired. Equations (25) and (28) give perfect completeness and, on no-instances, rejection probability at least
4.5 Unitary amplification with one witness
We give the amplification explicitly to retain the exact gate conditions and perfect completeness. Space-efficient amplification for unitary computations with quantum witnesses was developed by Fefferman et al. [FKL 16]. Let project onto initialized verifier workspace, let be the preliminary test's accepting projector at the output of , and put . On the image of , (26) gives
An initialized kernel witness is fixed by both and . On a no-instance, . Alternating a test and a test for pairs, accepting only if every test passes, would therefore have acceptance probability at most
These tests can be performed coherently in logarithmic space. Figure 7(b) shows one pair of tests and the final measurement. Introduce a failure-label register with labels 0, 1, ..., 2k, initially zero; any unused binary labels are left fixed. At test j, transpose labels 0 and j if that test fails. For a Q test apply V, condition the label transposition on failing, and apply . For a P test condition it on nonzero verifier workspace. These are Boolean conditions in the computational basis between the unconditional calls to V and its inverse. Each predicate is computed and uncomputed using separate scratch. Before test j, label j has no amplitude: earlier tests touched only smaller labels. Thus an old failure never returns to label zero, and the label-zero component is exactly the product of the passing projectors applied so far. This proves the displayed probability bound for the fully unitary implementation and for arbitrary, possibly entangled certificates. Mixed witnesses follow by linearity.
Every gate of V has an inverse over G up to a global phase. Reversing its circuit therefore implements up to a common phase, which does not affect either projector test. Extra helpers
(a) The exact history test V

(b) Amplification with one certificate and one final measurement
Repeat for

Figure 7: The unitary verifier constructed from the original QMAL₁ verifier. Merlin supplies one normalized history certificate in J. In (a), W implements the matrix entries of A exactly up to a common phase; S groups coefficient scratch and temporary helpers, and w comprises I and S. The zero-workspace output of V has probability and is the rejecting outcome. In (b), each controlled box swaps the displayed labels of L and fixes all other labels. The first records failure of the Q test; after , the second records failure of the P test. Conditions concern the whole workspace w, and their temporary helpers are returned to zero. The inverse of V is implemented up to global phase, which does not affect these tests. A fresh nonzero label is used at every test, so a recorded failure never returns to label zero. An honest certificate in ker A passes every test with certainty; all operations before the final measurement are unitary.
used to reverse primitive gates are returned to zero after each inverse circuit. No controlled-V operation is used. Take using the explicit rational bound above (with ). This is a logspace-computable polynomial bound. The final verifier accepts exactly when the failure label is zero, with perfect completeness and soundness at most . It uses witness and workspace qubits, polynomially many gates, and a fixed schedule on every input. This completes the proof of Theorem 4.1.
4.6 Gate-set examples and comparison with reweighted doubling
Section 4.2 verifies the conditions for ; see also the exact-synthesis characterization of Giles and Selinger [GS13]. Further examples are:
-
For any fixed finite collection of constant-arity unitaries whose entries satisfy the stated time and space bounds, satisfies the theorem. Clifford+T universality is not needed.
-
For any fixed finite set of angles such that each can be computed within those bounds, works, where , since . The angles need not be rational multiples of .
-
The set works for
Its entries are outside , so this specified matrix has no exact Clifford+T implementation with extra qubits returned to zero [GS13]. The construction uses directly.
These are equalities within each qualifying gate set, not a claim that different such gate sets define the same perfectly complete class.
Both this construction and the RQL construction use vectorization and preserve an exact zero, but they simulate different operators. Section 3.1 propagates a density operator forwards, reweights its doubled evolution, and keeps the left Kraus factors exact while approximating the right Kraus factors. Here we propagate a rejection observable backwards. Merlin supplies a history certificate, the verifier tests every history equation through one exact matrix block, and a bound on products of backward maps on observables supplies the inverse-polynomial gap. There are no reference states, square-root or inverse-square-root approximations, or invocations of BQL = BQU L in this proof. The first-failure label serves the same purpose as the earlier failure counter, but now enforces a sequence of alternating projector tests.
The exact condition also differs: RQL has perfect soundness on no-instances, whereas the present theorem preserves the existence of a perfectly accepted witness on yes-instances. It does not remove that witness or make completeness perfect when it was originally less than one. In particular, it does not establish QMAL = QMAL₁ or RQL = coQ₀MAL₁, the distinct questions discussed by Fefferman and Remscrim [FR21, Open Problems 1–2].
Comparison with perfect completeness for QMA. Grewal and Rudolph prove QMA = QMA₁ over {X, CNOT, Toffoli, H ⊗ H} using an exact history constraint [GR26, Sections 3.1–3.3]. They first arrange that the acceptance operator E has dyadic rational entries with a known denominator. Merlin supplies an exact rational value and a history whose final vector is mapped back to its first vector using . An exact matrix test rejects in proportion to the squared norm of the constraint residual. This is closely related to our use of a history certificate and an exact kernel test.
The space requirement separates the two results. Their certificate includes the numerator and denominator of , with bits when is integral, and their implementation uses an index register of that order. Even for a logarithmic-size original witness, can grow with the polynomial circuit length; the resulting space bound need not be logarithmic. Our construction instead uses the original perfect-completeness promise to obtain and checks its backward history without a supplied rational scalar. Thus their theorem does not directly establish , and our theorem only removes measurements from verifiers that already have perfect completeness.
4.7 Connection to span programs
Span programs, introduced by Karchmer and Wigderson [KW93], decide whether a fixed target vector lies in the span of vectors made available by the input bits. In linear-map notation, a fixed map and an available subspace accept when for some . Such a w is a positive witness; a negative witness is a vector with and for every . Witness norms underlie the connection to quantum query complexity [RŠ12, Rei09].
Our history test also describes a vector separating a target from a linear subspace. Writing for the matrix in (24) and for the standard basis of its domain, finite-dimensional linear algebra gives
Indeed, any nonzero has a nonzero coordinate and can be rescaled to separate the corresponding from every column of . Thus a perfectly accepted history certificate supplies the same kind of separating vector as a negative span-program witness. On a no-instance, Lemma 4.2 instead makes invertible, and every equation has a solution of norm at most .
There is also a spectral connection. Reichardt and Špalek use zero-eigenvalue witnesses in span-program formula evaluation [RŠ12]; Reichardt's reflection formulation gives query-optimal algorithms [Rei11]. Belovs and Reichardt obtain logarithmic-space algorithms for st-connectivity [BR12], while Ito and Jeffery develop approximate witnesses and their relation to spectral gaps [IJ19]. In our test, (29) identifies the perfectly accepted certificates with the common fixed vectors of P and Q; the singular-value bound for gives the gap used in amplification.
The resource connection is particularly close to Jeffery’s bounds relating quantum space to the logarithm of span-program size, including approximate span programs for two-sided error [Jef22]. Cornelissen, Jeffery, Ozols and Piedrafita also give conversions between quantum algorithms and span programs that preserve time up to polylogarithmic factors [CJOP20]. Here polynomial matrix dimension likewise permits a logarithmic-size quantum certificate. However, depends on the full input, whereas a standard span program fixes its map and lets input bits select available vectors. The displayed identity is therefore a geometric connection, not by itself a construction of such a span program or an algorithm without a witness. Our theorem additionally requires Merlin to supply the certificate and the exact gate implementation in Section 4.4 to preserve perfect completeness.
5 Conclusion
Under the gate assumptions of Theorem 3.3, . Keeping the left Kraus factors exact preserves zero acceptance, while reference-state reweighting retains an inverse-polynomial accepting probability on yes-instances. Theorem 3.5 also identifies this class with the standard Clifford+T class under its CM-field assumptions.
Theorem 4.1 proves under its stated gate assumptions. Here Merlin supplies a history certificate, and exact checks preserve perfect completeness. This construction uses neither reference-state reweighting nor the two-sided measurement-elimination theorem used by the RQL construction.
Several questions follow from these constructions.
Which gate sets support the simulation? Can the exact inverse assumption in Theorem 3.3 be removed while retaining its bounds on computing gate entries? Can the requirement to implement Clifford+T in Theorems 3.3 and 3.5 be removed? Can the gate-set independence theorem be extended beyond fixed CM-field gate sets? Approximate universality does not settle this issue: the standard gate-conversion argument preserves a bounded gap but can destroy an exact zero [vMW12, LGLW23].
Can both acceptance and rejection be exact? Define EQL and EQU using the same absolutely halting, polynomial-time, logarithmic-space models, with a correct answer of probability one on every promised input. Whether remains open here. The missing requirement is an exact implementation of the operations used by an exact simulation.
One can remove a normalization obstacle at the level of ideal operators. For the pure initial state, take and . The same doubled construction, with no inverse of , gives . Since , pairing with after copying the output gives amplitudes for the original output probabilities . For an exact source computation this would give success probability , and one ordinary Grover iteration would suffice. Exact efficient implementations of the steps and final pairing over a fixed gate set are not supplied by our approximation arguments. Establishing such an implementation, possibly with different reweighting factors, is the open problem; no EQL equality follows from this observation.
What is the remaining role of a quantum witness? Theorem 4.1 removes intermediate measurements from perfectly complete verifiers but retains a quantum witness. The further equality posed by Fefferman and Remscrim is not automatic [FR21, Open Problem 1]. Can the argument that preserves exact rejection help eliminate witnesses in this perfect-completeness setting? Any such comparison must use compatible gate-set conventions for the verifier and the simulation. The separate question also remains: the history construction preserves an existing exact kernel and does not create one from a merely high-acceptance witness.
Can the reference-state computation be made cheaper? The reference states bound the norms of the doubled steps, but implementing their square roots and inverse square roots can dominate the cost of the simulation. Can structure in the source channels make it cheaper to access the reference states and implement their square roots and inverse square roots? Can these operations be implemented without using two-sided measurement elimination? For superlogarithmic space, the relevant target is an improved simultaneous time-space bound, not just polynomial time in the Hilbert-space dimension. The time-space trade-offs of Girish and Raz, together with Zhandry's black-box lower bounds, provide benchmarks for this question [GR22, Zha24].
References
[AE25] Simon Apers and Roman Edenhofer. Directed st-connectivity with few paths is in quantum logspace. In 40th Computational Complexity Conference (CCC 2025), volume 339 of Leibniz International Proceedings in Informatics (LIPIcs), pages 18:1–18:15, 2025.
[AKN98] Dorit Aharonov, Alexei Kitaev, and Noam Nisan. Quantum circuits with mixed states. In Proceedings of the 30th Annual ACM Symposium on Theory of Computing (STOC), pages 20–30, 1998.
[BCP83] A. Borodin, S. Cook, and N. Pippenger. Parallel computation for well-endowed rings and space-bounded probabilistic machines. Information and Control, 58(1):113–136, 1983.
[BHMT02] Gilles Brassard, Peter Høyer, Michele Mosca, and Alain Tapp. Quantum amplitude amplification and estimation. Contemporary Mathematics, 305:53–74, 2002. arXiv:quant-ph/0005055. Generalizes Grover's algorithm to amplitude amplification.
[BK02] Howard Barnum and Emanuel Knill. Reversing quantum dynamics with near-optimal quantum and classical fidelity. Journal of Mathematical Physics, 43(5):2097–2106, 2002. Corrected author version: arXiv:quant-ph/0004088v2, 18 January 2026.
[BMP 99] P. Oscar Boykin, Tal Mor, Matthew Pulver, Vwani Roychowdhury, and Farrokh Vatan. On universal and fault-tolerant quantum computing, 1999.
[BR12] Aleksandrs Belovs and Ben W. Reichardt. Span programs and quantum algorithms for st-connectivity and claw detection. In Algorithms – ESA 2012, volume 7501 of Lecture Notes in Computer Science, pages 193–204. Springer, 2012.
[CJOP20] Arjan Cornelissen, Stacey Jeffery, Maris Ozols, and Alvaro Piedrafita. Span programs and quantum time complexity. In 45th International Symposium on Mathematical Foundations of Computer Science (MFCS 2020), volume 170 of Leibniz International Proceedings in Informatics (LIPIcs), pages 26:1–26:14. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, 2020.
[FKL 16] Bill Fefferman, Hirotada Kobayashi, Cedric Yen-Yu Lin, Tomoyuki Morimae, and Harumichi Nishimura. Space-efficient error reduction for unitary quantum computations. In 43rd International Colloquium on Automata, Languages, and Programming (ICALP 2016), volume 55 of Leibniz International Proceedings in Informatics (LIPIcs), pages 14:1–14:14, 2016.
[FL18] Bill Fefferman and Cedric Yen-Yu Lin. A complete characterization of unitary quantum space. In 9th Innovations in Theoretical Computer Science Conference (ITCS 2018), volume 94 of Leibniz International Proceedings in Informatics (LIPIcs), pages 4:1–4:21, 2018.
[FR21] Bill Fefferman and Zachary Remscrim. Eliminating intermediate measurements in space-bounded quantum computation. In Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 1343–1356. ACM, 2021.
[GLM 22] András Gilyén, Seth Lloyd, Iman Marvian, Yihui Quek, and Mark M. Wilde. Quantum algorithm for Petz recovery channels and pretty good measurements. Physical Review Letters, 128(22):220502, 2022.
[GR22] Uma Girish and Ran Raz. Eliminating intermediate measurements using pseudorandom generators. In 13th Innovations in Theoretical Computer Science Conference (ITCS 2022), volume 215 of Leibniz International Proceedings in Informatics (LIPIcs), pages 76:1–76:18, 2022.
[GR26] Sabee Grewal and Dorian Rudolph. QMA has perfect completeness, 2026. Version 1, 11 September 2026.
[GRZ21] Uma Girish, Ran Raz, and Wei Zhan. Quantum logspace algorithm for powering matrices with bounded norm. In 48th International Colloquium on Automata, Languages, and Programming (ICALP 2021), volume 198 of Leibniz International Proceedings in Informatics (LIPIcs), pages 73:1–73:20, 2021.
[GS13] Brett Giles and Peter Selinger. Exact synthesis of multiqubit clifford+t circuits. Physical Review A, 87(3):032332, 2013.
[IJ19] Tsuyoshi Ito and Stacey Jeffery. Approximate span programs. Algorithmica, 81(6):2158–2195, 2019.
[Imm88] Neil Immerman. Nondeterministic space is closed under complementation. SIAM Journal on Computing, 17(5):935–938, 1988.
[Jef22] Stacey Jeffery. Span programs and quantum space complexity. Theory of Computing, 18(11):1–49, 2022.
[JKMW10] Richard Jozsa, Barbara Kraus, Akimasa Miyake, and John Watrous. Matchgate and space-bounded quantum computations are equivalent. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 466(2115):809–830, 2010.
[KW93] Mauricio Karchmer and Avi Wigderson. On span programs. In Proceedings of the Eighth Annual Structure in Complexity Theory Conference, pages 102–111. IEEE Computer Society, 1993.
[LGLW23] François Le Gall, Yupan Liu, and Qisheng Wang. Space-bounded quantum state testing via space-efficient quantum singular value transformation. arXiv:2308.05079, 2023. Revised version 3, 1 July 2026.
[LGNY21] François Le Gall, Harumichi Nishimura, and Abuzer Yakaryilmaz. Quantum logarithmic space and post-selection. In 16th Conference on the Theory of Quantum Computation, Communication and Cryptography (TQC 2021), volume 197 of Leibniz International Proceedings in Informatics (LIPics), pages 10:1–10:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021.
[Mil20] J. S. Milne. Complex multiplication, 2020. Version 0.10, July 14, 2020.
[NC10] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press, 10th anniversary edition, 2010. Standard reference for quantum computing fundamentals.
[Pet86] Dénes Petz. Sufficient subalgebras and the relative entropy of states of a von Neumann algebra. Communications in Mathematical Physics, 105(1):123–131, 1986.
[Pet88] Dénes Petz. Sufficiency of channels over von Neumann algebras. The Quarterly Journal of Mathematics, 39(1):97–108, 1988.
[Rei09] Ben W. Reichardt. Span programs and quantum query complexity: The general adversary bound is nearly tight for every Boolean function. In Proceedings of the 50th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 544–551. IEEE Computer Society, 2009.
[Rei11] Ben W. Reichardt. Reflections for quantum query algorithms. In Proceedings of the Twenty-Second Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 560–569. SIAM, 2011.
[RŠ12] Ben W. Reichardt and Robert Špalek. Span-program-based quantum algorithm for evaluating formulas. Theory of Computing, 8(13):291–319, 2012.
[Sze88] Róbert Szelepcsényi. The method of forced enumeration for nondeterministic automata. Acta Informatica, 26:279–284, 1988.
[Tan22] Seiichiro Tani. Space-bounded unitary quantum computation with postselection. In 47th International Symposium on Mathematical Foundations of Computer Science (MFCS 2022), volume 241 of Leibniz International Proceedings in Informatics (LIPics), pages 81:1–81:15, 2022.
[TS13] Amnon Ta-Shma. Inverting well conditioned matrices in quantum logspace. In Proceedings of the 45th Annual ACM Symposium on Theory of Computing (STOC), pages 881–890, 2013.
[vMW12] Dieter van Melkebeek and Thomas Watson. Time-space efficient simulations of quantum computations. Theory of Computing, 8:1–51, 2012.
[Wat99] John Watrous. Space-bounded quantum complexity. Journal of Computer and System Sciences, 59(2):281–326, 1999.
[Wat01] John Watrous. Quantum simulations of classical random walks and undirected graph connectivity. Journal of Computer and System Sciences, 62(2):376–391, 2001.
[Wat03] John Watrous. On the complexity of simulating space-bounded quantum computations. Computational Complexity, 12(1–2):48–84, 2003.
[Zha24] Mark Zhandry. The space-time cost of purifying quantum computations. In 15th Innovations in Theoretical Computer Science Conference (ITCS 2024), volume 287 of Leibniz International Proceedings in Informatics (LIPics), pages 102:1–102:22, 2024.
A Implementing doubling
This appendix collects the circuit constructions for the reweighted doubled operators defined in the main text. The ideal clean-block construction is shared by the two simulations; the compiled construction makes explicit which factors remain exact in the one-sided case.
A.1 Implementation with exact controls and conjugation
The following gate assumptions give a direct generalization of Section 3.2. They also specify the interface used by Lemma 3.2. Section 3.3 removes the requirements for exact controlled gates and complex conjugates. We impose the following sufficient conditions on the fixed finite gate set G. An exact implementation is a fixed finite circuit over G, with a constant number of extra qubits initialized and returned to zero on every input. The circuit must implement the specified matrix exactly, including its phase.
-
Computing gate entries. For every , its entries can be approximated to additive error in deterministic space and time . Only is used below.
-
Exact standard gates. There are exact implementations of , , and CNOT. In particular, reversible Boolean gates, computational-basis predicates, and their phase reflections can be implemented exactly.
-
Exact inverses and complex conjugates. For every , there are exact implementations of and , where conjugation is in the computational basis.
-
Exact coherent control. For every , there is an exact implementation of . Further controls are obtained by computing their conjunction into clean scratch. In particular, this condition applies to the actual finite circuits implementing the right Kraus factors, not just their ideal targets.
These fixed circuits are independent of input length. Approximate scalar rotations are compiled using the exact implementations of Clifford+T and space-efficient synthesis [vMW12]; the phase-sensitive convention needed for controlled rotations is explained in Appendix A.4. No exact synthesis of or is assumed.
Theorem A.1 (Same-gate-set measurement elimination). Under conditions (1)–(4), the polynomial-time, logarithmic-space classes defined above satisfy
Proof. Under conditions (1)–(4), the construction in step 1 of Theorem 3.1 gives exact dilations over . Lemma 3.2 supplies the right-factor circuits over the same gate set. Conditions (2)–(4) allow every inverse, control and Boolean reflection used there to be implemented exactly. The clean-block identity (10) and steps 3–5 of that proof therefore give an absolutely halting, polynomial-time unitary simulation in logarithmic space, with zero acceptance on no-instances and acceptance greater than 2/3 on yes-instances. The reverse inclusion follows from the definitions.
Corollary A.2 (Examples). The theorem applies to and to
whenever the added entries satisfy condition (1), including .
Proof. The exact inverse, conjugation and controlled circuits for were given in step 1 of Theorem 3.1. The two added phase gates are each other's inverses and conjugates; the same AND-phase-uncompute construction controls each of them exactly. All numerical entries in these examples meet condition (1).
The equality for is over that same gate set on both sides. It does not assert gate-set independence for arbitrary finite gate sets, nor exact simulation of arbitrary channel matrices supplied without unitary dilations.
A.2 Doubling for BQL
Figure 8 expresses the ideal contraction as a clean block of a unitary circuit. The unitary extension of in this diagram is an abstract operator, so the diagram alone does not assert exact synthesis over a fixed gate set. For bounded error, this operator may be approximated to the accuracy required by the full simulation. The compiled form in Appendix A.3 can also be used for BQL. Appendix B proves the acceptance bounds after reducing the original computation's error. It also explains why implementing the right Kraus factors uses the known measurement-elimination theorem.

Figure 8: The ideal doubled step . Gates run left to right on a possibly entangled input on . The blue dilation writes the Kraus label into ; the purple circuit acts on to supply the right Kraus factors . The green tag selects the clean block, not a measurement. is an exact abstract unitary extension of , with no assumed exact synthesis over the gate set.
A.3 Doubling for RQL
For the one-sided simulation, Figure 9 replaces the ideal unitary for the right Kraus factors by a compiled circuit while retaining the exact unitary dilation of the original channel. Thus the clean block retains the exact Kraus factors on the first data register, as required by the perfect-soundness argument in the main text. The gate-set implementation hypotheses stated there still apply.

Figure 9: The compiled doubled step . The purple box replaces the ideal inverse in fig. 8 by the inverse of the implemented circuit . The left Kraus factors remain exact; the right Kraus factors act on . Label sums include * and padding labels, with zero left Kraus factors. Green tags are clean-block conditions, not measurements: the physical output is plus a component with nonzero , retained coherently.
A.4 Uniform implementation of the right Kraus factors
We prove Lemma 3.2. A clean block is the compression of an actual unitary between specified input and output subspaces, with ancillary registers fixed to zero; the input and output subspaces may have different dimensions. Compression is only notation: every register is retained coherently. Throughout this proof, dimensions and running times are polynomial in n, and the required error tolerances are inverse polynomial.
Approximating rotations, including their phases. All variable one-qubit rotations can be taken in SU(2). There is a fixed, finite, inverse-closed set of determinant-one Clifford+T circuits whose generated subgroup is dense in SU(2). Indeed, the determinant map on the group generated by H, T has finite image, so its kernel is finitely generated and has finite index. Projective universality of H, T [BMP+99] implies that the projective closure of this kernel is all of the connected group PU(2); its closure in SU(2) is therefore SU(2). Apply the phase-sensitive version of space-efficient Solovay–Kitaev, [vMW12, Theorem 4.5], to this fixed set. It approximates the specified matrix in operator norm, including its phase, with generation space for error . Scalar phases, when needed, can be realized on the zero state of a helper qubit using a determinant-one diagonal rotation; this helper is reused and required to be zero in the selected block. It is never reset: leakage from approximate rotations is included in the telescoping error bound for the full circuit relative to the ideal diagonal rotations. This also supplies phase-correct implementations of the controlled phase gates in a Fourier transform. All controls and inverses are formed after choosing the finite circuit that implements the approximation, using the exact gate implementations required by the theorem. The polynomially many gates used to implement the right Kraus factors can be approximated with a smaller inverse-polynomial error per gate, by the unitary telescoping bound.
Reference entries as two-sided computations. To implement the recurrence for , start in . Apply each source channel, then replace the state by with probability . For this reference-state experiment, the coin and all gates may be approximated sufficiently accurately. Their accumulated trace-distance error is bounded by the sum of the per-step errors. For a diagonal entry, or the real or imaginary part of an off-diagonal entry, measure the corresponding one- or two-coordinate Hermitian observable. Its norm is at most one, and it is implementable using reversible basis permutations and constant-dimensional rotations. Polynomially many independent trials with reused workspace and a classical sum estimate the entry to any inverse-polynomial additive accuracy, with constant error probability.
Thus, for an entry component , the promise problem versus is in BQL for inverse-polynomial . The established BQL = BQU L theorem [FR21, Theorem 1], followed by space-efficient unitary error reduction [FKL 16, Theorem 1.1 and Corollary 1.2] and two-sided gate approximation, supplies a uniform Clifford+T comparator with error at most any inverse-polynomial on promised inputs. It is a valid unitary circuit on every input, including thresholds in the promise gap; no correctness assertion there is needed. This is a quantum estimation argument, not an assertion that the entries of are classically computable in logarithmic space.
Representing the reference matrix in a unitary circuit. Let be the actual acceptance probability of this comparator. Compute, apply the sign +1 on acceptance and -1 on rejection, and uncompute with its actual inverse. The all-zero work block is exactly . For a power-of-two grid of N midpoint thresholds in , prepare and unprepare a uniform grid register. The resulting scalar block obeys
Indeed, the integral of against the uniform measure is ; the grid contributes at most , the thresholds within of contribute at most , and comparator errors outside that interval contribute at most .
These scalar circuits can be addressed coherently without quantum access to a classical circuit generator. Enumerate all polynomially many tuples and emit the corresponding fixed-input comparison circuit controlled on equality with the address registers. The address is unchanged. Polynomial enumeration and recomputation use space.
An equal superposition of the real and imaginary constructions, with an exact phase on the latter, gives a scalar entry block . Prepare a uniform row register, apply the scalar block controlled on row and input column, swap these two registers, and unprepare the old column. Its clean matrix block is : on column the clean output is . A selector qubit in chooses between this circuit and its inverse. Selecting the output component gives the exact Hermitian block
For example, take and a power-of-two in (30). The component errors are at most , so the complex entry errors and the bound give the displayed inequality. Choose , where . Then .
Square roots and inverse square roots without storing the matrix. Let U be the actual unitary with Hermitian clean block , and let P be its zero-scratch projector. Define
is a Hermitian unitary and its compression to is . For an eigenvalue of , the two-reflection walk has phases arccos on the associated invariant plane. Perform coherent phase estimation of , rotate a flag qubit so that its amplitude is , and uncompute the phase estimation. If and has Lipschitz constant , an estimate accurate to except with probability gives clean-block error at most . Both phases in the invariant plane have the same cosine. With inverse-polynomial , ordinary phase estimation uses qubits and polynomially many controlled powers of . The estimates are retained and uncomputed, never measured. Rotations depending on an estimate are implemented by enumerating its polynomially many bit strings and controlling each fixed rotation circuit on equality. The circuit generator therefore needs only classical addresses. For each flag rotation the entire SU(2) matrix, including , is approximated to the prescribed gate accuracy. Quadratically finer scalar precision suffices near and still uses only bits.
Put and choose
These functions are bounded, have polynomially bounded Lipschitz constants, and have values computable to inverse-polynomial accuracy in logarithmic space. Their clean blocks approximate and , respectively. For ,
For the first bound, the difference of roots solves the Sylvester equation with coefficients ; its integral solution has norm at most . The second follows by multiplying this root difference on the left and right by the inverse roots. Thus both unscaled root errors can meet any inverse-polynomial error tolerance. No eigenvectors are computed or stored.
Combining the factors to approximate . The construction below combines a square root, the inverse of the unitary dilation , and an inverse square root, as in the Petz-isometry implementation of Gilyén et al. [GLM 22, Eq. (9) and Theorem 1]. Section 3.1 identifies the matching Kraus factors and the different completion used here. Our preceding reference construction supplies logarithmic-space uniform access; the exact left Kraus factors in the main simulation preserve exact rejection.
Pad the number of source Kraus labels to a power of two . Prepare a uniform label , copy it into the environment , apply to data and , and require in the output block. The retained label gives exactly
Compose this block with the root blocks before and after it, and add a separate branch for . For a sum, prepare a selector with amplitudes proportional to the square roots of the coefficient magnitudes, select the component unitary, and unprepare the selector. Compression yields the sum divided by the sum of those magnitudes. There are only constantly many branches here. Products of the constant number of constituent blocks use distinct clean scratch, or the failure-counter construction in the main proof. The resulting block is
All normalization factors are known scalar functions of . For instance the ideal main-branch coefficient is and the star-branch coefficient is , using . The common scale is their sum's reciprocal. Errors in roots and scalar rotations change the unscaled block by at most a polynomial factor times their errors: this follows by a constant-length product telescoping bound and , . Consequently any specified inverse-polynomial bound on is attainable. Errors in preparing the selector are also bounded after division by the known normalization factor .
Removing the normalization factor. Choose a polynomially bounded integer for which and reduce the selected block's amplitude by a factor . First analyze an ideal rotation giving this factor. Rectangular oblivious amplitude amplification, using the input and output clean-subspace reflections, transforms the block as follows. Write in polar form. If , then
After m iterations the block is, with its known sign corrected,
Here and on that interval, since and . Thus . Use . Approximate this extra rotation so that the complete amplified
| Quantity | Sufficient choice | Resulting error or cost |
| Reference-matrix error | ||
| Threshold comparison | Gives the preceding matrix bound by (30) | |
| Reference experiment | Trace-norm error at most per trial; trials | Constant-error comparison with threshold gap |
| Root phase estimation | Functional-calculus error at most per normalized root | |
| Polar amplification | Integer ; | Error at most before final gate synthesis |
| Variable rotations | Operator-norm error per occurrence | At most additional error in the full amplified circuit |
Table 1: One sufficient error budget for a single right Kraus isometry. bounds the number of variable-rotation occurrences in the complete amplified circuit before those rotations are synthesized. Repeated occurrences, including those in inverses and controlled circuits, are counted separately.
circuit changes by at most ; per-call error suffices by unitary telescoping. The preceding approximation errors can be included in before amplification. The resulting block is within of , with all Kraus labels retained and no additional normalization factor. Thus this implementation avoids a fixed loss at every source step.
Finally conjugate this actual circuit gate by gate. For , use its exact complex-conjugation circuits; more generally, use condition (3) of Theorem A.1, to obtain and its labelled block within of . The initial states and projectors selecting the block have real entries, so conjugation commutes with taking this block.
An explicit precision budget. The following choices make the error estimates quantitative. Let be the desired error in the labelled block of Lemma 3.2, and set
Here is the padded number of source Kraus labels. All tolerances in Table 1 may be rounded down to dyadic numbers within a factor of two of the stated bound. The grid size is rounded up to a power of two. These choices require only logarithmically many bits.
For the reference experiment, a trace-norm error of changes the expectation of a norm-one observable by at most . Hoeffding's inequality gives empirical error at most , except with probability at most , using the stated number of trials. Thus a promised distance of at least from the threshold leaves a constant-probability correct comparison. The required trace-norm bound follows by telescoping the implemented reference channels: for at most channels, an error at most in diamond norm per channel suffices. For a reference trial with approximated unitary gate occurrences, per-gate operator-norm error at most suffices; the intervening channels contract trace distance. Applying [FR21, Theorem 1] gives a unitary comparator with constant gap. Then [FKL16, Corollary 1.2], with , reduces its error to at most . A further two-sided synthesis error of at most in its acceptance probability gives the actual comparator error used above.
To check the root budget, both and have Lipschitz constant at most : on the unclipped interval their derivatives are bounded respectively by and , and clipping does not increase these bounds. Hence . Equation (31) changes either normalized root by at most . Each implemented root block therefore differs from its block defined using by at most
Write and , so . The main branch is a product of two normalized root blocks and the contraction ; the additional branch uses one normalized inverse root. Every factor is a contraction. Product telescoping therefore bounds the error in the unscaled sum by
The polar-amplification bound proved above consequently applies. The chosen guarantees and .
In this calculation the comparator circuits are already finite Clifford+T circuits, while the remaining variable rotations are first analyzed as exact matrices. The number of their occurrences is fixed by the preceding circuit construction and does not depend on their eventual synthesis accuracy. Approximate all of them, including the selector, Fourier-transform, root-flag and attenuation rotations, with the final tolerance . The unitary telescoping bound adds at most to the amplified circuit's error. Thus the total labelled-block error is at most , leaving slack within the required . In particular, the main simulation's choice makes the accumulated doubled-step error at most .
The table specifies tolerances rather than claiming a particular polynomial degree for the imported two-sided simulator. The reference trials, address enumeration, phase-estimation powers and amplification calls each have length polynomial in and . For example, ordinary phase estimation can attain with controlled walk calls and estimation qubits. The imported comparator has polynomial length and logarithmic space by the cited theorems. Consequently and the fully synthesized circuit length are polynomial, while every address, counter, precision register and rotation generator uses space. There are only constantly many nested constructions. For the inverse-polynomial tolerances used here, the total space is .
Time and space bounds. All lower bounds on eigenvalues and all error tolerances above are inverse polynomial. The number of address tuples, phase-estimation calls, amplification iterations, and gates is polynomial. Scalar calculations keep only a constant number of -bit registers; loop bodies and gate sequences are regenerated when needed. Only a constant number of constructions are nested: the two-sided comparison circuit, reference block, root block, construction of , and amplification. Each level uses logarithmic workspace, hence their sum does also. Repeated powers are powers of full unitaries on the same registers and do not allocate new workspace on each call. The reference estimator uses the original measured computation; the two-sided measurement-elimination theorem is used as an established result. There is no recursive invocation of the one-sided simulator and no assumption of a classically accessible reference-state matrix. This proves Lemma 3.2.
B The conditional BQL application
Here BQL and BQU L refer to the measured and unitary polynomial-time, logarithmic-space models over , with acceptance at least 2/3 on yes-instances and at most 1/3 on no-instances. We separate the two-sided correctness argument from the implementation of its clean blocks. The implementation of the right Kraus factors in Appendix A.4 uses the established equality BQL = BQU L; the result below is a conditional doubling simulation, rather than an independent proof of that equality.
Proposition B.1 (Conditional bounded-error simulation). Suppose that, for every polynomial-time, logarithmic-space source computation over and every inverse-polynomial , there are polynomial-size, logspace-uniform unitary circuits over , on qubits, whose zero-scratch blocks satisfy
Then the reweighted doubling construction, preceded by measured source error reduction and followed by unitary amplification, simulates each BQL computation in BQU L.
Proof. Fix a source machine and an input of length n.
Reduce source error before doubling. Run independent repetitions of the original machine, resetting and reusing its workspace, and take their majority with a classical counter. Hoeffding's bound gives error at most . The counter uses bits, and the running time remains polynomial. Let be the padded power-of-two configuration dimension of this amplified source, and a polynomial bound on its running time. Both are polynomial in . Therefore, for all sufficiently large , its acceptance probability satisfies
The finitely many smaller input lengths can be handled directly. The repetition count is fixed before defining d, so this argument does not choose an accuracy circularly through the workspace it requires.
Compose the approximate contractions. Use . Since every is a block of an actual unitary, both and are contractions. Consequently
Give every step the same number of scratch qubits by adding unused qubits. To realize the product coherently, reuse this scratch and add a counter modulo a power of two larger than T. Apply every unconditionally, then increment the counter if the scratch is nonzero. Expand the product using the projectors onto zero and nonzero scratch. Final counter zero selects exactly those terms with zero scratch after every step: the counter can increase at most T times and cannot wrap to zero. This is the construction proved in (13).
The good subspace requires counter zero, scratch zero, and acceptance on the first data register. If its probability is , then
By (6) and (32),
on yes-instances,
on no-instances.
The first line uses and .
Amplify with both errors controlled. Append a Hadamard coin and require coin one in the good predicate. The resulting preparation has success . Thus on yes-instances and on no-instances. All zero-state and good-subspace reflections, controls, and actual inverses are exactly implementable over .
Prepare and retain a uniform choice , where , and apply Grover iterations to [BHMT02]. For , the averaged success is
On yes-instances, gives , so success is at least 1/4. On no-instances, the bound for integer gives
This also holds when . Four independent coherent copies followed by a reversible OR of their good predicates therefore accept with probability at least on yes-instances, and less than on no-instances. Only the final output qubit is measured.
The reused scratch, counter, choice register, and a constant number of copies require space. All repetition counts and circuit lengths are polynomial, and the loops and inverse circuits can be generated in logarithmic space.
Implementation and logical dependency. Lemma 3.2 and the clean-block construction in (10) supply the premise of Proposition B.1 for . Their reference-entry comparators use the established two-sided measurement-elimination theorem of Fefferman and Remscrim [FR21], as explained in Appendix A.4. Thus the present implementation uses BQL = BQU L as an input. An independent doubling proof of that equality would require computing the reference entries and implementing the right Kraus factors without using that theorem. This dependence does not affect the one-sided theorems in the main text, which use the established two-sided result as a premise.
C Further quantum-space background
This appendix expands the quantum-space background of Section 1.1. Figure 1 in that section summarizes the established containments.
The quantum space landscape. Watrous established the foundations of space-bounded quantum complexity and its classical simulation [Wat99, Wat03]. For standard finite algebraic gate sets, these results place bounded-error quantum logspace BQL inside classical polynomial time and deterministic space; the corresponding unbounded-error quantum and probabilistic space classes coincide. These upper bounds leave room for quantum advantages over classical logarithmic space. One early example is Watrous' unitary simulation of random walks, which placed undirected connectivity in [Wat01]. A different characterization was obtained by Jozsa, Kraus, Miyake and Watrous: polynomial-size, logspace-uniform nearest-neighbour matchgate circuits have the same computational power as polynomial-time unitary quantum logspace [JKMW10].
Linear algebra provides another useful description of this power. Ta-Shma gave quantum logspace algorithms for approximating inverses of polynomially well-conditioned matrices [TS13]. Fefferman and Lin obtained unitary algorithms and matching completeness results for suitably normalized matrix-inversion and minimum-eigenvalue problems [FL18]. The normalization and condition-number promises are essential: these results do not put unrestricted matrix inversion in quantum logspace. Space-efficient amplification is a further ingredient. Fefferman, Kobayashi, Lin, Morimae and Nishimura showed how to reduce error to using only additional qubits, where is the original completeness–soundness gap [FKL 16]. As a more recent application of quantum linear algebra, Apers and Edenhofer gave a quantum logspace procedure for counting directed s-t paths under polynomial bounds on the number of paths starting at s and ending at t [AE25]. The promise concerns these larger families of paths, not merely the number of s-t paths.
Removing measurements with two-sided error. Fefferman and Remscrim proved BQL = BQUL, and the analogous equality for space-constructible bounds [FR21, Theorem 1]. Their result covers general computations, including classical control conditioned on measurement outcomes. The proof relates their acceptance probabilities to well-conditioned linear-algebraic problems that admit unitary space-efficient algorithms. Independently, Girish, Raz and Zhan gave a unitary quantum logspace algorithm for powering contraction matrices [GRZ21]. They used it to simulate unital quantum computations, including circuits with unitary gates and intermediate measurements but without a separate classical memory that stores and acts on the outcomes [GRZ21, Section 5]. These are distinct model assumptions: a reset channel, for example, is not unital.
For and , these simulations have polynomial running time; their dependence on a general space bound is exponential in . Girish and Raz obtained a different trade-off: for circuits with unitary operations and intermediate measurements, time and space can be replaced by time poly( ) and space [GR22]. Zhandry proved lower bounds for black-box measurement-elimination procedures, showing limitations on simultaneously preserving time and space in that setting [Zha24]. Postselection gives a related comparison: Le Gall, Nishimura and Yakaryilmaz proved PostBQL = PL, and Tani showed that intermediate measurements and intermediate postselections can be deferred in the space-bounded, bounded-error postselection model [LGNY21, Tan22]. These results concern their respective computational models; postselection is not an operation available to an ordinary RQUL machine.
Why one-sided error is different. An additive approximation to an acceptance probability preserves a constant two-sided gap, but need not preserve perfect soundness. Fefferman and Remscrim explicitly isolated the remaining one-sided bounded-error question as Open Problem 1 [FR21, Section 6]. Their partial characterization includes
where the last class is the complement of unitary quantum Merlin–Arthur logspace with perfect completeness [FR21, Theorem 32 and Lemma 36]. They also established equality between general and unitary quantum logspace with one-sided unbounded error [FR21, Theorem 41]; allowing an arbitrarily small nonzero accepting probability is a different requirement from retaining an inverse-polynomial signal.
Le Gall, Liu and Wang subsequently found natural complete promise problems for coRQUL: given descriptions of logarithmic-space state-preparation circuits, distinguish equality of the output states from inverse-polynomial separation in trace distance or squared Hilbert–Schmidt distance [LGLW23, Theorem 1.1]. Their algorithms use space-efficient quantum singular value transformation. Their gate-set convention is relevant here: they allow single-qubit gates with space-computable amplitudes and explicitly discuss the difficulty of changing gate sets under one-sided error [LGLW23, Remark 2.7]. For two-sided bounded error, the space-efficient Solovay–Kitaev theorem makes the class independent of the gate set under the usual universality and computability assumptions, with each gate’s inverse available [vMW12]. It does not establish gate-set independence when zero acceptance must be preserved exactly. A same-gate-set statement must therefore specify which operations are synthesized exactly and which are approximated.
D Machine-checked mathematical lemmas
The Lean project verifies the supporting lemmas in Table 2, with the displayed assumptions. It does not formalize the complexity-class equalities.
| Paper component | Checked statements | Supplied assumptions or remaining steps |
| Reweighted doubling | Exact zero preservation for arbitrary right factors; vectorization; reweighted-step identity and telescoping. | Finite history expansion and supplied matrices satisfying the inverse identities. Matrix-root construction is not formalized. |
| Approximation and amplification | Product error at most ; norm and probability perturbation; averaged-Grover identities and scalar gap margins. | Per-step errors and norm bounds; the reduction of the circuit to a Grover rotation and its angle estimate. |
| Failure counter and recovery map | Zero count selects exactly the all-zero-scratch histories; normalization and reference recovery of the Kraus family. | The circuit’s history expansion; explicit root, channel-image and trace-preservation equations. |
| Witness histories | Kernel equivalence and the singular-value bound in Lemma 4.2, with Euclidean direct-sum norms. | Bounds on interval products, the honest history and the boundary map; the original rejection lower bound. |
| Exact matrix test | Paired coefficients, inactive-branch swaps, common phase, padding and uniform-address matrix identities from Lemma 4.3. | The gate implementation and address-controlled circuit construction. |
| Coherent witness amplification | Rejection geometry; the PQP norm bound; exact completeness; constant soundness and finite failure-register norm preservation. | The exact unitary block, an isometric embedding of initialized inputs, and the history matrix’s lower norm bound. |
Table 2: Scope of the Lean verification. The supplement’s formal/README.md gives the module and theorem names for each row.
Boundary of the verification. Quantum-machine semantics, the circuit compiler, the acceptance-probability bounds (6), uniform reference access, square-root synthesis, the CM-field encoding, and the complete uniformity and resource analysis remain ordinary mathematical proofs. For the witness result, positivity and the analytic bounds for backward channel maps are also supplied as hypotheses. Passing the Lean check does not certify these interfaces or the resulting complexity-class equalities.
Reproducing the check. The supplement formal-verification-source.zip contains the formal/ project; VERIFY-MANIFEST.json records its source revision and file hashes. It pins Lean 4.30.0 and all library dependencies. After installing elan, run from formal/:
lake exe cache get
python3 verify.py
The checker rebuilds proofs, rejects placeholders and audits foundational axioms; its report records source hashes. The README gives setup details and verification boundaries. Preserve the supplied dependency manifest and rerun the check after edits.