I was thinking of an error correcting code to correct 1-qubit errors. I came up with the following, which I guess has to have a mistake somewhere, but I am not able to find it.

The code is the same as the 9 qubit Shor code with one small difference. As in the Shor code, first we encode our qubit using the 3-qubit phase code. Then, instead of further encoding the 3 qubits against bit-flip errors, we only encode one of them, namely, the one that contains the state that we want to protect. The resulting code would be the following $$\small{|0\rangle \rightarrow |00000\rangle + |00001\rangle + |00010\rangle + |11100\rangle + |00011\rangle + |11101\rangle + |11110\rangle + |11111\rangle}$$

$$\small{|1\rangle \rightarrow |00000\rangle - |00001\rangle - |00010\rangle - |11100\rangle + |00011\rangle + |11101\rangle + |11110\rangle - |11111\rangle}$$

Thank you!

  • $\begingroup$ Hi, Alvaro! Welcome to Quantum Computing SE. I've edited your question to replace >'s with \rangle's, as that's the appropriate notation while denoting kets. $\endgroup$ Nov 3, 2018 at 5:19
  • $\begingroup$ There's a small typo with 111000 being 6 qubits instead of 5. $\endgroup$
    – AHusain
    Nov 3, 2018 at 8:42
  • $\begingroup$ This is a bit like trying to keep your password secret by making three copies, putting one of them in a safe, and then leaving the other two just lying around on your desk. Then, when someone reads the copies on your desk, you say "but I put it in a safe!". $\endgroup$ Nov 3, 2018 at 15:53
  • $\begingroup$ can you please put correct normalization factors? Thanks... $\endgroup$
    – draks ...
    Oct 19, 2020 at 14:43

1 Answer 1


It’s worth noting that it’s not impossible that your code could work - there is a 5 qubit code that is capable of correcting a single error (look up the perfect quantum error correcting code, just beware that I seem to remember there was a slight error in one of the circuit diagrams in one of the original papers).

However, to see that your particular code does not work, consider applying an X gate on the last qubit. Logical 0 stays as logical 0, while logical 1 is returned as logical 1, but with an overall negative sign. In other words, that single X implements logical Z. So, when this gate is applied, there is no error that an be detected let alone corrected, but obviously the logical state is not preserved.

  • $\begingroup$ Can you remember what the error was? I have issues building a 5-qubit error correction circuit from here $\endgroup$
    – sererant
    Oct 20, 2020 at 9:28

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.