For the best results, please submit quantum programs in the ionq.circuit.v0
format, as demonstrated below.
In the compilation and optimization process, your submitted circuit will be converted to an equivalent, optimized circuit expressed in terms of IonQ’s native gates, which may involve combining or canceling out some operations. If you wish to guarantee that the quantum computer executes the exact series of operations that you define, you can submit a circuit using our native gates, which will bypass our compiler.
For more examples and the full API specification for defining circuits, refer to the API reference.
To write a quantum program using Qiskit or another SDK, refer to our SDK guides.
We can create a maximally entangled Bell state by applying a Hadamard gate to a single qubit, and applying a controlled-not gate to a second qubit.
Half of the time the second qubit will be measured as , the other half will be measured as .
We can create a three qubit GHZ state by first applying a Hadamard gate to a single qubit, and then using it as the control qubit for a series of controlled-not gates.
The Toffoli gate, or controlled-controlled-not gate, is a universal reversible logic gate. We can simply apply a cnot to our target qubit, with two control qubits provided via array.
For actual execution, gates will be compiled into optimal operations for our trapped ion hardware. For convenience, we provide a more expressive gateset for programming.
We accept these gates as well as their controlled and multi-controlled variants:
Gate | Description |
---|---|
x | Pauli X gate |
y | Pauli Y gate |
z | Pauli Z gate |
rx | X-axis rotation |
ry | Y-axis rotation |
rz | Z-axis rotation |
h | Hadamard gate |
not | Convenient alias for Pauli-X gate |
cnot | Convenient alias for controlled-not gate |
s | S gate |
si | Conjugate transpose of S gate |
t | T gate |
ti | Conjugate transpose of T gate |
v | Square root of not gate |
vi | Conjugate transpose of square-root-of-not gate |
swap | Swaps two qubits |
Each operation in a circuit specifies a gate
and a target
qubit index (or a list of multiple targets
). Rotation gates also specify a rotation
in radians.
In addition, any gate can be expressed as a controlled gate by specifying a control
qubit, or as its multi-controlled variant by specifying a list of up to seven controls
(for any gate except swap
). This can often be used to simplify the circuit’s description. In general, circuits expressed in fewer QIS gates will be further optimized for runtime, so using multi-controlled variants of gates is recommended.
Examples:
{"gate": "h", "target": 0}
{"gate": "cnot", "target": 1, "control": 0}
{"gate": "cnot", "target": 0, "controls": [1, 2]}
{"gate": "rx", "target": 0, "rotation": 1.5708}
{"gate": "swap", "targets": [0,1]}
For more examples and the full API specification for defining circuits, refer to the API reference.
For information about writing quantum programs using IonQ’s hardware-native gate set, refer to our guides on getting started with native gates and using native gates with the IonQ API.
Support for submitting programs in QASM/OpenQASM and Quipper is currently experimental. If you use these languages, we will compile your code to a logically-equivalent representation using our supported gates. (For billing purposes, we’ll calculate your program’s resource requirements after it’s been compiled this way.)
Is there a language format you’d like to see supported? Drop us a line and let us know.
For the best results, please submit quantum programs in the ionq.circuit.v0
format, as demonstrated below.
In the compilation and optimization process, your submitted circuit will be converted to an equivalent, optimized circuit expressed in terms of IonQ’s native gates, which may involve combining or canceling out some operations. If you wish to guarantee that the quantum computer executes the exact series of operations that you define, you can submit a circuit using our native gates, which will bypass our compiler.
For more examples and the full API specification for defining circuits, refer to the API reference.
To write a quantum program using Qiskit or another SDK, refer to our SDK guides.
We can create a maximally entangled Bell state by applying a Hadamard gate to a single qubit, and applying a controlled-not gate to a second qubit.
Half of the time the second qubit will be measured as , the other half will be measured as .
We can create a three qubit GHZ state by first applying a Hadamard gate to a single qubit, and then using it as the control qubit for a series of controlled-not gates.
The Toffoli gate, or controlled-controlled-not gate, is a universal reversible logic gate. We can simply apply a cnot to our target qubit, with two control qubits provided via array.
For actual execution, gates will be compiled into optimal operations for our trapped ion hardware. For convenience, we provide a more expressive gateset for programming.
We accept these gates as well as their controlled and multi-controlled variants:
Gate | Description |
---|---|
x | Pauli X gate |
y | Pauli Y gate |
z | Pauli Z gate |
rx | X-axis rotation |
ry | Y-axis rotation |
rz | Z-axis rotation |
h | Hadamard gate |
not | Convenient alias for Pauli-X gate |
cnot | Convenient alias for controlled-not gate |
s | S gate |
si | Conjugate transpose of S gate |
t | T gate |
ti | Conjugate transpose of T gate |
v | Square root of not gate |
vi | Conjugate transpose of square-root-of-not gate |
swap | Swaps two qubits |
Each operation in a circuit specifies a gate
and a target
qubit index (or a list of multiple targets
). Rotation gates also specify a rotation
in radians.
In addition, any gate can be expressed as a controlled gate by specifying a control
qubit, or as its multi-controlled variant by specifying a list of up to seven controls
(for any gate except swap
). This can often be used to simplify the circuit’s description. In general, circuits expressed in fewer QIS gates will be further optimized for runtime, so using multi-controlled variants of gates is recommended.
Examples:
{"gate": "h", "target": 0}
{"gate": "cnot", "target": 1, "control": 0}
{"gate": "cnot", "target": 0, "controls": [1, 2]}
{"gate": "rx", "target": 0, "rotation": 1.5708}
{"gate": "swap", "targets": [0,1]}
For more examples and the full API specification for defining circuits, refer to the API reference.
For information about writing quantum programs using IonQ’s hardware-native gate set, refer to our guides on getting started with native gates and using native gates with the IonQ API.
Support for submitting programs in QASM/OpenQASM and Quipper is currently experimental. If you use these languages, we will compile your code to a logically-equivalent representation using our supported gates. (For billing purposes, we’ll calculate your program’s resource requirements after it’s been compiled this way.)
Is there a language format you’d like to see supported? Drop us a line and let us know.