<h2>Q1 : Fate of the 9 qubits</h2>
<p>There is no (or 2) answer to your question, since it is implementation dependent :</p>
<ol>
<li>If your implementation of the code is ideal, and you have a way to directly measure the syndromes, the 9 qubits are projected on the global 9 entangled qubits state. It is the case, for example, if the code is used in a fault-tolerant implementation of quantum computing.</li>
<li>If the implementation is more realistic, the measurement of the 8 syndromes is performed in 2 steps : 1st you apply a global unitary (through a quantum circuit) on the 9 qubits, then you measure 8 qubits, destroying them in the problem. You have then a single qubit, to which you can apply a unitary(depending on the measurement result) to get the single original qubit.</li>
</ol>
<h2>Q2: Effect of misalignment</h2>
<p>The misalignment behaves like an error, whether <span class="math-container">$x$</span> is small or <span class="math-container">$π/4$</span> (as in your <span class="math-container">$\lvert±\rangle$</span> example). What you describe correspond to applying the operator <span class="math-container">$\cos x I +\sin x XZ$</span> to each qubit. Measuring the syndrome projects the state to one with a given number of errors, but as long as there is less than 1 X error and 1 Z error, the code is enough to correct it.</p>
<p>This condition happens with probability
<span class="math-container">$$(\cos^2 x)^9 + 9 (\cos^2 x)^8\sin^2 x=\cos^{16}x(1+8\sin^2x)\simeq 1-64x^4$$</span>
the last approximation being valid for small <span class="math-container">$x$</span>.</p>
<p>If the rotation is by <span class="math-container">$\pi/4$</span>, the error rate is 50% and your code will not be able to correct it.</p>

CC BY-SA 3.0
2015-05-27T16:33:28.897Z
2015-05-27T16:33:28.897Z
2020-06-17T09:38:08.363Z
Frédéric Grosshans
<p>$\newcommand{\ket}[1]{\lvert #1 \rangle}$I've met a problem in quantum secret sharing which involves the use of a quantum error-correction code. (let's make it simple to be the 9-qubit Shor code)</p>

<p>In the Shor code, Alice encodes $\ket{0}$ as $(\ket{000}+\ket{111})^3$, and $\ket{1}$ as $(\ket{000}-\ket{111})^3$, so the code can fight against 1-qubit flip or phase error, and recover the original qubit.</p>

<p>However, what I'm wondering is:</p>

<ol>
<li><p>What becomes of the 9 qubits after measurement? Do they become the original 1 logical qubit? Or do they stay as 9 entangled qubits?</p></li>
<li><p>What would happen if Bob, the one who decodes the code, actually has a slightly different orthogonal basis than the original one due to imperfect knowledge or experimental error, e.g. Bob is measuring with $\ket{0'}=\cos(x)\ket{0}+\sin(x)\ket{1}$ and $\ket{1'}=-\sin(x)\ket{0}+\cos(x)\ket{1}$ but $x$ is small? (Or, let's say he is really unlucky and mistook Alice's $\ket{0}$ and $\ket{1}$ basis entirely, so he uses $\ket{+}$ and $\ket{-}$ basis, then Bell basis for him would become $\ket{+++} + \ket{---}$</p></li>
</ol>

<p>When $x$ is small, would he still be able to decode out the original qubit using the "wrong" Bell basis? And would there be some way to calculate the error probability?</p>

CC BY-SA 3.0
2015-04-24T02:48:52.333Z
I think we should wait a bit before migrating though. I _think_ the answer to (1) is that they become 1 logical qubit, and with (2) is that we would have some error in the final qubit every now and then.
Manishearth
CC BY-SA 3.0
2015-05-03T15:15:38.780Z
This doesn't seem to be a research level question. I'd migrate this to cs.stackexchange.com. Both questions seem to be about basic principles of measurement in quantum computation and aren't really specific to Shor's ECC per se.
Logan Mayfield
CC BY-SA 3.0
2015-05-05T12:56:28.350Z
The answer to (1) depends on the details of what you're calling "measurement". You can correct it in place, so they stay 9 entangled qubits, or you can decode it (with error correction) to the original logical qubit. In both cases, the details of how you would do it using one- and two-qubit operations are quite a bit more complicated than a usual physics measurement operator, although conceptually you can think of it as a standard projection operator on the $2^9$-dimensional Hilbert space.
Peter Shor 
CC BY-SA 3.0
2015-05-05T13:21:44.383Z
For your second question, you really need to do a calculation to get the exact results. This shouldn't be too cumbersome, but I'm not going to take the time. But qualitatively, if Bob has a small enough mistake in the basis, you can think of this as a small error in each qubit, so Bob will get the logical qubit with a much smaller error. If Bob uses the complementarity basis, my guess is that he gets a completely random qubit, although you would need to do calculation to be completely sure.
Peter Shor 
CC BY-SA 3.0
2015-05-05T16:18:20.713Z
@PeterShor Thank you very much for your reply, Professor Shor! Yes, indeed I can see it much better now. I think my big problem was that I confused measurement of the qubit with measurement of the error (measuring ancillary qubits). My current understanding is that, the error-correction and the decoding are independent processes. The quantum computer can always find the error by measuring ancillary qubits and correcting the 9 qubits "in place", while one can also decode the corrected 9 qubits any time, and get the 1 encoded logical qubit back (while destroying the 9 qubits due to no-cloning).
Mike Wong
CC BY-SA 3.0
2015-05-05T16:19:07.317Z
So it is like the process of finding the closest codeword to a received word, and the process of mapping backward from the codeword space to get the message. If Bob wants to know the original qubit, he would first "correct" the error, "decode" the 9 qubits, and "measure" the restored 1 qubit to get its state information, in the three independent steps. Would this understanding be correct?
Mike Wong
CC BY-SA 3.0
2015-05-05T16:26:42.917Z
Also, as I actually met this problem in secret sharing, may I also ask another small question about security? If Alice's encodes a qubit a|0>+b|1> (whose state Bob does not know), her encoding qubits would be a(|000>+|111>)^3+b(|000>-|111>)^3, right? Then one way of Bob retrieving the information is by honestly correcting the error and decoding to get the original qubit, and then measuring it. But what I'm wondering is, would Bob be able to retrieve any information about the state (a,b) from the 9 encoding qubits, while still being able to restore (a,b) non-disturbed?
Mike Wong
CC BY-SA 3.0
2015-05-05T16:27:59.120Z
I mean...since information is never cloned, but distributed across 9 qubits, would it be correct to say that Bob cannot know any additional information about the qubit's state from the encoding qubits than from the original qubit? i.e. would a secret sharing protocol that uses an ECC (to help it pass information through a noisy channel) instead of directly sending single qubits be any less secure? Thank you very much!!!
Mike Wong
CC BY-SA 3.0
2015-05-05T16:56:54.033Z
@Mike: if I understand your question correctly, using an QECC should, in terms of security, be equivalent to sending single qubits (unless you have an eavesdropper, in which case it might be more secure if you are clever about exactly how you send the encoded qubits through the channel).
Peter Shor 
CC BY-SA 3.0
2015-05-05T17:54:43.937Z
@PeterShor Thank you so much again for your reply! In the protocol I'm studying, the method for retrieving information is broadcasted (so ECC is also known by eavesdropper). Then the ECC-scheme would be the same in security, right? And if the ECC is secret too it might become even more secure. That is indeed very reassuring to know! Thank you very much again!
Mike Wong
CC BY-SA 3.0
2015-05-13T21:07:14.723Z
This question has garnered a lot of close votes, and I believe it might be a better fit for [CS.SE](http://cs.stackexchange.com/). Unfortunately, we can't migrate it since it was migrated here from physics. However, it seems that @PeterShor has largely answered this question in the comments, do you want to migrate your comments to a full answer?
Artem Kaznatcheev
CC BY-SA 3.0
2015-05-14T12:43:32.360Z
@Artem: in my opinion, a full answer should include some calculations for part b to actually show quantitatively what I said qualitatively. But I'm not going to take the time to do them.
Peter Shor 
<quantum-information>
Shor's quantum error correction code with unknown basis
Mike Wong
# Shor's quantum error correction code with unknown basis

(Asked by: username_0 on 2015-04-22)

$\newcommand{\ket}[1]{\lvert #1 \rangle}$I've met a problem in quantum secret sharing which involves the use of a quantum error-correction code. (let's make it simple to be the 9-qubit Shor code)

In the Shor code, Alice encodes $\ket{0}$ as $(\ket{000}+\ket{111})^3$, and $\ket{1}$ as $(\ket{000}-\ket{111})^3$, so the code can fight against 1-qubit flip or phase error, and recover the original qubit.

However, what I'm wondering is:

1. What becomes of the 9 qubits after measurement? Do they become the original 1 logical qubit? Or do they stay as 9 entangled qubits?
2. What would happen if Bob, the one who decodes the code, actually has a slightly different orthogonal basis than the original one due to imperfect knowledge or experimental error, e.g. Bob is measuring with $\ket{0'}=\cos(x)\ket{0}+\sin(x)\ket{1}$ and $\ket{1'}=-\sin(x)\ket{0}+\cos(x)\ket{1}$ but $x$ is small? (Or, let's say he is really unlucky and mistook Alice's $\ket{0}$ and $\ket{1}$ basis entirely, so he uses $\ket{+}$ and $\ket{-}$ basis, then Bell basis for him would become $\ket{+++} + \ket{---}$

When $x$ is small, would he still be able to decode out the original qubit using the "wrong" Bell basis? And would there be some way to calculate the error probability?

**Tags:** quantum-information
> **Comments:**
> **username_1**: I think we should wait a bit before migrating though. I _think_ the answer to (1) is that they become 1 logical qubit, and with (2) is that we would have some error in the final qubit every now and then.  
> **username_2**: This doesn't seem to be a research level question. I'd migrate this to cs.stackexchange.com. Both questions seem to be about basic principles of measurement in quantum computation and aren't really specific to Shor's ECC per se.  
> **username_3**: The answer to (1) depends on the details of what you're calling "measurement". You can correct it in place, so they stay 9 entangled qubits, or you can decode it (with error correction) to the original logical qubit. In both cases, the details of how you would do it using one- and two-qubit operations are quite a bit more complicated than a usual physics measurement operator, although conceptually you can think of it as a standard projection operator on the $2^9$-dimensional Hilbert space.  
> **username_3**: For your second question, you really need to do a calculation to get the exact results. This shouldn't be too cumbersome, but I'm not going to take the time. But qualitatively, if Bob has a small enough mistake in the basis, you can think of this as a small error in each qubit, so Bob will get the logical qubit with a much smaller error. If Bob uses the complementarity basis, my guess is that he gets a completely random qubit, although you would need to do calculation to be completely sure.  
> **username_0**: @PeterShor Thank you very much for your reply, Professor Shor! Yes, indeed I can see it much better now. I think my big problem was that I confused measurement of the qubit with measurement of the error (measuring ancillary qubits). My current understanding is that, the error-correction and the decoding are independent processes. The quantum computer can always find the error by measuring ancillary qubits and correcting the 9 qubits "in place", while one can also decode the corrected 9 qubits any time, and get the 1 encoded logical qubit back (while destroying the 9 qubits due to no-cloning).  
> **username_0**: So it is like the process of finding the closest codeword to a received word, and the process of mapping backward from the codeword space to get the message. If Bob wants to know the original qubit, he would first "correct" the error, "decode" the 9 qubits, and "measure" the restored 1 qubit to get its state information, in the three independent steps. Would this understanding be correct?  
> **username_0**: Also, as I actually met this problem in secret sharing, may I also ask another small question about security? If Alice's encodes a qubit a|0>+b|1> (whose state Bob does not know), her encoding qubits would be a(|000>+|111>)^3+b(|000>-|111>)^3, right? Then one way of Bob retrieving the information is by honestly correcting the error and decoding to get the original qubit, and then measuring it. But what I'm wondering is, would Bob be able to retrieve any information about the state (a,b) from the 9 encoding qubits, while still being able to restore (a,b) non-disturbed?  
> **username_0**: I mean...since information is never cloned, but distributed across 9 qubits, would it be correct to say that Bob cannot know any additional information about the qubit's state from the encoding qubits than from the original qubit? i.e. would a secret sharing protocol that uses an ECC (to help it pass information through a noisy channel) instead of directly sending single qubits be any less secure? Thank you very much!!!  
> **username_3**: @Mike: if I understand your question correctly, using an QECC should, in terms of security, be equivalent to sending single qubits (unless you have an eavesdropper, in which case it might be more secure if you are clever about exactly how you send the encoded qubits through the channel).  
> **username_0**: @PeterShor Thank you so much again for your reply! In the protocol I'm studying, the method for retrieving information is broadcasted (so ECC is also known by eavesdropper). Then the ECC-scheme would be the same in security, right? And if the ECC is secret too it might become even more secure. That is indeed very reassuring to know! Thank you very much again!  
> **username_4**: This question has garnered a lot of close votes, and I believe it might be a better fit for [CS.SE](http://cs.stackexchange.com/). Unfortunately, we can't migrate it since it was migrated here from physics. However, it seems that @PeterShor has largely answered this question in the comments, do you want to migrate your comments to a full answer?  
> **username_3**: @Artem: in my opinion, a full answer should include some calculations for part b to actually show quantitatively what I said qualitatively. But I'm not going to take the time to do them.  

---

## 1 answers

### Answer by username_5 on 2015-05-27. Score: 1

## Q1 : Fate of the 9 qubits

There is no (or 2) answer to your question, since it is implementation dependent :

1. If your implementation of the code is ideal, and you have a way to directly measure the syndromes, the 9 qubits are projected on the global 9 entangled qubits state. It is the case, for example, if the code is used in a fault-tolerant implementation of quantum computing.
2. If the implementation is more realistic, the measurement of the 8 syndromes is performed in 2 steps : 1st you apply a global unitary (through a quantum circuit) on the 9 qubits, then you measure 8 qubits, destroying them in the problem. You have then a single qubit, to which you can apply a unitary(depending on the measurement result) to get the single original qubit.

## Q2: Effect of misalignment

The misalignment behaves like an error, whether $x$ is small or $π/4$ (as in your $\lvert±\rangle$ example). What you describe correspond to applying the operator $\cos x I +\sin x XZ$ to each qubit. Measuring the syndrome projects the state to one with a given number of errors, but as long as there is less than 1 X error and 1 Z error, the code is enough to correct it.

This condition happens with probability
$$(\cos^2 x)^9 + 9 (\cos^2 x)^8\sin^2 x=\cos^{16}x(1+8\sin^2x)\simeq 1-64x^4$$
the last approximation being valid for small $x$.

If the rotation is by $\pi/4$, the error rate is 50% and your code will not be able to correct it.


---

