Tips and tricks#
This section introduces some tips and tricks for using the plugin.
Creating restarts of calculations#
You can create restarts easily using the
create_restart method attached to the
The function can also be applied to builder or input dictionary to created a copy with
Hence, the usage is not limited to the case where the calculation failed or the geometry optimisation
does not converged within the iteration limit. For example, you may just want to create
a series of calculation with slightly different parameters, which can be
achieved using the
For more detail, please see the docstring of
For workchains, use the
get_builder_restart method to get an
ProcessBuilder object containing
the original input.
Note that one still has to set
metadata fields (for example
as the aiida engine does not support inferring their values yet.
Creating pseudopotential families#
Update parameter of a calculation#
There is a
update_parameters method under
CastepCalculation which is available to quickly
change the input parameters of a calculation that is not yet stored in the database. Simply pass
the field you want to change as keyword arguments to the method.
A plain python dictionary may also be used as the input and will be serialized automatically into
Get a summary of the inputs and compare them#
get_castep_inputs_summary can be called to get a summary of the inputs
CastepCalculation at any time. In addition, the
can be used to compare the inputs between another calculation and returns the
difference in the inputs as a dictionary. The deepdiff package is used behind the scene.
Convention of kpoints#
CASTEP uses the Monkhorst-Pack grid formula following this <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.13.5188> paper,
where the directions with odd numbers are centred to the origin, and those with even numbers are not.
To get Gamma-centered grid,
kpoint_mp_offset needs to be specified with
-1/N for each direction with odd
For example, to use a Gamma-centered
8x8x8 grid, the follwing lines are required in the
kpoint_mp_grid: 8 8 8 kpoint_mp_offset: -0.0625 -0.0625 -0.0625
The plugin follows the same convention as used by the code, with the grid and the offsets passed to the code as they are.
This does mean that the same
KpointsData used for other DFT code can mean differently.
For example, a
(8, 8, 8) mesh given to
aiida-vasp is Gamma-centered, but is it not
when passed to
Certain quantities returned by methods of
KpointData assumes that grid is Gamma-centering,
so care should be taken to use them with
To select Gamma-centered kpoint grid, one can set the
ensure_gamma_centering port of the
CastepBaseWorkchain to be
This will automatically compute the offset and include it in the
KpointsData generated and passed to the underlying
bands output file written by CASTEP does not included the occupations for each band.
To read the occupation nubmers, one has to include the
castep_bin output in the retrieve list.
This will trigger the plugin to read the band information directly from this binary checkpoint file,
which contains the occupation numbers.
The will check if all kpoints contain empty bands, as otherwise the calculation results can have large errors.