I have a basic question about the encoding of logical information into physical qubits.

I only know the 3 qubit code (I have very limited knowledge in QEC).

The 3 qubit code is usually presented as: we have a data defined on a single qubit, we want to protect it.

To do it, we encode it on 3 physical qubits :

$$a|0\rangle + b |1\rangle \rightarrow a|000\rangle + b |111\rangle $$

And then by using ancillas, we check the parity and we know if a bit flip-occurred (in very short summary).

My question is:

In practice when we have a quantum computer, we encode the input in physical qubits (3 in this example), and then if we want to run a quantum algorithm, it will apply unitary on these 3 physical qubits?

Or is it more: we do everything with the single qubit and then at the end of the algorithm we protect by encoding the result on physical qubits.

For me, it would make sense that it is the first explanation but I would like to check this, like how and where are implemented Q.E.C in a quantum computer.

An example :

For example imagine that my quantum algorithm is just applying a unitary $U$ on an input $a|0\rangle + b |1\rangle$, would it work as :

  • I apply $U$ on $a|0\rangle + b |1\rangle$ : $U a|0\rangle + b |1\rangle = c |0\rangle + d |1\rangle $
  • I encode and protect it with QEC


  • I encode : $a|0\rangle + b |1\rangle \rightarrow a|000\rangle + b |111\rangle $
  • I apply the "logical equivalent" $U_L$ to the encoded data : $U_L a|000\rangle + b |111\rangle = c |000\rangle + d |111\rangle $

1 Answer 1


The whole point of encoding in an error correcting code is to protect against errors. You only get that protection while encoded. So you want to apply any unitaries on the encoded state.

  • $\begingroup$ Okay so to be absolutely sure, it corresponds to my second example rigjt ? $\endgroup$ Commented Jun 1, 2019 at 7:43
  • $\begingroup$ @StarBucK yes (I tried not to say that because your question was ordered differently to the example, and I was trying to avoid confusion) $\endgroup$
    – DaftWullie
    Commented Jun 1, 2019 at 8:27

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.