cirq.NeutralAtomDevice

A device with qubits placed on a grid.

Inherits From: Device

measurement_duration the maximum duration of a measurement.
gate_duration the maximum duration of a gate
control_radius the maximum distance between qubits for a controlled gate. Distance is measured in units of the indices passed into the GridQubit constructor.
max_parallel_z The maximum number of qubits that can be acted on in parallel by a Z gate
max_parallel_xy The maximum number of qubits that can be acted on in parallel by a local XY gate
max_parallel_c the maximum number of qubits that can be acted on in parallel by a controlled gate. Must be less than or equal to the lesser of max_parallel_z and max_parallel_xy
qubits Qubits on the device, identified by their x, y location. Must be of type GridQubit

ValueError if the wrong qubit type is provided or if invalid parallel parameters are provided

metadata Returns the associated Metadata with the device if applicable.

Methods

can_add_operation_into_moment

View source

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

THIS FUNCTION IS DEPRECATED.

IT WILL BE REMOVED IN cirq v0.15.

Use cirq.ConvertToNeutralAtomGates() instead to decompose operations.

distance

View source

duration_of

View source

Provides the duration of the given operation on this device.

Args
operation the operation to get the duration of

Returns
The duration of the given operation on this device

Raises
ValueError If the operation provided doesn't correspond to a native gate

neighbors_of

View source

Returns the qubits that the given qubit can interact with.

qid_pairs

View source

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

View source

qubit_set

View source

THIS FUNCTION IS DEPRECATED.

IT WILL BE REMOVED IN cirq v0.15.

Use metadata.qubit_set if applicable.

validate_circuit

View source

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_gate

View source

Raises an error if the provided gate isn't part of the native gate set.

Args
gate the gate to validate

Raises
ValueError If the given gate is not part of the native gate set.

validate_moment

View source

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

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