ionq.circuit.v0
format, as demonstrated below.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 |
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]}