This library calculates symmetry functions and their derivatives for machine learning potentials. For a short introduction see:
J. Behler, J. Chem. Phys. 134, 074106 (2011) (https://doi.org/10.1063/1.3553717)
The implementation is based on the concept of symmetry groups, as introduced in
A. Singraber, J, Behler, C. Dellago, J. Chem. Theory Comput. 15, 1827 (2019) (https://pubs.acs.org/doi/full/10.1021/acs.jctc.8b00770)
-
Element Embracing Symmetry Functions.
M. Eckhoff, M. Reiher, J. Chem. Theory Comput. 19, 3509 (2023) (https://pubs.acs.org/doi/full/10.1021/acs.jctc.3c00279)
- Git.
- OpenMP.
- cmake 3.22 (or later).
- GCC/G++ 11.4, C++ 17 standard (other compilers may work but are not tested; there are/were known compatibility problems
between Torch and GCC < 9, GCC >= 12. You can try setting
-DWARNINGS_AS_ERRORS=OFFto avoid compiler errors caused by warnings from this issue).
- Pybind11 (installed automatically if not available).
- GTest (installed automatically if not available).
- Boost/filesystem (1.74.0 or later).
- Torch/PyTorch (IMPORTANT: Check CXX11 ABI (see CMake flags below); see https://download.pytorch.org/whl/torch/ for different wheels).
- MKL (see
scripts/download_mkl.shfor installation tips).
git submodule init
git submodule update
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../inst -DCMAKE_PREFIX_PATH="$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')" ..
make -j10
make install
After calling make install, your installation directory will include the
header files (include), and a directory lib containing the shared library
for the Python bindings (SymFuncPy.cpython-<version-specification>.so),
the static library with the main implementation (libSymmetryFunctions.a), and the
Torch bindings libSymFuncTorch.so.
Export the path to the lib directory in your PYTHON_PATH to access the Python
bindings.
Other optional CMake flags:
-DSYM_PYTHON_BINDINGS=ON/OFF, defaultON.-DSYM_ENABLE_TESTS=ON/OFF, defaultON.-DSYMMETRY_FUNCTIONS_MARCH=<march-flag>, defaultnative.-DPYTHON_EXECUTABLE=<path to Python interpreter>.-DSYM_TORCH_BINDINGS=ON/OFF, defaultON.-D_GLIBCXX_USE_CXX11_ABI=0to use pre CXX11 ABI (REQUIRED by some torch versions.).-DWARNINGS_AS_ERRORS=ON/OFF, defaultON. Compile with the-Werror.
Required CMake flags for Torch bindings:
- Add
-DCMAKE_PREFIX_PATH="$(python -c 'import torch.utils; print(torch.utils.cmake_prefix_path)')"to the cmake call.
git submodule init
git submodule update
python3 -m pip install .
You can pass arguments to cmake by exporting the variable CMAKE_ARGS, e.g.,
CMAKE_ARGS=-DSYM_ENABLE_TESTS=OFF to disable compiling the tests. Note that
installing with pip will also change the directory of the Torch bindings
shared library to your python-environment site-package directory.
After compiling (installation not required), the test executable
SymmetryFunctions_tests will be in the directory build/bin.
You can run the tests by executing ./SymmetryFunctions_tests.
See src/Tests/python_bindings_test.py for an example.
See src/Tests/torch_bindings_test.py for an example.