fortnet icon indicating copy to clipboard operation
fortnet copied to clipboard

Fortnet is a Behler-Parrinello-Neural-Network implementation, written in modern Fortran.


Fortnet: A Behler-Parrinello-Neural-Network Implementation


|license| |latest version| |doi| |issues|

Fortnet is a Behler-Parrinello-Neural-Network implementation, written in modern Fortran. Using atom-centered symmetry functions to characterize local atomic environments, Fortnet provides easy access to the famous BPNN neural network architecture to predict atomic or global properties of your physical system, featuring powerful but optional MPI parallelism.

|logo|

Installation

|build status|

Building from source

Note: This section describes the building with default settings in a typical Linux environment. For more detailed information on the build customization and the build process, consult the detailed building instructions in INSTALL.rst <INSTALL.rst>_.

Download the latest stable source code from GitHub <https://github.com/vanderhe/fortnet/>_::

git clone https://github.com/vanderhe/fortnet.git

You need CMake (>= 3.16) to build and h5py to test Fortnet. If your environment offers no CMake/h5py or only older versions, you can easily install the latest software via Python's pip command::

pip install cmake h5py

Start CMake by passing your compilers environment variables FC, CC and the location where the code should be installed and the build directory (_build) as options::

FC=mpifort CC=gcc cmake -DCMAKE_INSTALL_PREFIX=$HOME/opt/fnet -B _build .

If the configuration was successful, start the build with::

cmake --build _build -- -j

After successful build, you should test the code by running::

pushd _build ctest -j popd

If the tests were successful, install the package via::

cmake --install _build

For further details see the detailed building instructions <INSTALL.rst>_.

Obtaining via Conda

An alternative way of obtaining Fortnet is to install it via the conda package management framework using Miniconda <https://docs.conda.io/en/latest/miniconda.html>_ or Anaconda <https://www.anaconda.com/products/individual>_. Make sure to add/enable the conda-forge channel in order to be able to access Fortnet::

conda config --add channels conda-forge

We recommend to set up a dedicated conda environment and to use the mamba installer <https://mamba.readthedocs.io/>_::

conda create --name fortnet conda activate fortnet conda install mamba

There are several build variants available, choose the one suiting your needs. For example, by issuing ::

mamba install 'fortnet==nompi_'

or ::

mamba install 'fortnet==mpi_mpich_'

or ::

mamba install 'fortnet==mpi_openmpi_'

to get the last stable release of Fortnet with, respectively, serial build or with MPI-parallelized build using either the MPICH or the OpenMPI framework.

Depending on whether you decided for a serial or parallel version, you may issue ::

fnet

or ::

mpirun -np ${NPROCS} fnet

to start Fortnet. ${NPROCS} is to be substituted by the number of MPI tasks (in general number of CPU cores) available.

Documentation

|docs status|

Consult following resources for documentation:

  • Step-by-step instructions with selected examples (Fortnet Recipes) <https://fortnet.readthedocs.io/>_

Citing

When publishing results obtained with Fortnet, please cite the following article:

  • Fortnet, a software package for training Behler-Parrinello neural networks; Computer Physics Communications 284, 108580 (2023) <https://doi.org/10.1016/j.cpc.2022.108580>_

Contributing

New features, bug fixes, documentation, tutorial examples and code testing is welcome during the ongoing Fortnet development!

The project is hosted on github <https://github.com/vanderhe/fortnet/>. Please check CONTRIBUTING.rst <CONTRIBUTING.rst> for guide lines.

I am looking forward to your pull request!

License

Fortnet is released under the GNU Lesser General Public License. See the included LICENSE <LICENSE>_ file for the detailed licensing conditions.

.. |logo| image:: ./utils/art/logo.svg :alt: Fortnet logo :width: 90 :target: https://github.com/vanderhe/fortnet/

.. |license| image:: ./utils/art/gnu-lgplv3.svg :alt: LGPL v3.0 :scale: 100% :target: https://opensource.org/licenses/LGPL-3.0

.. |latest version| image:: https://img.shields.io/github/v/release/vanderhe/fortnet :target: https://github.com/vanderhe/fortnet/releases/latest

.. |doi| image:: https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2022.108580-blue :target: https://doi.org/10.1016/j.cpc.2022.108580

.. |docs status| image:: https://readthedocs.org/projects/fortnet/badge/?version=latest :alt: Documentation Status :scale: 100% :target: https://fortnet.readthedocs.io/en/latest/

.. |issues| image:: https://img.shields.io/github/issues/vanderhe/fortnet.svg :target: https://github.com/vanderhe/fortnet/issues/

.. |build status| image:: https://img.shields.io/github/actions/workflow/status/vanderhe/fortnet/build.yml :target: https://github.com/vanderhe/fortnet/actions/