pygsti.models.memberdict
Defines OrderedDict-derived classes used to store specific pyGSTi objects
Module Contents
Classes
An ordered dictionary whose keys must begin with a given prefix. |
- class pygsti.models.memberdict.OrderedMemberDict(parent, default_param, prefix, flags, items=None)
Bases:
_PrefixOrderedDict
,pygsti.modelmembers.modelmember.ModelChild
An ordered dictionary whose keys must begin with a given prefix.
This class also ensure that every value is an object of the appropriate Model member type (e.g.
State
- orLinearOperator
-derived object) by converting any values into that type upon assignment and raising an error if this is not possible.Parameters
- parentModel
The parent model, needed to obtain the dimension and handle updates to parameters.
- default_param{“TP”,”full”,…}
The default parameterization used when creating an object from a key assignment.
- prefixstr
The required prefix of all keys (which must be strings).
- flagsdict
A dictionary of flags adjusting the behavior of the created object. Allowed keys are:
‘cast_to_type’: {“operation”,`”state”,`None} – whether (or not) to automatically convert assigned values to a particular type of ModelMember object. (default is None)
‘auto_embed’ : bool – whether or not to automatically embed objects with a lower dimension than this OrderedMemberDict’s parent model. (default is False).
‘match_parent_statespace’ : bool – whether or not to require that all contained objects match the parent Model’s state space (perhaps after embedding). (default is False)
‘match_parent_evotype’ : bool – whether or not to require that all contained objects match the parent Model’s evolution type. (default is False).
- itemslist, optional
Used by pickle and other serializations to initialize elements.
Creates a new OrderedMemberDict.
Parameters
- parentModel
The parent model, needed to obtain the dimension and handle updates to parameters.
- default_param{“TP”,”full”,…}
The default parameterization used when creating an object from a key assignment.
- prefixstr
The required prefix of all keys (which must be strings).
- flagsdict
A dictionary of flags adjusting the behavior of the created object. Allowed keys are:
‘cast_to_type’: {“operation”,`”state”,`None} – whether (or not) to automatically convert assigned values to a particular type of ModelMember object. (default is None)
‘auto_embed’ : bool – whether or not to automatically embed objects with a lower dimension than this OrderedMemberDict’s parent model. (default is False).
‘match_parent_statespace’ : bool – whether or not to require that all contained objects match the parent Model’s state space (perhaps after embedding). (default is False)
‘match_parent_evotype’ : bool – whether or not to require that all contained objects match the parent Model’s evolution type. (default is False).
- itemslist, optional
Used by pickle and other serializations to initialize elements.