Getting Started with Qumat
Installation
Install Qumat from PyPI:
pip install qumat
Install with QDP (Quantum Data Plane) support:
pip install qumat[qdp]
QDP (the qdp extra) requires Python 3.10-3.12 and is not available on Python 3.13.
From Source (Development)
For development or the latest changes, use uv:
git clone https://github.com/apache/mahout.git
cd mahout
pip install uv
uv sync # Core Qumat
uv sync --python '>=3.10,<3.13' --extra qdp # With QDP (NVIDIA GPU + CUDA; QDP needs Python 3.10-3.12)
:::note Why uv?
The repository commits a uv.lock, so uv sync gives a reproducible development environment across Python 3.10-3.13.
:::
Basic Usage
from qumat import QuMat
qumat = QuMat({
"backend_name": "qiskit",
"backend_options": {"simulator_type": "aer_simulator"},
})
qumat.create_empty_circuit(num_qubits=2)
qumat.apply_hadamard_gate(0)
qumat.apply_cnot_gate(0, 1)
result = qumat.execute_circuit()
print(result)
Choosing a simulator
backend_options["simulator_type"] selects the simulator. Each backend
accepts the values below; anything else raises a ValueError that lists
them.
backend_name | simulator_type |
|---|---|
"qiskit" (required) | "aer_simulator", "statevector_simulator", "qasm_simulator", "unitary_simulator", or any Aer method name such as "matrix_product_state" |
"cirq" | "default" (or omit it) |
"amazon_braket" | "local" (offline simulator, no AWS account), or "default" / omitted (the AWS SV1 managed simulator; needs AWS credentials and a region) |
Dependencies
Prior to installation, ensure Python 3.10-3.13 is installed. Dependencies such as Qiskit, Cirq, and Amazon Braket SDK are managed automatically. QDP (the qdp extra) requires Python 3.10-3.12 and is not available on Python 3.13.
Apache Release
Official source releases are available at apache.org/dist/mahout.
To verify the integrity of a downloaded release:
gpg --import KEYS
gpg --verify mahout-qumat-0.5.zip.asc mahout-qumat-0.5.zip
Examples
Refer to repository examples:
examples/Simple_Example.ipynbexamples/Optimization_Example.ipynb