  Up to this point, the aim was to develop a free field theory. Doing so does not only neglect interaction with other particles (fields), it is even unrealistic for one free particle because it interacts with the field that it generates itself. For the description of interactions—such as scattering in particle colliders—we need certain extensions and modifications of the formalism. The immediate contact between scattering experiments and QFT is given by the scattering or S-matrix which contains all the relevant predictive information about, e.g., scattering cross sections.  There are many schemes to calculate the S-matrix, among which one introduces the Hamiltonian formalism. The Hamiltonian density can be derived from the Lagrangian density by means of a Legendre transformation.