← Atlas

Operators · Stabilizer / 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.

Exact & formalUpdated

View frozen graph

q[0]q[1]q[2]q[3]ancillaStep 1 of 5 · CX · on q[0], ancillaCXStep 2 of 5 · CX · on q[1], ancillaCXStep 3 of 5 · CX · on q[2], ancillaCXStep 4 of 5 · CX · on q[3], ancillaCXStep 5 of 5 · Measure(Z) · on ancillaMeasure(Z)

5 steps across 5 wires. Hover a step, or press play to go through them in order.

Expected outcomes

  • Parity even (+1)50%
  • Parity odd (-1)50%
  • Steps5
  • Wires5
  • Data qubits4
  • Ancilla1
  • Depth4 CNOT + 1 measurement
  • Papers1
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

References

Exact & formal
  • Direct mathematics
  • Verified by construction
  • Textbook / standard citation
Method
P = Z^{⊗n} was checked to square to identity and to have eigenvalues +1 on even-weight basis strings, -1 on odd-weight strings, by direct evaluation on all 16 basis strings of a 4-qubit register. The non-destructive ancilla-CNOT-ladder measurement circuit was checked to leave each data-qubit basis state unchanged while depositing the correct parity bit onto the ancilla for all 16 inputs.
Result
Pass · P² = I and eigenvalues match even/odd Hamming weight exactly on all 16 basis strings; the ancilla circuit reproduces the same parity value non-destructively for every tested computational-basis input.
Quantum Computation and Quantum Information: 10th Anniversary Edition ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
paritystabilizer measurementsyndrome extractionnon-destructive measurement

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