pygsti.tools.basistools.stdmx_to_vec

Contents

pygsti.tools.basistools.stdmx_to_vec#

stdmx_to_vec(m, basis)#

Convert a matrix in the standard basis to a vector in the Pauli basis.

Parameters:
  • m (numpy array) – The matrix, shape 2x2 (1Q) or 4x4 (2Q)

  • basis ({'std', 'gm', 'pp', 'qt'} or Basis) – The basis type. Allowed values are Matrix-unit (std), Gell-Mann (gm), Pauli-product (pp), and Qutrit (qt). If a Basis object, then the basis matrices are contained therein, and its dimension is checked to match m.

Returns:

The vector, length 4 or 16 respectively.

Return type:

numpy array