catalyst.pauli_measure¶
- pauli_measure(pauli_word: str, wires, postselect: int | None = None) DynamicJaxprTracer[source]¶
A
qjit()compatible Pauli-product mid-circuit measurement for PennyLane/Catalyst.Important
The
qp.pauli_measure()function is not QJIT compatible under the legacy tracing pathway; usecatalyst.pauli_measure()instead.- Parameters:
pauli_word (str) – The Pauli word (e.g.
"XZ") acting onwires.wires (int or list[int]) – Wire(s) the Pauli product applies to.
postselect (Optional[int]) – Optional postselection (not yet supported in compilation).
- Returns:
A JAX tracer for the classical measurement outcome (boolean).
- Raises:
NotImplementedError – If
postselectis set (not yet plumbed through MLIR).ValueError – If the number of wires does not match the Pauli word length.
code/api/catalyst.pauli_measure
Download Python script
Download Notebook
View on GitHub