Given that

enter image description here

is equivalent to

enter image description here

I am interested into not performing the last CNOT. Rather, I want to keep track of the error I intentionally introduced by removing it.

I am trying to do this by means of auxilliary qubits.

Intuitively, I may do this by means of the following protocol: enter image description here

However, this doesn't seem to me as it does the right correction.

On contrary, I found that the following protocol gives the right density matrix: enter image description here Here I just removed what it was supposed to be a $Z$ correction. I don't get why it is not necessary (or maybe I am just using quirk's tools wrong).

  • $\begingroup$ Hello. I am not sure to understand what you want to do actually. Could you clarify what you mean by "I am interested into storing the last CNOT in auxilliary qubits"? $\endgroup$ Oct 31, 2022 at 13:42
  • $\begingroup$ Thanks, is it clear now? $\endgroup$ Oct 31, 2022 at 14:18

1 Answer 1


If you want to propagate a non-Pauli operator through a stabilizer circuit, a useful conversion is to transform it into a form where all the non-Pauli stuff is hidden away on ancilla qubits.

For example, a CNOT can be rewritten like this:

enter image description here

Which seems like a terrible idea, but because the parts touching the main circuit area are just Pauli product controls you can now easily move it through stabilizer operations by rewriting the Paulis. For example:

enter image description here

Once you've finished moving it to its final destination, you can attempt to convert back to a circuit that doesn't use ancilla qubits. Or just leave it in this form; it's really quite a useful way to understand a CNOT in a more generalized basis-independent way. It negates the amplitude of states in the intersection of the -1 eigenspaces of two Pauli product observables.

This same trick works for any operation you want to move through a circuit, including non-Clifford operations like Toffoli gates and T gates. It's the same underlying idea behind Clifford frame tracking used in "A Game of Surface Codes".

  • $\begingroup$ May you please show how to convert back your example after the moving? $\endgroup$ Oct 31, 2022 at 16:50
  • 1
    $\begingroup$ @DanieleCuomo for such a short example it's just going to be the CNOT conjugated by the Cliffords it moved through. $\endgroup$ Nov 1, 2022 at 19:43
  • $\begingroup$ May you please explain what you mean by conjugating the CNOT by that Clifford? $\endgroup$ Nov 21, 2022 at 16:20
  • $\begingroup$ @DanieleCuomo Conjugating means to left-multiply and right-multiply by a matrix and its inverse, respectively. Conjugating A by B means to compute $B A B^{-1}$. $\endgroup$ Nov 21, 2022 at 18:23
  • $\begingroup$ Thank you. Hence, basically, to eliminate the auxilliary qubits one should insert two copies (one conjugated) of the clifford. $\endgroup$ Nov 21, 2022 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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