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_gatereplaces 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 aGateasnative_gateslists 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 likegate_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 likegate_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
Return the duration of every native gate that has one. |
|
Return the error of every native gate that has one. |
|
Return the native gates supported by the gate set. |
|
Return where a native entangler sits, and which one. |
|
Return the qubits every native gate reserves while it runs. |
|
Return the |
|
Return the qubits the device resets and reads out together, or |
|
Return the qubit set every native entangling gate can be built on. |
Methods
|
Return a native gate's duration, or |
|
Return a native gate's average gate infidelity on its own qubits, or |
|
Rewrite a circuit's resets as the resets the device performs. |
|
Return the native readout a requested Pauli string is realized through by default. |
Return every Pauli string the hardware reads out directly. |
|
|
Generate a random circuit in the native gate set. |
|
Return the qubits a native gate reserves while it runs. |
|
Build the circuit resetting these qubits to \(|0\rangle\). |
|
Return a copy of this gate set with new errors, durations or reserved qubits. |