mthree.classes.ProbCollection

class ProbCollection(data)[source]

ProbCollection constructor.

Parameters:

data (list or ProbCollection) – List of ProbDistribution instances.

Raises:

TypeError – Must be list of ProbDistribution only.

Methods

expval([exp_ops])

Expectation value over entire collection.

expval_and_stddev([exp_ops])

Expectation value and standard deviation over entire 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

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