malada.utils package¶
Submodules¶
malada.utils.cell_transformations module¶
WILL BE DELETED: Transformation matrices for supercell creation.
malada.utils.convergence_guesses module¶
Initial guesses for convergence calculations.
malada.utils.custom_converter module¶
Collection of custom converters.
-
malada.utils.custom_converter.
kelvin_to_eV
(temperature_K)¶ Convert a temperature from Kelvin to electron volts.
- Parameters
temperature_K (float) – Temperature in Kelvin.
- Returns
temperature_Ry – Temperature expressed in electron volts.
- Return type
float
-
malada.utils.custom_converter.
kelvin_to_rydberg
(temperature_K)¶ Convert a temperature from Kelvin to Rydberg energy units.
- Parameters
temperature_K (float) – Temperature in Kelvin.
- Returns
temperature_Ry – Temperature expressed in Rydberg.
- Return type
float
-
malada.utils.custom_converter.
second_to_rydberg_time
(time_s)¶ Convert a time from second to Rydberg unit time.
This is used in e.g. QE.
- Parameters
time_s (float) – Time in seconds.
- Returns
time_ry – Time in Rydberg unit time.
- Return type
float
malada.utils.parameters module¶
Collection of all parameters for the pipeline.
-
class
malada.utils.parameters.
Parameters
¶ Bases:
object
Holds parameters needed for constructing a data acqusition pipeline.
-
temperature
¶ Temperature in K.
- Type
float
-
number_of_atoms
¶ Number of atoms in supercell.
- Type
int
-
crystal_structure
¶ Crystal structure, this is used for supercell creation because it determines the transformations.
- Type
string
-
element
¶ Name of the element for which to generate data.
- Type
string
-
base_folder
¶ Base folder to operate in.
- Type
string
-
dft_calculator
¶ Name of the DFT calculator, currently only QuantumESPRESSO and VASP are supported.
- Type
string
-
md_calculator
¶ Name of the DFT-MD calculator, currently only QuantumESPRESSO and VASP are supported.
- Type
string
-
pseudopotential
¶ Dictionary for the pseudopotential. Needs to contain “path” for path to pseudopotential, “name” for name, and “valence_electrons” for number of valence electrons.
- Type
dict
-
run_system
¶ Run system used during pipeline, currently only “bash” and “slurm_creator” are supported.
- Type
string
-
dft_slurm
¶ Slurm parameters used for DFT calculations
- Type
malada.SlurmParameters
-
md_slurm
¶ Slurm parameters used for DFT-MD calculations. Please note that these should not be set here, as they will be overwritten in the pipeline.
- Type
malada.SlurmParameters
-
dft_conv_accuracy_meVperatom
¶ Accuracy of the DFT convergence calculations in meV/atom.
- Type
float
-
maximum_cutoff_try
¶ Maxmimum number of cutoff convergence iterations. If the optimal cutoff is not found with initial values, calculation of it it is retried maximum_cutoff_try number of times.
- Type
int
-
maximum_kpoint_try
¶ Maxmimum number of k-grid convergence iterations. If the optimal k-grid is not found with initial values, calculation of it it is retried maximum_kpoint_try number of times.
- Type
int
-
dft_scf_accuracy_per_atom_Ry
¶ Accuracy of all DFT calculation in terms of total energy/per atom.
- Type
float
-
md_at_gamma_point
¶ If True, MD simulations will be run at the gamma point.
- Type
bool
-
maximum_number_of_timesteps
¶ Maximum number of timesteps for MD calculation.
- Type
int
-
time_step_fs
¶ Timestep for MD calculation in fs.
- Type
float
-
md_thermostat_controller
¶ Thermostat controller for MD calculation. This is “NRAISE” for QE and “SMASS” for VASP.
- Type
float
-
snapshot_parsing_beginning
¶ The snapshot after which snapshot parsing is started. If < 0 automatic detection of this snapshot will be performed (currently not supported)
- Type
int
-
snapshot_parsing_temperature_tolerance_percent
¶ Maximum deviation of temperature between snapshot and desired temperature for snapshot to be considered for DFT calculation (in percent)
- Type
float
-
snapshot_parsing_criterion
¶ Criterion with which to parse the snapshots, currently only “random” is supported.
- Type
string
-
number_of_snapshots
¶ Number of snapshots the pipeline shoudl generate.
- Type
int
-
distance_metric_snapshots
¶ Distance metric to determine how alike two atomic snapshots are. Currently only “realspace”, i.e. the realspace distance between atoms is calculated.
- Type
string
-
distance_metric_snapshots_cutoff
¶ Minimum distance in terms of distance_metric_snapshots after which after which two snapshots are considered distinct by the algorithm.
- Type
float
-
number_of_bands_factor
¶ Determines how many more many more bands then number of electrons will be used. E.g. if =0.05, the overall number of bands will be the number of electrons times 1.05. Has to be scaled with temperature. Default is 0.05, which should be ok up to ~2500K.
- Type
float
-
malada.utils.slurmparams module¶
Parameters to create a slurm run script.
-
class
malada.utils.slurmparams.
SlurmParameters
¶ Bases:
object
Class holding slurm parameters.
-
scf_executable
¶ Executable called for the DFT/MD calculation.
- Type
string
-
module_loading_string
¶ String to be executed prior to regular execution. Contains e.g. module loading on HPC infrastructures.
- Type
string
-
execution_time
¶ Runtime of job in hours.
- Type
int
-
partition_string
¶ String to be written on the top of a batch script containing information about which partition/account to use.
- Type
string
-
mpi_runner
¶ MPI executable to be called for MPI jobs. There can be considerable differences in using mpiexec vs. mpirun.
- Type
string
-
tasks_per_node
¶ Number of tasks per node.
- Type
int
-
nodes
¶ Number of nodes.
- Type
int
-
classmethod
from_xml
(filename)¶ Create a SlurmParameters object from an xml file.
- Parameters
filename (string) – Path to file from which to create the parameters.
- Returns
slurm_parameters – The new parameters with values from the file
- Return type
-
get_mpirunner_process_params
()¶ Get the correct call parameter for the number of processes.
For srun it is “-n”, for mpiexec it is “-np”, etc.
- Returns
processparameter – The correct call parameter for this type of MPI runner.
- Return type
string
-
save
(filename)¶ Save the parameters to a xml file.
- Parameters
filename (string) – Path to file to save parameters to.
-
malada.utils.vasp_utils module¶
Utilities for setting up VASP calculations.
-
class
malada.utils.vasp_utils.
VaspUtils
¶ Bases:
object
Collection of functions to write to VASP files other then POSCAR.
-
static
write_to_incar
(folder, vasp_array)¶ Write a dictionary of VASP input quantities to an INCAR file.
Currently, there is NO sanity checking done here. Meaning that wrong INCAR files can be reated very easily.
- Parameters
folder (string) – Path to where to write the INCAR file.
vasp_array (dict) – Dictionary of VASP quantities.
-
static
write_to_kpoints
(folder, kgrid)¶ Write a k-grid to VASP KPOINTS file.
- Parameters
folder (string) – Path to where to write the INCAR file.
kgrid (tuple) – k-grid to write in form of (kx, ky, kz).
-
static
write_to_potcar_copy
(folder, pspstring)¶ Create a file that will copy the POTCAR file to the run folder.
VASP always looks for the POTCAR (PSP) in the current folder. Therefore, before running, we have to copy it.
- Parameters
folder (string) – Path tto where to create this script.
pspstring (string) – Path to POTCAR file.
-
static
Module contents¶
MALADA utils provides utilities for building data acquistion pipelines.