cirq.google.SerializableDevice

class cirq.google.SerializableDevice(qubits: List[cirq.Qid], gate_definitions: Dict[Type[cirq.Gate], List[cirq.google.devices.serializable_device._GateDefinition]])[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
deserialization.
__init__(qubits: List[cirq.Qid], gate_definitions: Dict[Type[cirq.Gate], List[cirq.google.devices.serializable_device._GateDefinition]])[source]

Constructor for SerializableDevice using python objects.

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

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