Qubits are strongly affected by the environment. Any environmental disturbances, called “noise”, can disturb the superposition and cause decoherence.
Decoherence: loss of information due to environmental disturbances
There are two main types of decoherence: energy relaxation and dephasing.
Energy relaxation: \(|1\rangle\) state decays towards \(|0\rangle\) state.
Dephasing: If you look at this quick segment: Quantum decoherence, at the end there is a density matrix describing the actions of the system and the small blurb afterwards explains it quite well. Dephasing collapses the qubits into just \(|0\rangle\) and \(|1\rangle\)
But, the effects of these are being minimized with the ever-advancing technology. In fact, coherence time (the time in which the qubit stays coherent) has been increasing exponentially. But still, it is very short relative to our normal frames of time. Qubits generally stay coherent for just 0.0001 seconds (as of 2015).
These errors do inevitable occur, however, and thus quantum error correction strategies have come into existence. For example, quantum repetition code is very widespread. The first step to quantum repetition code is repeating the state of a qubit multiple times. For example, \(|0\rangle\) would be assigned a “codeword” of \|000\rangle\) which would utilize three qubits. From here, there are three main implementations of quantum repetition code.
The first simply uses a majority. For example, if a bit flip error occurs and a \(|0\rangle\) becomes a \(|1\rangle\) and thus the codeword \(|000\rangle\) becomes \(|010\rangle\), then simply the code takes the majority value of the three qubits (which would be 0) and corrects \(|010\rangle\) to \(|000\rangle\). However, if two errors occur, then clearly the correction code would not work. Luckily, the probability of two errors is quite small; at just 1% error rate, the error rate for 2 errors would be less than 0.03%.
The second is a bit flip encoder and decoder.
The third is the encoder with bit-flip code and parity checks. Firstly, assume that qubits 0, 1, 2 contain the codeword 000. First, the code applies a SWAP gate between qubits 2 and 3 so that now the codeword is stored in qubits 0, 1, 3 (I was personally confused what the purpose of the SWAP gate was but turns out it is just for physical limitations such as wires). At this point, qubits 2 and 4 are error qubits. Qubit 4 checks the parity of 0 and 1. Qubit 2 checks the parity of 1 and 3. These two qubits are represented by \(s = s_0 + s_1\) where \(s_0\) is qubit 4 and \(s_1\) is qubit 2. These two respective \(s\)’s will be 1 depending on if their parity is incorrect. For example, for a \(s = 00\) error syndrome, there was no error. On the other hand, if \(s = 01\) then qubit 3 was flipped. If \(s = 10\) then qubit 0 was flipped. If \(s = 11\) then qubit 1 was flipped.
Parity: the fact of being even or odd. For example, \(|00\rangle\) has a different parity than \(|01\rangle\) in both regard to 0 and 1; there are even numbers of 0’s in the initial codeword while there is an odd number of zeroes in the final codeword.
Lastly, there is one more quantum error correction method: stabilizer measurements.