localuf.sim.accuracy.monte_carlo¶
- localuf.sim.accuracy.monte_carlo(sample_counts, code_class, decoder_class, noise, scheme='batch', get_commit_height=None, get_buffer_height=None, parametrization='balanced', demolition=False, monolingual=False, _merge_redundant_edges=True, **kwargs_for_decoder_class)[source]¶
Make threshold data for any decoder.
- Parameters:
sample_counts (dict[int, list[tuple[float, int]]]) – A dictionary mapping code distances to lists of (noise level, sample count) pairs. If
schemeis ‘global batch’, each sample count must be the same for all noise levels of a given distance. For a more detailed definition of ‘sample’, see_base_classes.Scheme.run.code_class (Type[Code]) – The class of the code; either
localuf.Repetitionorlocaluf.Surface.decoder_class (Type[Decoder]) – The class of the decoder; available decoders are listed in
localuf.decoders.noise (Literal['code capacity', 'phenomenological', 'circuit-level']) – The noise model.
scheme (Literal['batch', 'global batch', 'forward', 'frugal']) – The decoding scheme; either ‘batch’, ‘global batch’, ‘forward’ or ‘frugal’. In global batch scheme, the decoding graph is
d*nlayers tall i.e. as tall as the (entire) decoding graph would be in forward scheme with commit heightd.get_commit_height (Callable[[int], int] | None) – A function with input
dthat outputs commit height e.g.lambda d: 2*(d//2). IfNone, commit height isdfor forward scheme and1for frugal scheme. Affects only forward and frugal decoding schemes.get_buffer_height (Callable[[int], int] | None) – A function with input
dthat outputs buffer height. IfNone, buffer height isdfor forward scheme and2*(d//2)for frugal scheme. Affects only forward and frugal decoding schemes.parametrization (Literal['standard', 'balanced', 'ion trap']) – defines relative fault probabilities of 1- and 2-qubit gates, and prep/measurement. Affects only circuit-level noise.
demolition (bool) – whether measurement destroys the ancilla qubit state which hence needs to be initialized for next measurement cycle. Affects only circuit-level noise.
monolingual (bool) – whether can prep/measure in only Z basis hence X-basis prep/measurement needs Hadamard gates. Affects only circuit-level noise.
_merge_redundant_edges (bool) – whether to merge redundant boundary edges. Affects only circuit-level noise.
kwargs_for_decoder_class – are for
decoder_class.
- Return df:
A DataFrame where each column is a (distance, probability); rows ‘m’, ‘n’ indicate number of logical errors and samples, respectively.