cirq_ionq.ionq_devices.IonQAPIDevice

A device that uses the QIS 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/XPowGate"><code>cirq.XPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/YPowGate"><code>cirq.YPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ZPowGate"><code>cirq.ZPowGate</code></a>
* <a href="https://quantumai.google/reference/python/cirq/XXPowGate"><code>cirq.XXPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/YYPowGate"><code>cirq.YYPowGate</code></a>, <a href="https://quantumai.google/reference/python/cirq/ZZPowGate"><code>cirq.ZZPowGate</code></a>
* <a href="https://quantumai.google/reference/python/cirq/CNOT"><code>cirq.CNOT</code></a>, <a href="https://quantumai.google/reference/python/cirq/H"><code>cirq.H</code></a>, <a href="https://quantumai.google/reference/python/cirq/SWAP"><code>cirq.SWAP</code></a>
* <a href="https://quantumai.google/reference/python/cirq/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

is_api_gate

View source

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.