code: def low_rank_eigen(G, num_eig):
      """Calculate num_eig eigenvectors and eigenvalues of gaussian matrix G.
  
      Enables lower dimensional solving.
  
      """
      S, Q = np.linalg.eigh(G)
      eig_indices = list(np.argsort(np.abs(S))[::-1][:num_eig])
      Q = Q[:, eig_indices]  # eigenvectors
      S = S[eig_indices]  # eigenvalues.
      return Q, S
  
file_path: dipy/dipy/align/cpd.py
imports: import numpy
  import numbers
  from warnings import warn
label_desc: Use image node_id 2 for calling a global function with example usage: low_rank_eigen(G, num_eig) and returns: Q,  S