Role of closed paths in the path integral approach of statistical thermodynamics