Skip to content

Supported Gates ​

Twenty named gates run natively, plus explicit unitaries and measurements. The table below is generated from the same gate table the Qiskit converter and the backend's Target read, and an executable check at the bottom of the page fails if the two ever disagree.

Native gates ​

Qiskit nameNative opcodeQubitsParametersMeaningCliffordPauli propagation
xOpcode.X10Pauli Xyesyes
yOpcode.Y10Pauli Yyesyes
zOpcode.Z10Pauli Zyesyes
hOpcode.H10Hadamardyesyes
sOpcode.S10S = √Zyesyes
sdgOpcode.Sdg10S†yesyes
tOpcode.T10T = √Snono
tdgOpcode.Tdg10T†nono
sxOpcode.SX10√Xyesyes
sxdgOpcode.SXdg10√X†yesyes
rxOpcode.RX11Rotation about Xnoyes
ryOpcode.RY11Rotation about Ynoyes
rzOpcode.RZ11Rotation about Z (RZ(θ) = diag(e^{-iθ/2}, e^{iθ/2}))noyes
pOpcode.P11Phase gate diag(1, e^{iλ})noyes
uOpcode.U13General single-qubit U(θ, φ, λ)noyes
cxOpcode.CX20Controlled-X (control, target)yesyes
czOpcode.CZ20Controlled-Zyesyes
swapOpcode.SWAP20Swapyesyes
cpOpcode.CP21Controlled phase (control, target)nono
ccxOpcode.CCX30Toffoli (control, control, target)nono
  • Clifford gates are the ones the stabilizer engine can run: x y z h s sdg sx sxdg cx cz swap.
  • Pauli propagation accepts the Clifford gates plus rz rx ry p u. It does not accept t, tdg, cp, ccx or unitaries. See Pauli Propagation.
  • The dense, MPS, tensor-network and cut strategies accept every gate in the table.

Other operations ​

OperationSupport
Unitary (explicit matrix)1 to 5 qubits; must be unitary. Any Qiskit gate with a to_matrix() on at most five qubits is lowered to one
MeasureTerminal only: no operation may follow it on the same qubit
barrier, id, delayDropped; they cannot change any output

Not supported ​

OperationResult
resetUnsupportedFeatureError
Classical control (if_test, conditional gates)UnsupportedFeatureError
Mid-circuit measurementUnsupportedFeatureError
A gate on more than 5 qubits that is not in the tableUnsupportedFeatureError; try transpile(qc, backend)
Unbound parametersInvalidCircuitError

Conventions ​

Parameters and matrices follow Qiskit. Controlled gates list controls first and the target last. See Conventions.

Verification ​

python
import re
from pathlib import Path

from menos import Opcode
from menos.qiskit._gate_table import GATE_TABLE
from menos.qiskit.target import build_target

page = Path("docs/reference/supported-gates.md").read_text(encoding="utf-8")
documented = set(re.findall(r"^\| `([a-z]+)` \| `Opcode\.(\w+)`", page, flags=re.MULTILINE))
assert documented == {(name, spec.opcode.name) for name, spec in GATE_TABLE.items()}
assert len(GATE_TABLE) == 20
assert {name for name in GATE_TABLE} <= set(build_target().operation_names)
assert sorted(m for m in dir(Opcode) if m[0].isupper()) == sorted(spec.opcode.name for spec in GATE_TABLE.values())

Released under the Apache-2.0 license. GitHub · PyPI