POVMPubResult¶
- class POVMPubResult(data, metadata)¶
Bases:
PubResultThe 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_keysto 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
PubResultinterface.
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 thePOVMImplementationinstance stored inside themetadatato construct a counter of POVM outcomes.- Parameters:
loc (int | tuple[int, ...] | ellipsis | None) – specifies the location of the counts to return. By default,
Noneis used, which aggregates all counts from a single PUB. Ifloc=..., all counts from the PUB are returned, but separately. Iflocis 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.ndarrayof 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 thePOVMImplementationinstance stored inside themetadatato recover the sampled POVM outcomes.- Parameters:
loc (int | tuple[int, ...] | ellipsis | None) –
specifies the location of the outcomes to return. By default,
Noneis used, which aggregates all outcomes from a single PUB. Ifloc=..., all outcomes from the PUB are returned, but separately. Iflocis 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.ndarrayof outcome lists is returned. Otherwise, a single outcome list is returned.- Return type: