PennyLane plugin for the Maestro quantum simulator by Qoro Quantum
Project description
pennylane-maestro
A PennyLane plugin for the Maestro quantum simulator by Qoro Quantum.
Run your PennyLane circuits on Maestro's high-performance C++ backend — drop-in, one-line device change, no code rewrite.
Performance Highlights
Benchmarked on PennyLane 0.44.1. Run
examples/benchmark_lightning_vs_maestro.pyto reproduce.
Statevector — Variational Circuit (analytic, ⟨Z₀⟩)
| Qubits | default.qubit |
lightning.qubit |
maestro.qubit |
vs dq | vs lq |
|---|---|---|---|---|---|
| 20 | 977 ms | 115 ms | 45 ms | 22× | 2.6× |
| 22 | 4.31 s | 543 ms | 184 ms | 23× | 3.0× |
| 24 | 10.5 s | 2.36 s | 820 ms | 13× | 2.9× |
| 26 | DNF | 10.1 s | 3.56 s | ∞ | 2.8× |
MPS — Scaling to 1000 Qubits (analytic, bond dim = 128)
| Qubits | default.qubit |
default.tensor (quimb) |
maestro.qubit (MPS) |
vs quimb |
|---|---|---|---|---|
| 100 | OOM | 90 ms | 11 ms | 8× |
| 500 | OOM | 689 ms | 90 ms | 7.7× |
| 1000 | OOM | 1.96 s | 207 ms | 9.5× |
MPS Shot Sampling — 10,000 shots (only Maestro supports this)
| Qubits | maestro.qubit (MPS) |
Unique Samples |
|---|---|---|
| 100 | 259 ms | 10,000 |
| 500 | 1.22 s | 10,000 |
| 1000 | 2.43 s | 10,000 |
Neither
default.tensornor Qiskit Aer MPS support shot-based sampling through PennyLane.
Installation
pip install pennylane-maestro
This automatically installs pennylane (≥0.38) and qoro-maestro (≥0.2.8).
Quick Start
import pennylane as qml
import numpy as np
dev = qml.device("maestro.qubit", wires=2)
@qml.qnode(dev)
def circuit(theta):
qml.RX(theta, wires=0)
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(1))
result = circuit(np.pi / 4)
print(result)
Switching Backends
All backends are selected via keyword arguments to qml.device:
# ── CPU Statevector (default) ──
dev = qml.device("maestro.qubit", wires=20)
# ── GPU Statevector ──
dev = qml.device("maestro.qubit", wires=20, simulator_type="Gpu")
# ── GPU with Double Precision ──
dev = qml.device("maestro.qubit", wires=20,
simulator_type="Gpu", use_double_precision=True)
# ── MPS for 100+ qubits ──
dev = qml.device("maestro.qubit", wires=100,
simulation_type="MatrixProductState",
max_bond_dimension=256)
# ── Stabilizer for Clifford circuits ──
dev = qml.device("maestro.qubit", wires=1000,
simulation_type="Stabilizer")
# ── Finite shots ──
dev = qml.device("maestro.qubit", wires=10, shots=10_000)
Available Options
simulator_type |
Description |
|---|---|
"QCSim" |
Qoro's optimised CPU simulator (default) |
"Gpu" |
CUDA-accelerated GPU simulator |
"CompositeQCSim" |
Multi-node distributed CPU |
"QuestSim" |
QuEST-based reference simulator |
simulation_type |
Description |
|---|---|
"Statevector" |
Full statevector (default) |
"MatrixProductState" |
MPS / tensor-train for large qubit counts |
"Stabilizer" |
Clifford-only stabilizer |
"TensorNetwork" |
General tensor network |
"PauliPropagator" |
Pauli propagation |
"ExtendedStabilizer" |
Extended stabilizer |
Hamiltonian VQE Example
Hamiltonians are evaluated natively via Maestro's batched estimate() — all Pauli terms in a single C++ call:
import pennylane as qml
import numpy as np
n_qubits = 20
H = qml.Hamiltonian(
[0.5] * (n_qubits - 1) + [0.3] * n_qubits,
[qml.PauliZ(i) @ qml.PauliZ(i+1) for i in range(n_qubits - 1)] +
[qml.PauliX(i) for i in range(n_qubits)]
)
dev = qml.device("maestro.qubit", wires=n_qubits)
@qml.qnode(dev, diff_method="parameter-shift")
def vqe_circuit(params):
for i in range(n_qubits):
qml.RY(params[i], wires=i)
for i in range(n_qubits - 1):
qml.CNOT(wires=[i, i + 1])
return qml.expval(H)
params = np.random.random(n_qubits)
energy = vqe_circuit(params)
gradient = qml.grad(vqe_circuit)(params)
Supported Operations
The plugin delegates execution to Maestro. If you use an operation not directly implemented in Maestro (e.g. Rot), PennyLane automatically decomposes it into supported gates.
GPU Acceleration
Maestro supports CUDA-accelerated simulation via a dynamically-loaded GPU backend.
Note: The GPU backend is not included in the open-source version of Maestro. Contact Qoro Quantum for access to the GPU release bundle and a license key.
Setup
-
Obtain the GPU release bundle from Qoro Quantum (team@qoroquantum.de). It contains:
libmaestro_gpu_simulators.so— the GPU simulator librarylibLexActivator.so— license validation library
-
Install the libraries into your environment:
cp libmaestro_gpu_simulators.so $CONDA_PREFIX/lib/ cp libLexActivator.so $CONDA_PREFIX/lib/
-
Set your license key (provided by Qoro Quantum):
export MAESTRO_LICENSE_KEY="XXXX-XXXX-XXXX-XXXX"
To persist across sessions:
echo 'export MAESTRO_LICENSE_KEY="XXXX-XXXX-XXXX-XXXX"' >> ~/.bashrc source ~/.bashrc
The first run requires an internet connection for license activation. After that, the license is cached locally for 30 days of offline use.
-
Use the GPU device in PennyLane:
import maestro import pennylane as qml # Initialize GPU backend (required once per session) assert maestro.init_gpu(), "GPU init failed — check library path and CUDA install" # GPU Statevector dev = qml.device("maestro.qubit", wires=28, simulator_type="Gpu", use_double_precision=True) # GPU MPS for large circuits dev_mps = qml.device("maestro.qubit", wires=200, simulator_type="Gpu", simulation_type="MatrixProductState", max_bond_dimension=256)
GPU-Supported Simulation Modes
| Simulation Type | GPU Support |
|---|---|
| Statevector | ✅ |
| MPS | ✅ |
| Tensor Network | ✅ |
| Pauli Propagator | ✅ |
| Stabilizer | ❌ |
| Extended Stabilizer | ❌ |
Requirements: Linux with NVIDIA GPU (Ampere/Hopper recommended), CUDA 13.0+, and cuQuantum (
conda install -c conda-forge cuquantum).
Authors & License
Maintained by Qoro Quantum (team@qoroquantum.de).
Licensed under GPL-3.0. See the LICENSE file for more details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pennylane_maestro-0.1.0.tar.gz.
File metadata
- Download URL: pennylane_maestro-0.1.0.tar.gz
- Upload date:
- Size: 29.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7394dee2fbea33f16554f333e4433391c36bcf14b21a79607cb6bc3d61524017
|
|
| MD5 |
4a87cd8acecdc23f064999fbab701bea
|
|
| BLAKE2b-256 |
16287fbddab4c927771b810feca184a2c02e4a849fba25118339b97b895ea28b
|
Provenance
The following attestation bundles were made for pennylane_maestro-0.1.0.tar.gz:
Publisher:
publish.yml on QoroQuantum/pennylane-maestro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_maestro-0.1.0.tar.gz -
Subject digest:
7394dee2fbea33f16554f333e4433391c36bcf14b21a79607cb6bc3d61524017 - Sigstore transparency entry: 1236540124
- Sigstore integration time:
-
Permalink:
QoroQuantum/pennylane-maestro@44d9f9ed3574a074d4ed2c5ef578ee7b7b9cdcf9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QoroQuantum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@44d9f9ed3574a074d4ed2c5ef578ee7b7b9cdcf9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pennylane_maestro-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pennylane_maestro-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
076bd9c47a516799b5376999875997c08251dd277e685a2c03d4eaacc17d80a5
|
|
| MD5 |
349765073625865a5a352f4cf28137de
|
|
| BLAKE2b-256 |
26c8b202de64f14ddb88ce0a49189107235b3317549a48346c4a60cc0f68444f
|
Provenance
The following attestation bundles were made for pennylane_maestro-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on QoroQuantum/pennylane-maestro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pennylane_maestro-0.1.0-py3-none-any.whl -
Subject digest:
076bd9c47a516799b5376999875997c08251dd277e685a2c03d4eaacc17d80a5 - Sigstore transparency entry: 1236540137
- Sigstore integration time:
-
Permalink:
QoroQuantum/pennylane-maestro@44d9f9ed3574a074d4ed2c5ef578ee7b7b9cdcf9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/QoroQuantum
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@44d9f9ed3574a074d4ed2c5ef578ee7b7b9cdcf9 -
Trigger Event:
workflow_dispatch
-
Statement type: