Skip to content

microsoft/LightAIMD

Repository files navigation

LightAIMD

- Ubuntu 22.04
Build Build status badge
Sanity Test Test status badge

LightAIMD is a lightweight AIMD (ab initio molecular dynamics) simulation program for simulating aperiodic molecular systems, such as biomolecules.

Features

LightAIMD supports Hartree-Fock and Density Functional Theory based quantum chemistry calculations. Given a 3D molecular structure, LightAIMD can calculate single point energy, single point forces (electronic forces acting on the nuclei), or perform Born-Oppenheimer molecular dynamics simulation.

Getting started

You can use the scripts/build.py script to set up the development environment and build LightAIMD. This project provides a meta build system that automatically detects the code dependencies, generates the Ninja build scripts, and builds the project. The meta build system should work for most modern Linux systems.

To install the build tools, run the following command (python3 is required) if a supported package manager, apt, dnf, pacman, or zypper, is available on your system:

python3 scripts/build.py --install-build-tools

If the build script cannot locate a supported package manager, it will print the required packages that are missing and you need to install them manually. The following packages are required:

  • python3 (for running the build script)
  • git (for cloning the source code)
  • curl (for downloading the external libraries)
  • C and C++ compiler (GCC, Clang, or Intel® C/C++ compiler)
  • gfortran (for building libxc)
  • GNU AutoTools (for building libxc)
  • Ninja Build system
  • CUDA Toolkit (optional, for building the CUDA-enabled version of LightAIMD)

To build LightAIMD, simply run:

python3 scripts/build.py --build --release

To build the debug version, run:

python3 scripts/build.py --build --debug

You can also build the release version and the debug version at the same time:

python3 scripts/build.py --build --release --debug

The supported compilers include Clang, GCC, and Intel® C compiler (icx). You can specify the compiler by using "--compiler" option, with the following choices: "clang", "gcc", and "icx". For example, to use clang:

python3 scripts/build.py --build --release --compiler clang

The default compiler is gcc. To use the icx compiler, you need to install the Intel® oneAPI Base Toolkit and configure the local environment variables using the setvars.sh script, which can be found in the installation directory, for example:

source /opt/intel/oneapi/setvars.sh

If Intel® oneMKL, which is included in the Intel® oneAPI Base Toolkit, is installed and the local environment is configured with the above command, you can link to the Intel® oneMKL library instead of liblapacke by using the --use-mkl option:

python3 scripts/build.py --build --release --use-mkl # use the default compiler gcc

If you want to use the Intel® oneMKL library with the icx compiler, run the following command:

python3 scripts/build.py --build --release --use-mkl --compiler icx # use icx compiler

If the Nvidia CUDA Compiler nvcc is detected, the build script will compile the CUDA-enabled version of LightAIMD. To explicitly disable CUDA support, you can use the --disable-cuda option:

python3 scripts/build.py --build --release --disable-cuda

Sanity tests

After building LightAIMD, you can run the sanity tests:

python3 scripts/build.py --sanity-test --release

You can run the sanity tests for both the release version and the debug version if you have built both versions:

python3 scripts/build.py --sanity-test --release --debug

Run your first simulation

Single point energy calculation

You can run a Hartree-Fock (HF) based single point energy calculation:

./build/release/bin/lightaimd --hf --mol samples/h2o.xyz

or you can run a Density Functional Theory (DFT) based single point energy calculation:

./build/release/bin/lightaimd --dft --mol samples/h2o.xyz

Single point force calculation

You can run a HF based single point force calculation:

./build/release/bin/lightaimd --hf --force --mol samples/h2o.xyz

or you can run a DFT based single point force calculation:

./build/release/bin/lightaimd --dft --force --mol samples/h2o.xyz

Ab Initio Molecular Dynamics (AIMD) simulation

You can run an HF (Hartree-Fock) based simulation:

./build/release/bin/lightaimd --hf --bomd --mol samples/h2o.xyz

or you can run a DFT (Density Functional Theory) based simulation:

./build/release/bin/lightaimd --dft --bomd --mol samples/h2o.xyz

Here, --bomd stands for Born-Oppenheimer (Ab Initio) Molecular Dynamics.

Design philosophy

  • Minimalist yet generic
    • Supports all the basis sets on BSE (Basis Set Exchange)
    • Supports the following types of functionals provided by Libxc: LDA, GGA, Hybrid GGA, MGGA, and Hybrid MGGA
  • As self-contained as possible by minimizing external dependency

Contributing

Please read the development guide and the code of conduct for contributing code.

Follow these instructions for reporting security issues.

License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT license.

Disclaimer

LightAIMD is currently a research project. It is not an officially supported Microsoft product.

Acknowledgements

The repo doesn't contain 3rd party code. It links to the following external libraries:

To understand the theory behind LightAIMD, you may refer to this tutorial.