> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ionq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using native gates with qBraid

> Learn how to use our hardware-native gateset to run a circuit with qBraid

<Info>
  This guide covers how to use IonQ's native gates in qBraid. To learn more
  about what the native gates are and when to use them, refer to our guide on
  [getting started with native
  gates](/guides/getting-started-with-native-gates).
</Info>

## 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 qBraid, we recommend reviewing our guides on [Getting Started with Native Gates](/guides/getting-started-with-native-gates)
and [Getting Started with qBraid](/sdks/qBraid/index). Native gates are also supported in the [IonQ API](/api-reference/v0.3/native-gates-api),
[Qiskit](/sdks/qiskit/native-gates-qiskit), [Cirq](/sdks/cirq/native-gates-cirq), and [PennyLane](/sdks/pennylane/native-gates-pennylane).

<Warning>
  This is an advanced-level feature. Using the hardware-native gate interface
  without a thorough understanding of quantum circuits is likely to result in
  less-optimal circuit structure and worse algorithmic performance overall than
  using our abstract gate interface.
</Warning>

***

## Using native gates

IonQ's native gates are incorporated as a natural extension of the OpenQASM standard library within the `qbraid[ionq]` runtime integration.
qBraid supports the following IonQ native gates:

* `gpi(phi)`
* `gpi2(phi)`
* `ms(phi0, phi1, theta=0.25)` for Aria systems (retired)
* `zz(theta)` for Forte systems

For more details about these gate definitions and parameters, refer to the [native gates guide](/guides/getting-started-with-native-gates#introducing-the-native-gates).

<Tip>
  The parameters in the IonQ native gate specification are always defined in
  *turns*, not in radians. One turn is 2π radians.
</Tip>

Native gate circuits can then be built and executed as follows:

```python theme={null}
from qbraid.runtime import IonQProvider

provider = IonQProvider(api_key="YOUR_API_KEY")

device = provider.get_device("simulator")

qasm = """
OPENQASM 3.0;
qubit[3] q;
gpi(0.5) q[0];
gpi2(0) q[1];
ms(0,0.5) q[1], q[2];
"""

job = device.run(qasm, shots=1000)
```

<Tip>
  Each quantum circuit submitted to the IonQ Cloud must use a consistent gateset
  throughout--you cannot mix and match native gates and abstract gates in the
  same circuit.
</Tip>

The `qbraid[ionq]` runtime integration does not currently support automatic transpilation from abstract to native gates, but we may add this
capability in the future. For now, we recommend following this general procedure (also described in our main [native gates guide](/guides/getting-started-with-native-gates#converting-to-native-gates))
or using a different SDK.

***

## Additional resources

* [Getting Started with Native Gates](/guides/getting-started-with-native-gates)
* [Getting Started with qBraid](/sdks/qbraid/index)
