pygsti.modelmembers.operations.staticstdop
The StaticStandardOp class and supporting functionality.
Module Contents
Classes
An operation that is completely fixed, or "static" (i.e. that posesses no parameters) |
- class pygsti.modelmembers.operations.staticstdop.StaticStandardOp(name, basis='pp', evotype='default', state_space=None)
Bases:
pygsti.modelmembers.operations.linearop.LinearOperator
,pygsti.modelmembers.errorgencontainer.NoErrorGeneratorInterface
An operation that is completely fixed, or “static” (i.e. that posesses no parameters) that can be constructed from “standard” gate names (as defined in pygsti.tools.internalgates).
Parameters
- namestr
Standard gate name
- basisBasis or {‘pp’,’gm’,’std’}, optional
The basis used to construct the Hilbert-Schmidt space representation of this state as a super-operator.
- evotypeEvotype or str, optional
The evolution type. The special value “default” is equivalent to specifying the value of pygsti.evotypes.Evotype.default_evotype.
- state_spaceStateSpace, optional
The state space for this operation. If None a default state space with the appropriate number of qubits is used.
Initialize a new LinearOperator
- property total_term_magnitude
Get the total (sum) of the magnitudes of all this operator’s terms.
The magnitude of a term is the absolute value of its coefficient, so this function returns the number you’d get from summing up the absolute-coefficients of all the Taylor terms (at all orders!) you get from expanding this operator in a Taylor series.
Returns
float
- property total_term_magnitude_deriv
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.
Returns
- numpy array
An array of length self.num_params
- name
- to_dense(on_space='minimal')
Return the dense array used to represent this operation within its evolution type.
Note: for efficiency, this doesn’t copy the underlying data, so the caller should copy this data before modifying it.
Parameters
- on_space{‘minimal’, ‘Hilbert’, ‘HilbertSchmidt’}
The space that the returned dense operation acts upon. For unitary matrices and bra/ket vectors, use ‘Hilbert’. For superoperator matrices and super-bra/super-ket vectors use ‘HilbertSchmidt’. ‘minimal’ means that ‘Hilbert’ is used if possible given this operator’s evolution type, and otherwise ‘HilbertSchmidt’ is used.
Returns
numpy.ndarray
- taylor_order_terms(order, max_polynomial_vars=100, return_coeff_polys=False)
Get the order-th order Taylor-expansion terms of this operation.
This function either constructs or returns a cached list of the terms at the given order. Each term is “rank-1”, meaning that its action on a density matrix rho can be written:
rho -> A rho B
The coefficients of these terms are typically polynomials of the operation’s parameters, where the polynomial’s variable indices index the global parameters of the operation’s parent (usually a
Model
), not the operation’s local parameter array (i.e. that returned from to_vector).Parameters
- orderint
Which order terms (in a Taylor expansion of this
LindbladOp
) to retrieve.- max_polynomial_varsint, optional
maximum number of variables the created polynomials can have.
- return_coeff_polysbool
Whether a parallel list of locally-indexed (using variable indices corresponding to this object’s parameters rather than its parent’s) polynomial coefficients should be returned as well.
Returns
- termslist
A list of
RankOneTerm
objects.- coefficientslist
Only present when return_coeff_polys == True. A list of compact polynomial objects, meaning that each element is a (vtape,ctape) 2-tuple formed by concatenating together the output of
Polynomial.compact()
.
- to_memoized_dict(mmg_memo)
Create a serializable dict with references to other objects in the memo.
Parameters
- 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.).
Returns
- 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.