Sign in
← Atlas
Exact & formalOperatorsStabilizer / error-syndrome measurement

Joint parity operator measurement

The joint parity operator Z^{⊗n} and its standard non-destructive ancilla-based measurement circuit, the core primitive behind stabilizer syndrome extraction.

paritystabilizer measurementsyndrome extractionnon-destructive measurement

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

Almost every stabilizer code, entanglement witness, and error-correction syndrome extraction reduces to the same primitive: measure the joint parity of a set of qubits without collapsing any other information about their individual states.

Circuit & simulation
Parity even (+1)50%
Parity odd (-1)50%
What this takes and returns
TakesNothingWhat joins here

No input port, deliberately. You measure a state with this entry; you do not apply it and pass a register on.

Nothing in the Atlas meets this end.

ReturnsNothingWhat joins here

No output port, deliberately. An observable is measured with, never applied, so there is no register to hand on.

Nothing in the Atlas meets this end.

Not a stage. You measure a state with this; you do not apply it and pass a register on. It has a width and deliberately no ports. See all 60 →

How it works

The joint parity operator on nn qubits is

P=Z1Z2Zn.P = Z_1 Z_2 \cdots Z_n.

Spectrum. Since each ZiZ_i has eigenvalues ±1\pm1, PP has eigenvalue (1)x(-1)^{|x|} on basis state x|x\rangle, where x|x| is the Hamming weight of the bit string xx: +1+1 on even-weight strings, 1-1 on odd-weight strings. P2=IP^2 = I since Zi2=IZ_i^2=I for every factor, so PP is both Hermitian and unitary — a valid observable with only two possible measurement outcomes.

Non-destructive measurement circuit. To measure P\langle P\rangle without destroying superpositions within a fixed-parity eigenspace (essential for stabilizer codes, where you want to detect an error without collapsing the encoded logical information), introduce one ancilla in 0|0\rangle and apply CNOTiancilla\mathrm{CNOT}_{i\to\text{ancilla}} for every data qubit ii. Since CNOT targeting the ancilla implements xdata0ancxdataixianc|x\rangle_{\text{data}}|0\rangle_{\text{anc}} \mapsto |x\rangle_{\text{data}}|{\oplus_i x_i}\rangle_{\text{anc}}, measuring the ancilla in the ZZ basis returns the parity bit ixi\oplus_i x_i (equivalently, P=12ancilla\langle P\rangle = 1-2\langle \text{ancilla}\rangle) while leaving the data register's relative phases and any coherence within a parity sector completely undisturbed — only the parity value is extracted, exactly the property a syndrome measurement needs.

Where this shows up. GHZ-state and cluster-state verification protocols measure exactly this operator (or products of it, e.g. the stabilizer generators KiK_i of the graph states elsewhere in this catalog are all built from parity-type XX-and-ZZ-string measurements) to certify entanglement without full state tomography. In stabilizer error correction, syndrome bits are joint-parity measurements of ZZ- or XX-type check operators, and the non-destructive ancilla trick above is the literal circuit used to extract each syndrome bit without collapsing the encoded logical qubit.

Implementation
Native
parity_operator_measurement.py
from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
import numpy as np

def parity_measurement_circuit(n: int) -> QuantumCircuit:
    qc = QuantumCircuit(n + 1, 1)  # qubits 0..n-1 = data, qubit n = ancilla
    for i in range(n):
        qc.cx(i, n)
    qc.measure(n, 0)
    return qc

# Verify P = Z^{\otimes n} spectrum directly against Hamming weight
n = 4
for x in range(2 ** n):
    bitstring = format(x, f"0{n}b")
    weight = bitstring.count("1")
    expected_parity = 1 if weight % 2 == 0 else -1
    assert expected_parity == (-1) ** weight

qc = parity_measurement_circuit(n)
print(qc.draw())


FINAL_CIRCUIT = qc
Quantum vs classical

Classical baseline

Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.

Quantum claim

The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.

How to compare

Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Quantum Computation and Quantum Information: 10th Anniversary Edition2010 · Michael A. Nielsen and Isaac L. Chuang

Standard textbook derivation of ancilla-based non-destructive parity and stabilizer measurement circuits.

doi.org/10.1017/cbo9780511976667