MachineModel
- class MachineModel(num_qudits, coupling_graph=None, gate_set=None, radixes=[])[source]
Bases:
object
A model of a quantum processing unit.
- __init__(num_qudits, coupling_graph=None, gate_set=None, radixes=[])[source]
MachineModel Constructor.
- Parameters:
num_qudits (
int
) – The total number of qudits in the machine.coupling_graph (
Iterable[tuple[int, int]] | None
) – A coupling graph describing which pairs of qudits can interact. Given as an undirected edge set. If left as None, then an all-to-all coupling graph is used as a default. (Default: None)gate_set (
GateSetLike | None
) – The native gate set available on the machine. If left as None, the default gate set will be used. Seedefault_gate_set()
.radixes (
Sequence[int]
) – A sequence with its length equal to num_qudits. Each element specifies the base of a qudit. Defaults to qubits.
- Raises:
ValueError – If num_qudits is nonpositive.
Note
Pre-built models for many active QPUs exist in the
ext
package.
Methods
get_locations
(block_size)Return all block_size connected blocks of qudit indicies.
is_compatible
(circuit[, placement])Check if a circuit is compatible with this model.