Running calculations

Here we provide some examples of how to use the calculator, ranging from very basic to more advanced. That all scripts here have been written in such a fashion that they will run regardless of whether you have set mode = 'run' or mode = 'queue' in your .vasprc. Thus, if you are in queue mode on the cluster a small job will be submitted.

Basics - relaxing a water molecule

This example illustrates how to relax a water molecule using VASP’s internal relaxation routines. Note that the first and mandatory argument to the calculator is always the run directory where all VASP i/o files will be created. The atoms are passed to the calculator as a keyword argument, whereupon the calculator is attached to the atoms object internally. Note that the xc-functional is set via the special keyword argument xc where only the name of the functional is needed and any other INCAR settings needed by VASP will be set automatically. Before running the calculation we also set some submission options for the queue. Note that some prominent options such as walltime, account and nodes have their own keys in the VASPRC confiugration dictionary while others can be passed through the queue_options entry.

If we are submitting jobs through the queue, results are not immediately available to the script and the calculator handles this by simply returning None if the calculation has not finished, we use this to halt the script before any analysis is done. After the job is finished we simply rerun the script, this causes the calculator to restart and read the results without performing another calculation and we can continue on to analysis.