Ancilla bit 2026-10-14
An ancilla bit is an auxiliary bit providing workspace in reversible computation. In a quantum circuit, an ancilla qubit provides quantum workspace; a general quantum ancilla need not be a single bit.
Ancilla qubit Created 2026-10-14 Updated 2026-11-05
An ancilla qubit is a two-dimensional quantum ancilla. It is the quantum version of an ancilla bit; an auxiliary quantum register can contain several such qubits.
Bit-flip repetition code Created 2026-09-28 Updated 2026-10-14
The -qubit bit-flip repetition code stores one logical qubit in and . Its stabilizer generators are for , and its logical operators are and . Interchanging the Pauli X gate and Pauli Z gate gives the phase-flip repetition code. For odd , majority-vote decoding of a repetition code corrects up to physical Pauli X gate errors, assuming ideal operations and a noise family containing only these bit flips.
For , prepare two quantum ancillas in and apply controlled-NOT gates from the input qubit to each of them. By linearity, encoding sends
This does not produce , which would contain cross terms. For example, encoding produces , whereas three independent copies would have eight equal computational basis amplitudes. The encoding creates quantum entanglement when both coefficients are nonzero and respects the no-cloning theorem.
The three-qubit bit-flip syndrome table corrects the family and its entire linear span, as specified by the Knill--Laflamme condition. It cannot correct arbitrary errors on one physical qubit: the phase flip
commutes with both checks and acts as logical . In particular, it takes the encoded to the orthogonal encoded with error syndrome . Thus its full quantum code distance is one, despite correcting one error of the restricted Pauli X gate type. The Shor code, Steane code and five-qubit error correcting code provide protection against arbitrary one-qubit errors.
Suppose a known list of distinct -bit strings is available and computational basis transpositions on qubits have polynomial-size implementations. Start with the uniform superposition state of index labels , leaving the data zero. First swap with for each nonzero . Next, for each , swap with . Distinct index labels separate the first-stage pairs, and distinct data strings separate the second-stage pairs. Thus no later transposition disturbs an earlier term. At most transpositions prepare the uniform data state and return the quantum ancilla to zero. For the quantum circuit has polynomial size. This assumes the list is available; a membership predicate alone does not supply it.
Encode as . Four controlled-NOT gates copy the displayed two data parities into initially zero quantum ancillas. No logical amplitude is measured. The error syndromes correspond respectively to no bit flip and bit flips on data qubits . Conditional Toffoli gates, with temporary Pauli X gates implementing zero-valued controls, undo the indicated error. Inverse encoding yields the original logical state and a separate syndrome state. A phase flip has zero bit-flip syndrome and remains as a logical phase error; this three-qubit code is not a general single-qubit-error code.
Two angle-zero one-bit teleportations with outcomes implement on an arbitrary input, up to global phase. A Controlled-Z gate with a fixed quantum ancilla implements , so removes the known factor. The result is up to phase. With probability one half the desired Pauli X gate is applied; otherwise the input is unchanged. Repeating until gives an exact heralded correction with two attempts on average and almost-sure termination. It has no finite worst-case measurement count. A Pauli frame avoids this repeat-until-success procedure when only logical action or classical output statistics are required.
HHL controlled reciprocal rotation Created 2026-10-05 Updated 2026-11-05
On a positive eigenvalue label and a clean quantum ancilla, the HHL algorithm applies a quantum variable rotation with angle , where :
Uncomputation of the eigenvalue register followed by conditioning on flag one multiplies each input eigenvector amplitude by . If is normalized, the success probability is . Choosing from a valid condition number bound gives success probability at least .
One-bit teleportation Created 2026-10-06 Updated 2026-10-07
Apply a Controlled-Z gate to input and a fresh quantum ancilla. Measuring the input in the equatorial qubit measurement basis at angle , with outcome , leaves the unnormalized output
Each branch has probability , independently of the input. The logical output is with known Pauli frame ; the input qubit has been measured, so this does not clone it.
An unrestricted Boolean function on inputs cannot be classified as constant or nonconstant with certainty using a single phase oracle query, even with quantum ancillas. Write a purified query input as with and . The zero constant function leaves it unchanged; the function supported only at produces a vector with inner product with it. Perfect discrimination of pure states requires orthogonality, forcing for all and thus , a contradiction. This is an exact quantum query complexity obstruction for all nonconstant inputs, rather than the restricted promise used by the Deutsch-Jozsa algorithm.
We prove the one-query constancy obstruction for phase oracles while allowing arbitrary quantum ancillas. By purification of a density operator, the quantum state immediately before the sole query can be taken as
The ancilla vectors need not be normalized or orthogonal. Classical randomness and earlier quantum measurements can be included in additional ancillas; allowing access to these systems only gives the proposed algorithm more power.
For the zero constant function, the phase oracle is , leaving unchanged. For each , consider the Boolean function that is one at and zero elsewhere. Since , it is nonconstant, and its phase oracle produces
Any later fixed unitary transformation preserves these inner products. An arbitrary final quantum measurement cannot distinguish the constant output from each nonconstant output with certainty unless they are orthogonal, by perfect discrimination of pure states requires orthogonality. Explicitly, an accepting POVM effect would satisfy and , forcing .
Therefore exact classification requires for every . Summing gives
which contradicts . Thus one query cannot decide constancy with certainty. The other constant function gives , differing only by a global phase, so it does not change the argument. For comparison, permits ; the impossibility arises from demanding the test work for every nonconstant Boolean function.
For the Kraus operators of the measurement in quantum mechanics, the Born rule gives
The density matrix is the unnormalized state of that outcome. It is positive, its trace is , and completeness gives . There is no conditional state to assign to an event with .
For a projective measurement, each is an orthogonal projection, satisfying . Completeness becomes . Fix in the range of . Then
Since , the th summand already equals . All other summands are nonnegative, so for . Consequently , and taking adjoints also gives . This proves the stronger completeness forces orthogonality of measurement projections:
For the unitary dilation of a measurement instrument, take a quantum ancilla with orthonormal states , initially in . Define
The completeness equation implies
so is an isometry. Its action on the input subspace can be extended to a unitary operator on the enlarged system:
Choose orthonormal bases in the two complementary subspaces and map one to the other. Their dimensions agree; the extra unused quantum ancilla level also ensures this extension is possible for an infinite-dimensional system. After the coupling, the joint density matrix is
Now perform a projective measurement on the larger system, with
These are pairwise orthogonal and sum to the full identity. The unused level has zero weight in , so merging it into outcome one adds no probability. For every ,
Its trace is , and taking the partial trace over the quantum ancilla after normalization gives exactly . Hence unitary coupling to an quantum ancilla, a projective measurement, and discarding the quantum ancilla reproduce both the probabilities and the conditional states of the general measurement. This is the instrument version of a Stinespring dilation, rather than a construction reproducing only the outcome probabilities.
An oracle can recognize a solution without disclosing it in advance. If an efficiently evaluable or black-box predicate has the promised unique marked input, write exactly for that input. A Boolean quantum oracle computes this predicate reversibly as
Its diagonal projector on the search register is . To implement a selectable phase, compute into a zero quantum ancilla, apply a known phase to its component, and uncompute. The search register then undergoes
This requires evaluation access to the predicate, not classical knowledge of which input passes it. The term is known from the Hadamard transform. With Hamiltonian-oracle access, or by controlled short-time simulations of the two terms, their sum can realize continuous-time quantum search.
The unknown projector is supplied through an oracle or a physically encoded recognition rule. It cannot be manufactured for an arbitrary hidden with no such input-dependent resource. The oracle assumption and the fixed energy scale are essential when interpreting the square-root search time as a computational advantage.
The first two CNOT gates encode as
the three-qubit bit-flip repetition code. In the printed detection circuit the first quantum ancilla records and the second records . Both start in . For an incoming bit-error pattern , the two logical basis branches give the same error syndrome
Adding to a computational string leaves both parities unchanged, so the ancillas acquire no information about or . The joint state after extraction is
The syndrome measurement therefore preserves the unknown logical amplitudes. For zero or one bit flip the corrections are
Each indicated correction squares to the identity and restores the encoded state. The order of the two ancilla labels matters: the printed first ancilla is the parity, not the parity. This is coherent syndrome extraction for the three-qubit repetition code with the circuit's specific parity choices.
For later use, an error pattern and its complement have the same syndrome. Minimum-weight recovery corrects patterns of weight zero or one. Patterns of weight two or three instead leave , the logical bit flip that exchanges the two codewords. The code protects against the stated bit-flip channel, not arbitrary single-qubit phase errors.
List the known distinct strings in as , where , and use an -qubit index quantum ancilla. Apply Hadamard gates to that register to prepare
First, for each with , apply the available unitary operator that transposes and . The pairs are disjoint because they have distinct index labels. Skip a transposition when the two vectors coincide. This produces
Second, for each , transpose and . These pairs are disjoint because the data strings are distinct. No pair contains the term with , and no later transposition moves an earlier output. The final state is exactly
This clean subset superposition preparation uses at most of the given transpositions and Hadamard gates. Since , is polynomial in ; multiplying this count by the assumed polynomial size of each transposition gives a polynomial-size quantum circuit. The index quantum ancilla returns to zero, so the data register is a pure uniform superposition state, rather than a mixture obtained by discarding its index. The construction uses an available enumeration of the known subset; a membership oracle alone would not justify that enumeration.
Write the normalized input quantum state as . The fresh quantum ancilla is , so the Controlled-Z gate creates
Applying the measurement bra to the first qubit leaves the unnormalized second-qubit vector
Since form an orthonormal basis,
Also , while the Pauli X gate fixes and changes the sign of . Dividing by the branch norm therefore gives
This is one-bit teleportation with the present positive-exponent measurement vectors; the transferred logical gate is .
Number the three data qubits from top to bottom. It suffices initially to follow a pure input ; linearity will extend the result to every density operator. The first two controlled-NOT gates create . The first layer of Hadamard gates then encodes this as
the three-qubit phase-flip repetition code. Let indicate whether a Pauli Z gate occurred on data qubit during storage. The next layer of Hadamard gates uses and gives
The two initially zero syndrome quantum ancillas receive the adjacent parities. In the diagram's top-to-bottom order, their error syndrome is
Both terms of the logical superposition have these same parities, so the syndrome is independent of . Measuring it reveals no logical-state information.
At the marked position of in the printed circuit, there has already been another layer of Hadamard gates on the data. There is also a layer immediately after . Thus a desired correction in the parity-extraction frame must be implemented as at the actual recovery location, since . Choose the recovery according to
The two patterns on each row share a syndrome because complementing all three bits does not change either parity. For a weight-zero or one error, the recovery removes the entire error in the parity-extraction frame. The remaining state is , and the two final controlled-NOT gates give .
For a weight-two or three error, minimum-weight recovery instead leaves all three bits flipped, giving . The final controlled-NOT gates send this to . Consequently, for every input density operator,
The logical failure is a Pauli X gate after decoding, even though the stored physical errors were Pauli Z gates: exchanges the two encoded codewords. This is the logical failure of the three-qubit phase-flip repetition code.
Write and . The initial Hadamard gates prepare in the search register and in the final quantum ancilla. Since the Pauli X gate satisfies , the Boolean quantum oracle acts by quantum phase kickback:
For a single marked entry this is the marked-state phase oracle on the search register. The ancilla stays separate and unchanged throughout.
The Grover diffusion operator is , because . The PDF circuit places one diffusion after each oracle call, so the state before measurement is
In the supplied amplitude amplification theorem, take and . Their overlap has modulus , so the Grover rotation angle is . A quantum measurement in the computational basis therefore gives
The inverse sine here is applied to the overlap of the two different states. The converted TeX's self-overlap in the angle definition is a transcription error; the original PDF has .
No measurement on the supplied system alone distinguishes ensembles with the same density operator. A completely general measurement in quantum mechanics has POVM effects with . The outcome probability for a quantum ensemble is
If both ensembles have the same , every outcome probability is identical. This proves the claim for all positive operator-valued measures, and includes projective measurements as a special case. An quantum ancilla in a fixed independent state does not help: the input density operators remain identical after tensoring with that ancilla, and the same argument applies to any joint measurement.
The premise concerns access only to the prepared state. An accessible preparation label or a correlated purification of a density operator is additional information outside that premise and can distinguish global preparations. Without such side information, different ensemble decompositions do not define distinguishable states.
Apply to the data and phase quantum registers, leaving the flag quantum ancilla untouched. This inverse needs no extra oracle assumption: the promised dyadic eigenvalues give , hence . The inverse of each controlled unitary gate used in can therefore be built from repeated uses of the supplied controlled-, and the known Hadamard gates and quantum Fourier transform gates can be reversed. Uncomputation is necessary to erase the eigenvalue label coherently. The resulting quantum state is
A quantum measurement in the computational basis of the flag followed by postselection on one yields
This requires . For a normalized input and nonnegative eigenvalues, the success probability of positive quantum spectral filtering satisfies . In the general inequality, equality holds precisely when the input is supported on the minimum-eigenvalue eigenspace. Omitting uncomputation and discarding the phase quantum register would instead leave a mixed state with diagonal weights proportional to , rather than the desired coherent pure state.
The printed universal nonzero-success request needs a nonkernel-input hypothesis. An -qubit Hermitian operator has eigenvalues, counted with multiplicity. All are distinct, and the printed dyadic grid contains exactly possible values. They therefore occupy the entire grid, including zero: this is a multiplicity-free complete dyadic spectrum, and . Taking , , and satisfies every printed spectral promise but gives . No normalized output vector exists, so no algorithm can deliver it with nonzero probability.
For every input outside the kernel, the procedure above has , giving the requested strict bound on the meaningful domain. The corrected result is therefore exact quantum spectral filtering conditional on , with the boxed probability. This does not require knowing the input probability amplitudes or making extra copies of an unknown quantum state. Arbitrarily small nonzero support outside the kernel gives arbitrarily small success probability, and a failed flag measurement disturbs the input; fresh independent trials cannot be assumed when only one unknown physical input is supplied.
Let denote the coherent exact quantum phase estimation unitary operator from the preceding part, with the data quantum register written first. For every eigenvector of ,
because and lies in , with no phase-aliasing ambiguity. Apply coherently to the input quantum state and a clean quantum register; do not measure the eigenvalue label. By linearity it produces .
Append a quantum ancilla in , and use the provided quantum variable rotation with , choosing the nonnegative cosine. The resulting normalized quantum state is
The sum covers both terms; this fixes the potentially ambiguous sum placement in the abbreviated display. The orthonormal basis of eigenvectors and the unit length of each rotated quantum ancilla show that its norm is one. This is quantum spectral filtering by multiplication, not the reciprocal rotation used in the HHL algorithm.