POVMPubResult¶
- class POVMPubResult(data, metadata)¶
Bases:
PubResult
The result of a
POVMSamplerJob
.Initialize the result object.
- Parameters:
data (DataBin) – The raw data bin object that contains raw measurement bitstrings.
metadata (POVMMetadata) – The metadata object that stores the POVM used and all necessary data to interpret the raw measurement bitstring. For example, for randomized POVMs, each bitstring has to be associated with the corresponding
pvm_keys
to produce a meaningful POVM outcome.
Attributes
- metadata¶
The metadata of this result object.
Warning
The object returned by instances of this subclass have a different type than dictated by the
PubResult
interface.
Inherited Attributes
- data¶
Result data for the pub.
Methods
- get_counts(*, loc=None)¶
Get the counter of outcomes from the result.
This method will leverage
get_povm_counts_from_raw()
from thePOVMImplementation
instance stored inside themetadata
to construct a counter of POVM outcomes.- Parameters:
loc (int | tuple[int, ...] | ellipsis | None) – specifies the location of the counts to return. By default,
None
is used, which aggregates all counts from a single PUB. Ifloc=...
, all counts from the PUB are returned, but separately. Ifloc
is a tuple of integers, it must define a single parameter set. Refer to this how-to guide for more information.- Returns:
The POVM counts. If
loc=...
, annp.ndarray
of counters is returned. Otherwise, a single counter is returned.- Return type:
- get_samples(*, loc=None)¶
Get the individual POVM outcomes of the result.
This method will leverage
get_povm_outcomes_from_raw()
from thePOVMImplementation
instance stored inside themetadata
to recover the sampled POVM outcomes.- Parameters:
loc (int | tuple[int, ...] | ellipsis | None) –
specifies the location of the outcomes to return. By default,
None
is used, which aggregates all outcomes from a single PUB. Ifloc=...
, all outcomes from the PUB are returned, but separately. Ifloc
is a tuple of integers, it must define a single parameter set. Refer to this how-to guide for more information.- Returns:
The list of POVM outcomes. If
loc=...
, annp.ndarray
of outcome lists is returned. Otherwise, a single outcome list is returned.- Return type: