A parity bit records whether the number of one bits in a word is even or odd and can detect every error that flips an odd number of bits.
Apply one CNOT gate from each input qubit to the same target. Their actions commute because controls remain unchanged and each contribution is added modulo two. This reversible circuit computes the parity bit with exactly one two-qubit gate per input, and its inverse is the same circuit. Unlike measuring the inputs to compute parity classically, the unitary preserves quantum superposition and can be uncomputed after phase application.
The length- even-weight code consists of binary words whose coordinates sum to zero. It has parameters .

Articles by others on the same topic (1)

A parity bit is a form of error detection used in digital communications and storage systems. It is a binary digit added to a group of binary digits (bits) to make the total number of set bits (ones) either even or odd, depending on the type of parity being used.