MaestroConfig¶
- class MaestroConfig(simulator_type=None, simulation_type=None, max_bond_dimension=None, singular_value_threshold=None, use_double_precision=False, disable_optimized_swapping=False, lookahead_depth=-1, mps_measure_no_collapse=True, mps_qubit_threshold=22, noise_model=None, noise_seed=42, noise_realizations=None)[source]¶
Bases:
objectConfiguration object for
MaestroSimulator.Each field maps directly to an identically-named field on
maestro.SimulatorConfig; see the maestro Python bindings guide for the underlying semantics of each knob.mps_qubit_thresholdis Divi-specific and drives automatic Statevector → MatrixProductState selection.simulator_typeandsimulation_typeaccept the string names of the corresponding maestro enum members, e.g."QCSim","Gpu","Statevector","MatrixProductState".Nonemeans “use maestro’s default”.Every field is explicit — unknown options raise
TypeErrorat construction time instead of being silently dropped by a**kwargspassthrough, so upstream changes tomaestro.SimulatorConfigsurface as loud failures.Attributes Summary
Disable MPS swap-cost optimization.
Lookahead depth for the MPS swap optimizer.
Maximum bond dimension for MPS simulation.
If
True, use the non-collapsing MPS measurement algorithm; ifFalse, use the collapsing one.Qubit count above which automatic MPS selection kicks in.
Maestro
NoiseModelobject.Number of Monte-Carlo noise realizations.
Seed for Pauli-error sampling.
Simulation method, e.g.
"Statevector"or"MatrixProductState".Maestro simulator type, e.g.
"QCSim"or"Gpu".SVD truncation threshold for MPS simulation.
Use double-precision floating point.
Methods Summary
override(other)Return a new config overriding fields with non-default values from
other.Attributes Documentation
- max_bond_dimension: int | None = None¶
Maximum bond dimension for MPS simulation.
Noneuses maestro’s default, except when auto-MPS is triggered (in which case 64 is used).
- mps_measure_no_collapse: bool = True¶
If
True, use the non-collapsing MPS measurement algorithm; ifFalse, use the collapsing one.
- mps_qubit_threshold: int = 22¶
Qubit count above which automatic MPS selection kicks in. Only active when
simulation_typeisNone; has no effect whensimulation_typeis set explicitly. Divi-specific; not forwarded tomaestro.SimulatorConfig.
- noise_model: NoiseModel | None = None¶
Maestro
NoiseModelobject.None(default) disables noise — circuits run viasimple_execute(sampling) orsimple_estimate(expval). When set, dispatch routes tonoisy_execute/noisy_estimate/noisy_estimate_montecarlodepending onnoise_realizations. Divi-specific; not forwarded tomaestro.SimulatorConfig— Maestro keeps noise models separate from simulator config and accepts them positionally on the noisy entry points.
- noise_realizations: int | None = None¶
Number of Monte-Carlo noise realizations.
None(default) selects the analytical noisy backend when available:Expval —
maestro.noisy_estimate, which applies exact Pauli damping coefficients to noiseless expectation values. Deterministic.Sampling — no analytical equivalent; falls back to one realization (
noisy_executewithnoise_realizations=1).
A positive
intNselects Monte-Carlo backends:Expval —
maestro.noisy_estimate_montecarlo, which runsNindependent Pauli-injection passes and averages the expectation values.Sampling —
maestro.noisy_execute, which dividesshotsacrossmin(shots, N)batches, each with a freshly sampled noise pattern. Total shot count is alwaysshots; ifN > shotsthe effective realization count is capped atshots.
Note that
noise_realizations=1is not equivalent toNonefor expval — the former is one random Pauli sampling, the latter is the exact analytical average. Divi-specific; not forwarded tomaestro.SimulatorConfig.
- noise_seed: int = 42¶
Seed for Pauli-error sampling. Consulted whenever execution routes through one of Maestro’s stochastic noisy entry points (
noisy_executeornoisy_estimate_montecarlo); the analyticalnoisy_estimatepath ignores it. Each circuit in aMaestroSimulator.submit_circuits()batch is seeded withnoise_seed + i(whereiis the circuit’s index in the input mapping) so circuits in the same batch get independent error patterns.Reproducibility scope: the seed pins the Pauli error patterns sampled from the noise model. Expectation-value runs (
noisy_estimate_montecarlo) are fully reproducible because the inner loop is analytical. Noisy sampling runs (noisy_execute) are only partially reproducible: the same Pauli errors are injected, but the shot-count outcomes still vary across runs because Maestro’s measurement sampler initialises its own RNG from system entropy on every call.Divi-specific; not forwarded to
maestro.SimulatorConfig.
- simulation_type: str | None = None¶
Simulation method, e.g.
"Statevector"or"MatrixProductState".Noneenables automatic selection based on qubit count.
- simulator_type: str | None = None¶
Maestro simulator type, e.g.
"QCSim"or"Gpu".Noneuses maestro’s default ("QCSim").
- singular_value_threshold: float | None = None¶
SVD truncation threshold for MPS simulation.
Noneuses maestro’s default.
Methods Documentation
- override(other)[source]¶
Return a new config overriding fields with non-default values from
other.“Non-default” here means a field whose value differs from the class default. This keeps the override semantics consistent with
ExecutionConfig.- Return type: