dual_from_empirical_frequencies¶
- dual_from_empirical_frequencies(povm_post_processor, *, loc=None, bias=None, ansatz=None)¶
Return the Dual frame of
povmbased 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 anansatzstate.- Parameters:
povm_post_processor (POVMPostProcessor) – the
POVMPostProcessorobject from which to extract thePOVMPostProcessor.povmand 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,locis trivially set to 0.bias (list[float] | float | None) – the strength of the bias towards the outcome distribution of the
ansatzstate. 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.povmis not aProductPOVMinstance.ValueError – if
locisNoneandPOVMPostProcessor.countsstores more than a single counter (i.e., multiple sets of parameter values were supplied to the sampler in a single Pub).ValueError – if
biasis a list but its length does not match the number of local POVMs forming the product POVM.ValueError – if
ansatzis 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: