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 2026-10-14
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.
For the transposition map , the induced trace norm is , while stabilization gives
Thus an entangled quantum ancilla can amplify the distinguishability witnessed by transposition by a factor of .
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.
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.
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.