mthree.classes.QuasiCollection

class QuasiCollection(data)[source]

QuasiCollection constructor.

Parameters:

data (list or QuasiCollection) – List of QuasiDistribution instances.

Raises:

TypeError – Must be list of QuasiDistribution only.

Methods

expval([exp_ops])

Expectation value over entire collection.

expval_and_stddev([exp_ops])

Expectation value and standard deviation over entire collection.

nearest_probability_distribution()

Nearest probability distribution over collection

stddev()

Standard deviation over entire collection.

Attributes

mitigation_overhead

Mitigation overhead over entire collection.

shots

Number of shots taken over collection.

expval(exp_ops='')[source]

Expectation value over entire collection.

Parameters:

exp_ops (str or dict or list) – Diagonal operators over which to compute expval.

Returns:

Array of expectation values.

Return type:

ndarray

Raises:

M3Error – Length of passes operators does not match container length.

Notes

The dict operator format is a sparse diagonal format using bitstrings as the keys.

expval_and_stddev(exp_ops='')[source]

Expectation value and standard deviation over entire collection.

Parameters:

exp_ops (str or dict or list) – Diagonal operators over which to compute expval.

Returns:

Tuples of expval and stddev pairs.

Return type:

list

Raises:

M3Error – Length of passes operators does not match container length.

Notes

The dict operator format is a sparse diagonal format using bitstrings as the keys.

property mitigation_overhead

Mitigation overhead over entire collection.

Returns:

Array of mitigation overhead values.

Return type:

ndarray

nearest_probability_distribution()[source]

Nearest probability distribution over collection

Returns:

Collection of ProbDistributions.

Return type:

ProbCollection

property shots

Number of shots taken over collection.

Returns:

Array of shots values.

Return type:

ndarray

stddev()[source]

Standard deviation over entire collection.

Returns:

Array of standard deviations.

Return type:

ndarray