This repository contains code, data sets and models corresponding to the following publication:
Hyperdensity functional theory of soft matter
Florian Sammüller, Silas Robitschko, Sophie Hermann, and Matthias Schmidt, Phys. Rev. Lett. 133, 098201 (2024); arXiv:2403.07845.
For an introductory account and detailed derivations, see also:
Why hyperdensity functionals describe any equilibrium observable
Florian Sammüller and Matthias Schmidt, J. Phys.: Condens. Matter 37, 083001 (2025); arXiv:2410.10534.
A recent version of Julia must be installed on your system.
Launch the Julia REPL and enter the package manager by typing ]
.
Set up the project as follows:
activate .
instantiate
We consider the hard rod fluid ("HR"), the square well fluid with a range of 1.2 ("SW1.2") in one spatial dimension and the hard sphere fluid ("HS") in planar three dimensional geometry.
To test the hyper-DFT framework, the non-trivial observable of interest is chosen to be the largest cluster size of a given microstate (see also simulation.jl
for an algorithm to detect particle clusters).
Neural direct correlation functionals (see also NeuralDFT and NeuralDFT-Tutorial) can be loaded from the files model_<particles>.bson
.
Simulation data is provided in the directories data_<particles>_L<system length>
(raw) and in the files data_<particles>_L<system length>.jld2
(preprocessed).
The trained hyper-direct correlation functionals for the considered cluster observable are saved in the files model_cluster_<particles>_L<system length>.bson
.
Code to generate and process the reference simulation data as well as to train the neural hyper-direct correlation functional is given in main.jl
(the data for the 3D HS fluid has been generated with MBD).
Utilities are provided in simulation.jl
, dft.jl
and neural.jl
.
Plots of the manuscript can be reproduced with plots.ipynb
(start a Jupyter server to run this notebook).