pygsti.tools.matrixtools.independent_columns

pygsti.tools.matrixtools.independent_columns#

independent_columns(m, initial_independent_cols=None, tol=1e-07)#

Computes the indices of the linearly-independent columns in a matrix.

Optionally starts with a “base” matrix of independent columns, so that the returned indices indicate the columns of m that are independent of all the base columns and the other independent columns of m.

Parameters:
  • m (numpy.ndarray or scipy sparse matrix) – The matrix.

  • initial_independent_cols (numpy.ndarray or scipy sparse matrix, optional) – If not None, a matrix of known-to-be independent columns so to test the columns of m with respect to (in addition to the already chosen independent columns of m.

  • tol (float, optional) – Tolerance threshold used to decide whether a singular value is nonzero (it is if it’s is greater than tol).

Returns:

A list of the independent-column indices of m.

Return type:

list