Error Correction - RPIQuantumComputing/QuantumCircuits GitHub Wiki

The qubits used in quantum computers are not deterministic. They are prone to errors. If the encoded case of a qubit is a 0, then an error in measurement would be measuring a 1. Over time, better qubits have been developed that are less prone to errors, but we will never be able to remove these imperfections entirely. A theoretically perfect qubit is referred to as a logical qubit, while the practical qubits being used in quantum computers are referred to as physical qubits.

It is obviously bad to have errors in our calculations, so we seek to model logical qubits using many physical qubits. One way to account for noise is to measure qubits multiple times. If the probability of a qubit error is 1%, then it would be extremely unlikely to observe 3 or 4 erroneous outcomes in a row. We will define a variable p as the probability of an error occurring. This can vary between qubits. We then define Pa as the maximum probability of error that is acceptable. A high Pa indicates that it is less important that the calculation is correct, while a low Pa indicates that it is more important that the calculation is correct. If p < Pa, then we can accept our answer at face-value, but if p > Pa, we must make more measurements until p < Pa.

As p increases, it becomes more difficult to distinguish the true value of qubits. At p = 0.5, the measured output is determined entirely by noise, with no trace of the encoded case.

Errors in qubits do not only occur during measurement. They also occur while they are idle. Since qubits interact with each other and their environment, it is possible for idle qubits to be affected by these factors. The longer qubits are left idle for, the more pronounced the effects of these factors becomes. An obvious solution to this problem is to periodically measure idle qubits so that no qubit is left idle for too long. However, this would collapse any superpositions in our qubits. Instead, we make a circuit to detect errors.

If we know that two qubits are paired, then they should be either |00> or |11>. We can perform a CX gate on each qubit to a third qubit. The result is that our third qubit is 0 if the input qubits are 00 or 11, and 1 if they are 01 or 10. If this circuit outputs a 1, that indicates that something is wrong. It does this all without collapsing the states of our qubits.

Armed with this information, we can create a circuit to implement repetition code. The following diagram is a circuit that uses 3 physical qubits to model 1 logical qubit.

quanatm carcat

image from Qiskit

In the diagram above, the qubits labeled code_qubit 0 - 2 are the qubits encoding our logical qubit. Ideally, they will all be identical. The link qubits calculate whether or not our code qubits are all the same or not. The first link qubit compares code qubits 0 and 1 equality. The second compares code qubits 1 and 2 equality. This circuit will output a string of 5 bits, such as: ‘000 00’. The first 3 bits are the final measurements of the code qubits. The last two are called the syndrome measurement. The syndrome measurement can be repeated multiple times. A possible output of this circuit with 3 syndrome measurements would look like this: ‘000 00 00 00’. This circuit can also use more than 3 code qubits to model a logical qubit. Such a circuit could produce an output like this: ‘0000 000’. Here, 4 code qubits are used. The syndrome measurement contains 3 qubits not 2 because there is another qubit to compare.

The output of the above circuit is a good first step, but we would rather transform it into a more useful form. This transformation is rather simple-we just reorganize the bits to follow a more informative format. This looks like this: an output of ’000 00 00’ would transform into ‘0 0 00 00 00’ and an output of ‘111 00 00’ would transform into ‘1 1 00 00 00.’ The ‘0 0’ and ‘1 1’ in this form represent the logical representation. Any singular code qubit could be used for these digits. The following digits are the syndrome measurements, except there has been a small adjustment. The syndrome bits now display the change between syndrome rounds. The extra syndrome round is a special measurement. It is determined by the final readout measurement of all of the code qubits. It is also displayed as a change between rounds.

Using these syndrome measurements, we can determine how likely a string of bits is to change into another string of bits. By running these tests multiple times we can determine what the original string most likely was. For example, if we know qubits 1 and 2 disagree while 2 and 3 agree, we can reasonable conclude that qubit 1 suffers from a bitflip error without knowing what the state of qubit 1 is, thus we avoid the above issue of measurement collapse while also gaining the ability to correct for errors. More complicated schemas include other possibilities like an unexpected Y or Z gate, but, with these three syndrome measurements, we have a mathematical guarentee that any arbitrary unitary error can be corrected. The trick of this is the observation that all other errors are unitaries, those unitaries can be represented by a superposition of the identity, X, Y, and Z gate and we are measuring if either of these gates where unexpectedly applied. In other words, we are collapsing our error possibilities from a continuous amount of possibilities into a correctable subset through measurement-the devil which illuded us initally now serves as our saving grace.


⚠️ **GitHub.com Fallback** ⚠️