:py:mod:`pygsti.modelmembers.povms.povm` ======================================== .. py:module:: pygsti.modelmembers.povms.povm .. autoapi-nested-parse:: Defines the POVM class Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: pygsti.modelmembers.povms.povm.POVM .. py:class:: POVM(state_space, evotype, rep=None, items=None) Bases: :py:obj:`pygsti.modelmembers.modelmember.ModelMember`, :py:obj:`collections.OrderedDict` A generalized positive operator-valued measure (POVM). Meant to correspond to a positive operator-valued measure, in theory, this class generalizes that notion slightly to include a collection of effect vectors that may or may not have all of the properties associated by a mathematical POVM. Parameters ---------- state_space : StateSpace The state space of this POVM (and of the effect vectors). evotype : Evotype The evolution type. items : list or dict, optional Initial values. This should only be used internally in de-serialization. Initialize a new ModelMember .. py:property:: num_params Get the number of independent parameters which specify this POVM. Returns ------- int the number of independent parameters. .. py:property:: num_elements Return the number of total spam vector elements in this povm. This is in general different from the number of *parameters*, which are the number of free variables used to generate all of the vector *elements*. Returns ------- int .. py:method:: to_vector() Extract a vector of the underlying gate parameters from this POVM. Returns ------- numpy array a 1D numpy array with length == num_params(). .. py:method:: from_vector(v, close=False, dirty_value=True) Initialize this POVM using a vector of its parameters. Parameters ---------- v : numpy array The 1D vector of POVM parameters. Length must == num_params(). close : bool, optional Whether `v` is close to this POVM'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:: set_time(t) Sets the current time for a time-dependent operator. For time-independent operators (the default), this function does absolutely nothing. Parameters ---------- t : float The current time. Returns ------- None .. py:method:: transform_inplace(s) Update each POVM effect E as s^T * E. Note that this is equivalent to the *transpose* of the effect vectors being mapped as `E^T -> E^T * s`. Parameters ---------- s : GaugeGroupElement A gauge group element which specifies the "s" matrix (and it's inverse) used in the above similarity transform. Returns ------- None .. py:method:: depolarize(amount) Depolarize this POVM by the given `amount`. Parameters ---------- amount : float or tuple The amount to depolarize by. If a tuple, it must have length equal to one less than the dimension of the gate. All but the first element of each spam vector (often corresponding to the identity element) are multiplied by `amount` (if a float) or the corresponding `amount[i]` (if a tuple). Returns ------- None .. py:method:: acton(state) Compute the outcome probabilities the result from acting on `state` with this POVM. Parameters ---------- state : State The state to act on Returns ------- OrderedDict A dictionary whose keys are the outcome labels (strings) and whose values are the probabilities of seeing each outcome.