Curriculum / Noise & Error Correction / Logical Qubit Operations
Logical Qubit Operations
Perform logical X and Z operations on an encoded 3-qubit logical qubit.
Logical Qubit Operations
A logical qubit is the fault-tolerant abstraction: a single quantum information unit encoded across many physical qubits, protected by an error correcting code. Logical qubit operations are quantum gates applied to this abstraction, implemented as carefully designed sequences of physical gates that preserve the code space.
From physical to logical:
Every physical quantum operation has a logical counterpart. The logical gate must:
- 1.Map codewords to codewords (stay in the code space)
- 2.Implement the correct logical action (e.g., logical X maps |0̄⟩ → |1̄⟩)
- 3.Be fault-tolerant (not spread errors beyond the code's correction capability)
For the 3-qubit repetition code:
- •Logical |0̄⟩ = |000⟩
- •Logical |1̄⟩ = |111⟩
- •Logical X̄ = X on all 3 qubits: |000⟩ ↔ |111⟩
- •Logical Z̄ = Z on any 1 qubit: creates relative phase between codewords
- •Logical H̄ = requires code switching (rep code is not CSS-complete for H)
Not all gates can be implemented fault-tolerantly on a given code. For CSS codes, the Clifford gates {H, CNOT, S} are transversal (each physical gate maps to a logical gate). The T gate is not transversal (Eastin-Knill theorem) and requires magic state injection. Together, {H, CNOT, T} form a universal gate set: so with CSS codes + magic state distillation, you can implement any quantum algorithm fault-tolerantly. The distinction: Clifford + T gives universality, but T is expensive while Clifford operations are 'free'.
Logical gate implementations:
The examples below use the Steane [[7,1,3]] code, a 7-qubit code you will meet later in this track. For now, read it as a larger cousin of the repetition code:
| Logical gate | Physical implementation (Steane [[7,1,3]]) | Fault-tolerant? |
|---|---|---|
| Logical X̄ | X on all 7 qubits | Yes (transversal) |
| Logical Z̄ | Z on all 7 qubits | Yes (transversal) |
| Logical H̄ | H on all 7 qubits | Yes (transversal) |
| Logical CNOT | CNOT between corresponding qubits of two blocks | Yes (transversal) |
| Logical T̄ | Magic state injection + gate teleportation | Yes (via distillation) |
| Logical S̄ | S on all 7 qubits | Yes (transversal) |
This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.
How this lesson works
A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.
Part of: Noise & Error Correction
Understand quantum noise and build error correction codes to protect quantum information.
This lesson is part of Pro
Unlock Noise & Error Correction and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.