pygsti.objects.TPParameterizedSPAMVec¶
-
class
pygsti.objects.
TPParameterizedSPAMVec
(vec)¶ Encapsulates a SPAM vector that is fully parameterized except for the first element, which is frozen to be 1/(d**0.25). This is so that, when the SPAM vector is interpreted in the Pauli or Gell-Mann basis, the represented density matrix has trace == 1. This restriction is frequently used in conjuction with trace-preserving (TP) gates.
-
__init__
(vec) Initialize a TPParameterizedSPAMOp object.
Parameters: vec (array_like or SPAMVec) – a 1D numpy array representing the SPAM operation. The shape of this array sets the dimension of the SPAM op.
Methods
__init__
(vec)Initialize a TPParameterizedSPAMOp object. convert_to_vector
(V)Static method that converts a vector-like object to a 2D numpy dim x 1 column array. copy
()Copy this SPAM vector. deriv_wrt_params
()Construct a matrix whose columns are the derivatives of the SPAM vector with respect to a single param. from_vector
(v)Initialize the SPAM vector using a 1D array of parameters. get_dimension
()Return the dimension of the gate matrix. num_params
()Get the number of independent parameters which specify this SPAM vector. set_vector
(vec)Attempts to modify SPAMVec parameters so that the specified raw SPAM vector becomes vec. to_vector
()Get the SPAM vector parameters as an array of values. -