This guide covers how to use IonQ’s native gates in Qiskit. To learn more about what the native gates are and when to use them, refer to our guide on getting started with native gates.
Introduction
Building and submitting circuits using IonQ’s hardware-native gateset enables you to bypass our compiler and optimizer, providing more control and transparency than the default abstract gateset (though often at the cost of performance and convenience). Before working with native gates in Qiskit, we recommend reviewing our guides on Getting Started with Native Gates and Getting Started with Qiskit. Native gates are also supported in the IonQ API, Cirq, and PennyLane. Note that the first few code examples in this section highlight specific components of native gate workflows. For end-to-end code snippets that you can copy-paste and run directly, skip to the full code examples section below.Building circuits with native gates
Native gate circuit construction is supported as ofv0.3.1 of the Qiskit IonQ Provider.
Gates are provided as part of the qiskit-ionq package, including:
GPIGate(phi)GPI2Gate(phi)MSGate(phi0, phi1, theta=0.25)for Aria systemsZZGate(theta)for Forte systems
circuit.append() method:
Note that Qiskit also defines MS and ZZ gates in qiskit.circuit.library, but these gates are not equivalent to the IonQ native gates. To build a circuit in IonQ native gates, make sure you’re using the gates imported from qiskit_ionq.
For a complete code example including circuit submission, skip to the full code examples below.
Transpiling a circuit to native gates
Converting a circuit to native gates with Qiskit’s transpilation is supported as ofv0.5.1 of the Qiskit IonQ Provider.
Start with the usual imports, plus Qiskit’s transpile() method:
Next, set up an IonQProvider and backend, using gateset="native". Qiskit’s transpiler can use the target gateset defined by this backend.
transpile() method and the native-gates backend to convert the circuit to IonQ’s native gateset:
Here, we can see that the Hadamard and CNOT gates in the original circuit were converted into a series of GPI2 gates and one MS gate.
For a complete code example including circuit submission, skip to the full code examples below.
Submitting a circuit that uses native gates
Whether you built a circuit in native gates originally, or you built a circuit in abstract gates and transpiled it with Qiskit, you’ll need to submit it to an IonQ backend that was set up with the native gateset. Circuits submitted this way will bypass IonQ’s compiler and optimizer. Set up an IonQ backend and specify the native gateset: here, we’ll use the ideal simulator, but you can also use the noisy simulator or an IonQ QPU. This tells the backend to expect circuits defined in native gates, and to bypass IonQ’s compiler and optimizer. With the default setting,gateset="qis", the backend will expect circuits defined in abstract gates.
qc_native, either by building it in native gates directly or building it in abstract gates and then transpiling it, you can submit it to the native gate backend:

