docs: def principal_angle(A,B):
      """
      Find the principal angle between two subspaces
      spanned by columns of A and B
      """
      from numpy.linalg import qr, svd
      qA, _ = qr(A)
      qB, _ = qr(B)
      U,S,V = svd(qA.T.dot(qB))
      return np.arccos(min(S.min(), 1.0))