gramian_reduction function

Helper function to slm_fit_csr