pygsti.tools.basistools.basis_matrices

Contents

pygsti.tools.basistools.basis_matrices#

basis_matrices(name_or_basis, dim, sparse=False)#

Get the elements of the specified basis-type which spans the density-matrix space given by dim.

Parameters:
  • name_or_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 dim.

  • dim (int) – The dimension of the density-matrix space.

  • sparse (bool, optional) – Whether any built matrices should be SciPy CSR sparse matrices or dense numpy arrays (the default).

Returns:

A list of N numpy arrays each of shape (dmDim, dmDim), where dmDim is the matrix-dimension of the overall “embedding” density matrix (the sum of dim_or_block_dims) and N is the dimension of the density-matrix space, equal to sum( block_dim_i^2 ).

Return type:

list