Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Qiskit

pip install "qirc[qiskit]"
from qiskit import transpile

compiled = transpile(circuit, basis_gates=["rz", "sx", "x", "cx"], optimization_level=3, optimization_method="qirc")

optimization_method="qirc" runs Qiskit’s own optimization stage and then passes the circuit through qirc at the same level, keeping qirc’s result only when it has fewer two qubit gates, or as many and fewer gates overall. Circuits with control flow are left to Qiskit. qirc.qiskit.optimize(circuit, basis, level) applies the same step to a single circuit.