pygsti.tools.basistools.create_basis_for_matrix#
- create_basis_for_matrix(mx, basis)#
Construct a Basis object with type given by basis and dimension appropriate for transforming mx.
Dimension is taken from mx (if it’s not given by basis) that is sqrt(mx.shape[0]).
- Parameters:
mx (numpy.ndarray) – A matrix, assumed to be square and have a dimension that is a perfect square.
basis ({'std', 'gm', 'pp', 'qt'} or Basis object) – A basis name or Basis object. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt) (or a custom basis object). If a custom basis object is provided, it’s dimension must equal sqrt(mx.shape[0]), as this will be checked.
- Return type: