Skip main navigation

Extracting Parity

Extracting Parity
© Keio University

Error correcting codes generally identify errors by calculating the parity of a set of bits.

Parity tells us whether the number of ones in a set of bits is even or odd; the parity of 001 and 111 is 1, while the parity of 000, 110, and 101 is 0. Parity can be calculated by taking the XOR (exclusive OR) of the set of bits. Extracting parity without destroying the superposition is the tricky part of QEC. The CNOT can help.

Parity on a Bell pair

For example, let’s look at our Bell pair (frac{|00rangle + |11rangle}{sqrt{2}}). Consider each element of the superposition separately. The parity of (|00rangle) is 0. The parity of (|11rangle) is also zero. If we try to find the parity by first measuring each qubit, then calculating the parity classically, we will destroy the superposition and entanglement.

Instead, let’s add another qubit, initialized to be (|0rangle), then use that to calculate the parity. Now our state is (frac{(|00rangle + |11rangle)|0rangle}{sqrt{2}} = frac{|000rangle + |110rangle}{sqrt{2}}).

Recall that the quantum equivalent of XOR is CNOT. Let’s first apply a CNOT using the left qubit as the control and the right qubit as the target. In each term of the superposition, if the left qubit is zero, it will leave the right qubit alone. If the left qubit is one, it will flip the right qubit. That will make the state (frac{|000rangle + |111rangle}{sqrt{2}}).

Now do the same thing using the middle qubit as the control, and the right qubit as the target. If the middle qubit is zero, leave the right qubit alone; if it’s one, flip the right qubit. Now we have the state (frac{|000rangle + |110rangle}{sqrt{2}} = frac{(|00rangle + |11rangle)|0rangle}{sqrt{2}}). In the first term in the superposition, the parity of 00 is 0, and in the right term of the superposition, the parity of 11 is also 0. It’s the same!

Now if we go measure the right hand qubit, we will definitely find 0. Since it’s always 0, the rest of the state is unaffected, and our superposition and entanglement are the same!

On the other hand, consider another type of Bell pair, (frac{|01rangle + |10rangle}{sqrt{2}}). This second type of Bell pair is the same as our first type, but with one qubit flipped – a single bit flip error. The operation would go differently. The first CNOT gate would take our state from (frac{(|01rangle + |10rangle)|0rangle}{sqrt{2}} = frac{|010rangle + |100rangle}{sqrt{2}}) to (frac{|010rangle + |101rangle}{sqrt{2}}), then the second CNOT would advance the state to (frac{|011rangle + |101rangle}{sqrt{2}} = frac{(|01rangle + |10rangle)|1rangle}{sqrt{2}}). Now if we measure the last qubit, we find 1, and once again the superposition and entanglement of the first two qubits (our original Bell pair) are unaffected.

Parity of larger states

That procedure gives us the ability to measure the parity without collapsing the state, at least for certain kinds of two-qubit states. If we can extend this concept to more qubits, we can build complete error correction.

Consider the three-qubit state (frac{|000rangle + |111rangle}{sqrt{2}}). If we add a fourth qubit and calculate the parity of all three qubits, the problem is that the parity of the components of the superposition differ. We will end up with even (0) parity for the (|000rangle) state, and odd (1) parity for the (|111rangle) state, so we would have the state (frac{|0000rangle + |1111rangle}{sqrt{2}}). Measuring the last (parity) qubit would collapse our superposition.

Instead, we use our technique to measure the parity of only a subset of the qubits. In this case, we’ll work two at a time, first calculating the parity of the left and middle qubits, which should be 0, then the parity of the middle and right qubits, which should also be 0.

This particular state forms the basis of the simplest quantum error correcting code, to which we turn next.

パリティの抽出

誤り訂正符号は、一般に、ビットのセットのパリティを算出することにより、エラーを特定します。

パリティは、一連のビットのうちのビット数が偶数か奇数かを示します。001および111のパリティは1であり、一方、000、110、101のパリティは0です。パリティは、ビットのセットのXOR(排他的論理和)を取ることによって計算することができます。重ね合わせを破損することなくパリティを抽出することは、QECの難しい部分ですが、CNOTがそれを容易にします。

ベルペアのパリティ

たとえば、ベルペア:(frac{vert00rangle + vert11rangle}{sqrt{2}})を見てみましょう。重ね合わせの各要素を別々に考えてみましょう。(vert00rangle)のパリティは0です。 (vert11rangle)のパリティもゼロです。 最初に各量子ビットを測定してパリティを見つけようとすると、パリティを古典的に計算すると、重ね合わせとエンタングルメントが破棄されます。

代わりに、(vert0rangle)に初期化された別の量子ビットを追加し、それを使ってパリティを計算してみましょう。 ここで、状態は(frac{(vert00rangle + vert11rangle)vert0rangle}{sqrt{2}} = frac{vert000rangle + vert110rangle}{sqrt{2}})となります。

XORの量子相当量はCNOTであることを思い出してください。最初にコントロールとして左量子ビットを使用し、右量子ビットをターゲットとしてCNOTを適用しましょう。重畳の各項において、左の量子ビットがゼロであれば、右の量子ビットだけが残ります。左の量子ビットが1の場合、右の量子ビットを反転します。 それは状態(frac{vert000rangle + vert111rangle}{sqrt{2}})になります。

今度は、中央の量子ビットをコントロールとして使用し、右の量子ビットをターゲットとして同じことを行います。中央の量子ビットがゼロの場合は、右の量子ビットだけを残します。それが1つの場合は、右の量子ービットを反転します。今度は状態(frac{vert000rangle + vert110rangle}{sqrt{2}} = frac{(vert00rangle + vert11rangle)vert0rangle}{sqrt{2}})になります。重畳の最初の項では、00のパリティは0であり、重畳の右の項では、11のパリティも0です。同じです!

右の量子ビットを測定すると、0が見つかるはずです。これは常に0なので、残りの状態は影響を受けず、重ね合わせとエンタングルメントは同じです!

一方、別の種類のベルペア、 (frac{vert01rangle + vert10rangle}{sqrt{2}})を考えてみましょう。この第2のタイプのベルペアは、第1のタイプと同じですが、1つの量子ビットがフリップされています(シングルビットフリップエラー)。すると、操作は異なって行きます。最初のCNOTゲートは(frac{(vert01rangle + vert10rangle)vert0rangle}{sqrt{2}} = frac{vert010rangle + vert100rangle}{sqrt{2}})から(frac{vert010rangle + vert101rangle}{sqrt{2}})への状態をとり、2番目のCNOTは状態を(frac{vert011rangle + vert101rangle}{sqrt{2}} = frac{(vert01rangle + vert10rangle)vert1rangle}{sqrt{2}})に進めます。ここで最後の量子ビットを測定すると、1となり、最初の2つの量子ビット(元のベルペア)の重ね合わせとエンタングルメントは影響を受けません。

より大きな状態のパリティ

その手順は、少なくともある種の2量子ビット状態について、状態を崩すことなくパリティを測定する能力を与えます。この概念をより多くの量子ビットに拡張することができれば、完全な誤り訂正を構築することができます。

3量子ビット状態(frac{vert000rangle + vert111rangle}{sqrt{2}})を考えてみましょう。4番目の量子ビットを追加して3つの量子ビットすべてのパリティを計算すると、重なりの成分のパリティが異なるという問題があります。(vert000rangle)の嬢阿智の偶数 (0) パリティと (vert111rangle)の状態の奇数 (1) パリティで終わるので、状態(frac{vert0000rangle + vert1111rangle}{sqrt{2}})になります。最後(パリティ)量子ビットを測定すると、重ね合わせが崩れます。

代わりに、量子ビットのサブセットのみのパリティを測定する技術を使用します。 この場合、最初に左と中の量子ビットのパリティを計算します。これは0にする必要があります。中位量子ビットと右量子ビットのパリティも0にする必要があります。

この特定の状態は、最も簡単な量子誤り訂正符号の基礎を形成しますが、これらは次回学習します。

© Keio University
This article is from the free online

Understanding Quantum Computers

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now