A closed quantum circuit cannot throw information away. Its gates are unitary operators, and unitary operators have inverses.
This is the basic reason quantum circuits are reversible.
Unitary means invertible
A closed-system quantum gate is represented by a unitary operator
Therefore
So every valid closed-system quantum gate can be undone. If a state evolves as
then applying
Irreversible classical functions lose information
Many classical functions are not reversible. For example,
loses information if only the sum is kept.
The output
So the map
cannot be inverted in general. The output does not contain enough information to recover the input.
That kind of collapse is not allowed for a unitary gate, because a unitary gate must have a unique way back.
Reversible embeddings keep the input
To use a classical function inside a quantum circuit, one usually embeds it into a reversible transformation.
For a classical function
where
The important point is that
This transformation is reversible because applying it twice recovers the original target:
The input