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 binary code consists of words with . It is the kernel of the linear map that sums the coordinates, equivalently the binary single parity-check code.
For its parameters are : the single independent parity equation leaves dimension , every nonzero codeword has even Hamming weight, and a word with two nonzero coordinates attains weight . For the code is , so the distance- assertion does not apply.

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.