Training
Learning path
Get started with Azure Quantum - Training
Intrigued by quantum computing but don't know where to start? This learning path helps prepare you for this exciting next generation of computing.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
This article explains the basics of quantum error correction, the types of quantum errors, and some common quantum error correction codes. It also provides an example of how to correct errors using the three-qubit code.
Quantum error correction (QEC) is a technique that allows us to protect quantum information from errors. Error correction is especially important in quantum computers, because efficient quantum algorithms make use of large-scale quantum computers, which are sensitive to noise.
The basic principle behind quantum error correction is that the number of bits used to encode a given amount of information is increased. This redundancy allows the code to detect and correct errors.
The error rates for quantum computers are typically higher than classical computer's errors due to the challenges associated with building and operating quantum systems. Noise, decoherence, and imperfections in quantum gates can cause errors in quantum computations. Current quantum computers have error rates in the range of 1% to 0.1%. In other words, this means that on average one out of every 100 to 1000 quantum gate operations results in an error.
There are two fundamental types of quantum errors: bit flips and phase flips.
Bit flip errors occur when a qubit changes from
Phase flip errors occur when a qubit changes its phase. They are also known as
In quantum computing, quantum errors can manifest as bit flips, phase flips, or a combination of both.
Quantum error correction codes work by encoding the quantum information into a larger set of qubits, called the physical qubits. The joint state of the physical qubits represents a logical qubit.
The physical qubits are subject to errors due to decoherence and imperfections in quantum gates. The code is designed so that errors can be detected and corrected by measuring some of the qubits in the code.
For example, imagine you want to send the single-qubit message
Now, imagine that a single bit-flip error occurs during transmission so that what the recipient receives is the state
The code distance of a QEC code is the minimum number of errors that change one codeword into another, that is, the number of errors that can't be detected. The code distance
where
Note that repetition codes, such as the three-bit code used in this example, can only correct bit-flip errors, and not phase flip errors. To correct both types of errors, more sophisticated quantum error correction codes are needed.
There are many different types of QEC codes, each with its own properties and advantages. Some common QEC codes are:
Repetition code: The simplest quantum error correction code, where a single qubit is encoded into multiple qubits by repeating it multiple times. The repetition code can correct bit flip errors, but not phase flip errors.
Shor code: The first quantum error correction code, developed by Peter Shor. It encodes one logical qubit into nine physical qubits. Shor code can correct one-bit flip error or one phase flip error, but it can't correct both types of errors at the same time.
Steane code: This is a seven-qubit code that can correct both bit flip and phase flip errors. It has the advantage of being fault-tolerant, meaning that the error correction process itself doesn't introduce extra errors.
Surface code: This is a topological error correction code that uses a two-dimensional lattice of qubits to encode logical qubits. It has a high error correction threshold and is considered one of the most promising techniques for large-scale, fault-tolerant quantum computing. The surface code is used by the Azure Quantum Resource Estimator.
Hastings-Haah code: This quantum error correction code offers better space-time costs than surface codes on Majorana qubits in many regimes. For gate-based instruction sets, the overhead is larger, which makes this approach less efficient than the surface code.
The three-qubit error correction code is a simple repetition code that can detect and correct one bit flip error. It encodes a single logical qubit into three physical qubits by repeating the qubit three times.
Tip
Check out the Q# code sample for the three-qubit code.
Imagine you want to send an arbitrary single qubit
Therefore, the single qubit
Let's break down the steps of the three-qubit code.
First, you encode your single qubit
Next, you prepare two further qubits in the state
Lastly, you encode the single qubit into a joint state of three qubits, by applying two CNOT operations. The first CNOT uses the first qubit as control and acts on the second qubit, producing
You send all three qubits. Assuming only one-bit flip errors can occur, the received qubits are in one of the following states:
State | Error |
---|---|
No error | |
Qubit 1 | |
Qubit 2 | |
Qubit 3 |
First, you introduce two more qubits, prepared in the state
Next, you carry out four CNOT operations: the first two operations use the first and second received qubits as control and act on the first auxiliary qubit, and last two operations use the first and third received qubits as control and act on the second auxiliary bit. The total state of all five qubits is now:
State | Error |
---|---|
No error | |
Qubit 1 | |
Qubit 2 | |
Qubit 3 |
To retrieve the error information, you measure the two auxiliary qubits in the computational basis states
Now you know which of the four possible states the three received qubits are in. You can correct the error by applying the correction operation. In this case you're dealing with bit flip errors, so the correction is a
For example, if the error syndrome is
Error syndrome | Collapse state | Correction |
---|---|---|
Do nothing | ||
Apply |
||
Apply |
||
Apply |
Finally, to extract the single qubit you wanted to transmit originally, you apply two CNOT operations: one uses the first qubit as control and acts on the second qubit, and other uses the first qubit as control and acts on the third one.
The state of the first qubit is now
Important
The QEC code doesn't gain any information regarding the coefficients
Training
Learning path
Get started with Azure Quantum - Training
Intrigued by quantum computing but don't know where to start? This learning path helps prepare you for this exciting next generation of computing.