pygsti.modelmembers.term.RankOnePolynomialOpTerm#
- class RankOnePolynomialOpTerm(rep, evotype)#
Bases:
RankOneOpTerm,_HasPolynomialCoefficientAn operation term with polynomial coefficient.
Methods
__init__(rep, evotype)compose(all_terms)Compose all_terms and set the composed term's magnitude to magnitude.
copy()Copies this term.
copy_with_magnitude(mag)Copy and set the magnitude of the copy to mag
create_from(coeff, pre_op, post_op, evotype, ...)Creates a
RankOneOpTermusing natural arguments.embed(state_space, target_labels)Embeds this term's action as a part of a larger state space.
map_indices_inplace(mapfn)Performs a bulk find & replace on the coefficient polynomial's variable indices.
mapvec_indices_inplace(mapvec)Performs a bulk find & replace on this polynomial's variable indices.
torep()Access to the underlying representation object.
Attributes
The term's coefficient (a
Polynomial).- compose(all_terms)#
Compose all_terms and set the composed term’s magnitude to magnitude.
- Parameters:
all_terms (list) – List of the terms to compose.
- Return type:
- copy()#
Copies this term.
- Return type:
- copy_with_magnitude(mag)#
Copy and set the magnitude of the copy to mag
- Parameters:
mag (float) – Magnitude to set.
- Return type:
- classmethod create_from(coeff, pre_op, post_op, evotype, state_space)#
Creates a
RankOneOpTermusing natural arguments.- Parameters:
coeff (Polynomial or complex) – The term’s coefficient.
pre_op (LinearOperator or OpRep or numpy.ndarray) – The left-side operator, i.e. A in rho => A rho B^dag.
post_op (LinearOperator or OpRep or numpy.ndarray) – The right-side operator, i.e. B in rho => A rho B^dag.
evotype (Evotype or str) – The evolution type
state_space (StateSpace or str) – The state space of this term.
- Return type:
- embed(state_space, target_labels)#
Embeds this term’s action as a part of a larger state space.
- Parameters:
state_space (StateSpace) – The full state space this term’s action will be embedded into.
target_labels (tuple) – A tuple of the target labels.
- Return type:
- map_indices_inplace(mapfn)#
Performs a bulk find & replace on the coefficient polynomial’s variable indices.
This function should only be called when this term’s coefficient is a
Polynomial.- Parameters:
mapfn (function) – A function that takes as input an “old” variable-index-tuple (a key of this Polynomial) and returns the updated “new” variable-index-tuple.
- Return type:
None
- mapvec_indices_inplace(mapvec)#
Performs a bulk find & replace on this polynomial’s variable indices.
This function is similar to
map_indices()but uses a vector to describe individual index updates instead of a function for increased performance.This function should only be called when this term’s coefficient is a
Polynomial.- Parameters:
mapvec (numpy.ndarray) – An array whose i-th element gives the updated “new” index for the i-th variable. Note that this vector maps individual variable indices old->new, whereas mapfn in
map_indices()maps between tuples of indices.- Return type:
None
- torep()#
Access to the underlying representation object.
- property coeff#
The term’s coefficient (a
Polynomial).