build_pauli_readout_circuit

GateCompiler.build_pauli_readout_circuit(pauli_readout, compiled=None)

Construct a gate-set-native readout circuit for a requested Pauli string.

The device reads \(Z\) on its readable qubit and nothing else, so reading a Pauli string means rotating each qubit’s chosen basis onto \(Z\) and folding the string’s support onto that qubit. Appending the returned circuit to a state-preparation circuit turns the hardware’s own readout into a readout of the requested string.

The two circuits have to meet in one qubit indexing: pass the state-preparation circuit as compiled, and express whatever runs before it in that circuit’s own input qubit assignment. The circuit is built with the Qiskit transpiler, whichever strategy this compiler is configured with. Under a QiskitConfig it uses that configuration’s transpiler settings; under a synthesis strategy, QiskitConfig’s defaults.

Passing a readout target to compile() instead takes a different route on a synthesis strategy: the transformation joins the unitary and is synthesized with the circuit. This method is for the transformation on its own.

Parameters:
  • pauli_readout – One Pauli label per qubit, in Qiskit’s order, as a string or a sequence – "XIZ" reads \(Z\) on qubit 0 and \(X\) on qubit 2.

  • compiled (QuantumCircuit | None) – A compiled circuit to read the output-qubit assignment off, so a circuit whose layout is not the identity is handled without saying so.

Return type:

QuantumCircuit

Returns:

Circuit realizing the readout transformation in the gate set’s natives.

Raises:

QuasarError – If the gate set declares no single readable qubit, or if the Pauli string is all identities.