pygsti.forwardsims.termforwardsim_calc_generic.find_best_pathmagnitude_threshold

pygsti.forwardsims.termforwardsim_calc_generic.find_best_pathmagnitude_threshold#

find_best_pathmagnitude_threshold(fwdsim, rholabel, elabels, circuit, polynomial_vindices_per_int, repcache, circuitsetup_cache, comm, mem_limit, pathmagnitude_gap, min_term_mag, max_paths, threshold_guess)#

Computes probabilities for multiple spam-tuples of circuit

Parameters:
  • fwdsim (TermForwardSimulator) – The calculator object holding vital information for the computation.

  • rholabel (Label) – Prep label for all the probabilities to compute.

  • elabels (list) – List of effect labels, one per probability to compute. The ordering of elabels determines the ordering of the returned probability polynomials.

  • circuit (Circuit) – The gate sequence to sandwich between the prep and effect labels.

  • repcache (dict, optional) – Dictionary used to cache operator representations to speed up future calls to this function that would use the same set of operations.

  • circuitsetup_cache (dict, optional) – Dictionary used to cache preparation specific to this function, to speed up repeated calls using the same circuit and set of parameters, including the same repcache.

  • comm (mpi4py.MPI.Comm, optional) – When not None, an MPI communicator for distributing the computation across multiple processors.

  • mem_limit (int, optional) – A rough memory limit in bytes.

  • pathmagnitude_gap (float, optional) – The amount less than the perfect sum-of-path-magnitudes that is desired. This sets the target sum-of-path-magnitudes for each circuit – the threshold that determines how many paths are added.

  • min_term_mag (float, optional) – A technical parameter to the path pruning algorithm; this value sets a threshold for how small a term magnitude (one factor in a path magnitude) must be before it is removed from consideration entirely (to limit the number of even potential paths). Terms with a magnitude lower than this values are neglected.

  • max_paths (int, optional) – The maximum number of paths allowed per circuit outcome.

  • threshold_guess (float, optional) – In the search for a good pathmagnitude threshold, this value is used as the starting point. If 0.0 is given, a default value is used.

Returns:

  • npaths (int) – the number of paths that were included.

  • threshold (float) – the path-magnitude threshold used.

  • target_sopm (float) – The desired sum-of-path-magnitudes. This is pathmagnitude_gap less than the perfect “all-paths” sum. This sums together the contributions of different effects.

  • achieved_sopm (float) – The achieved sum-of-path-magnitudes. Ideally this would equal target_sopm. (This also sums together the contributions of different effects.)