1
$\begingroup$

In IBM's Qiskit online simulator, we have the (non-reversible) ability to set a specific qubit to $| 0\rangle$. This is convenient but I'm left confused as to what happens to the elements of the statevector. The amplitudes must go somewhere so the probability is conserved, and I imagined at first that the 0 component for each 'Hadamard pair' absorbs the missing amplitude. But this does not take the phase into account.

What happens in the simulator when we set a qubit to $|0\rangle$?

$\endgroup$

1 Answer 1

2
$\begingroup$

Applying a reset to a qubit is equivalent to measuring it, and then applying a bit flip to it conditioned on the measurement result.

def reset(qubit):
    if measure(qubit) == ON:
        X(qubit)

For example, in this Quirk circuit, you can see that the post-reset state matches the state you'd get when conditioning on a measurement-via-ancilla+bit-flip of the target qubit:

enter image description here

An equivalent reset, but perhaps more "physically accurate", is to swap the qubit for a fresh ancilla, then discard the ancilla.

def reset(qubit):
    ancilla = new_zero_qubit()
    swap(ancilla, qubit)
    discard(ancilla)
$\endgroup$
2
  • $\begingroup$ Perfect, thank you! Are there instances where these results would give states which differ by a global phase (In my attempts to implement an ancillary qubit reset, I succeed in most cases, but in some am off by a global phase of $\pi$ when compared to IBM)? $\endgroup$
    – Craig
    Jan 10 at 4:11
  • 1
    $\begingroup$ Global phase is unobservable so that doesn't matter. $\endgroup$ Jan 10 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.