|View source on GitHub|
A device whose properties are represented by an edge-labelled graph.
cirq.contrib.graph_device.UndirectedGraphDevice( device_graph: Optional[
cirq.contrib.graph_device.UndirectedHypergraph] = None, crosstalk_graph: Optional[
cirq.contrib.graph_device.UndirectedHypergraph] = None ) -> None
Each (undirected) edge of the device graph is labelled by an UndirectedGraphDeviceEdge or None. None indicates that any operation is allowed and has zero duration.
Each (undirected) edge of the constraint graph is labelled either by a function or None. The function takes as arguments operations on the adjacent device edges and raises an error if they are not simultaneously executable. If None, no such operations are allowed.
* the crosstalk graph is allowed to have vertices (i.e. device edges) that do not exist in the graph device. * duration_of does not check that operation is valid.
can_add_operation_into_moment( operation: "cirq.Operation", moment: "cirq.Moment" ) -> bool
Determines if it's possible to add an operation into a moment.
For example, on the XmonDevice two CZs shouldn't be placed in the same moment if they are on adjacent qubits.
||The operation being added.|
||The moment being transformed.|
|Whether or not the moment will validate after adding the operation.|
decompose_operation( operation: "cirq.Operation" ) -> "cirq.OP_TREE"
Returns a device-valid decomposition for the given operation.
This method is used when adding operations into circuits with a device specified, to avoid spurious failures due to e.g. using a Hadamard gate that must be decomposed into native gates.
qubit_set() -> FrozenSet['cirq.Qid']
Returns a set or frozenset of qubits on the device, if possible.
If the device has a finite set of qubits, then a set or frozen set
of all qubits on the device is returned.
If the device has no well defined finite set of qubits (e.g.
validate_circuit( circuit: "cirq.Circuit" ) -> None
Raises an exception if a circuit is not valid.
||The circuit to validate.|
||The circuit isn't valid for this device.|
cirq.ops.Operation, other_operations: Iterable[
cirq.ops.Operation] ) -> None
Raises an exception if a moment is not valid.
||The moment to validate.|
||The moment isn't valid for this device.|
cirq.ops.Operation) -> None
Raises an exception if an operation is not valid.
||The operation to validate.|
||The operation isn't valid for this device.|
__add__( other )
__eq__( other )