pygsti.forwardsims.termforwardsim_calc_generic.pathmagnitude_threshold

pygsti.forwardsims.termforwardsim_calc_generic.pathmagnitude_threshold#

pathmagnitude_threshold(oprep_lists, e_indices, num_elabels, target_sum_of_pathmags, foat_indices_per_op=None, initial_threshold=0.1, min_threshold=1e-10, max_npaths=1000000)#

Find the pathmagnitude-threshold needed to achieve some target sum-of-path-magnitudes: so that the sum of all the path-magnitudes greater than this threshold achieve the target (or get as close as we can).

Parameters:
  • oprep_lists (list of lists) – representations for the terms of each layer of the circuit whose outcome probability we’re computing, including prep and POVM layers. oprep_lists[i] is a list of the terms available to choose from for the i-th circuit layer, ordered by increasing term-magnitude.

  • e_indices (numpy array) – The effect-vector index for each element of oprep_lists[-1] (representations for all effect vectors exist all together in oprep_lists[-1]).

  • num_elabels (int) – The total number of different effects whose reps appear in oprep_lists[-1] (also one more than the largest index in e_indices.

  • target_sum_of_pathmags (array) – An array of floats of length num_elabels giving the target sum of path magnitudes desired for each effect (separately).

  • foat_indices_per_op (list) – A list of lists of integers, such that foat_indices_per_op[i] is a list of indices into oprep_lists[-1] that marks out which terms are first-order (Taylor) terms that should therefore always be traversed regardless of their term-magnitude (foat = first-order- always-traverse).

  • initial_threshold (float) – The starting pathmagnitude threshold to try (this function uses an iterative procedure to find a threshold).

  • min_threshold (float) – The smallest threshold allowed. If this amount is reached, it is just returned and searching stops.

  • max_npaths (int, optional) – The maximum number of paths allowed per effect.

Returns:

  • threshold (float) – The obtained pathmagnitude threshold.

  • npaths (numpy array) – An array of length num_elabels giving the number of paths selected for each of the effect vectors.

  • achieved_sopm (numpy array) – An array of length num_elabels giving the achieved sum-of-path- magnitudes for each of the effect vectors.