# Why does phase flip correction error? Why could any error be written as a linear combination of I, X, Z and ZX matrices?

I don't understand how it's being proven that error correction can be applied only to X, Z noises and this solves all errors?

Does this have to be with this set being universal? (Z is exactly like phase matrix or rotation matrix.)

Bonus question: When recovering a state in Shors code does it matter if I apply X, Z or Z, X?

• Any 2x2 matrix can be written as a linear combination of I,X,Z and ZX. Moreover, those 4 matrices form an orthogonal basis in matrix space of 2x2 matrices under Hilbert–Schmidt inner product. Mar 9 '19 at 8:33
• For sure I'm too late, but you can play around with this code and check step by step what is being done in the Shor's 9-qubit algorithm for correcting quantum errors: github.com/sebastianvromero/qecc_shor9q . Cheers! Apr 5 at 23:44

2. You can still get upper bounds on how bad more flexible real quantum errors will be. An accidental 5 degree rotation around the Z axis of a qubit is no worse than a $$\sin^2(5^\circ)$$ chance of a Z error on that qubit.