append_pauli_readout

append_pauli_readout(circuit, pauli_string)

Return a copy of circuit with trailing readout-target measurements.

For each Pauli string, adds a new one-bit classical register and appends a PauliProductMeasurement naming the string – the form compile() reads a readout target from. Several strings ask one readout to deliver all of them, in the order given. Use remove_pauli_readouts() to undo this.

Parameters:
  • circuit (QuantumCircuit) – Circuit to append the measurements to. Not modified in place.

  • pauli_string (str | Sequence[str]) – One Pauli string, or a list of them. A string gives Pauli letters, one per qubit in circuit, in Qiskit’s order: the last letter is qubit 0, as in a Qiskit Pauli label. "I" marks a qubit not part of the measurement; an all-"I" string is rejected.

Return type:

QuantumCircuit

Returns:

A copy of circuit with one classical register and measurement appended per string.

Raises:

ValidationError – If the list is empty, or if a string does not give exactly circuit.num_qubits letters, holds a letter other than I, X, Y or Z, or gives only "I".