Constrained by Nature
Quantum Mechanics is reversible and this is what we observe when we study the evolution of quantum states and see that information is not lost and that there are no 2 input states that will evolve to the same output state given a particular Hamiltonian.
This makes Quantum Computing really special both positively and negatively. It basically makes it difficult and expensive to even built simple concepts like basic arithmetic. Adding two numbers is not a reversible operation unless we keep track of at least one of the original inputs.
Pitfalls of Reversibility
Ignoring this fact can create big problems to your circuits. As we use “work” qubits (auxiliary qubits) to ensure reversibility we increase the chances of breaking things as these qubits become entangled with our computations the risks associated with entangled qubits collapsing and destroying everything increases.
Fortunately we can always uncompute. We can always reverse the operations that entangled the work qubits so that we can reuse them later on. But this is also an expensive thing to do specially with NISQ devices.
Reversibility & Reverse Engineering
On the other hand, this reversibility is also good news! You can always reverse-engineer a pure quantum algorithm! Sort of. With enough time and patience we can always try to uncompute a circuit. We can’t really access the state information when using a real device but with enough measurements we can approximate any circuit without really knowing any of its internals. Quantum Process Tomography is one of the techniques that can be employed to gain such inisghts.
Inspired by this constrain and taking advantage of simulators, I’ve employed a similar trick in order to solve the last exercise of IBM’s Quantum Challenge 2020.