Jump to content

Requests for technical support from the VASP team should be posted in the VASP Forum.

Running GRACE force fields in VASP

From VASP Wiki
Revision as of 22:13, 31 March 2026 by Singraber (talk | contribs) (Created page with "{{available|6.6.0}} Pre-trained [https://gracemaker.readthedocs.io/ GRACE] machine-learned force fields can be used as an alternative to {{VASP}}-native force fields to drive essentially every {{VASP}} simulation which uses the the prediction-only mode {{TAG|ML_MODE|run}}. This includes molecular dynamics simulations, ionic optimization (see {{TAG|IBRION}}) and :Categ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Pre-trained GRACE machine-learned force fields can be used as an alternative to VASP-native force fields to drive essentially every VASP simulation which uses the the prediction-only mode ML_MODE = run. This includes molecular dynamics simulations, ionic optimization (see IBRION) and advanced sampling techniques. To be able to use GRACE force fields VASP must be built with VASPml (-Dlibvaspml) and GRACE support (-DVASPML_ENABLE_GRACE), for details see the build customization options.

Models

The easiest way to obtain GRACE models is to download them via the tensorpotential package, directly with pip or within a dedicated conda environment.

Install tensorpotential and all its dependencies simply with:

pip install tensorpotential==0.5.7

After installation the command line tool grace_models becomes available. First, inspect available models with

grace_models list

which will produce output like this:

...
Available models:
...
================================================================================
GRACE-2L-OMAT
	DESCRIPTION: A two-layer semi-local GRACE model, fitted on the OMat24 dataset, with fixed 6 A cutoff.
	PATH: /fsc/home/singraber/.cache/grace/GRACE-2L-OMAT
	CHECKPOINT: AVAILABLE, BUT NOT DOWNLOADED
	LICENSE: Academic Software License
================================================================================
...

Select a model and download it with the following command:

grace_models download [MODEL_NAME]

Given the example model above the command would be grace_models download GRACE-2L-OMAT. The GRACE model will be automatically downloaded and unpacked to the directory ~/.cache/grace/.

Select GRACE model in VASP

In the INCAR file the GRACE force field method must be selected via ML_TYPE = grace and the model may be specified via ML_GRACE_MODEL. A minimal block of tags could look like this:

...
# MD related settings, etc.
...
# ML force field settings
ML_LMLFF       = .TRUE.
ML_LIB         = .TRUE.
ML_MODE        = run
ML_TYPE        = grace
ML_GRACE_MODEL = GRACE-2L-OMAT
...