|
Maestro 0.3.1
Unified interface for quantum circuit simulation
|
Maestro provides seamless integration with Stim and Sinter, the standard Python benchmarking frameworks for quantum error correction (QEC).
Through maestro.sinter, you can execute Stim circuits and error correction benchmarks using Maestro's high-performance simulation engines (such as Matrix Product State or GPU-accelerated statevectors) as custom Sinter samplers.
To use the Sinter integration, install the optional sinter extra:
This installs sinter>=1.14 and stim>=1.14.
| Class / Function | Description |
|---|---|
| MaestroSinterSampler | Implements sinter.Sampler. Passed to sinter.collect() as a custom sampler backend in custom_decoders. |
| MaestroCompiledSampler | Implements sinter.CompiledSampler. Holds compiled circuit execution plans for repeated batch sampling or direct detection event generation. |
| translate_stim_to_maestro(circuit, qubit_order=None) | Converts clean Stim circuits, extended gate strings or instruction tuples into (QuantumCircuit, empty NoiseModel, measurement_count). |
You can pass MaestroSinterSampler into sinter.collect via the custom_decoders dictionary:
CLEAN_CIRCUIT_API_VERSION = 1 identifies translation with explicit initial resets, measurement/reset basis handling, classical record ordering and optional qubit allocation order. Measurement character k is classical bit k. Unsupported embedded noise, measurement inversion and record-controlled operations raise ValueError instead of silently changing their meaning. Native NoiseModel execution remains supported. The previous translation of instruction-local noise into a global hardware model was lossy and is removed. No embedded-noise sampler or coherent conversion policy is included here.
Counts must contain exactly the requested positive integer number of shots. Unexpected record widths and nonzero padding raise ValueError. A caller's SimulatorConfig is copied before sampling. Direct compiled samplers accept a seed (or config.seed); successive calls advance their random stream. An explicit per-call seed replays that call without consuming the stream. MaestroSinterSampler factories reject seed and config.seed because collect worker identities are unavailable for reproducible stream partitioning. Histograms do not preserve chronological shot order.
For direct shot sampling from Python without running a full Sinter task collection: