quantum error correction jian-wei pan lecture note 9
TRANSCRIPT
Quantum Error Quantum Error CorrectionCorrection
Jian-Wei Pan
Lecture Note 9
Errors CorrectionErrors Correction• PROBLEMPROBLEM: When computing with a
quantum computer, you can’t look at what the computer is doingYou are only allowed to look at the end
• RESULTRESULT: What happens if an error is introduced during calculation?
• SOLUTIONSOLUTION: We need some sort of quantum error detection/correction procedure
Classical ErrorsClassical Errors
• Goal: store an unknown single bit for a time t.
• Errors: in a time interval τ one error occurs with the probability Pτ. The probability that the bit flips:
0 1
1 0
Classical Error Correcting Codes Classical Error Correcting Codes
• Suppose errors in our physical system for storing 0 and 1 cause each physical bit to be flipped independently with the probability Pτ
• We can correct the errors by using a “redundant coding”
• e.g. : encode a logical 0 with the state 000 and a logical 1 with the state 111
Reversible networks for encoding and Reversible networks for encoding and decoding a single bit decoding a single bit ““bb””
00
b bbb
00
b bbb
Network for encoding
Network for decoding
Classical Error Correcting Codes Classical Error Correcting Codes
After the errors occur• Probability of no errors:
• Probability of error in one bit:
• Probability of error in two bits:
• Probability of error in three bits:
31 P
23 1P P
23 1P P
3P
Classical Error Correcting Codes Classical Error Correcting Codes
• Decode the logical bits by taking the majority answer of the three bits and correct the encoded bits
• So
• We will have the correct state with a probability
000100
000010
000001
000000
111110
111101
111011
111111
3 2 2 31 3 1 1 3 2cP P P P P P
Correction for a long time Correction for a long time
• Goal: keep the state for a very long time t• Perform many measurements
Consider for time τ sufficiently short
Divide t in N intervals of duration τ = t/NAfter the time t
2 3
2
1 3 2
1 3
N
ct
ct
ct ctP
N N
P when N ct
P c
Zeno Zeno effect!effect!
• Measurement of error destroys superpositions.
• No-cloning theorem prevents repetition.
• Must correct multiple types of errors (e.g., bit flip and phase errors).
Quantum Errors Quantum Errors
Example of 3-qubit Error CorrectionExample of 3-qubit Error Correction
• A 3-bit quantum error correction scheme uses an encoder and a decoder circuit as shown below:
EncoderEncoder DecoderDecoder0
0
Input qubit Output qubit
OperationsOperations& Errors& Errors
We will distinguish among good states 0 and 1 and all other states
As we see one qubit is encoded to three qubits
3-qubit Error Correction: 3-qubit Error Correction: the Encoderthe Encoder
• The encoder will entangle the two redundant qubits with the input qubit:
a|0> + b|1>
|0>
|0>
1.1. If the input If the input state is |0> then state is |0> then the encoder does nothing sothe encoder does nothing so the output state is |000>the output state is |000>
2.2. If the input If the input state is |1> then state is |1> then the encoder flips the lowerthe encoder flips the lower states so the output state isstates so the output state is |111>|111>
33. If the input. If the input is is an superposition statean superposition state, , thenthen the output the outputis the is the entangled stateentangled state a|000> + b|111> a|000> + b|111>
• Problem: Any correction must be done without looking at the output The decoder looks just like the encoder:
Corrected output
Measure: if 11 flip the top qubit}
If the input to the decoderIf the input to the decoder is |000> or |111> is |000> or |111> there wasthere wasno errorno error so the output of the decoder is: so the output of the decoder is:
Input OutputInput Output|000> |000>|000> |000>|111> |100> (the top 1 causes the bottom bits to flip) |111> |100> (the top 1 causes the bottom bits to flip)
Error free flag
3-qubit Error Correction: 3-qubit Error Correction: the Decoderthe Decoder
Example continued:Example continued:Consider all the possible error conditions:Consider all the possible error conditions:
No Errors:No Errors:
a|000> + b|111> decoded to a|000> + b|100> = (a|0> + b|1>)|00>
Top qubit flipped:Top qubit flipped:
a|100> + b|011> decoded to a|111> + b|011> = (a|1> + b|0>)|11>
So, flip the top qubit = (a|0> + b|1>)|11>
Middle qubit flipped:Middle qubit flipped:
a|010> + b|101> decoded to a|010> + b|110> = (a|0> + b|1>)|10>
Bottom qubit flipped:Bottom qubit flipped:
a|001> + b|110> decoded to a|001> + b|101> = (a|0> + b|1>)|01>
Decoder without MeasurementDecoder without Measurement
• The prior decoder circuit requires the measurement of the two extra bits and a possible flip of the top bitBoth these operations can be implemented
automatically using a Toffoli gate
If these are both 1then flip the top bit
}
Thus we can correct single bit-flip errors
The ErrorsThe Errors
Phase-shift Error CorrectionPhase-shift Error Correction
HH
HH
HH
a|0> + b|1>
|0>
|0>
0 1 0 1 0 1
0 1 0 1 0 1
EncodingEncoding
HH
HH
HH
Hadamards Gate
10 0 1
21
1 0 12
DecodingDecodingCorrected output
Measure: if 11 shift the phase ofthe top qubit
}
• The 2 codes earlier corrects either bit flips or or phase flips.
• Shor’s 9 qubits error correcting code combines both codes.
• It can correct any arbitrary single qubit error yzx ,,
Shor’s 9 Qubits Error Correcting Shor’s 9 Qubits Error Correcting CodeCode
A full Error Correction CodeA full Error Correction Code
3
3
000 1110 0
2
000 1111 1
2
L
L
encodeencoderr
decodedecoderr
Architecture of Shor CodeArchitecture of Shor Code
A more efficient CodeA more efficient Code
Can it be more efficient?Can it be more efficient?
• Shor’s code uses 9 qubits to encode 1 qubit, but more efficient codes exist.
• Given our error model where errors can be any of the Pauli matrices applied to any qubit.
• To recover from 1 qubit errors, what is the minimum number to encode 1 qubit?
zyx , ,
How to calculate this number?
How to use syndrome bits to How to use syndrome bits to calculate the minimum lengthcalculate the minimum length
• Argument:Supposing we encode 1 qubit using n qubits.We can have n-1 syndrome bits, the values of
which tells us the exact error that occurred.• Hence 2n-1 errors can be represented by the
syndrome bits
We have n qubits, and so 3n possible errors. Consider also the case of no errors.
Hence,Least value of n solving this is 5.
1213 nn
Pauli rotations
Encoding
• Use 5 qubits to encode 1 qubit :
10 00000 01111 10011 11100
8
00110 01001 10101 11010
encode
11 11111 10000 01100 00011
8
11001 10110 01010 00101
encode
From above, we calculate:
• Encoding circuitEncoding circuit
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
1 2 3 4 5 1 2 3 4
0 1 0 0 0 0 0 0 1 1 1 1 1 0 0 1 1 11 1 0 08
0 0 1 1 0 0 1 0 0 1 1 0 1 0 1 11 0 1 0
11 1 1 1 1 0 0 08
encode
5 1 2 3 4 5 1 2 3 4 5
1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
0 0 1 1 0 0 0 0 0 1 1
11 0 0 1 1 0 11 0 0 1 0 1 0 0 0 1 0 1
Shift phase
Rules of shifting phase and flip bit
• If qubits 2,3 and 4 are ‘1’, shift the phase
• If qubits 2 and 4 is ‘0’ and qubit 3 is ‘1’, shift the phase
• If qubit 1 is ‘1’, flip qubits 3 and 5
Signal after Hadamards:
Encoding circuit
Hadamards
Step-by-step analysis of the encoding circuit
Shifting phase when 2,3,4 are “1”
Shifting phase when 2,4 are “0” and 3 is “1”
Step-by-step analysis of the encoding circuit
Flipping bits 5 when bit 3 is “1” and then flipping bit 3 and 5 when bit 1 is “1”
Flipping bits 3 and 5 with “1” in bits 2 and 4
Step-by-step analysis of the encoding circuit
Shifting phase in data bit when bits 4 and 5 are “1”
• Assuming at most 1 qubit error and the error is just as likely to affect any qubit.
• The decoding circuit is the encoding circuit in reverse:
Step-by-step analysis of the decoding circuit
This is the decoding circuitThis is the decoding circuit
Example: Error is phase and bit flip on 3Example: Error is phase and bit flip on 3rdrd qubitqubit
• Assume encoded qubit damaged such that:
Continuation of error analysis in decoderContinuation of error analysis in decoder
10000011100100110111
111000001000101110118
01111100011011001000
000111110111010001008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
10000011100100110111
111000001000101110118
01111100011011001000
000111110111010001008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
Phase and bit flip on 3rd qubit
Shift phase when bits 4 and 5 are “1”
Flipping bit 3 when bit 4 is “1” and flipping bit 5 when bit 2 is “1”
10000110100110100111
110001001000101011118
11011100010011001100
100111100101110001008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
10000110101100110011
110001001010001110118
11111101011011011100
101111110111110101008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
Continuation of error analysis in decoderContinuation of error analysis in decoder
Flipping bits 3 and 5 when bit 1 is “1” and then flipping bit 5 when bit 3 is “1”
10000110101100110011
110001001010001110118
11111101011011011100
101111110111110101008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
Continuation of error analysis in decoderContinuation of error analysis in decoder
Shifting phase on bit 5 when 2,3,4 are “1”
• Re-express equation to prepare for Hadamard transform:
12
1001
2
10
2
10
2
110101
2
10
2
10
0010112
11110122
10
2
10
00011011001110014
110101111111010142
10
10000110101100110011
110001001010001110118
11111101011011011100
101111110111110101008
54321543215432154321
54321543215432154321
54321543215432154321
54321543215432154321
Continuation of error analysis in decoderContinuation of error analysis in decoder
This is on inputs to Hadamards
• Qubits 1,2,4 and 5 are the syndrome bits which indicate the exact error that occurred and the current state of qubit 3.
544
332211 1
2
1001
2
10
2
10
543321 100111
Continuation of error analysis in decoderContinuation of error analysis in decoder
This syndrome on bits 1,2,4,5 will be now used to modify the bit 3
• BBnn denotes a denotes a bit-flipbit-flip on on NNth th qubitqubit
• SSnn denotes a denotes a phase-shiftphase-shift on on NNth th
qubitqubit
• BSBSn n denotes a denotes a bit-flip and a bit-flip and a phase-phase-
shiftshift on on NNth qubitth qubit
Syndromes Syndromes TableTable
From previous slide
Execution of correction based on syndromesExecution of correction based on syndromes
• According to syndrome table, the 3rd qubit is in state .
• So apply a phase shift and a bit flip to obtain the protected qubit .
544
332211 1
2
1001
2
10
2
10
543321 100111
1101 BS3 01
01
10
The 5 qubits error correcting circuitThe 5 qubits error correcting circuit
Before transmission
After transmission
Concatenated CodeConcatenated Code
• 1 qubit can be encoded using 5 qubits.
• Each of the 5 qubits can be further encoded using 5 qubits.
• Continue doing this until some number of hierarchical levels is reached.
• Illustration:We will use the 5 qubit encoding.Assume probability of single qubit error is e and
that errors are uncorrelated.
Example of Concatenated CodeExample of Concatenated Code
• For 2 levels, number of qubits required is 52 = 25
• This encoding will fail when 2 or more sub blocks of 5 qubits cannot recover from errors.
• Hence probability of recovery failure is in order of = (e2)2 = e4
• e4 < e2. 2 levels encoding has better probability of error recovery than 1 level if e is small enough
Example of Concatenated CodeExample of Concatenated Code
• For 3 levels, number of qubits required is 53 = 125
• This encoding will fail when 2 or more sub blocks of 25 qubits cannot recover from errors.
• Hence probability of recovery failure is in order of = (e4)2 = e8
• e8 < e4. 3 levels encoding has better better probabilityprobability of error recovery than 2 levels if e is small enough.
Example of Concatenated CodeExample of Concatenated Code
• In general for L levels,Number of qubits required is 5L
Probability of recovery failure is in the order of
• Advantages of concatenated code: If probability of individual qubit error, e, is
pushed below a certain threshold value, adding more levels will reduce probability of recovery failure.
i.e. we can increase the accuracy of our encoding indefinitely by adding more levels.
Error correction is simple using a divide and conquer strategy.
L
e2
Example of Concatenated CodeExample of Concatenated Code
• Disadvantages of concatenated coding:If probability of individual qubit error, e, is
above the threshold value, adding more levels will make things worse.( i.e. probability of recovery failure will be higher)
Exponential number of qubits needed.• Note:
Threshold value depends on• Type of encoding used• Types of errors that occurs.• When the errors are likely to occur (during
qubit storage, or gate processing)
Concatenated CodeConcatenated Code