IonQ Devices

The PennyLane-IonQ plugin provides the ability for PennyLane to access devices available via IonQ’s online API.

Currently, access is available to two remote devices: one to access an ideal trapped-ion simulator and another to access to IonQ’s trapped-ion QPUs.

Trapped-ion simulator

The SimulatorDevice provides a trapped-ion simulation. Once the plugin has been installed, you can use this device directly in PennyLane by specifying "ionq.simulator":

import pennylane as qml
from pennylane_ionq import ops

dev = qml.device("ionq.simulator", wires=2)

@qml.qnode(dev)
def circuit(x, y, z):
    qml.RX(w, wires=0)
    ops.YY(y, wires=[0,1])
    ops.ZZ(z, wires=[0,1])
    return qml.expval(qml.PauliZ(0))

Hardware noise model simulation

The simulator supports hardware-aware noise models that approximate the noise characteristics of IonQ’s trapped-ion QPUs. To enable a noise model, pass the noise_model parameter:

dev = qml.device("ionq.simulator", wires=2, noise_model="aria-1")

Available noise models are "ideal" (default, noiseless), "harmony", "aria-1", "aria-2", "forte-1", and "forte-enterprise-1". For reproducible results, you can also set a noise_seed:

dev = qml.device("ionq.simulator", wires=2, noise_model="aria-1", noise_seed=42)

See the IonQ noise model documentation for details on each noise model.

Trapped-Ion QPU

The QPUDevice provides access to IonQ’s trapped-ion QPUs. Once the plugin has been installed, you can use this device directly in PennyLane by specifying "ionq.qpu" with a "backend" from available backends:

import pennylane as qml
from pennylane_ionq import ops

dev = qml.device("ionq.qpu", backend="aria-1", wires=2)

@qml.qnode(dev)
def circuit(x, y):
    qml.XX(x, wires=[0, 1])
    ops.YY(y, wires=[0, 1])
    return qml.expval(qml.PauliZ(0))

Both devices support the same set of operations.

IonQ Operations

PennyLane-IonQ provides three gates specific to IonQ’s ion-trap API:

XX(phi, wires)

The Ising XX gate.

YY(phi, wires)

The Ising YY gate.

ZZ(phi, wires)

The Ising ZZ gate.

These three gates can be imported from pennylane_ionq.ops.

Remote backend access

Access credentials will be needed for the IonQ platform in order to use these remote devices. These credentials should be provided to PennyLane via a configuration file or environment variable. Specifically, the variable IONQ_API_KEY must contain a valid access key for IonQ’s online platform.