The StaticPureState class and supporting functionality.

Module Contents



A pure state vector that is completely fixed, or "static" (i.e. that posesses no parameters).

class pygsti.modelmembers.states.staticpurestate.StaticPureState(purevec, basis='pp', evotype='default', state_space=None)

Bases: pygsti.modelmembers.states.densestate.DensePureState, pygsti.modelmembers.errorgencontainer.NoErrorGeneratorInterface

A pure state vector that is completely fixed, or “static” (i.e. that posesses no parameters).


vecarray_like or SPAMVec

a 1D numpy array representing the SPAM operation. The shape of this array sets the dimension of the SPAM op.

basisBasis or {‘pp’,’gm’,’std’}, optional

The basis used to construct the Hilbert-Schmidt space representation of this state as a super-ket.

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 state Vector

taylor_order_terms(order, max_polynomial_vars=100, return_coeff_polys=False)

Get the order-th order Taylor-expansion terms of this state vector.

This function either constructs or returns a cached list of the terms at the given order. Each term is “rank-1”, meaning that it is a state preparation followed by or POVM effect preceded by actions on a density matrix rho of the form:

rho -> A rho B

The coefficients of these terms are typically polynomials of the State’s parameters, where the polynomial’s variable indices index the global parameters of the State’s parent (usually a Model) , not the State’s local parameter array (i.e. that returned from to_vector).


The order of terms to get.

max_polynomial_varsint, optional

maximum number of variables the created polynomials can have.


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.


A list of RankOneTerm objects.


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