circuits / bit-flip-code

Quantum Error Correction (Bit Flip)

FEATURED

The 3-qubit bit flip code. Encodes 1 logical qubit into 3 physical qubits to correct a single X error.

quantumcomputer.dev
openqasm3q7 gatesdepth 60 views0 saves0 forks0 downloads

Source Code

OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[1];
// Encode
cx q[0],q[1];
cx q[0],q[2];
// Error on q[1]
x q[1];
// Syndrome
cx q[0],q[1];
cx q[0],q[2];
ccx q[1],q[2],q[0];
measure q[0] -> c[0];

Cite this circuit

MIT
quantumcomputer.dev. "Quantum Error Correction (Bit Flip)". quantumcomputer.dev/circuits/bit-flip-code. 2026.