pygsti.algorithms.scoring.CompositeScore

Contents

pygsti.algorithms.scoring.CompositeScore#

class CompositeScore(major, minor, n)#

Bases: object

Class for storing and comparing scores calculated from eigenvalues.

The comparison functions operate according to the logic that a lower score is better. The score value is broken into two parts: ‘major’ and ‘minor’. A CompositeScore with a smaller ‘major’ part is always smaller than one with a larger ‘major’ part. The ‘minor’ parts are only compared when the major parts are equal. Typically, the negative of the number of non-zero eigenvalues is used to as the major part so that a score that has more non-zero eigenvalues (higher N) will always compare as less than a score that has fewer non-zero eigenvalues (lower N), with ties for N being resolved by comparing the minor score in the straightforward manner (since the non-AC score is assumed to be better for lower values). For bookkeeping, the CompositeScore object also separately holds the number of non-zero eigenvalues, as this may not always be recovered from the major part of the score.

Parameters:
  • major (float) – Major (more significant) component of score.

  • minor (float) – Minor (less significant) component of score.

  • n (int) – Number of non-zero eigenvalues.

Methods

__init__(major, minor, n)