|
Maestro 0.3.1
Unified interface for quantum circuit simulation
|
Install pre-built binary wheels from PyPI (Linux, macOS, Windows):
Or build from source from the repository root:
Supported platforms (pre-built wheels):
| Platform | Architecture | Python |
|---|---|---|
| Linux | x86_64 | 3.10, 3.11, 3.12 |
| macOS | arm64 (Apple Silicon) | 3.10, 3.11, 3.12 |
| Windows | AMD64 | 3.10, 3.11, 3.12 |
All execution and estimation functions accept a SimulatorConfig object that bundles every simulator knob into a single, reusable value. Create one config and pass it to every call — no need to repeat simulator_type, simulation_type, max_bond_dimension, etc.
| Parameter | Type | Default | Description |
|---|---|---|---|
| simulator_type | SimulatorType | QCSim | Simulation backend |
| simulation_type | SimulationType | Statevector | Simulation method |
| max_bond_dimension | int or None | None | MPS bond dimension limit |
| singular_value_threshold | float or None | None | MPS truncation threshold |
| truncation_mode | str or None | None (backend default: "discarded_weight") | How singular_value_threshold is interpreted: "discarded_weight" (Qiskit Aer/ITensor convention — discard the smallest singular values until their cumulative squared weight reaches the threshold) or "relative_max" (discard singular values below threshold * sigma_max). Only the QCSim and GPU backends support "relative_max"; Aer raises ValueError if it's requested. |
| use_double_precision | bool | False | GPU double precision flag |
| disable_optimized_swapping | bool | False | Disable MPS swap optimization |
| lookahead_depth | int | -1 | Swap optimization lookahead depth |
| mps_measure_no_collapse | bool | True | Use probability-based MPS sampling |
| seed | int or None | None | Seed all backend and Maestro sampling RNGs. Parallel jobs derive deterministic, distinct child streams. |
The fastest way to run a circuit is maestro.simple_execute. Pass an OpenQASM 2.0 string and get measurement counts back immediately.
Result Dictionary Schema:
| Key | Type | Description |
|---|---|---|
| counts | dict[str, int] | Measurement outcome -> count |
| simulator | int | Backend enum value (see SimulatorType) |
| method | int | Simulation method enum value (see SimulationType) |
| time_taken | float | Wall-clock execution time in seconds |