Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

BasisExpectationValue

class BasisExpectationValue(validate=True)[source]

Compute expectation value of measured basis from probability.

Note

The sign becomes P(0) -> 1, P(1) -> -1.

Create new node.

Parameters:

validate (bool) – If set to False the DataAction will not validate its input.

Methods

__call__(data)

Call the data action of this node on the data.

Parameters:

data (ndarray) – A numpy array with arbitrary dtype. If the elements are ufloat objects consisting of a nominal value and a standard error, then the error propagation is done automatically.

Returns:

The processed data.

Return type:

ndarray