Skip to content

Support reading in of local VASP setups via a .json file

Andrew Rosen requested to merge (removed):rosen-setups into master

Motivation

Context: See !2232 (comment 747431119). Currently, there is no easy way to read in a pre-defined setups dictionary in the Vasp() calculator, which makes it easy to make mistakes between calculations and is not particularly amenable to large screening studies where someone might want to define their own base setups for the entire periodic table.

Changes in this PR

There are now two ways to read in custom, pre-defined setups.

In the first way, simply provide a full path to a .json file containing the desired setups.

In the second way, if the ASE_VASP_SETUPS environment variable is defined by the user and setups='$mysetups' in the Vasp() calculator, then it will read in the corresponding mysetups.json file in the ASE_VASP_SETUPS directory. Note that '$mysetups' is merely an example. Using setups='$mysetups2' would read in the file at ${ASE_VASP_SETUPS}/mysetups2.json. In this way, one can create a library of custom setups and switch between them extremely easily for their various projects.

Example 1

from ase.calculators.vasp import Vasp
calc = Vasp(xc = 'PBE', setups = '/path/to/my/mysetups.json')

Example 2

export ASE_VASP_SETUPS='/path/to/my/setups' # in that folder is mysetups.json
from ase.calculators.vasp import Vasp
calc = Vasp(xc = 'PBE', setups = '$mysetups') # where mysetups.json is in the ASE_VASP_SETUPS directory
Edited by Andrew Rosen

Merge request reports