  We show how to construct an effective Hamiltonian whose dimension scales
linearly with system size, and whose eigenvalues systematically approximate the
excitation energies of GW theory. This is achieved by rigorously expanding the
self-energy in order to exactly conserve a desired number of
frequency-independent moments of the self-energy dynamics. Recasting $GW$ in
this way admits a low-scaling O[$N^4$] approach to build and solve this
Hamiltonian, with a proposal to reduce this further to O[$N^3$]. This relies on
exposing a novel recursive framework for the density response moments of the
random phase approximation (RPA), where the efficient calculation of its
starting point mirrors the low-scaling approaches to compute RPA correlation
energies. The frequency integration of $GW$ which distinguishes so many
different GW variants can be performed without approximation directly in this
moment representation. Furthermore, the solution to the Dyson equation can be
performed exactly, avoiding analytic continuation, diagonal approximations or
iterative solutions to the quasiparticle equation, with the full-frequency
spectrum obtained from the complete solution of this effective static
Hamiltonian. We show how this approach converges rapidly with respect to the
order of the conserved self-energy moments, and is applied across the GW100
benchmark dataset to obtain accurate $GW$ spectra in comparison to traditional
implementations. We also show the ability to systematically converge
all-electron full-frequency spectra and high-energy features beyond frontier
excitations, as well as avoiding discontinuities in the spectrum which afflict
many other GW approaches.
