![]() |
A generic Pasqal device.
cirq_pasqal.pasqal_device.PasqalDevice(
qubits: Sequence[cirq.Qid]
) -> None
The most general of Pasqal devices, enforcing only restrictions expected to be shared by all future devices. Serves as the parent class of all Pasqal devices, but can also be used on its own for hosting a nearly unconstrained device. When used as a circuit's device, the qubits have to be of the type cirq.NamedQubit and assumed to be all connected, the idea behind it being that after submission, all optimization and transpilation necessary for its execution on the specified device are handled internally by Pasqal.
Args | |
---|---|
qubits (NamedQubit): Qubits on the device, exclusively unrelated to a physical position. |
Raises | |
---|---|
TypeError
|
If the wrong qubit type is provided. |
ValueError
|
If the number of qubits is greater than the devices maximum. |
Attributes | |
---|---|
maximum_qubit_number
|
|
metadata
|
Returns the associated Metadata with the device if applicable. |
supported_qubit_type
|
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.
An operation can be added if the moment with the operation added is valid.
Args | |
---|---|
operation
|
The operation being added. |
moment
|
The moment being transformed. |
Returns | |
---|---|
Whether or not the moment will validate after adding the operation. |
Raises | |
---|---|
ValueError
|
If either of the given moment or operation is invalid |
decompose_operation
decompose_operation(
operation: cirq.Operation
) -> 'cirq.OP_TREE'
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Use PasqalConverter() to decompose operation instead.
is_pasqal_device_op
is_pasqal_device_op(
op: cirq.Operation
) -> bool
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_list
qubit_list()
qubit_set
qubit_set() -> FrozenSet[cirq.Qid]
THIS FUNCTION IS DEPRECATED.
IT WILL BE REMOVED IN cirq v0.15
.
Use metadata.qubit_set() if applicable.
validate_circuit
validate_circuit(
circuit: 'cirq.AbstractCircuit'
) -> None
Raises an error if the given circuit is invalid on this device.
A circuit is invalid if any of its moments are invalid or if there is a non-empty moment after a moment with a measurement.
Args | |
---|---|
circuit
|
The circuit to validate |
Raises | |
---|---|
ValueError
|
If the given circuit can't be run on 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
)
Raises an error if the given operation is invalid on this device.
Args | |
---|---|
operation
|
The operation to validate. |
Raises | |
---|---|
ValueError
|
If the operation is not valid. |
NotImplementedError
|
If the operation is a measurement with an invert mask. |
__eq__
__eq__(
other: _SupportsValueEquality
) -> bool