pygsti.modelmembers.povms.marginalizedpovm
Defines the MarginalizedPOVM class
Module Contents
Classes
A POVM whose effects are the sums of sets of effect vectors in a parent POVM. |
- class pygsti.modelmembers.povms.marginalizedpovm.MarginalizedPOVM(povm_to_marginalize, all_sslbls, sslbls_after_marginalizing)
Bases:
pygsti.modelmembers.povms.povm.POVM
A POVM whose effects are the sums of sets of effect vectors in a parent POVM.
Namely the effects of the parent POVN whose labels have the same character at certain “marginalized” indices are summed together.
Parameters
- povm_to_marginalizePOVM
The POVM to marginalize (the “parent” POVM).
- all_sslblsStateSpaceLabels or tuple
The state space labels of the parent POVM, which should have as many labels (factors) as the parent POVM’s outcome/effect labels have characters.
- sslbls_after_marginalizingtuple
The subset of all_sslbls that should be kept after marginalizing.
Create a MarginalizedPOVM.
Create a marginalized POVM by adding together sets of effect vectors whose labels have the same character at marginalized indices. This assumes that the POVM being marginalized has a particular (though common) effect-label structure whereby each state-space sector corresponds to a single character, e.g. “0010” for a 4-qubt POVM.
Parameters
- povm_to_marginalizePOVM
The POVM to marginalize (the “parent” POVM).
- all_sslblsStateSpaceLabels or tuple
The state space labels of the parent POVM, which should have as many labels (factors) as the parent POVM’s outcome/effect labels have characters.
- sslbls_after_marginalizingtuple
The subset of all_sslbls that should be kept after marginalizing.
- to_memoized_dict(mmg_memo)
Create a serializable dict with references to other objects in the memo.
Parameters
- mmg_memo: dict
Memo dict from a ModelMemberGraph, i.e. keys are object ids and values are ModelMemberGraphNodes (which contain the serialize_id). This is NOT the same as other memos in ModelMember (e.g. copy, allocate_gpindices, etc.).
Returns
- mm_dict: dict
A dict representation of this ModelMember ready for serialization This must have at least the following fields: module, class, submembers, params, state_space, evotype Additional fields may be added by derived classes.
- marginalize_effect_label(elbl)
Removes the “marginalized” characters from elbl, resulting in a marginalized POVM effect label.
Parameters
- elblstr
Effect label (typically of the parent POVM) to marginalize.
- keys()
An iterator over the effect (outcome) labels of this POVM.
- values()
An iterator over the effect POVM effect vectors of this POVM.
- items()
An iterator over the (effect_label, effect_vector) items in this POVM.
- simplify_effects(prefix='')
Creates a dictionary of simplified effect vectors.
Returns a dictionary of effect POVMEffects that belong to the POVM’s parent Model - that is, whose gpindices are set to all or a subset of this POVM’s gpindices. Such effect vectors are used internally within computations involving the parent Model.
Parameters
- prefixstr
A string, usually identitying this POVM, which may be used to prefix the simplified gate keys.
Returns
OrderedDict of POVMEffects