pygsti.tools.basistools.change_basis#
- change_basis(mx, from_basis, to_basis, expect_real=True)#
Convert a operation matrix from one basis of a density matrix space to another.
- Parameters:
mx (numpy array) – The operation matrix (a 2D square array or 1D vector) in the from_basis basis.
from_basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – The source basis. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).
to_basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – The destination basis. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object).
expect_real (bool, optional (default True)) – Optional flag specifying whether it is expected that the returned array in the new basis is real valued. Default is True.
- Returns:
The given operation matrix converted to the to_basis basis. Array size is the same as mx.
- Return type:
numpy array