Here is my question: Second-quantized Hamiltonians act on any state, regardless of how many electrons the state has. They are also block diagonal on different particle-number subspaces, as they commute with the electron number operator.
Now, suppose that one writes down a molecular Hamiltonian in the second-quantized formalism. In order to get the ground state energy, does one need to project the Hamiltonian on the correct electron subspace and diagonalize?
Or is the bare diagonalization of the Hamiltonian (without projecting) sufficient to pick the subspace with the right number of electrons?