  We consider classical particles on the line with the Weierstrass $\wp$
function as potential. This system parameterizes special solutions of the KP
equation. We derive the trace formula which relates the Hamiltonian of the
particle system to the residues of some Abelian differential (meromorphic
one-form) on the spectral curve. Such formula is important for the construction
action-angle variables and study invariant Gibbs' states.
