22

12

Most reversible quantum algorithms use standard gates like Toffoli gate (CCNOT) or Fredkin gate (CSWAP). Since some operations require a constant $\left|0\right>$ as input and the number of inputs and outputs is equal, *garbage qubits* (or *junk qubits*) appear in the course of the computation.

So, a principal circuit like $\left|x\right>\mapsto\left|f(x)\right>$ actually becomes $\left|x\right>\left|0\right>\mapsto\left|f(x)\right>\left|g\right>$,

where $\left|g\right>$ stands for the garbage qubit(s).

Circuits that preserve the original value ends up with $\left|x\right>\left|0\right>\left|0\right>\mapsto\left|x\right>\left|f(x)\right>\left|g\right>$

I understand that garbage qubits are inevitable if we want the circuit to stay reversible, but many sources${}^1$ claim that it is important to eliminate them. **Why is it so?**

${}^1$ Due to requests for sources, see for example this arXiv paper, pg 8, which says

However, each of these simple operations contains a number of additional, auxiliary qubits, which serve to store the intermediate results, but are not relevant at the end. In order not to waste any unneccesary [sic] space, it is therefore important to reset these qubits to 0 so that we are able to re–use them

or this arXiv paper which says

The removal of garbage qubits and ancilla qubits are essential in designing an efficient quantum circuit.

or the many other sources - a google search produces many hits.

Should the answer be $\frac{1}{2}|00\rangle + \frac{1}{2}|01\rangle + \frac{1}{2}|10\rangle - \frac{1}{2}|11\rangle$? i.e. -ve in the last term? Thanks a lot! – HYW – 2020-01-01T19:19:57.817

1@HYW Yes, thanks, that was a typo. – Sanchayan Dutta – 2020-01-01T19:28:31.193