Let's look at quantum subroutine of Shor's algorithm:
- Hadamard gates create superposition of all (exponential number) values for input qubits.
- Then we perform a classical function on them, which is here: $f(a) = y^a \textrm{ mod } N$, where $N$ is the number we would like to factorize, $y<N$ is some chosen (usually random) number.
- Then we perform measurement of value of this function $f(a)=m$ (random). This measurement restricts the original ensemble to only input values $a$, such that $f(a)=m$.
- Mathematics says that this restricted ensemble has to be periodic, this period can be concluded from value of (quantum) Fourier transform, and allows to conclude the factors.
So generally we branch calculations, get the final outcome from the first branch (input qubits), but treatment of other branches seems also crucial to make the algorithm work - including "uncomputing" of auxiliary qubits.
Imagine Bob has access to implementation of Shor's algorithm, but it is leaky - like in the yellow box above, value and auxiliary qubits finally get to Eve.
A natural question is if Eve can cripple Bob's computation? For example allowing him or not to break RSA cipher. If she could, she could also delay this choice.
As uncomputing or not requires input qubits, it seems tough to cripple calculations through auxiliary qubits alone (?)
However, there is Walborn's "Double-slit quantum erasure" experiment (nice explanation), where rotating polarizer for one of entangled photons, we erase or not which-slit information for the second photon - deciding between classical and interfering statistics for this double-slit.
So maybe Eve could erase information from value qubits, e.g. by putting Hadamard gates before measuring these qubits? This way their measurement would no longer restrict to fixed value of classical function, crippling calculations?