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 gatesdepth614 views0 saves0 forks0 downloads
1OPENQASM 2.0;
2include "qelib1.inc";
3qreg q[3];
4creg c[1];
5// Encode
6cx q[0],q[1];
7cx q[0],q[2];
8// Error on q[1]
9x q[1];
10// Syndrome
11cx q[0],q[1];
12cx q[0],q[2];
13ccx q[1],q[2],q[0];
14measure q[0] -> c[0];

Cite this circuit

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