A Pasqal virtual device with qubits in 3d.
Inherits From: PasqalDevice
, Device
cirq.pasqal.PasqalVirtualDevice(
control_radius: float,
qubits: Sequence[Union[ThreeDQubit, GridQubit, LineQubit]]
) -> None
Used in the notebooks
A virtual representation of a Pasqal device, enforcing the constraints
typically found in a physical device. The qubits can be positioned in 3d
space, although 2d layouts will be supported sooner and are thus
recommended. Only accepts qubits with physical placement.
Args |
control_radius
|
the maximum distance between qubits for a controlled
gate. Distance is measured in units of the coordinates passed
into the qubit constructor.
|
qubits
|
Qubits on the device, identified by their x, y, z position.
Must be of type ThreeDQubit, TwoDQubit, LineQubit or GridQubit.
|
Raises |
ValueError
|
if the wrong qubit type is provided or if invalid
parameter is provided for control_radius.
|
Attributes |
maximum_qubit_number
|
|
supported_qubit_type
|
|
Methods
can_add_operation_into_moment
View source
can_add_operation_into_moment(
operation: cirq.ops.Operation
,
moment: cirq.ops.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
View source
decompose_operation(
operation: cirq.ops.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.
distance
View source
distance(
p: Any,
q: Any
) -> float
Returns the distance between two qubits.
Args |
p
|
qubit involved in the distance computation
|
q
|
qubit involved in the distance computation
|
Raises |
ValueError
|
If p or q not part of the device
|
Returns |
The distance between qubits p and q.
|
is_pasqal_device_op
View source
is_pasqal_device_op(
op: cirq.ops.Operation
) -> bool
minimal_distance
View source
minimal_distance() -> float
Returns the minimal distance between two qubits in qubits.
Args |
qubits
|
qubit involved in the distance computation
|
Raises |
ValueError
|
If the device has only one qubit
|
Returns |
The minimal distance between qubits, in spacial coordinate units.
|
qubit_list
View source
qubit_list()
qubit_set
View source
qubit_set() -> FrozenSet[cirq.ops.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.
cirq.UnconstrainedDevice has this property), then None is
returned.
|
validate_circuit
View source
validate_circuit(
circuit: "cirq.Circuit"
) -> 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
View source
validate_moment(
moment: cirq.ops.Moment
)
Raises an error if the given moment is invalid on this device.
Args |
moment
|
The moment to validate.
|
Raises |
ValueError
|
If the given moment is invalid.
|
validate_operation
View source
validate_operation(
operation: cirq.ops.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
|
__eq__
View source
__eq__(
other: _SupportsValueEquality
) -> bool
__ne__
View source
__ne__(
other: _SupportsValueEquality
) -> bool