Abstract
We explore the feasibility of using machine learning methods to obtain an analytic form of the classical free energy functional for two model fluids, hard rods and Lennard--Jones, in one dimension . The Equation Learning Network proposed in Ref. 1 is suitably modified to construct free energy densities which are functions of a set of weighted densities and which are built from a small number of basis functions with flexible combination rules. This setup considerably enlarges the functional space used in the machine learning optimization as compared to previous work 2 where the functional is limited to a simple polynomial form. As a result, we find a good approximation for the exact hard rod functional and its direct correlation function. For the Lennard--Jones fluid, we let the network learn (i) the full excess free energy functional and (ii) the excess free energy functional related to interparticle attractions. Both functionals show a good agreement with simulated density profiles for thermodynamic parameters inside and outside the training region.
Introduction
Classical Density Functional Theory (DFT) is a cornerstone for understanding fluid behavior. The "holy grail" of DFT is the excess free energy functional ($F^{ex}$), which contains all information about particle interactions. However, for most systems, its exact form is unknown. While machine learning has recently been used to "learn" these functionals, most models are "black boxes" that offer no physical insight and struggle with functional derivatives essential for calculating structural properties. This paper introduces the Functional Equation Learner (FEQL), a specialized neural network that moves beyond black-box models to discover actual analytical equations for classical density functionals.
Methods
The FEQL network is designed to output symbolic mathematics. It utilizes a physics-informed approach by first transforming raw density into "weighted densities" ($n_i$) via convolution kernels, a step inspired by Fundamental Measure Theory (FMT).
The network architecture consists of layers with specific mathematical operations: unary units (identity, exponential, logarithm) and binary units (multiplication, division). To ensure simplicity and interpretability, the authors apply $L_1$ regularization (Lasso) and a three-step training process to prune the network. This "Occam’s Razor" approach forces the discovery of the simplest mathematical expression that fits the data. Because the resulting functional is built from simple basis functions, it is analytically differentiable, allowing for the calculation of the direct correlation function (DCF).
Results
The model was trained and evaluated on 1D Hard Rods (HR) and Lennard-Jones (LJ) fluids. For Hard Rods, the FEQL recovered a functional providing a near-perfect match to the exact equation of state and density profiles, even for high-density regimes outside the training data.
For the LJ fluid, the authors found that splitting the functional into a known repulsive part and a learned attractive part led to superior stability and accuracy. The ML-generated functional showed excellent agreement with Grand Canonical Monte Carlo (GCMC) simulations and avoided unphysical instabilities common in earlier ML models.
As shown in Figure 3, the learned functionals didn't just "memorize" the training data; they remained accurate for thermodynamic parameters outside the training region, such as interaction strengths nearly triple the training limit. The model also successfully captured the direct correlation function, particularly the challenging "hard core" exclusion region.
Conclusion
The FEQL approach demonstrates that machine learning can be used to discover interpretable, analytical physical laws. By moving beyond polynomial approximations, the network captures the complex physics of dense fluids while providing formulas that researchers can inspect and implement in standard DFT solvers. While currently focused on 1D systems, extending this framework to 3D by incorporating tensor weighted densities is a promising direction for future research.
Summary updated