data qubits q0,q1,q2 syndrome ancillas a1,a2 X gate applied (error / correction) current probability / p-marker

Quantum Error Correction Circuit: 3-Qubit Bit-Flip Code

This is the circuit-model twin of the site's Bloch-sphere 3-qubit bit-flip code simulator: the same quantum repetition code, independently implemented as a genuine 5-qubit statevector simulator (32 complex amplitudes covering 3 data qubits and 2 syndrome ancillas) that applies real CNOT and Pauli-X gate matrices in the order a physical circuit would. Encoding entangles a chosen logical qubit into α|000⟩+β|111⟩; injected bit-flip errors act as unitary X gates; syndrome extraction uses two ancilla CNOT pairs and projective measurement to identify a faulty qubit without ever collapsing the encoded superposition; and correction plus a decoding circuit recover the original logical amplitudes exactly for any single-qubit error. Watch the live gate-by-gate circuit diagram, a basis-state probability histogram read straight off the statevector, and a chart comparing the analytic 3p²−2p³ failure-rate formula against your own running Monte-Carlo trials.