QM QUA SDK
raw JSON → 1.2.6 verified Mon Apr 27 auth: no python
SDK for writing and executing QUA programs to control quantum processors on Quantum Machines hardware. Current version 1.2.6, requires Python <3.13. Released monthly.
pip install qm-qua Common errors
error ModuleNotFoundError: No module named 'qm' ↓
cause Installed wrong package 'qm' instead of 'qm-qua'.
fix
Run: pip uninstall qm && pip install qm-qua
error AttributeError: module 'qm' has no attribute 'QuantumMachine' ↓
cause Import path is wrong; QuantumMachine is not a submodule.
fix
Use: from qm import QuantumMachine
error ImportError: cannot import name 'Program' from 'qm' ↓
cause Program is in the QUA subpackage, not top-level qm.
fix
Use: from qm.qua import Program
Warnings
breaking Major API change between 0.x and 1.0: QuantumMachine now requires a config object; Program uses context manager; controllers removed. ↓
fix Upgrade scripts: replace old 'qm.QuantumMachine(host, port)' with 'QuantumMachine(config, simulate=True)' and wrap programs in 'with Program():'.
gotcha Do not use pip install qm alone; that installs an unrelated package. Always use qm-qua. ↓
fix Run 'pip uninstall qm' and 'pip install qm-qua'.
deprecated ConfigBuilder is deprecated since 1.0. Use SimulationConfig directly. ↓
fix Replace 'ConfigBuilder().build()' with 'SimulationConfig(duration=...)'.
gotcha Python version must be <3.13; does not support 3.13+. ↓
fix Use Python 3.9–3.12. Check with 'python --version'.
Imports
- QuantumMachine wrong
from qm.QuantumMachine import QuantumMachinecorrectfrom qm import QuantumMachine - Program wrong
from qm.Program import Programcorrectfrom qm.qua import Program - ConfigBuilder
from qm import SimulationConfig
Quickstart
from qm import QuantumMachine, SimulationConfig
from qm.qua import Program, play, amp
import numpy as np
# Minimal program
with Program() as prog:
play('pulse', amp(0.5) * np.array([1+j for j in range(1024)]))
# Simulate
config = SimulationConfig(duration=1000)
qm = QuantumMachine(config=config, simulate=True)
job = qm.execute(prog)
res = job.get_results()