Quantum Computing · Qiskit · May 2026

Quantum Error Correction

A five-qubit simulation that introduces rotational noise, detects a single corrupted data qubit with parity syndromes, and restores logical |0⟩ and |1⟩ states.

Role Developer Stack Python · Qiskit · Aer Method 3 data + 2 ancilla qubits
Qiskit quantum error correction circuit with five qubits
Five-qubit ECC circuit
100% corrected shots

Testing whether syndrome logic can recover a single noisy qubit.

The project repeats one logical value across three data qubits, applies a random Rx or Ry rotation to one qubit, and compares measurement results before and after correction.

Two ancilla qubits compute adjacent parity checks. Their syndrome identifies the corrupted position, allowing controlled-X gates to restore the repeated state before the final measurement.

01

Inject noise

Random qubit, rotation plane, and angle from 0 to π/2.

02

Read syndrome

Ancillas store q0 ⊕ q1 and q1 ⊕ q2.

03

Correct state

The syndrome selects the data qubit that receives an X correction.

Noise, syndrome detection, and repeatable simulation.

Rotational error model

Corrupt one statevector.

The helper applies either an X-axis or Y-axis rotation, while the randomizer selects the affected qubit and angle.

Python · Qiskit
def corrupt(angle, q, plane):
    qc_err = QuantumCircuit(1)
    if plane == 'ZX':
        qc_err.rx(angle, 0)
    else:
        qc_err.ry(angle, 0)
    return q.evolve(Operator(qc_err))

def get_noise():
    which_qubit = rng.integers(0, 3)
    plane = 'ZX' if rng.integers(0, 2) == 0 else 'ZY'
    theta = rng.uniform(0.0, np.pi * 0.5)
    return which_qubit, plane, theta

The simulated correction recovered every logical measurement.

27randomized trials
1,024shots per trial
81.0%average correct without ECC
100%correct with ECC
Before correction595 / 1,024
Histogram showing noisy logical zero measurement outcomes
A large rotation reduced this example to 58.1% correct measurements.
After correction1,024 / 1,024
Histogram showing corrected logical zero measurements
The corrected data register returned 000 in every shot.

Result: across all 27 trials, ECC produced 27,648 correct data-register measurements out of 27,648. The uncorrected simulations averaged 81.0%, with individual trials ranging from 49.1% to 100%.

Scope: this demonstrates correction of one simulated data-qubit error in a repeated-state model; it is not a complete fault-tolerant quantum-computing architecture.

Professional development

Quantum Professional

Black Opal certificate issued by Q-CTRL on May 28, 2026.

Black Opal Quantum Professional certificate awarded to Hamed Emari