Hamiltonian formulation of time-dependent variational principles for the many-body system