GateSet

class GateSet(name, n_qubits, *, single_qubit_gate_error=None, entangler_gate_error=None, gate_errors=None, single_qubit_gate_duration=None, entangler_gate_duration=None, gate_durations=None, reserved_qubits_by_gate=None)

Represent a native gate set and its native-circuit metadata.

A gate set is the gate-level description of a device: its native gate catalogue, its topology, and the data the gate-level compilers need to lower a circuit onto it. A pulse backend registered for the gate set holds its pulse-level description.

A gate set also carries what each native gate costs on the device: its error and its duration, both optional. Each is given as one value for every single-qubit pulse and one for every entangler, as a value per native gate, or both, the per-gate values replacing the uniform ones for the gates they name. A frame change (rz) takes no time and carries no error. There is no default value. If a value is not given and a method needs it, the method raises an error.

A gate set also says which qubits each native gate reserves while it runs. Two gates may run at once when their reserved qubits are disjoint. A gate always reserves its own qubits. Unlike the error and the duration, this has a default, which the gate set gives: a gate reserves its own qubits, and on a gate set whose gates on an outer qubit also drive the central qubit, such as CROTGateSet, the central qubit too. A frame change reserves no qubit. reserved_qubits_by_gate replaces the default for the gates it names.

Parameters:
  • name (str) – Name of the gate set.

  • n_qubits (int) – Number of qubits supported by the gate set.

  • single_qubit_gate_error (float | None) – Average gate infidelity of one single-qubit pulse.

  • entangler_gate_error (float | None) – Average gate infidelity of one entangler, on its own qubits.

  • gate_errors (Mapping[Gate, float] | None) – Average gate infidelity of each native gate on its own qubits. A key is a Gate as native_gates lists it, or its (name, qubits) pair, such as ("crot", (0, 1)).

  • single_qubit_gate_duration (float | None) – Duration of one single-qubit pulse.

  • entangler_gate_duration (float | None) – Duration of one entangler.

  • gate_durations (Mapping[Gate, float] | None) – Duration of each native gate, keyed like gate_errors. A duration’s unit is the caller’s, the same for every gate of the set.

  • reserved_qubits_by_gate (Mapping[Gate, Iterable[int]] | None) – The qubits each named native gate reserves while it runs, keyed like gate_errors. A gate also reserves its own qubits.

Variables:
  • name – Name of the gate set.

  • n_qubits – Number of qubits supported by the gate set.

Raises:

ValidationError – If a key names no native gate, an error is outside [0, 1), a duration is negative, or a reserved qubit is outside the register.

Attributes

gate_durations

Return the duration of every native gate that has one.

gate_errors

Return the error of every native gate that has one.

native_gates

Return the native gates supported by the gate set.

placements

Return where a native entangler sits, and which one.

reserved_qubits_by_gate

Return the qubits every native gate reserves while it runs.

routing_edges

Return the topology entries usable for pairwise routing.

spam_qubits

Return the qubits the device resets and reads out together, or None.

topology

Return the qubit set every native entangling gate can be built on.

Methods

gate_duration(gate)

Return a native gate's duration, or None when it has none.

gate_error(gate)

Return a native gate's average gate infidelity on its own qubits, or None when it has none.

lower_resets(circuit)

Rewrite a circuit's resets as the resets the device performs.

pauli_readout_native(pauli_readout[, ...])

Return the native readout a requested Pauli string is realized through by default.

pauli_readouts_native()

Return every Pauli string the hardware reads out directly.

random_circuit(n_gates[, seed])

Generate a random circuit in the native gate set.

reserved_qubits(gate)

Return the qubits a native gate reserves while it runs.

reset_circuit(qubits)

Build the circuit resetting these qubits to \(|0\rangle\).

with_properties(*[, ...])

Return a copy of this gate set with new errors, durations or reserved qubits.