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 product POVM, 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 an ansatz state.
- Parameters:
povm_post_processor (POVMPostProcessor) – the
POVMPostProcessor
object from which to extract the 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. If None, 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-subsystem.
- Raises:
NotImplementedError – if
povm_post_processor.povm
is not apovm_toolbox.quantum_info.product_povm.ProductPOVM
instance.ValueError – if
loc
is None and that the POVM post-processor stores more than one 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 POVMpovm_post_processor.povm
.ValueError – if
ansatz
is a list but its length does not match the number of local POVMs forming the product POVMpovm_post_processor.povm
.
- Return type: