remove_pauli_readouts

remove_pauli_readouts(circuit)

Split the trailing readout requests off circuit.

The inverse of append_pauli_readout(): undoes exactly what it does, however many times it was called, and also recognizes a compiled circuit’s own trailing, already-reduced measurements (see compile()).

Parameters:

circuit (QuantumCircuit) – Circuit to inspect. Not modified in place.

Returns:

body is circuit with its trailing run of PauliProductMeasurement instructions removed, and pauli_strings holds the Pauli string each named, in circuit order. A string is in Qiskit’s order, its last letter qubit 0, with "I" for the qubits an instruction did not act on. A circuit that does not end with one comes back unchanged, with an empty list.

Return type:

A (body, pauli_strings) pair