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.

Ideal trapped-ion simulator

The SimulatorDevice provides an ideal noiseless 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))

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="harmony", 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.