pygsti.modelmembers.povms.tensorprodpovm
¶
Defines the TensorProductPOVM class
Module Contents¶
Classes¶
A POVM that is effectively the tensor product of several other POVMs (which can be TP). |
- class pygsti.modelmembers.povms.tensorprodpovm.TensorProductPOVM(factor_povms, evotype='auto', state_space=None)¶
Bases:
pygsti.modelmembers.povms.povm.POVM
A POVM that is effectively the tensor product of several other POVMs (which can be TP).
- Parameters
factor_povms (list of POVMs) – POVMs that will be tensor-producted together.
evotype (Evotype or str, optional) – The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype. The special value “auto” uses the evolution type of the first factor if there are more than zero factors.
state_space (StateSpace, optional) – The state space for this POVM. This should be a space description compatible with the product of all the factors’ state spaces. If None a default compatible space will be chosen.
- 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.
- submembers(self)¶
Get the ModelMember-derived objects contained in this one.
- Returns
list
- __contains__(self, key)¶
For lazy creation of effect vectors
- __iter__(self)¶
Implement iter(self).
- __len__(self)¶
Return len(self).
- keys(self)¶
An iterator over the effect (outcome) labels of this POVM.
- values(self)¶
An iterator over the effect SPAM vectors of this POVM.
- items(self)¶
An iterator over the (effect_label, effect_vector) items in this POVM.
- __getitem__(self, key)¶
For lazy creation of effect vectors
- __reduce__(self)¶
Needed for OrderedDict-derived classes (to set dict items)
- simplify_effects(self, 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
- property parameter_labels(self)¶
An array of labels (usually strings) describing this model member’s parameters.
- property num_params(self)¶
Get the number of independent parameters which specify this POVM.
- Returns
int – the number of independent parameters.
- to_vector(self)¶
Extract a vector of the underlying gate parameters from this POVM.
- Returns
numpy array – a 1D numpy array with length == num_params().
- from_vector(self, 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
- depolarize(self, 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
- __str__(self)¶
Return str(self).