deltakit.decode.analysis.RunAllAnalysisEngine#

class deltakit.decode.analysis.RunAllAnalysisEngine(experiment_name: str, decoder_managers: Iterable[DecoderManager], loop_condition: Callable[[EmpiricalDecodingErrorDistribution], bool] | None = None, data_directory: Path | None = None, num_parallel_processes: int = 16, lvl: int = 0, batch_size: int = 10000000, max_shots: int = 10000000)#

Bases: object

Class to run experiments on different codes and decoders, it will run all of the given sequence of decoder managers.

Parameters:
  • experiment_name (str) – Name of this experiment.

  • loop_condition (Callable[EmpiricalDecodingErrorDistribution, bool]) – For a given code and noise model, this loop condition controls how many evaluations of a particular code and noise model are run. It is given as a function that takes in the current empirical decoding error distribution and returns True if another shot should be performed.

  • data_directory (Optional[Path], optional) – Path to directory in which to store experiment results data. If not given, no data is output to CSV. By default None.

  • num_parallel_processes (int, optional) – Number of parallel processes to use. If <=1, process will be run sequentially. By default 16.

  • lvl (int, optional) – Logging level to use, by default logging.NOTSET.

  • batch_size (int, optional) – The number of decoding shots to run in a batch. Should beset as high as possible.

  • max_shots (int, optional) – The maximum number of shots to run.

Methods#

RunAllAnalysisEngine.construct_file_path

Return the file path to be used for the results data.

RunAllAnalysisEngine.loop_until_failures

Loop until there have been at least a specific number of failures, as defined by the decoder manager.

RunAllAnalysisEngine.loop_until_observable_rse_below_threshold

Loop until the maximum number of shots or relative standard error on the estimate of LEP go below the given amount.

RunAllAnalysisEngine.run

For all codes on all noise sources given to this instance, evaluate the given decoder and return the number of logical failures, non-zero syndromes and stabilisers after several shots in accordance with the given loop condition.

RunAllAnalysisEngine.save_results

Save the results to file and log that the file path was used.