deltakit.decode.analysis.StimDecoderManager#

class deltakit.decode.analysis.StimDecoderManager(stim_noise_circuit: Circuit, decoder: GraphDecoder, noise_model: SequentialNoise[Circuit, tuple[OrderedSyndrome, tuple[bool, ...]]] | MonteCarloNoise[Circuit, tuple[OrderedSyndrome, tuple[bool, ...]]] | None = None, reporters: list[BaseReporter] | None = None, metadata: dict[str, str] | None = None, seed: int | None = None, batch_size: int = 10000)#

Bases: NoiseModelDecoderManager[tuple[OrderedSyndrome, tuple[bool, …]], Circuit, tuple[bool, …], tuple[ndarray[tuple[Any, …], dtype[uint8]], ndarray[tuple[Any, …], dtype[uint8]]], ndarray[tuple[Any, …], dtype[uint8]]]

Decoder manager to support Stim circuits being used for noise generation, and Stim observables to define decoder success.

Parameters:
  • stim_noise_circuit (stim.Circuit) – Stim circuit to use to inform how noise samples are generated.

  • decoder (GraphDecoder) – Decoder to use to decode generated shots.

  • noise_model (NoiseModel[stim.Circuit, StimOutput] | None, optional) – Stim circuit based noise model to use, when None an instance of SampleStimNoise which will just directly take samples from the stim_noise_circuit is used.

  • reporters (Optional[List[BaseReporter]], optional) – Optional list of reporters to give extra information about a decoder, by default None.

  • metadata (Optional[Dict[str, str]], optional) – Metadata to associate with this experiment, by default None.

  • seed (Optional[int], optional) – Optional seed for use with given noise sources, by default None which results in random seed generation.

Methods#

StimDecoderManager.clear_pool_manager

Configure pool workers to state of this decoder manager.

StimDecoderManager.configure_pool

Configure pool workers to state of this decoder manager.

StimDecoderManager.generate_single_error

Generate an error for a single shot of decoding.

StimDecoderManager.get_reporter_results

Get aggregated data from the manager's internal state and all available reporters as a dict from string of data identifier to data.

StimDecoderManager.reset

Reset all reporters and their aggregations.

StimDecoderManager.run_batch_shots

Run multiple shots of decoding.

StimDecoderManager.run_batch_shots_parallel

Run batch of shots in parallel using processes number of runners from pool.

StimDecoderManager.run_single_shot

Run a single shot of decoding.