Imposing particle number subspace on second quantized Hamiltonians
$\newcommand{\Ket}[1]{\left|#1\right&gt;}$
$\newcommand{\Bra}[1]{\left&lt;#1\right|}$
$\newcommand{\BraKet}[2]{{\left&lt;#1}\left|#2\right&gt;}$

It's an older question, but one worth answering!

For the uninitiated, second quantization is a bookkeeping technique that describes many-particle systems as excited states of a field, usually taken to be the reference field or vacuum state. I found the most clear description of it in atomic_rabbit's answer to this reddit post. The second-quantized operator is useful because this form allows it to be applied to an indeterminately sized system (the number of particles is not explicitly stated in the second-quantized operator).

Now, onto the question:

The "first-quantized" (electronic) Hamiltonian has the form (in atomic units):

$\hat{H} = \sum_i\frac{1}{2}\nabla^2_i - \sum_i\sum_A\frac{Z_A}{r_{iA}}+\frac{1}{2}\sum_i\sum_j\frac{1}{r_{ij}} = \sum_i\hat{h}(i)+\frac{1}{2}\sum_i\sum_j\frac{1}{r_{ij}}$ 

which, upon second quantization, goes to:

$\hat{H} = \sum_{p,q}\Bra{p}\hat{h}\Ket{q}a^+_pa_q + \frac{1}{4}\sum_{p,q,r,s}\Bra{pq}\Ket{rs}a^+_pa^+_qa_sa_r$

In the case of "first quantization", we construct the matrix form of the operator by projecting it onto whatever basis functions we're using. We then find the eigenvalues of the operator by diagonalizing its matrix form. Your question is an excellent one, because in second quantization, this projection seems to be already done within the operator, and so we should be able to diagonalize the operator outright. Right?

The catch is that the second-quantized operator still has the creation and annihilation operators that have not yet been projected onto any basis. This is equivalent to us not knowing whether there is a particle in the p$^{th}$ state. And what are the states? Those are properties of the field, which we must find out by projecting the second-quantized operator onto said field.