# uncomputing ancilla After computing with ancilla, one need to reverse the computation to avoid interference that affect later measurements and to reuse the ancilla later in the computation. This enable computing with less qubits and allow to run computations in a limited quantum computer. Reversing the ancilla change it to have the same value on all branches and so it can be tensored-out ("factored out") from the superposition and does not affect measuring non-ancilla qubits. Here is an example how ancilla might affect measurement: - Start with $\ket+\ket0$ where $\ket0$ is the ancilla. - apply CNOT with 1st qubit as a controller and ancilla as value : $\ket+\ket0\mapsto\frac{1}{\sqrt2}(\ket{00}+\ket{11})$. - apply Hadamard on the 1st qubit: $\frac{1}{2}(\ket{00}+\ket{10}+\ket{01}+\ket{11})$ . - Measuring the first qubit return $0$ or $1$ with probability 0.5 - BUT, if we reverse the ancilla by applying another CNOT before applying H we get $\ket+\ket0$ , then applying H we get $\ket0\ket0$ and measure the first qubit return 0 with probability 1. - This shows how ancilla entanglement can effect measurement as it created extra branches to the qubits. ## Created 2026-09-22 12:02