![]() |
A device that contains only acquaintance and permutation gates.
Inherits From: Device
Methods
can_add_operation_into_moment
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.
Args | |
---|---|
operation
|
The operation being added. |
moment
|
The moment being transformed. |
Returns | |
---|---|
Whether or not the moment will validate after adding the operation. |
decompose_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
qubit_set() -> Optional[AbstractSet['cirq.Qid']]
Returns a set or frozenset of qubits on the device, if possible.
Returns | |
---|---|
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
validate_circuit(
circuit: "cirq.Circuit"
) -> None
Raises an exception if a circuit is not valid.
Args | |
---|---|
circuit
|
The circuit to validate. |
Raises | |
---|---|
ValueError
|
The circuit isn't valid for this device. |
validate_moment
validate_moment(
moment: "cirq.Moment"
) -> None
Raises an exception if a moment is not valid.
Args | |
---|---|
moment
|
The moment to validate. |
Raises | |
---|---|
ValueError
|
The moment isn't valid for this device. |
validate_operation
validate_operation(
operation: "cirq.Operation"
) -> None
Raises an exception if an operation is not valid.
Args | |
---|---|
operation
|
The operation to validate. |
Raises | |
---|---|
ValueError
|
The operation isn't valid for this device. |
Class Variables | |
---|---|
gate_types |