Wire at a time. Every gate function in this reference is imported directly from b01t and can be called inside any decorated program body. Which gates are available depends on context: exact programs (@coherent, @primitive) reject parametric rotations, while broad programs (@parametric, @adaptive) accept all gates listed here. Calling a gate outside a decorated build context raises DSLValidationError.
Gate overview
| Gate | Operation | Exact context | Compute block | Phase block |
|---|---|---|---|---|
x | Pauli-X (bit flip) | Yes | Yes | No |
h | Hadamard | Yes | No | No |
z | Pauli-Z (phase flip) | Yes | No | Yes |
s | S gate (√Z) | Yes | No | Yes |
sdg | S-dagger (S†) | Yes | No | Yes |
t | T gate (√S, π/8 rotation) | Yes | No | Yes |
tdg | T-dagger (T†) | Yes | No | Yes |
rx | X-rotation by angle θ | No | No | No |
ry | Y-rotation by angle θ | No | No | No |
rz | Z-rotation by angle θ | No | No | Yes* |
rz is allowed in broad-path phase blocks (@parametric) but is not in the exact gate set and cannot be used in @coherent or @primitive programs.
x
|0⟩ to |1⟩ and |1⟩ to |0⟩. This is the quantum analogue of a classical NOT gate.
x is self-inverse: x(x(q)) = I.
Allowed in: exact programs, compute blocks, phase blocks (no), top-level broad programs.
The target qubit wire.
h
|0⟩ to (|0⟩ + |1⟩)/√2 and |1⟩ to (|0⟩ − |1⟩)/√2, creating an equal superposition. h is self-inverse.
Allowed in: exact programs (top-level), top-level broad programs. Not allowed in compute or phase blocks — it is neither a permutation gate nor a diagonal gate.
The target qubit wire.
z
|0⟩ unchanged and maps |1⟩ to −|1⟩. z is self-inverse and is a diagonal gate.
Allowed in: exact programs, phase blocks.
The target qubit wire.
s
|1⟩, equivalent to √Z. s and sdg are inverses of each other.
Allowed in: exact programs, phase blocks.
The target qubit wire.
sdg
s. Applies a −π/2 phase to |1⟩.
Allowed in: exact programs, phase blocks.
The target qubit wire.
t
|1⟩, equivalent to √S. Together with h and cx, the T gate generates a universal gate set. t and tdg are inverses.
Allowed in: exact programs, phase blocks.
The target qubit wire.
tdg
t. Applies a −π/4 phase to |1⟩.
Allowed in: exact programs, phase blocks.
The target qubit wire.
rx
theta (in radians). Parametric — not in the exact gate set.
Allowed in: @parametric and @adaptive programs only. Raises DSLValidationError inside @coherent or @primitive.
Rotation angle in radians.
The target qubit wire.
ry
theta (in radians). Parametric — not in the exact gate set.
Allowed in: @parametric and @adaptive programs only.
Rotation angle in radians.
The target qubit wire.
rz
theta (in radians). Parametric — not in the exact gate set. rz is a diagonal gate and is allowed in broad-path phase blocks inside @parametric programs.
Allowed in: @parametric and @adaptive programs; allowed in broad-path phase blocks. Raises DSLValidationError inside @coherent or @primitive.
Rotation angle in radians.
The target qubit wire.