Discretization of errors
So far we've considered errors and errors in the context of the 9-qubit Shor code, and in this section we'll consider arbitrary errors. What we'll find is that, to handle such errors, we don't need to do anything different from what we've already discussed; the ability to correct errors, errors, or both, implies the ability to correct arbitrary errors. This phenomenon is sometimes called the discretization of errors.
Unitary qubit errors
Let's begin with single-qubit unitary errors. For example, such an error could correspond to a very small rotation of the Bloch sphere, possibly representing an error incurred by a gate that isn't perfect, for instance. Or it could be any other unitary operation on a qubit and not necessarily one that's close to the identity.
It might seem like correcting for such errors is difficult. After all, there are infinitely many possible errors like this, and it's inconceivable that we could somehow identify each error exactly and then undo it. However, as long as we can correct for a bit-flip, a phase-flip, or both, then we will succeed in correcting an arbitrary single-qubit unitary error using the procedures described earlier in the lesson.
To see why this is the case, let us recognize first that we can express an arbitrary unitary matrix representing an error on a single qubit, as a linear combination of the four Pauli matrices (including the identity matrix).
As we will see, when the error detection circuits are run, the measurements that give us the syndrome bits effectively collapse the state of the encoding probabilistically to one where an error (or lack of an error) represented by one of the four Pauli matrices has taken place. (It follows from the fact that is unitary that the numbers and must satisfy and indeed, the values and are the probabilities with which the encoded state collapses to one for which the corresponding Pauli error has occurred.)
To explain how this works in greater detail, it will be convenient to use subscripts to indicate which qubit a given qubit unitary operation acts upon. For example, using Qiskit's qubit numbering convention to number the 9 qubits used for the Shor code, we have these expressions for various unitary operations on single qubits, where in each case we tensor the unitary matrix with the identity matrix on every other qubit.
So, in particular, for a given qubit unitary operation we can specify the action of applied to qubit by the following formula, which is similar to the one before except that each matrix represents an operation applied to qubit
Now suppose that is the 9-qubit encoding of a qubit state. If the error takes place on qubit we obtain the state which can be expressed as a linear combination of Pauli operations acting on as follows.