class List[cirq.Qid], gate_definitions: Dict[Type[cirq.Gate], List[]])[source]

Device object generated from a device specification proto.

Given a device specification proto and a gate_set to translate the
serialized gate_ids to cirq Gates, this will generate a Device that can
verify operations and circuits for the hardware specified by the device.
Expected usage is through constructing this class through a proto using
the static function call from_proto().
This class only supports GridQubits and NamedQubits. NamedQubits with names
that conflict (such as “4_3”) may be converted to GridQubits on
__init__(qubits: List[cirq.Qid], gate_definitions: Dict[Type[cirq.Gate], List[]])[source]

Constructor for SerializableDevice using python objects.

Note that the preferred method of constructing this object is through
the static from_proto() call.
  • qubits – A list of valid Qid for the device.

  • gate_definitions – Maps cirq gates to device properties for that gate.


can_add_operation_into_moment(operation, moment)

Determines if it’s possible to add an operation into a moment.


Returns a device-valid decomposition for the given operation.


from_proto(proto, gate_sets)

param proto

A proto describing the qubits on the device, as well as the


Returns a set or frozenset of qubits on the device, if possible.


Raises an exception if a circuit is not valid.


Raises an exception if a moment is not valid.


Raises an exception if an operation is not valid.