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; use catalyst.pauli_measure() instead.

Parameters:
  • pauli_word (str) – The Pauli word (e.g. "XZ") acting on wires.

  • 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 postselect is set (not yet plumbed through MLIR).

  • ValueError – If the number of wires does not match the Pauli word length.