pygsti.forwardsims.termforwardsim_calc_generic.circuit_achieved_and_max_sopm

pygsti.forwardsims.termforwardsim_calc_generic.circuit_achieved_and_max_sopm#

circuit_achieved_and_max_sopm(fwdsim, rholabel, elabels, circuit, repcache, threshold, min_term_mag)#

Compute the achieved and maximum sum-of-path-magnitudes (SOPM) for a given circuit and model.

This is a helper function for a TermForwardSimulator, and not typically called independently.

A path-integral forward simulator specifies a model and path criteria (e.g. the max Taylor order). The model’s operations can construct Taylor terms with coefficients based on the current model parameters. The magnitudes of these coefficients are used to estimate the error incurred by a given path truncation as follows: term coefficient magnitudes are multiplied together to get path magnitudes, and these are added to get an “achieved” sum-of-path-magnitudes. This can be compared with a second quantity, the “maximum” sum- of-path-magnitudes based on estimates (ideally upper bounds) of the magnitudes for all paths.

Parameters:
  • fwdsim (TermForwardSimulator) – The forward simulator. Contains the model that is used.

  • rholabel (Label) – The preparation label, which precedes the layers in circuit. Note that circuit should not contain any preparation or POVM labels - only the operation labels.

  • elabels (list or tuple) – A list of POVM effect labels, which follow the layers in circuit. Note that circuit should not contain any preparation or POVM labels - only the operation labels.

  • circuit (Circuit) – The non-SPAM operations that make up the circuit that values are computed for.

  • repcache (dict) – A dictionary of already-build preparation, operation, and POVM effect representations. Keys are labels and values are the representation objects. Use of a representation cache can significantly speed up multiple calls to this function.

  • threshold (float) – A threshold giving the minimum path magnitude that should be included in the “achieved” sum of path magnitudes. As this number gets smaller, more paths are included.

  • min_term_mag (float) – The minimum magnitude a single term can have and still be considered in paths. This essentially specifies a pre-path-magnitude threshold that lessens computational overhead by ignoring terms that have a very small magnitude.

Returns:

  • achieved_sopm (float) – The achieved sum-of-path-magnitudes.

  • max_sopm (float) – The approximate maximum sum-of-path-magnitudes.