Usually, in second quantization formalism, we are dealing with hamiltonians that are certain functions of the creation and annihilation operators.
I have been given a particular state and I want to build an Hamiltonian, or more generally an operator, that is diagonal in said basis. So I want an Hamiltonian of the type \begin{equation} \hat{H}=\sum_i c_i|v_i\rangle\langle v_i| \end{equation} and I want to see how it looks like as a function of the creation/annihilation operators. I know how my states $|v_i\rangle$ look like (in the Fock basis representation they are $|v_i\rangle=\hat{a}_i \sum_{n_1,n_1,\dots} f(n_1)f(n_2)\dots|2n_1,2n_2,\dots\rangle$) and I can substitute them into the Hamiltonian to get the representation of the Hamiltonian in the Fock basis. \begin{equation} \hat{H}=\sum_ic_i\hat{a}_i \sum_{n_1,n_1,\dots,m_1,m_2,\dots} f(n_1)f(n_2)\dots f(n_1)f(n_2)\dots|2m_1,2m_2,\dots\rangle\langle2m_1,2m_2,\dots|\hat{a}^\dagger_i \end{equation} and then I could write $|2n_1,2n_2,\dots\rangle$ as $(a_1^\dagger)^{n_1}(a_2^\dagger)^{n_2}\dots|0,0,\dots\rangle$.
It may be a stupid question but how do I ''get rid'' of the vacuum states $|0,0,\dots\rangle\langle 0,0,\dots|$ or can I even do that? I know that when we have a first quantization Hamiltonian and we want to ''upgrade'' it to the second quantization form we sum over all the particles and over all the states and then we use a completeness relation to get rid of the bra\kets but it doesn't look like I can do it here so I was wondering if I can even ger rid of it.