pygsti.modelmembers.operations.convert#
- convert(operation, to_type, basis, ideal_operation=None, flatten_structure=False, cptp_truncation_tol=1e-06)#
Convert operation to a new type of parameterization.
This potentially creates a new LinearOperator object, and Raises ValueError for invalid conversions.
- Parameters:
operation (LinearOperator) – LinearOperator 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 operation. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).
ideal_operation (LinearOperator or "identity", optional) – The ideal (usually unitary) version of operation, potentially used when converting to an error-generator type. The special value “identity” can be used to indicate that the ideal operation is the identity.
flatten_structure (bool, optional) – When False, the sub-members of composed and embedded operations are separately converted, leaving the original operation’s structure unchanged. When True, composed and embedded operations are “flattened” into a single operation of the requested to_type.
cptp_truncation_tol (float, optional (default 1e-6)) – Tolerance used for conversion to CPTP parameterizations. When converting to CPTP models negative eigenvalues of the choi matrix representation of a superoperator are truncated, which can result in a change in the PTM for that operator. This tolerance indicates the maximum amount of truncation induced deviation from the original operations (measured by frobenius distance) we’re willing to accept without marking the conversion as failed.
- Returns:
The converted operation, usually a distinct object from the operation object passed as input.
- Return type: