  We present a compressive sensing approach for the long standing problem of
Matsubara summation in many-body perturbation theory. By constructing
low-dimensional, almost isometric subspaces of the Hilbert space we obtain
optimum imaginary time and frequency grids that allow for extreme data
compression of fermionic and bosonic functions in a broad temperature regime.
The method is applied to the random phase and self-consistent $GW$
approximation of the grand potential. Integration and transformation errors are
investigated for Si and SrVO$_3$.
