Diagonalization methods for the general bilinear Hamiltonian of an assembly of bosons