![]() |
A cirq.Qid supporting Rigetti QCS Aspen device topology.
cirq_rigetti.aspen_device.RigettiQCSAspenDevice(
isa: Union[InstructionSetArchitecture, Dict[str, Any]]
) -> None
Args | |
---|---|
isa
|
The InstructionSetArchitecture retrieved from the QCS api.
|
Raises | |
---|---|
UnsupportedRigettiQCSQuantumProcessor
|
If the isa does not define an Aspen device. |
Attributes | |
---|---|
metadata
|
Returns the associated Metadata with the device if applicable. |
qubit_topology
|
Return qubit topology indices with nx.Graph. |
Methods
can_add_operation_into_moment
can_add_operation_into_moment(
operation: 'cirq.Operation', moment: 'cirq.Moment'
) -> bool
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
can_add_operation_into_moment will be removed in the future. Consider using device.validate_circuit instead.
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'
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Devices will no longer decompose operations.
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.
qid_pairs
qid_pairs() -> Optional[FrozenSet['cirq.SymmetricalQidPair']]
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
qubit coupling data can now be found in device.metadata if provided.
Returns a set of qubit edges on the device, if possible.
This property can be overridden in child classes for special handling.
The default handling is: GridQids and LineQids will have neighbors as
edges, and others will be fully connected.
Returns:
If the device has a finite set of qubits, then a set of all edges
on the device is returned.
If the device has no well defined finite set of qubits (e.g.
`cirq.UnconstrainedDevice` has this property), then `None` is
returned.
qubit_set
qubit_set() -> Optional[AbstractSet['cirq.Qid']]
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Use metadata.qubit_set if applicable.
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.
`cirq.UnconstrainedDevice` has this property), then `None` is
returned.
qubits
qubits() -> List['AspenQubit']
Return list of AspenQubit
s within device topology.
Returns | |
---|---|
List of AspenQubit s within device topology.
|
validate_circuit
validate_circuit(
circuit: 'cirq.AbstractCircuit'
) -> 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 does not satisfy the topological constraints of the device.
Note, in case the operation is invalid, you can still use the Quil compiler to rewire qubits and decompose the operation to this device's topology.
Additionally, this method will not attempt to decompose the operation into this device's native gate set. This integration, by default, uses the Quil compiler to do so.
Please see the Quil Compiler documentation for more information.
Args | |
---|---|
operation
|
The operation to validate. |
Raises | |
---|---|
UnsupportedRigettiQCSOperation
|
The operation isn't valid for this device. |
validate_qubit
validate_qubit(
qubit: 'cirq.Qid'
) -> None
Raises an exception if the qubit does not satisfy the topological constraints of the RigettiQCSAspenDevice.
Args | |
---|---|
qubit
|
The qubit to validate. |
Raises | |
---|---|
UnsupportedQubit
|
The operation isn't valid for this device. |
__eq__
__eq__(
other: _SupportsValueEquality
) -> bool