pygsti.modelmembers.states.convert

Contents

pygsti.modelmembers.states.convert#

convert(state, to_type, basis, ideal_state=None, flatten_structure=False, cp_penalty=1e-07)#

TODO: update docstring Convert SPAM vector to a new type of parameterization.

This potentially creates a new State object. Raises ValueError for invalid conversions.

Parameters:
  • state (State) – State vector to convert

  • to_type ({"full","full TP","static","static unitary","clifford",LINDBLAD}) – The type of parameterizaton to convert to. “LINDBLAD” is a placeholder for the various Lindblad parameterization types. See Model.set_all_parameterizations() for more details.

  • basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – The basis for state. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).

  • ideal_state (State, optional) – The ideal (usually pure) version of state, potentially used when converting to an error-generator type.

  • flatten_structure (bool, optional) – When False, the sub-members of composed and embedded operations are separately converted, leaving the original state’s structure unchanged. When True, composed and embedded operations are “flattened” into a single state of the requested to_type.

  • cp_penalty (float, optional) – CPTP penalty that gets factored into the optimization to find the resulting model when converting to an error-generator type.

Returns:

The converted State vector, usually a distinct object from the object passed as input.

Return type:

State