The DepolarizeOp class and supporting functionality.

Module Contents



A depolarizing channel.

class pygsti.modelmembers.operations.depolarizeop.DepolarizeOp(state_space, basis='pp', evotype='default', initial_rate=0, seed_or_state=None)

Bases: pygsti.modelmembers.operations.stochasticop.StochasticNoiseOp

A depolarizing channel.

  • state_space (StateSpace, optional) – The state space for this operation.

  • basis (Basis or {'pp','gm','qt'}, optional) – The basis to use, defining the “principle axes” along which there is stochastic noise. While strictly unnecessary since all complete bases yield the same operator, this affects the underlying StochasticNoiseOp and so is given as an option to the user.

  • evotype (Evotype or str, optional) – The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.

  • initial_rate (float, optional) – the initial error rate.

  • seed_or_state (float or RandomState, optional) – Random seed for RandomState (or directly provided RandomState) for sampling stochastic superoperators with the ‘chp’ evotype.

_rates_to_params(self, rates)

Note: requires rates to all be the same

_params_to_rates(self, params)

Return a list of dicts, one per rate, expressing the rate as a polynomial of the local parameters (tuple keys of dicts <=> poly terms, e.g. (1,1) <=> x1^2)

property total_term_magnitude_deriv(self)

The derivative of the sum of all this operator’s terms.

Computes the derivative of the total (sum) of the magnitudes of all this operator’s terms with respect to the operators (local) parameters.


numpy array – An array of length self.num_params

to_memoized_dict(self, mmg_memo)

Create a serializable dict with references to other objects in the memo.


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.).


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.

classmethod _from_memoized_dict(cls, mm_dict, serial_memo)

For subclasses to implement. Submember-existence checks are performed, and the gpindices of the return value is set, by the non-underscored :method:`from_memoized_dict` implemented in this class.


Return str(self).


Summarizes the contents of this object in a single line. Does not summarize submembers.