:py:mod:`pygsti.modelmembers.povms.complementeffect` ==================================================== .. py:module:: pygsti.modelmembers.povms.complementeffect .. autoapi-nested-parse:: The ComplementPOVMEffect class and supporting functionality. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pygsti.modelmembers.povms.complementeffect.ComplementPOVMEffect .. py:class:: ComplementPOVMEffect(identity, other_effects, called_from_reduce=False) Bases: :py:obj:`pygsti.modelmembers.povms.conjugatedeffect.ConjugatedStatePOVMEffect` TODO: docstring A POVM effect vector that ensures that all the effects of a POVM sum to the identity. This POVM effect vector is paramterized as `I - sum(other_spam_vecs)` where `I` is a (static) identity element and `other_param_vecs` is a list of other spam vectors in the same parent :class:`POVM`. This only *partially* implements the model-member interface (some methods such as `to_vector` and `from_vector` will thunk down to base class versions which raise `NotImplementedError`), as instances are meant to be contained within a :class:`POVM` which takes care of vectorization. Parameters ---------- identity : array_like or POVMEffect a 1D numpy array representing the static identity operation from which the sum of the other vectors is subtracted. other_spamvecs : list of POVMEffects A list of the "other" parameterized POVM effect vectors which are subtracted from `identity` to compute the final value of this "complement" POVM effect vector. Initialize a new POVM effect Vector .. py:property:: num_params Get the number of independent parameters which specify this POVM effect vector. Returns ------- int the number of independent parameters. .. py:attribute:: identity .. py:attribute:: other_effects .. 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:: to_vector() Get the POVM effect vector parameters as an array of values. Returns ------- numpy array The parameters as a 1D array with length num_params(). .. py:method:: from_vector(v, close=False, dirty_value=True) Initialize the POVM effect vector using a 1D array of parameters. Parameters ---------- v : numpy array The 1D vector of POVM effect vector parameters. Length must == num_params() close : bool, optional Whether `v` is close to this POVM effect vector's current set of parameters. Under some circumstances, when this is true this call can be completed more quickly. dirty_value : bool, optional The value to set this object's "dirty flag" to before exiting this call. This is passed as an argument so it can be updated *recursively*. Leave this set to `True` unless you know what you're doing. Returns ------- None .. py:method:: deriv_wrt_params(wrt_filter=None) The element-wise derivative this POVM effect vector. Construct a matrix whose columns are the derivatives of the POVM effect vector with respect to a single param. Thus, each column is of length dimension and there is one column per POVM effect vector parameter. Parameters ---------- wrt_filter : list or numpy.ndarray List of parameter indices to take derivative with respect to. (None means to use all the this operation's parameters.) Returns ------- numpy array Array of derivatives, shape == (dimension, num_params) .. py:method:: has_nonzero_hessian() Whether this POVM effect vector has a non-zero Hessian with respect to its parameters. Returns ------- bool