We're celebrating World Quantum Day 2022! Join us

cirq_ionq.ionq_devices.IonQAPIDevice

A device that uses the gates exposed by the IonQ API.

When using this device in constructing a circuit, it will convert one and two qubit gates that are not supported by the API into those supported by the API if they have a unitary matrix (support the unitary protocol).

Note that this device does not do any compression of the resulting circuit, i.e. it may result in a series of single qubit gates that could be executed using far fewer elements.

The gates supported by the API are

* <a href="https://quantumai.google/reference/python/cirq/ops/XPowGate"><code>cirq.XPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/YPowGate"><code>cirq.YPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/ZPowGate"><code>cirq.ZPowGate</code></a>
* <a href="https://quantumai.google/reference/python/cirq/ops/XXPowGate"><code>cirq.XXPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/YYPowGate"><code>cirq.YYPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/ZZPowGate"><code>cirq.ZZPowGate</code></a>
* <a href="https://quantumai.google/reference/python/cirq/ops/CNOT"><code>cirq.CNOT</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/H"><code>cirq.H</code></a>, <a href="https://quantumai.google/reference/python/cirq/ops/SWAP"><code>cirq.SWAP</code></a>
* <a href="https://quantumai.google/reference/python/cirq/ops/MeasurementGate"><code>cirq.MeasurementGate</code></a>

qubits The qubits upon which this device acts or the number of qubits. If the number of qubits, then the qubits will be cirq.LineQubits from 0 to this number minus one.
atol The absolute tolerance used for gate calculations and decompositions.

metadata Returns the associated Metadata with the device if applicable.

Methods

can_add_operation_into_moment

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

View source

THIS FUNCTION IS DEPRECATED.

IT WILL BE REMOVED IN cirq v0.15.

Use cirq_ionq.decompose_to_device operation instead.

is_api_gate

View source

qid_pairs

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

View source

THIS FUNCTION IS DEPRECATED.

IT WILL BE REMOVED IN cirq v0.15.

Use metadata.qubit_set if applicable.

validate_circuit

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

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

View source

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.