# VASP via AMS¶

## VASP support in the Amsterdam Modeling Suite¶

### General¶

With AMS2019.3, the graphical user interface supports setting up, running and visualizing some results from calculations run using the Vienna Ab initio Simulation Package, VASP, version 5.X. VASP itself is not included in the Amsterdam Modeling Suite, but needs to be obtained and installed separately. As the VASP code has not been developed by SCM, we cannot give support for VASP issues other than use via our GUI or PLAMS.

This feature is currently under active development, and should be considered experimental. We encourage users to report any problems they encounter, and to inform us about what type of features they would like to see added.

### VASP as an external engine¶

The GUI supports setting up calculations with VASP as an external engine to the AMS driver, hence “VASP via AMS”. This means that the AMS driver handles all changes to the system’s geometry during for example a geometry optimization, NEB calculation, or molecular dynamics simulation. The energy and forces at each step are calculated by a single point VASP calculation. Efficient use of restart files minimize the resulting overhead.

VASP can also natively perform geometry optimizations, NEB calculations, and molecular dynamics simulations, but the VASP-via-AMS feature only supports those types of calculations via the AMS driver.

AMS driver tasks that change the number of atoms from one step to the next, for example Grand-Canonical Monte Carlo, Molecule Gun, or the numerical calculation of phonons (via a supercell), are currently not supported by the VASP-via-AMS interface.

### Tutorials¶

There are tutorials that show how to use VASP via the GUI, and via the python scripting toolkit PLAMS.

## Setting up a VASP calculation¶

### VASP executable¶

There needs to be a working VASP installation on the machine where the calculation is run. Specify the exact command you would like to execute to run VASP as the Command to execute VASP on the main VASP page in ADFinput. For example, set it to mpirun -np 16 vasp, if you use mpirun to launch VASP and would like to parallelize over 16 processes.

### Pseudopotentials and PAW potentials (POTCAR)¶

VASP requires that pseudopotentials or PAW potentials be used for each element. Such potentials are distributed with VASP in files called POTCAR or POTCAR.Z. For example, the following files might exist for PAW potentials intended for use with the PBE density functional:

/some/path/PBE_PAW/H/POTCAR
/some/path/PBE_PAW/O/POTCAR
/some/path/PBE_PAW/O_h/POTCAR
/some/path/PBE_PAW/O_s/POTCAR


In this case, /some/path/PBE_PAW would be a POTCAR Library, that can be entered on the main VASP in ADFinput. That would by default use the /some/path/PBE_PAW/H/POTCAR and /some/path/PBE_PAW/O/POTCAR files for H and O, respectively. To specify other POTCAR files, for example the harder (O_h) or softer (O_s) PAW potentials for O, select those files on the Details → Pseudopotentials page.

If you set a POTCAR library, it will be remembered for the next time you launch ADFinput.

Note: The POTCAR library is a path on the machine running ADFinput, which need not be the same machine as where the calculation is eventually run.

Tip: If as an example you frequently use the O_h/POTCAR file for O atoms, consider creating a custom POTCAR library where this file is instead moved to O/POTCAR, so that it is automatically selected if you specify the custom POTCAR library.

### k-point sampling (KPOINTS)¶

You can specify the grid sizes for Monkhorst-Pack or Gamma-centered k-point grids, together with fractional k-point coordinate displacements, on the main page in ADFinput. If you would like to use a custom KPOINTS file (to be read by VASP), select your file under Details → Expert VASP → KPOINTS File. That file will override any other specified k-point settings.

Currently, to specify a path through the Brillouin zone for band structure calculations, or to use some manually specified set of k-points, you must generate such a KPOINTS file yourself.

### Other settings (INCAR)¶

Many calculation settings can be set using the GUI, for example,

• The planewave energy cutoff (main panel)
• The exchange-correlation functional (main panel)
• Fractional occupation scheme (smearing) (main panel)
• van der Waals corrections (Model → Van der Waals correction)
• Hubbard U parameters for different elements (Model → Hubbard U)
• WAVECAR or CHGCAR files for restarting or initializing a calculation (Details → Expert VASP)

Moreover, you can set arbitrary settings as “Additional INCAR options” on the Details → Expert VASP page. In case of any conflict between these and other INCAR-related settings set in the GUI, the “Additional INCAR options” take precedence.

You can also use your own INCAR file (Details → Expert VASP). That will ignore all INCAR-related settings in the GUI.

Note: the INCAR tags NSW, IBRION, ISIF, and LWAVE are automatically set by the AMS driver before VASP is executed.

## Running VASP via AMS¶

### Running VASP with ADFjobs¶

You can run a VASP-via-AMS job just like any other job using ADFjobs. If a geometry optimization, molecular dynamics simulation, or NEB calculation was performed, you can visualize the results in ADFmovie.

Note that the AMS driver enforces that LWAVE be set to .TRUE., thus leaving the WAVECAR file on disk. This file can become rather large, so if you do not need it for post-analysis, or for initializing another calculation, you could consider removing this file after the calculation has completely finished.

### Preprocessing the input¶

You can also choose to only do the necessary preprocessing of a job before VASP is executed, by selecting “Only preprocess” on the Details → Expert VASP page. By running such a job, the INCAR, POSCAR, POTCAR, KPOINTS, and any other auxiliary input files will be left on disk in the folder jobname.results/external, but VASP will not be executed. It may be useful to manually inspect the contents of these files, to see exactly what the input to VASP is. For the preprocessing step, no working installation of VASP is needed.

### Scripting support¶

Using VASP-via-AMS via the Python scripting framework PLAMS is fully supported, see the tutorial.

## VASP via AMS without the GUI¶

This section describes how to set up a VASP-via-AMS calculation without the GUI. Please note that the keyword names, and the syntax for setting up a VASP-via-AMS calculation, may change in future versions of the Amsterdam Modeling Suite. For this reason, we recommend setting up the calculation via the GUI.

Before ams is executed, the pertinent POTCAR (as read by VASP) must be created in $AMS_RESULTSDIR. VASP runs as an external engine to the AMS driver. The engine block to the AMS input file should read: Engine External InputDefinition$ADFHOME/data/input_def/vasp.json
Execute "$ADFBIN"/startpython "$ADFHOME"/scripting/standalone/external_engines/vasp.py
Input
...
EndInput
EndEngine


where $ADFHOME and $ADFBIN are replaced by their respective values, and where the allowed settings in the Input block are the following:

CHGCARFile
Type: String CHGCAR file Use a custom CHGCAR file for intializing the charge density. Note: You must also set ICHARG to an appropriate value for this CHGCAR file to be read by VASP.
EnergyChoice
Type: Multiple Choice FreeEnergy [FreeEnergy, EnergyWithoutEntropy, EnergySigmaToZero] Energy from OUTCAR The energy from the VASP output which is used with the AMS driver.
EnergyCutoff
Type: Float 400.0 eV Planewave energy cutoff The energy cutoff for the planewave basis set. VASP keyword: ENCUT
INCARFile
Type: String INCAR file Use a custom INCAR file. The keywords NSW, IBRION, ISIF, and LWAV must not be set in this INCAR file, since they are controlled by the AMS driver.
Initialize
Type: String WAVECAR file Path to a WAVECAR (wavefunction) file from a previous calculation that is used to initialize the present calculation. If specified, the file will be copied into the new calculation directory and the VASP keyword ISTART will be set to 1.
KPOINTSFile
Type: String KPOINTS file Use a custom KPOINTS file. This will override any other settings related to the k-point sampling.
KPOINTSOrigin
Type: Multiple Choice Monkhorst-Pack [Gamma-centered, Monkhorst-Pack] Type of k-point grid Type of regular k-point grid. Gamma-centered k-point grids always include the Gamma point, whereas Monkhorst-Pack grids do not include the Gamma point if any of the k-point grid dimensions is even. To use a custom set of k-points, or to specify paths in the Brillouin zone, prepare such a KPOINTS file manually and set the KPOINTSFile setting.
LDAU
Type: Bool False Use DFT+U Enables a DFT+U calculation. The options LMAXMIX, LDAUType, LDAUU, LDAUJ, and LDAUL must also be set.
LDAUJ
Type: Float List
LDAUL
Type: String
LDAUType
Type: Multiple Choice 2 [1, 2, 4] Hubbard U-Type 1: The rotationally invariant DFT+U introduced by Liechtenstein et al. 2: The simplified (rotationally invariant) approach to DFT+U, introduced by Dudarev et al. 4: Same as type 1, but without exchange splitting. VASP keyword: LDAUTYPE.
LDAUU
Type: Float List
LMAXMIX
Type: Integer 2 LMAXMIX VASP keyword: LMAXMIX
Misc
Type: Non-standard block Additional INCAR options The contents of this block are copied verbatim into the VASP INCAR file. Note: do not set NSW, IBRION, ISIF or LWAV in this block, as those keys are set by the AMS driver.
nk1
Type: Integer 1 Number of k-points in the first dimension
nk2
Type: Integer 1 Number of k-points in the second dimension
nk3
Type: Integer 1 Number of k-points in the third dimension
Occupation
Type: Multiple Choice Gaussian [Gaussian, Fermi, 1stOrderMethfesselPaxton, 2ndOrderMethfesselPaxton, TetrahedronMethodWithoutBlochlCorrections, TetrahedronMethodWithBlochlCorrections] Type of smearing Type of electronic smearing (fractional occupation scheme). VASP keyword: ISMEAR
OnlyPreprocessing
Type: Bool False Only preprocess If Yes, VASP will not be executed. Instead, the first set of input files (e.g. INCAR, POSCAR, POTCAR, KPOINTS) that would have been read by VASP will be left on disk for inspection.
POTCARLibrary
Type: String Path to POTCAR library Path to the POTCAR (pseudopotential) library, as delivered with VASP. This library must be accessible on the machine currently running ADFinput. For example, setting this to /library/PBE/PAW/ will use /library/PBE/PAW/Cu/POTCAR as the POTCAR file for Cu atoms by default. Click the arrow to see or change exactly which POTCAR files are used.
Precision
Type: Multiple Choice Normal [Single, Normal, Accurate] Precision VASP keyword: PREC
sk1
Type: Float 0.0 Fractional shift of the k-mesh in the first dimension
sk2
Type: Float 0.0 Fractional shift of the k-mesh in the second dimension
sk3
Type: Float 0.0 Fractional shift of the k-mesh in the third dimension
Smearing
Type: Float 0.2 eV Smearing width VASP keyword: SIGMA
SpinPolarization
Type: Bool False Spin-polarization Determines if a spin-polarized calculation is performed. If set, the VASP keyword ISPIN is set to 2.
VASPExec
Type: String Command to execute VASP Command used to execute VASP. For example: mpirun -np 4 vasp
vdW
Type: Multiple Choice Disable [Disable, DFT-D2, DFT-D3, DFT-D3(BJ), TS, TSWithIterativeHirshfeldPartitioning, ManyBodyDispersionEnergyMethod, IDVW=4] van der Waals method The van der Waals correction method. VASP keyword: IVDW Default: IVDW = 0 (Disable)
Verbosity
Type: Bool False Verbosity If set, more detailed information is printed in the output file.
XC
Type: Multiple Choice Auto [Auto, LDA, PBE, PW91, HF, PBE0, HSE06, B3LYP, 03, 05, 10, 20, 91, AM, B3, B5, BF, BO, CA, CO, HL, MK, OR, PE, PL, PS, PZ, RA, RE, RP, VW, WI] XC functional The exchange-correlation functional. This setting must be consistent with POTCAR. If your desired functional is not present in the list, choose Auto and set the GGA tag manually under Additional INCAR options. Note: not all functionals are implemented in all versions of VASP. Auto: The XC functional is determined by the information in POTCAR. The GGA setting is not set. LDA: the VASP GGA setting is set to an empty string. PBE: sets GGA = PE. PW91: sets GGA = 91. HF: Hartree-Fock. Sets LHFCALC = .TRUE, AEXX = 1, ALDAC = 0, AGGAC = 0. PBE0: sets GGA = PE, LHFCALC = .TRUE. HSE06: sets GGA = PE, LHFCALC = .TRUE., HFSCREEN = 0.2. B3LYP: sets LHFCALC = .TRUE., GGA = B3, AEXX = 0.2, AGGAX = 0.72, AGGAC = 0.81, ALDAC = 0.19. All other options set the VASP GGA setting to the corresponding value. For more information, see the VASP manual.