measurement_qasms_from_groups

measurement_qasms_from_groups(measurement_groups, n_qubits, measure_all=True)[source]

Emit body-only measurement QASM per commuting observable group.

For each QWC group, determines the measurement basis per qubit from the big-endian Pauli labels and emits the appropriate diagonalising gates (H for X, Sdg+H for Y, nothing for Z/I) followed by measure q[i] -> c[i] instructions. No PennyLane dependency.

Parameters:
  • measurement_groups (tuple[tuple[str, ...], ...]) – Tuple of tuples of big-endian Pauli label strings, one tuple per commuting group.

  • n_qubits (int) – Total qubit count.

  • measure_all (bool) – If True, measure all qubits. If False, restrict to qubits active in the group.

Return type:

list[str]