quantum error correction basics - pace university
TRANSCRIPT
1
Abstract— Quantum computing is an emerging technology.
Similar to classical computing where transmitting data over
network or in memory could corrupt bit strings, current quantum
computer technology is not immune from data corruption.
Different types of quantum computers are built to exhibit
quantum properties. In ideal condition, quantum device should
show exact realizations of quantum information and data
manipulation, but in real world, it doesn’t behave as theoretical
model mostly due to environmental noise. Since 1995, many new
mythologies, codes and techniques have been developed to mitigate
errors in large scale quantum algorithm. This paper is widely
associated with the information in Qubits that emphasizes the
prominence of the Error Correction for a sustained and reliable
Quantum Information System. It navigates through the basic
information about the Qubits and advertently considers the
various approaches towards Quantum Error Correction.
Index Terms— Quantum Computing, Quantum Error
correction, Quantum Circuits
I. INTRODUCTION
UANTUM Error Correction (QEC) has been introduce in
1995 and is concerned with the reliable Quantum
Information Processing in the presence of local errors.
While the classical computing relies on Parity for Error
correction, the Quantum Computing is farfetched and
meticulous than that. In order to understand the level of
complexity involved we begin with some basic information
about the interpretation of Quantum Information System and
build on the theory revolving around the QEC.
II. QUANTUM COMPUTING BASIC
Qubit is the basic unit of quantum computing [15]. In contrast
to the classical binary bits of information in ordinary
computers, “qubits” consist of quantum particles that have
some probability of being in each of two states, 0 or 1, at the
same time as shown in Figure 1. A single qubit is represented
by basis vectors |0> and |1>. In Quantum Information Theory
the states |0> and |1> form an orthonormal basis of the Hilbert
Space of a single Qubit. The Hilbert Space in fact includes all
linear combinations of basis |0> and |1> [7]. In pure qubit state,
a single qubit can be described by a linear combination of |0>
and |1>:
A. Measurement
The quantum state of a qubit is unknown until it is measured.
After the measurement, it changes the state and the process is
an irreversible operation. The probability of outcome |0> with
value 0 is |α|2 and the probability of outcome |1> with value 1
is |β|2. Since there are two outcomes, |α|2 + |β|2 is always equal
to 1. See Figure 2.
Figure 1. Comparison between classical bit and qubit bit.
Figure 2. Single Qubit Measurement Results.
B. Operation on qubit states
Qubits manipulation takes place in quantum logical gates.
And these quantum logical gates are building blocks of a
quantum circuit in a quantum computer. The most common
single qubit gate is NOT-gate. CNOT-gate is one of the most
important 2-quibit gates besides Hadamard ‘H’ gate. A
Quantum Circuit with Hadamard ‘H’ and CNOT-gates is shown
in figure 3.
Mohammad Z Chowdhury, Krishna Bathula,
Lu Dong, Kaleemunnisa LNU, and Charles C. Tappert
Seidenberg School of CSIS Pace University, Pleasantville NY 10570
Quantum Error Correction Basics1
Q
Proceedings of Student-Faculty Research Day Conference, CSIS, Pace University, May 3rd, 2019
1 Thanks to the IBM Faculty Award that made this research possible.
2
Figure 3. A 3-qubit circuit with CNOT-gate and Hadamard-gate.
III. QUANTUM ERROR CORRECTION
Before Shor’s [14] algorithm in 1995, despite quantum
computing’s demonstrated efficiency over classical computing
on small scale, the coherent quantum states were extremely
weak and many believed that it wouldn’t be realistic to maintain
large, multi-qubit and coherent quantum states for a long
enough time to complete any quantum algorithms.
A. Previous and current research
However, classical error correction cannot meet the demand
because firstly, the classical techniques assume all of the bits in
the computer can be measured and this assumption would
destroy any entanglement between qubits; secondly, a classical
computer only needs to store 0 and 1, but a quantum computer
would need to store phase information in entangled states[11].
In the early stage of research, an emphasis was placed on
developing quantum codes ([1],[6],[8]). Researchers then
continued to introduce more demanding theoretical frameworks
for the structure and operation of QEC ([9],[16]),[3]).
Meanwhile, concepts such as fault-tolerant quantum
computation led to the birth of the threshold theorem for
concatenated QEC ([10],[5]). Different approaches to continue
developing QEC protocols have been made in areas such as
ions, photon, etc. ([4],[17],[2]). While a lot of previous work
cited focused on primarily illustrating the scaling properties of
QEC codes, Ofek, et al [13] tried to use QEC to extend the
lifetime of quantum information.
Passive QEC methods, such as error suppression have also
been developed as well. One of the most error suppression
protocols is the decoherence free subspaces [12].
IV. QUANTUM ERRORS: CAUSE AND EFFECTS
Quantum Computers compute at individual level of atoms.
Based on the classical error correction analogy QEC was
developed. The physical mechanism behind quantum system is
responsible for quantum errors to exist. We analyze the errors
and their types in the context of physical system.
A. Environmental decoherence
In quantum system, environmental decoherence is the
important source of error. The problem with Quantum
Computers is, instability caused by environmental interference
that can upset the state of the qubits. Decoherence occurs when
the qubits lose information due to the environment they are in
over time. Sometimes decoherence is referred to noise. Adding
more qubits in the system would increase the overall
vulnerability to decoherence. This makes big obstacle in
scalability.
B. Reliable Execution of gates
Since there is no technique exists to perform gates
transformation with perfect accuracy, there always will have
small imperfections in transformation. Also, incorrect
knowledge of the system dynamics could yield incorrect result.
Therefore, qubit systems must be characterized before being
used so that errors can be controlled coherently.
V. QUANTUM ERROR CORRECTION REQUIREMENTS
Classical coding theory plays an important role in quantum
error correction, yet certain issues need to be considered when
transferring classical technique to quantum domain. Moreover,
classical methods are only designed to correct large discrete
errors (i.e. bit flips), where quantum error is continuous. Due to
No Cloning theorem which prevents making perfect copies of
unknown quantum state of qubits, classical code-based data-
copying can’t be used in QEC. Another important factor is, we
can’t measure the qubits for its error directly as this would
collapse quantum superposition state. Qubits are prone to both
traditional bit errors |0> ↔ |1> and phase errors |0> ↔ |0>, |1>
↔ -|1>. Therefore, to detect and correct errors without
measuring the qubits stats, error correction protocol which is
redundant encoding must be deployed.
A good strategy for constructing a Quantum Code ([1],[6]) is
to ensure no information of the encoded state is present in any
single Qubit. The resulting code keeps all information out of
every pair of Qubits.
The schematic process of QEC in figure 4 involves encoding
of qubit, detection for noise and finally decoding. Encoding
process takes the qubit representing data along with the clean
ancilla qubits in order to produce a code block that correct the
error. Syndrome Measurement extracts the error information in
the qubit from the ancilla qubits without actually disturbing the
qubit state. The decoding process allows in identifying any
errors that occurred when qubits traverse through noisy
channel.
Figure 4 Schematic Process of QEC.
A. Bit Flip
In classical computing, bit flips occur in transmission due to
the noise in wire or in memory due to heat, low voltage and
other environmental factors as shown in figure 5.
3
Figure 5 Classical computing bit flip.
In quantum system, bit-flip occurs due to environmental
decoherence/noise. In this paper, we will discuss how to correct
single qubit bit-flip using 3-qubit bit-flip code. Keep in mind
that, this code can’t correct both bit and phase flips
simultaneously. We will discuss later how this code can be
extended to construct 9-qubit Shor [14] quantum code.
Three physical qubits can be used to represent one logical
qubit of information to correct any single bit-flip error. Hence,
we deploy two ancilla qubits, with the objective of extracting
Syndrome Information out of the data block and simultaneously
not trying to disturb and distinguish the exact state of the actual
qubit.
The two logical basis states |0>L and |1>L are defined as,
|0>L = |000>, |1>L = |111>
Such that an arbitrary single qubit state |ψ> =α|0> + β|1> is
mapped to,
α|0> + β|1> → α|0>L+ β|1> L
= α|000> + β|111>
= |ψ>L
A quantum circuit required to encode a single logical qubit
using two ancilla qubits and two CNOT gate is shown figure 5.
This circuit prepare the |0>L state for the 3-qubit code where an
arbitrary single qubit state, |ψ> is coupled to two initialized
ancilla qubits via CNOT gates to prepare |ψ>L.
Figure 6 An encoded circuit of single logical qubit[7]
The encoding and correcting circuit is illustrated in figure 7.
Detailed technical explanation is beyond the scope of this
paper.
Figure 7 Quantum circuit to encode and correct a single qubit bit-flip
error [7]
Assuming that after encoding, a single bit-flip occurs on one
of the three qubits or not error at all. Two ancilla qubits are then
coupled to data block which only checks the parity between
qubits. Then ancilla are measured. Using this syndrome
information, error can be corrected by applying classically
controlled gate.
Table 1 Syndrome information and its corresponding error
Syndrome Error
00 No error
01 3rd qubit flipped
10 2nd qubit flipped
11 1st qubit flipped
Table 2 Ancilla measurement for single qubit error with the 3-qubit
code. All possible four states correspond to either no error or a bit
flip on one of the three qubits.
Collapsed State Syndrome Error
α|000> + β|111> 00 No error
α|001> + β|110> 01 3rd qubit flipped
α|010> + β|101> 10 2nd qubit flipped
α|100> + β|011> 11 1st qubit flipped
B. Phase Flip
In addition to Bit errors, qubits also face the challenge of
phase errors. The phase errors are encountered, when a qubit’s
basis state picks a phase factor. For instance, |0> → eiΦ|0>,
where ‘Φ’ is the angle during the spin and measured in radians
which is less than 1. This angle has a value pointing that the
quantum errors are continuous when compared to the classical
counterparts. Now the initial state which is |Ψ> = α|0> + β|1>
transforms into |Ψ> = α|0> + β eiΦ|1> when the phase factor is
established. For this reason, we need to have a systematic error
detection and correction.
4
Figure 8 Illustration of spin and Phase Factor in a Qubit.
In Quantum Mechanics relative phases in a superposition are
highly significant. In a ‘Z’ or phase flip error we can obtain |0>
→ Z|0> = |0> and |1> → Z|1> = -|1>. Practically while
addressing the Quantum Circuits, when the phase flip or Pauli
operator ‘Z’ is applied to the qubit |Ψ> = α|0> + β |1>, results
in the state |Ψ> = α|0> - β |1>. Hence |Ψ> = α|0> - β |1> does
not represent the same thing as |Ψ> = α|0> + β |1>, except when
α=0 and β =0.
In view of the fact that the repetition of 000,111 corrects the
Bit Flip error, the repetition of phase +++, --- corrects the Phase
Flip error. The code words |+++> and |---> are used to represent
the logical states |+>L and |->L respectively. When the ancilla
qubits are patched with the original qubit |Ψ> = α|+> + β |->,
the logical state for encoding is represented as |Ψ> = α|+++> +
β |---> for the phase flip error detection and correction.
The encoder of the phase flip is similar to the bit flip with
only exception that Hadamard gates are applied at the end as
shown in below Figure 9.
Figure 9 An Encoding circuit of logical qubit with Hadamard Gate
[15]
To correct both Bit Flip and Phase Flip simultaneously we
can use both codes together which is a valid encoding of the
state α|0> - β |1>:
α|0> + β|1> → α (|000> + β|111>)3 + α (|000> - β|111>)3
The logical representation of the basis state is now:
|0>L = (|000> + |111>)(|000> + |111>)(|000> + |111>)
|1>L = (|000> - |111>)(|000> - |111>)(|000> - |111>)
As we know that HZH = X, indicates that prior to sending the
information on a Quantum channel and just after receiving the
Quantum information we need to apply the Hadamard gates
Figure 8.
Figure 10 Quantum Circuit of Phase Flip with phase error [15]
The phase changes are amplitude (or bit flip) changes if we
consider the Hadamard basis. The Hadamard basis satisfies the
condition HX = ZH. It means that in Hadamard basis, the phase
flips turn to be bit flips and vice versa. This helps us in
determining the encoding code that can correct the Phase errors
by mapping H|0> → H3|000> and H|1> → H3|111>. Finally
the Bit Flip code and Phase Flip code are concatenated to
correct them concurrently. This results in 9 qubit code that is
discussed in detailed in section C of this paper.
The Encoder into Bit Flip code QC has been demonstrated
on an IBM Quantum Experience (IBM QE). IBM QE is a cloud
based platform to interact with an existent Quantum Computer
housed in IBM research lab. The QC can be visualized below.
Figure 11 Bit Flip Encoder Code QC on IBM Quantum Experience
Composer.
C. Shor’s Error Code
Effective techniques for quantum error correction were first
developed in 1995 by Shor. Up till then many skeptical
physicists regarded quantum computing as totally impractical.
With the development of error correction techniques, “totally
impractical” was replaced with “extremely difficult.” We will
be using Shor’s algorithm for correcting arbitrarily single qubit
errors, and it also works for two qubit errors.
Shor’s nine qubit code was first quantum code to be
discovered that has property that it allows recovery from an
arbitrary error on any one of the carriers. There are more
efficient codes that exist but nine qubit code demonstrate how
the error recovery process works, in easy way.
The error channel may induce a bit flip, a sign/phase flip, or
5
both. If we can design a code that corrects all Xi, and Zi errors,
then it corrects all single qubit errors. To construct such a code,
we can try to combine CBF (This quantum code encodes the state
|0⟩ in the state |000⟩ and state |1⟩ in the state |111⟩) and CPF
(corrects phase-flip errors) First encoding a qubit using CPF and
then encoding each resulting qubit using CBF leads to the nine-
qubit code, which is known as Shor’s nine-qubit code.
The encoding of the Shor code can be understood in two
parts: The first uses the phase flip code in:
|ψ⟩ = α |+ + +⟩ + β |- - -⟩
The second part consists of encoding each of the three
original qubits into three more qubits using the bit flip code:
| + ⟩ → |000⟩ + |111⟩ and | - ⟩ → |000 ⟩ - |111 ⟩
The end result corresponds to the nine-qubit encoding,
| ψ⟩ = α | 0⟩ + β | 1⟩
We often write these states as follows
Shor 9-qubit quantum code circuit. The “inner” part corrects
any single-qubit X-error. The “outer” part corrects any single-
qubit Z-error. Since Y =iXZ, single-qubit Y-errors are also
corrected.
Figure 12 Circuit encodes the Shor’s nine qubit code.
The logical operations on the new qubit are:
X = Z1Z2Z3Z4Z5Z6Z7Z8Z9 for an X-gate and
Z = X1X2X3X4X5X6X7X8X9 for a Z-gate.
In summary, the Shor code is the concatenation of the bit flip
and phase flip error correcting codes. One way of making a
quantum circuit more robust to errors is by concatenating
quantum error-correcting codes to form new, larger codes.
Figure 13 Schematic illustrating concatenations of code.
At the first level, we encode every qubit with some code. At
the second level, each qubit forming the code word gets
encoded again, using the same or a different code. If we use the
same n-qubit code, after two levels, each logical qubit is
effectively encoded by ‘n2’ physical qubits. For ‘k’ encoding
levels, a logical qubit is formed by ‘nk’ physical qubits.
Like the bit and phase flip error correcting codes there are
stabilizers for the Shor code. However, this time, there are eight
total stabilizers which can detect and diagnosis errors Table 3
Table 3. The three-qubit phase flip code procedure is listed
for each of the four possible stabilizer measurement outcomes
The simple way to think about the Shor code is to
breakdown the state | ψ⟩ into three different blocks of logical
qubits; so, as an example, |0⟩ would have three blocks
containing (|000⟩ + |111⟩ ). The error correction procedure
begins by applying the first six stabilizers each of the three
blocks to detect bit flip errors. There are two-bit flip stabilizers
6
for each block. After correcting any bit flip error, the last two
stabilizers are applied to each block to detect phase flip errors.
D. Stabilizer Codes
Stabilizer code is a class of quantum error correcting codes.
The general formalism applies broadly and efficiently describes
general rules to construct preparation circuits, correction
circuits and fault-tolerant logical gate operations.
Daniel Gottesman, using the Heisenberg representation for
quantum mechanics, introduced the first formalism in his
doctoral thesis. Quantum states are described in terms of
operators instead of the states as we shall see in examples later.
It is important to keep in mind that we must learn nothing
about the actual state of the code within the coding space as we
make a measurement to find out about the error. Superpositions
of the basis states would be disturbed if something was indeed
learnt during measurement. Hence, even if we would correct the
basis states, we could not correct an arbitrary valid codeword.
Hence, for example, if we wish to learn about the error Ea and
Eb, we measure ⟨ψi|Ea
†Eb|ψi⟩ for all possible errors Ea and Eb.
A state |ψ⟩ is defined to be stabilized by some operator, K,
if it is a +1 eigenstate of K , i.e. K |ψ⟩ = |ψ⟩ . For instance, a
single qubit state |1⟩ is stabilized by the operator σz so that σz|1⟩ = |1⟩.
Hence, we can define a multi-qubit states in the same way.
An N-qubit stabilizer state, |ψ⟩N is then defined by the N
generators of an Abelian (all elements commute) subgroup, G,
of the N-qubit Pauli group, G={Ki |Ki|ψ⟩=|ψ⟩, [Ki,Kj]=0,
∀(i,j)}⊂PN, where PN is the N fold tensor product of all
elements of P, the Pauli group contains
±σI,±iσI,±σx,±iσx,±σy,±iσy,±σz,±iσz.
Many multi-qubit states are in fact stabilizer states, such as
two-qubit Bell states and Greenberger-Horne-Zeilinger (GHZ)
states. For example, bell states can be written in any two
linearly independent generators.
Four Orthogonal Bell States
Each of the four Bell states correspond to the four ± eigenstate
combinations of these two operators, where X is σx and Z is σz
The use of the stabilizer formalism to describe quantum error
correction codes is very useful since it allows easy synthesis of
correction circuits and also allows for quick determination of
what logical operations can be applied directly on encoded data.
The link between stabilizer codes and stabilizer states is defined
as a related coding subspace within the larger Hilbert space of
a multi-qubit system.
Gottesman states that “…a quantum code with stabilizer S
will detect all errors E that are either in S or anticommute with
some element of S. In other words, E ∈ S ∪ (G − N(S)). This
code will correct any set of errors {Ei} iff EaEb ∈ S ∪ (G −
N(S)) ∀ Ea,Eb (note that Ea†Eb commutes with M ∈ G iff EaEb
= ±Ea†Eb does).”
Despite these advantages, larger codes generally require
more complicated error correction circuits. As the complexity
of the error correction circuits increase, adapting such codes to
physical computer architectures becomes more difficult.
Example: The 7-qubit Steane Code
This is defined as a [[7,1,3]] quantum code, where there are
7 physical qubits that encode 1 logical qubit with a distance
between 3 basis states and correct 1 error.
Each of K above is stabilized by its respective operations.
The set above defines a 2-dimensional subspace and hence a
single encoded qubit. A final operator fixes the encoded state.
For the Steane Code, it is Z = ZZZZZZZ = Z⊗7, and Z |0⟩ L =
|0⟩ L and Z |1⟩ L = − |1⟩ L. |0⟩ L and |1⟩ L are two valid basis
states in state vector, i.e.
7
Quantum circuit for preparing [[7,1,3]] is shown below.
Figure 13 Quantum Circuit of 7-qubit Steane Code
VI. CONCLUSION
The intent of this paper is to introduce readers with the basic
understanding of qubits and the likelihood of errors in Quantum
Information System (QIS). These errors in QIS are addressed
with the appropriate quantum error correction measures. The
various noise errors in QIS are described using the relevant
types and their associated error correction approaches. Further
the paper illustrates the Encoder in Bit Flip code on an IBM QE.
This facilitates the reader a more valuable and practical insights
towards the QEC. We encourage them to explore the essential
QEC and emerging fault tolerance techniques further deep and
practically indulge in QEC using the cloud based platforms
such as IBM QE where one can access a Quantum Computer
virtually.
VII. ACKNOWLEDGMENT
The authors would like to thank Dr. Charles Tappert, Dr.
Ronald Frank, and Prof. Istvan Barabasi for creating the CS837
Quantum Computing course at Pace University. Also we would
like to extend our sincere gratitude to IBM Corporation for
conducting Quantum Workshop at IBM Research Centre York
Town, NY and providing academic support and access to the
IBM Quantum Experience.
VIII. REFERENCES
[1] A.M. Steane. Error Correcting Codes in Quantum Theory.
Phys. Rev. Lett., 77:793, 1996
[2] Aoki, T. et al. Quantum error correction beyond qubits. Nat.
Phys. 5, 541–546 (2009).
[3] A.R. Calderbank, E.M. Rains, P.W. Shor, and N.J.A.
Sloane. Quantum Error Correction via Codes Over GF(4). IEEE
Trans. Inform. Theory, 44:1369, 1998.
[4] Chiaverini, J. et al. Realization of quantum error correction.
Nature 432, 602–605 (2004).
[5] D. Gottesman. Fault-Tolerant Quantum Computation with
Local Gates. J. Mod. Opt., 47:333, 2000.
[6] D. Gottesman. A Class of Quantum Error-Correction Codes
Saturating the Quantum Hamming Bound. Phys. Rev. A.,
54:1131, 1990.
[7] Devitt, Simon J., William J. Munro, and Kae Nemoto.
"Quantum Error Correction for Beginners." Reports on
Progress in Physics 76.7 (2013): 076001.
[8] E. Knill and R. Laflamme. A Theory of Quantum Error-
Correcting Codes. Phys. Rev. Lett., 84:2525, 2000.
[9] E. Knill, R. Laflamme, and G.J. Milburn. A Scheme for
Efficient Quantum Computation with linear optics.
Nature (London), 409:46, 2001.
[10] E. Knill, R. Laflamme, and W.H. Zurek. Resilient
Quantum Computation. Science, 279:342, 1998.
[11] Gottesman, Daniel. "Stabilizer codes and quantum error
correction." arXiv preprint quant-ph/9705052 (1997).
[12] Lidar, D. A., Chuang, I. L., & Whaley, K. B. (1998).
Decoherence-free subspaces for quantum computation.
Physical Review Letters, 81(12), 2594.
[13] Ofek, N., Petrenko, A., Heeres, R., Reinhold, P., Leghtas,
Z., Vlastakis, B., ... & Mirrahimi, M. (2016). Demonstrating
quantum error correction that extends the lifetime of quantum
information. arXiv preprint arXiv:1602.04768.
[14] P.W. Shor. Scheme for reducing decoherence in quantum
computer memory. Phys. Rev. A., 52:R2493, 1995
[15] “Qubit.” Wikipedia, Wikimedia Foundation, 21 Mar. 2019,
en.wikipedia.org/wiki/Qubit.
[16] R. Cleve and D. Gottesman. Efficient Computations of
Encodings for Quantum Error Correction. Phys. Rev. A., 56:76,
1997.
[17] Schindler, P. et al. Experimental Repetitive Quantum Error
Correction. Science 332, 1059–1061 (2011).
IX. APPENDICES
The following Python code introduces the implementation of
the various Quantum Error Correction methods. The
environment used is cloud based Jupiter Hub, running with
Python version 3 Notebook. The library used for simulating the
dynamics of open Quantum systems is QuTip. QuTip
essentially provides the user-friendly and efficient numerical
simulations of Quantum Computing. Although there is reusable
code for different error methods at few instances, we try to
8
present each scenario individually with the relevant method.
A. Bit Flip and Phase Flip
Consider the following code. This is the common
declaration for representing all the classes of errors which
import the Qutip Library, and ‘random’ is python package that
generates pseudo random numbers. This will make all functions
and classes in QuTip available in the rest of the program.
Snippet 1. Common Declarations
A state psi is defined which is arbitrary, with two subspaces
that are linearly independent can be noted in Snippet 2. The
‘psi’ represents the logical qubit to be encoded whereas the
‘qubit1’ and ‘qubit2’ denote the physical qubits.
Snippet 2. Physical and Logical Qubit States
Controlled NOT (CNOT) gates are applied to entangle the
EPR state ‘Ψ’. A swap gate is equivalent to three CNOT gates
applied in the given format, so it is given ‘cnot(N=3)’. The
control and target qubits are specified using the keyword
arguments ‘control’ and ‘target’. Syndrome Measurement
variables A and B are assigned since they are the tensor product
of the states of the Pauli operators. The ‘sigmaz’ represents the
Pauli Z operator that acts on the qubits. The ‘qeye’ generates
the identity operator with two quantum states. (From Snippet 2)
Now the qubits are flipped at random using ‘flip’ and
‘random’ functions and the Syndrome is measured for possible
detection of Bit Flips as shown in Snippet 3. This is constrained
to generate Bit Flips.
Snippet 3. Flipping random Qubit and Syndrome measurement
On the other hand, phase errors are introduced at random in
the exclusive python notebook for detecting Phase Flips. The
following Snippet 4 shows determining the basis states as ‘+’
and ‘-’ to introduce the phase factor.
Snippet 4. Converting basis to ‘+’ ’-’ and Changing Phase of Qubit
for Phase Flip implementation
Both the qubits states are then checked using different
possible combinations of ‘a’ and ‘b’ states for the detection of
Bit Flip and Phase Flip. If there is an error detected, it is
reported as -1 and the relevant correction is applied using the
Pauli X and Z operators for Bit and Phase flips respectively.
The code that is responsible for Error Detection and correction
is shown below in Snippet 5.
Snippet 5. Error Detection
After successful error correction, the logical qubit is decoded
in compliance with the schematic process of QEC Snippet 6.
The CNOT gates are applied back to disentangle the state.
Snippet 6. Error Correction and Decode
9
B. Shor’s 9-qubit code
First a state ‘psi’ is defined which is arbitrary, with two
subspaces which are linearly independent as in Snippet 1.Then
single logical qubit is encoded with 9 physical qubits. The full
multipartite state of the system is defined and CNOT gates are
applied for encoding that can be inferred in Snippet 7. Finally
the encoding of the qubits is performed using the Phase Flip
code.
Snippet 7. Encode Logical Qubit and define state
Once the encoding of the 9-qubits is performed, random Bit
Flip and Phase Flip errors are introduced in code Snippet 8.
Snippet 8. Introducing Random Bit and Phase Flip Errors
The Bit Flip error detection and error correction are
performed for each block of 3, as the 9-qubits are divided in to
3 blocks. Block level operations are defined and Syndrome
Information is measured on each block of 3 in Snippet 9.
Snippet 9. Detect and Correct Bit Flip Errors
Similarly, the above process is repeated for the Phase Flip
detection and error correction. It is measured across the 3 blocks
as shown in Snippet 10.
Snippet 10. Detect and Correct Phase Flip Errors
To conclude the Shor’s code, the Bit Flip is decoded using
the CNOT operators. While for the Phase Flip the CNOT and
Hadamard operators are applied for successfully decoding the
states.
Snippet 11. Decoding Bit Flip and Phase Flip on Qubits.