dual_from_state¶
- dual_from_state(povm: BasePOVM, state: SparsePauliOp | DensityMatrix | Statevector) BaseDual [source]¶
Return the Dual frame of
povm
based on the outcome distribution of a suppliedstate
.This method constructs a joint Dual frame where the alpha-parameters are set as the outcome probabilities of the supplied
state
. It can be shown that this is the Dual frame minimizing the variance of the estimator (irrespective of the observable to estimate) if outcomes are sampled from this state.You can use this function like any of the Dual frame constructors to set the
POVMPostProcessor.dual
attribute as shown in this how-to guide.Warning
Computing this Dual frame obviously requires knowledge of an exact reference state and, thus, is limited in its applicability to development and testing cases in which an exact state is available.
- Parameters:
povm (BasePOVM) – the POVM for which we want to build a Dual frame.
state (SparsePauliOp | DensityMatrix | Statevector) – the state from which to compute the outcome probabilities.
- Raises:
NotImplementedError – if
povm
is not aMultiQubitPOVM
instance. If you have aProductPOVM
, have a look atdual_from_marginal_probabilities()
.- Returns:
The Dual frame with minimal variance of the estimator for any arbitrary observable.
- Return type: