:py:mod:`pygsti.modelmembers.povms.marginalizedpovm` ==================================================== .. py:module:: pygsti.modelmembers.povms.marginalizedpovm .. autoapi-nested-parse:: Defines the MarginalizedPOVM class Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pygsti.modelmembers.povms.marginalizedpovm.MarginalizedPOVM .. py:class:: MarginalizedPOVM(povm_to_marginalize, all_sslbls, sslbls_after_marginalizing) Bases: :py:obj:`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_marginalize : POVM The POVM to marginalize (the "parent" POVM). all_sslbls : StateSpaceLabels 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_marginalizing : tuple 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_marginalize : POVM The POVM to marginalize (the "parent" POVM). all_sslbls : StateSpaceLabels 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_marginalizing : tuple The subset of `all_sslbls` that should be *kept* after marginalizing. .. py:attribute:: povm_to_marginalize .. py:attribute:: sslbls_to_marginalize .. py:attribute:: sslbls_after_marginalizing .. py:attribute:: indices_to_keep .. py:method:: 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. .. py:method:: submembers() Get the ModelMember-derived objects contained in this one. Returns ------- list .. py:method:: marginalize_effect_label(elbl) Removes the "marginalized" characters from `elbl`, resulting in a marginalized POVM effect label. Parameters ---------- elbl : str Effect label (typically of the parent POVM) to marginalize. .. py:method:: keys() An iterator over the effect (outcome) labels of this POVM. .. py:method:: values() An iterator over the effect POVM effect vectors of this POVM. .. py:method:: items() An iterator over the (effect_label, effect_vector) items in this POVM. .. py:method:: 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 ---------- prefix : str A string, usually identitying this POVM, which may be used to prefix the simplified gate keys. Returns ------- OrderedDict of POVMEffects