  We compute the Hamiltonian and Lagrangian associated to the large deviations
of the trajectory of the empirical distribution for independent Markov
processes, and of the empirical measure for translation invariant interacting
Markov processes. We treat both the case of jump processes (continuous-time
Markov chains and interacting particle systems) as well as diffusion processes.
For diffusion processes, the Lagrangian is a quadratic form of the deviation of
the trajectory from the Kolmogorov forward equation. In all cases, the
Lagrangian can be interpreted as a relative entropy or relative entropy density
per unit time.
