orthogonal_columns

tenpy.linalg.np_conserved.orthogonal_columns(a, new_label=None)[source]

Find orthogonal columns for a given matrix.

Given a of shape (M,N) with M >= N and assuming full rank N of a, this function considers the columns of a as basis vectors and finds orthogonal columns completing it. The resulting ortho will be a (M, (M-N)) matrix. A simple (and more expensive) implementation based on qr() would look like this:

def orthogonal_columns(a, new_label):

q, r = ncp.qr(a, mode=’complete’, inner_labels=[new_label, None]) r_dense = r.to_ndarray() zero_r_rows = (np.linalg.norm(r_dense, axis=1) == 0) ortho = q.iproject(zero_r_rows, axis=1) ortho.iset_leg_labels([a.get_leg_labels()[0], new_label]) return ortho

Parameters:
  • a (Array) – A square matrix to be exponentiated, shape (M,N) with N <= M.

  • new_label (None | str) – New right label for the returned ortho. None defaults to the right label of A.

Returns:

ortho – Isometry in the sense ortho^dagger @ orhto == eye, i.e. has orthonormal columns. Further, all columns are orthonormal to the columns of a.

Return type:

Array