dual_from_empirical_frequencies¶
- dual_from_empirical_frequencies(povm_post_processor: POVMPostProcessor, *, loc: int | tuple[int, ...] | None = None, bias: list[float] | float | None = None, ansatz: list[SparsePauliOp | DensityMatrix | Statevector] | SparsePauliOp | DensityMatrix | Statevector | None = None) BaseDual [source]¶
Return the Dual frame of
povm
based on the frequencies of the sampled outcomes.Given outcomes sampled from a
ProductPOVM
, each local Dual frame is parametrized with the alpha-parameters set as the marginal outcome frequencies. For stability, the (local) empirical frequencies can be biased towards the (marginal) outcome probabilities of anansatz
state.- Parameters:
povm_post_processor (POVMPostProcessor) – the
POVMPostProcessor
object from which to extract thePOVMPostProcessor.povm
and the empirical frequencies to build the Dual frame.loc (int | tuple[int, ...] | None) – index of the results to use. This is relevant if multiple sets of parameter values were supplied to the sampler in the same Pub. If
None
, it is assumed that the supplied circuit was not parametrized or that a unique set of parameter values was supplied. In this case,loc
is trivially set to 0.bias (list[float] | float | None) – the strength of the bias towards the outcome distribution of the
ansatz
state. If it is afloat
, the same bias is applied to each (local) sub-system. If it is a list offloat
, a specific bias is applied to each sub-system. IfNone
, the bias for each sub-system is set to be the number of outcomes of the POVM acting on this sub-system.ansatz (list[SparsePauliOp | DensityMatrix | Statevector] | SparsePauliOp | DensityMatrix | Statevector | None) – list of quantum states for each local sub-system. If a single (local) quantum state is supplied, it is used for all sub-systems. From these states, the local outcome probability distributions are computed for each sub-system. The empirical marginal frequencies are biased towards these distributions. If None, the fully mixed state is used for each sub-system.
- Raises:
NotImplementedError – if
POVMPostProcessor.povm
is not aProductPOVM
instance.ValueError – if
loc
isNone
andPOVMPostProcessor.counts
stores more than a single counter (i.e., multiple sets of parameter values were supplied to the sampler in a single Pub).ValueError – if
bias
is a list but its length does not match the number of local POVMs forming the product POVM.ValueError – if
ansatz
is a list but its length does not match the number of local POVMs forming the product POVM.
- Returns:
The Dual frame based on the empirical outcome frequencies from the post-processed result.
- Return type: