The Helmholtz free energy functional F is defined as F = Ω Ω + ∫ ∫ d 3 r n ( r ) μ μ ( r ) . The functional derivative in the density function determines the local chemical potential: μ μ ( r ) = δ δ F ( r ) / δ δ n ( r ) . In classical statistical mechanics the partition function is a sum over probability for a given microstate of N classical particles as measured by the Boltzmann factor in the Hamiltonian of the system. The Hamiltonian splits into kinetic and potential energy, which includes interactions between particles, as well as external potentials. The partition function of the grand canonical ensemble defines the grand potential. A correlation function is introduced to describe the effective interaction between particles.