Reversible Computation in Quantum Computing
Mastering Reversibility, Ancilla Bits, and Unitary Logic
1. The Necessity of Reversibility
In classical logic, gates like AND are irreversible. In quantum computing, all operations must be Unitary ($U^{\dagger}U = I$), meaning they are perfectly reversible. Information is never lost; it is simply transformed.
Information Loss: You cannot reconstruct inputs from the output.
2. Ancilla Bits & Uncomputation
Because we cannot erase information, we use Ancilla bits as temporary “scratch space.” However, if these qubits are left in an arbitrary state, they remain entangled with the computation. Uncomputation (running gates in reverse) resets them to |0>, “cleaning” the quantum workspace.
The Toffoli Gate (CCX)
The Toffoli gate is reversible because its mapping is bijective. No two inputs result in the same output.
| Input (A, B, C) | Output (A, B, C ⊕ AB) | Status |
|---|---|---|
| 0, 0, 0 | 0, 0, 0 | Unique |
| 1, 1, 0 | 1, 1, 1 | Flipped (AND) |
| 1, 1, 1 | 1, 1, 0 | Flipped Back |
The Fredkin Gate (CSWAP)
3. Mathematics: Unitary vs. Hermitian
Proof: Is Pauli-Y Unitary?
| 0 | –i |
| i | 0 |
| 0 | –i |
| i | 0 |
Pauli-Y is Unitary (Y†Y = I). Because Y = Y†, it is also Hermitian.
Unitary but NOT Hermitian: The S Gate
| 1 | 0 |
| 0 | i |
| 1 | 0 |
| 0 | –i |
Since S ≠ S†, you must apply the S-Dagger gate to reverse an S rotation.
4. Qiskit Verification
from qiskit import QuantumCircuit, transpile from qiskit_aer import AerSimulator qc = QuantumCircuit(3) qc.x([0, 1]) # Controls to |1> # Toffoli is Hermitian (U = U†), so applying it twice cleans the ancilla qc.ccx(0, 1, 2) # Calculation step qc.ccx(0, 1, 2) # Uncomputation step qc.measure_all() counts = AerSimulator().run(transpile(qc, AerSimulator())).result().get_counts() print(f"Resulting state: {counts}") # Expect {'011': 1024}
Built with Qiskit 1.x • Quantum Series 2025