ArticleslgStudy

physics

Shor code

Shor code is a physics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Shor code rather than just read about it. In short: In quantum computing, the Shor code or Shor nine qubit code is a foundational code in quantum error correction that protects quantum information against decoherence and operational errors. It was the first quantum error correcting code, introduced by Peter Shor in 1995.

Shor code — main illustration
Shor code — illustration

Key takeaways

  • Shor code belongs to physics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Shor code to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Shor code from memory before moving on to harder problems.

Reference excerpt

In quantum computing, the Shor code or Shor nine qubit code is a foundational code in quantum error correction that protects quantum information against decoherence and operational errors. It was the first quantum error correcting code, introduced by Peter Shor in 1995. It encodes a single logical qubit into a system of nine physical qubits, allowing simultaneous correction of both bit-flip, phase-flip or a joint phase and bit flip errors on any single physical qubit. As the first quantum error-correcting code to demonstrate fault tolerant quantum computing in principle, the Shor code marked a critical step toward the development of reliable quantum computing systems. The Shor code is a simple example of a Bacon–Shor code. These codes have the property that are constructed from local operations and repeating patterns, and introduce the ability to switching encoding dynamically (while the circuit is running) in a fault-tolerant manner.

Description

Encoding states

The Shor code encodes one logical qubit in 9 physical qubits. To construct the code, we first encode a state α|0⟩+β|1⟩ to an encoding of three qubits, as|0⟩→|+++⟩and|1⟩→|−−−⟩,where |±⟩=(|0⟩±|1⟩)/2. In order to obtain the desired Shor logical |0L⟩ and |1L⟩ we use concatenation, that is, each of the three qubits is multiplied into a three qubit block, given by|0L⟩=122(|000⟩+|111⟩)⊗(|000⟩+|111⟩)⊗(|000⟩+|111⟩)and|1L⟩=122(|000⟩−|111⟩)⊗(|000⟩−|111⟩)⊗(|000⟩−|111⟩).

Detection and correction Qubits for three blocks (0,1,2), (3,4,5) and (6,7,8), where each block is protected from bit-flips and the three blocks are protected together from a phase flip on any of the blocks. Thus the Shor code can correct any bit and/or phase flip errors in any single qubit. It can also correct two bit flips as long as the errors occur in separate blocks. Due to discretization of errors it can be shown that any unitary transformation on a single qubit can be corrected just by correcting bit flips and phase flips errors.

Logical gates One can define logical Pauli gates for the Shor code, where the logical Pauli Z gate is given by ZL=X⊗X⊗X⊗X⊗X⊗X⊗X⊗X⊗X, where X is the single qubit Pauli X gate. In the same manner a logical Pauli X is given by XL=Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z⊗Z,where Z is the single qubit Pauli Z gate.

Random error threshold According to the threshold theorem a quantum error correction code can correct physical error if the error rate is below a certain threshold. If p is the probability of a random error happening on a single qubit, a conservative estimate can treat any error affecting two or more qubits as uncorrectable; this happens with probabilityP2(p)=1−(1−p)9−9p(1−p)8≈36p2,When P2(p) is larger than p itself (where we neglected terms with power larger than p3), it is better to not use Shor code at all. In this case the threshold is approximately p=1/36=2.78%. However including errors in the error correction itself this value can drop to 10−4.

Stabilizer formalism The Shor code is a [[9,1,3]] code (9 qubits, 1 logical qubit, distance 3), the later number indicates that it can correct at most a single qubit error. In the stabilizer formalism, the Shor code has 8 generators (6 bit flip and 2 phase flip parity checks):

123456789g1ZZIIIIIIIg2IZZIIIIIIg3IIIZZIIIIg4IIIIZZIIIg5IIIIIIZZIg6IIIIIIIZZg7XXXXXXIIIg8IIIXXXXXX As the Shor code has only X stabilizers and Z stabilizers (does not mix X and Z in the stabilizer), it is then considered a CSS code.

See also Steane code Five-qubit error correcting code

References

Illustrations

Shor code: Quantum circuit to encode a single logical qubit with the Shor code. E indicates an error and the rest of the circuit to the right decodes the state.
Quantum circuit to encode a single logical qubit with the Shor code. E indicates an error and the rest of the circuit to the right decodes the state.
Shor code: Creation of each block. In this diagram, the Hadamard gate (H) creates a state |+⟩ and the other two qubits are concatenated using Controlled NOT gates.
Creation of each block. In this diagram, the Hadamard gate (H) creates a state |+⟩ and the other two qubits are concatenated using Controlled NOT gates.

Worked examples

Example 1 — a first encounter with Shor code

Start with the simplest possible case. Write down what Shor code claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In physics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Shor code before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Shor code ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Shor code

In research
Shor code appears in physics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Shor code in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Shor code is common in secondary-school and first-year university syllabi. It links to neighbouring topics Quantum information science, so understanding it makes those chapters shorter.
In everyday life
Look for Shor code outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Shor code” →

How to study Shor code in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Shor code means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Shor code out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Shor code in simple terms?

In quantum computing, the Shor code or Shor nine qubit code is a foundational code in quantum error correction that protects quantum information against decoherence and operational errors. It was the first quantum error correcting code, introduced by Peter Shor in 1995.

Why does Shor code matter?

Because it connects several physics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Shor code?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Shor code.

Tags

  • Quantum information science

Keep exploring