9

I wish to have a "reset" gate. This gate would have an effect to bring a qubit to the $\mid0\rangle$ state.
Clearly, such a gate is not unitary (and so I'm unable to find any reliable implementation in terms of universal gates).

Now for my particular needs, I need this ability to reset a qubit or a quantum register to that state so users can always start from $\mid0\rangle$. I'm making a small programming language that transpiles to QASM, and when a function is exited, I want all local (quantum) variables (qubits) reset to $\mid0\rangle$ so they can be reused. QASM reset instruction does not work on the real processor.

I think that something to this effect may be achieved with quantum phase estimation but I'm wondering if there is another way.

Sanchayan Dutta
  • 17,945
  • 8
  • 50
  • 112
Ntwali B.
  • 453
  • 2
  • 9

2 Answers2

6

One way is simply to measure the qubit in the standard, $Z$, basis. If you get the answer 0, then you've got the state you want. Otherwise, you apply a bit-flip to it.

Indeed, if you want to implement a non-unitary operation, you need some sort of measurement operation somewhere, whether that's a direct measurement, or the implementation of a CP map or POVM (but for these options, you need to introduce ancillas of a fixed state, which rather negates the point). Or you could use noise in the system, but you are unlikely to have sufficient control of it - it's noise after all! Of course, none of these options just reset a single qubit; anything that qubit is entangled with is also affected, but that's kind of in the definition of "reset" in the quantum context.

The only other option is to uncompute, but this is not a generic option because, generically you have to uncompute the entire computation to reset even a single qubit, and that resets everything. Except it doesn't work perfectly because of errors. You would be better starting a new computation. There are specific scenarios where an ancilla qubit is used and it can be uncomputed, but this is typically built into the algorithm because the uncomputation step is important for getting rid of some unwanted entanglement that would otherwise appear.

DaftWullie
  • 62,671
  • 4
  • 55
  • 140
4

I do not think that you can achieve this with a single gate, but the cool thing of quantum gates and unitary transformations is that they are reversible, therefore, when implementing a function in your quantum circuit, all you need to do is 'uncompute' it just by reversing the gates that you used.

Here i made a random circuit and reversed it; you can see that you are back to the state $\vert 0\rangle$.

This would mean that you have to "reset" in a specific way for each function, though.

FSic
  • 889
  • 6
  • 18