dfttk package
Submodules
dfttk.eos_fit module
This EOS fitting code is based on the following paper:
Shun-Li Shang et al., Computational Materials Science, 47, 4, (2010). https://doi.org/10.1016/j.commatsci.2009.12.006
It includes the following equations of state: 4-parameter Teter-Shang modified Birch-Murnaghan (mBM4), 5-parameter Teter-Shang modified Birch-Murnaghan (mBM5), 4-parameter Birch-Murnaghan (BM4), 5-parameter Birch-Murnaghan (BM5), 4-parameter Natural (LOG4), 5-parameter Natural (LOG5), 4-parameter Murnaghan, 4-parameter Vinet, and 4-parameter Morse.
- dfttk.eos_fit.BM4(volume, energy)[source]
Fits the BM4 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.BM4_derivative(volume, b, c, d)[source]
Derivative of BM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.BM4_derivative2(volume, b, c, d)[source]
Second derivative of BM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.BM4_eos_parameters(a, b, c, d)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, and d.
- Parameters:
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.BM4_equation(volume, a, b, c, d)[source]
BM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
energy(s)
- Return type:
float | np.ndarray
- dfttk.eos_fit.BM5(volume, energy)[source]
Fits the BM5 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.BM5_derivative(volume, b, c, d, e)[source]
Derivative of BM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.BM5_derivative2(volume, b, c, d, e)[source]
Second derivative of BM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.BM5_eos_parameters(volume_range, a, b, c, d, e)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.
- Parameters:
volume_range (np.ndarray) – range of volumes
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.BM5_equation(volume, a, b, c, d, e)[source]
BM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG4(volume, energy)[source]
Fits the LOG4 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.LOG4_derivative(volume, b, c, d)[source]
Derivative of LOG4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG4_derivative2(volume, b, c, d)[source]
Second derivative of LOG4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG4_eos_parameters(volume_range, a, b, c, d)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, and d.
- Parameters:
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.LOG4_equation(volume, a, b, c, d)[source]
LOG4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG5(volume, energy)[source]
Fits the LOG5 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.LOG5_derivative(volume, b, c, d, e)[source]
Derivative of LOG5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG5_derivative2(volume, b, c, d, e)[source]
Second derivative of LOG5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.LOG5_eos_parameters(volume_range, a, b, c, d, e)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.
- Parameters:
volume_range (np.ndarray) – range of volumes
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.LOG5_equation(volume, a, b, c, d, e)[source]
LOG5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.fit_to_all_eos(df)[source]
Fits the volume and energies of configurations to all EOS functions and returns the results in a dataframe.
- Parameters:
df (
DataFrame
) – Dataframe from extract_configuration_data in dfttk.aggregate_extraction- Return type:
tuple
[DataFrame
,DataFrame
]- Returns:
tuple(eos_values_df, eos_parameters_df)
- dfttk.eos_fit.mBM4(volume, energy)[source]
Fits the mBM4 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.mBM4_derivative(volume, b, c, d)[source]
Derivative of mBM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.mBM4_derivative2(volume, b, c, d)[source]
Second derivative of mBM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.mBM4_eos_parameters(a, b, c, d)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, and d.
- Parameters:
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.mBM4_equation(volume, a, b, c, d)[source]
mBM4 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.mBM5(volume, energy)[source]
Fits the mBM5 EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.mBM5_derivative(volume, b, c, d, e)[source]
Derivative of mBM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.mBM5_derivative2(volume, b, c, d, e)[source]
Second derivative of mBM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
second derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.mBM5_eos_parameters(volume_range, a, b, c, d, e)[source]
Calculate V0, E0, B, BP, and B2P from a, b, c, d, and e.
- Parameters:
volume_range (np.ndarray) – range of volumes
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
V0, E0, B, BP, B2P
- Return type:
tuple[float, float, float, float, float]
- dfttk.eos_fit.mBM5_equation(volume, a, b, c, d, e)[source]
mBM5 EOS.
- Parameters:
volume (float | np.ndarray) – input volume
a (float) – a-parameter
b (float) – b-parameter
c (float) – c-parameter
d (float) – d-parameter
e (float) – e-parameter
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.morse(volume, energy)[source]
Fits the Morse EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.morse_derivative(volume, b, c, d)[source]
Derivative of Morse EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.morse_equation(volume, V0, E0, B, BP)[source]
Morse EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
E0 (float) – equilibrium energy
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.murnaghan(volume, energy)[source]
Fits the Murnaghan EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.murnaghan_derivative(volume, V0, B, BP)[source]
Derivative of Murnaghan EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.murnaghan_equation(volume, V0, E0, B, BP)[source]
Murnaghan EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
E0 (float) – equilibrium energy
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.plot_config_energy(df, max_rank=10000, inset_max_rank=10, show_inset=True, color_assignment=None, show_fig=True)[source]
- dfttk.eos_fit.plot_energy_difference(df, reference_config, per_atom=False, show_fig=True, convert_to_mev=False, volume_precision=0.0001, title=None, marker_alpha=1, cmap='plotly', marker_size=10)[source]
Takes a dataframe and plots the energy difference with respect to a reference configuration as a function of volume. Utilizes plot_ev() for the actual plotting.
- Parameters:
df (pandas.DataFrame) – dataframe containing the volumes, energies, and number of atoms of each
configuration.
reference_config (str) – name of the configuration to be used as the reference state
per_atom (bool, optional) – Defaults to False.
show_fig (bool, optional) – Defaults to True.
convert_to_mev (bool, optional) – Defaults to False.
title (_type_, optional) – Defaults to None.
marker_alpha (int, optional) – Defaults to 1.
cmap (str, optional) – Defaults to ‘plotly’.
marker_size (int, optional) – Defaults to 10.
- Returns:
A Plotly figure.
- Return type:
fig (plotly.graph_objs._figure.Figure)
- dfttk.eos_fit.plot_ev(data, eos_name='BM4', highlight_minimum=True, per_atom=False, title=None, show_fig=True, cmap='plotly', marker_alpha=1, marker_size=10)[source]
Plot the energy vs volume curves for each configuration.
- Parameters:
data (pandas.DataFrame, list of pandas.DataFrame, or list of str) – Data must be a pandas
DataFrames. (DataFrame or a list of pandas)
eos_name (str, optional) – EOS name. Defaults to “BM4”.
highlight_minimum (bool, optional) – Defaults to True.
per_atom (bool, optional) – Defaults to False.
title (_type_, optional) – Defaults to None.
show_fig (bool, optional) – Defaults to True.
left_col (str, optional) – Defaults to “volume”.
right_col (str, optional) – Defaults to “energy”.
cmap (str, optional) – Defaults to ‘plotly’.
marker_alpha (int, optional) – Defaults to 1.
marker_size (int, optional) – Defaults to 10.
- Returns:
A Plotly figure.
- Return type:
fig (plotly.graph_objs._figure.Figure)
- dfttk.eos_fit.plot_mv(df, show_fig=True)[source]
Plot the magnetic moment vs volume
- Parameters:
df (pd.DataFrame) – single pandas data frame or a list of pandas dataframes with columns [‘config’, ‘# of ion’, ‘volume’, ‘tot’]
show_fig (bool, optional) – Defaults to True.
- Returns:
plotly figure
- Return type:
go.Figure
- dfttk.eos_fit.vinet(volume, energy)[source]
Fits the Vinet EOS to the input volume and energy data.
- Parameters:
volume (float | np.ndarray) – volume data
energy (float | np.ndarray) – energy data
- Returns:
EOS parameters and the corresponding volume, energy, and pressure
- Return type:
tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray, np.ndarray]
- dfttk.eos_fit.vinet_derivative(volume, V0, B, BP)[source]
Derivative of Vinet EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
derivative of energy
- Return type:
float | np.ndarray
- dfttk.eos_fit.vinet_equation(volume, V0, E0, B, BP)[source]
Vinet EOS
- Parameters:
volume (float | np.ndarray) – input volume
V0 (float) – equilibrium volume
E0 (float) – equilibrium energy
B (float) – bulk modulus
BP (float) – derivative of bulk modulus with respect to pressure
- Returns:
energy
- Return type:
float | np.ndarray
dfttk.workflows module
Workflows to automate VASP calculations using custodian.
- dfttk.workflows.NELM_reached(path)[source]
Prints the path of the calculations that have reached NELM.
- Parameters:
path (str) – path to the folder containing all the calculation folders. E.g. vol_1, phonon_1, etc.
- Return type:
None
- dfttk.workflows.charge_density_difference(path, vasp_cmd, handlers, backup=False, max_errors=10)[source]
Runs a charge density difference calculation. The charge_density_difference is calculated as the difference between the charge density of the final electronic step and the charge density of a single step.
- Parameters:
path (str) – path that contains the VASP input files.
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
backup (bool, optional) – If True, the starting INCAR, KPOINTS, POSCAR and POTCAR files will be copied with a “.orig”
False. (appended. Defaults to)
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- Returns:
The charge density difference between the final electronic step and a single step.
- Return type:
Chgcar
- dfttk.workflows.custodian_errors_location(path)[source]
Prints the calculation folders containing the custodian errors in the specified path.
- Parameters:
path (str) – path to the folder containing all the calculation folders. E.g. vol_1, phonon_1, etc.
- Returns:
volume folders that encountered VASP errors list[str]: phonon folders that encountered VASP errors
- Return type:
list[str]
- dfttk.workflows.elec_dos_parallel(path, volumes, kppa, run_file, scaling_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)))[source]
Runs the run_elec_dos function in parallel for a list of volumes.
- Parameters:
path (
str
) – path to the folder containing the VASP input files.volumes (
list
[float
]) – a list of volumes to run the electron DOS calculations for.kppa (
float
) – k-point grid density.run_file (
str
) – bash script to run the electron DOS calculations.scaling_matrix (
tuple
[tuple
[int
]]) – scaling matrix for the supercell. The default is the identity matrix.
- Return type:
None
- dfttk.workflows.encut_conv_test(path, vasp_cmd, handlers, encut_list=[270, 320, 370, 420, 470, 520, 570, 620, 670, 720, 770, 820], backup=False, max_errors=10)[source]
Runs a series of VASP calculations with different ENCUT values for convergence testing.
- Parameters:
path (str) – path to the folder containing the VASP input files
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
encut_list (list[int], optional) – list of ENCUT values to run the calculations for.
[270 (Defaults to)
320
370
420
470
520
570
620
670
720
770
820].
backup (bool, optional) – If True, appends the original POSCAR, POTCAR, INCAR, and KPOINTS files with .orig. Defaults to False.
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- dfttk.workflows.ev_curve_series(path, volumes, vasp_cmd, handlers, restarting=False, keep_wavecar=False, keep_chgcar=False, copy_magmom=False, default_settings=True, override_2relax=None, override_3static=None, max_errors=10)[source]
Runs a series of three_step_relaxation calculations for a list of volumes.
- Parameters:
path (str) – path to the folder containing the VASP input files.
volumes (list[float]) – list of volumes
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
restarting (bool, optional) – for restarting failed jobs. Defaults to False.
keep_wavecar (bool, optional) – if True, does not delete WAVECAR.3static. Defaults to False.
keep_chgcar (bool, optional) – if True, does not delete CHGCAR.3static. Defaults to False.
copy_magmom (bool, optional) – If True, copies the magmom from an OUTCAR file of one run to the INCAR
False. (file of the next run. Defaults to)
default_settings (bool, optional) – Use the default settings for three_step_relaxation. Defaults to True.
override_2relax (list, optional) – override settings for the second relaxation step. Defaults to None.
override_3static (list, optional) – override settings for the final static step. Defaults to None.
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- Return type:
None
- dfttk.workflows.kpoints_conv_test(path, vasp_cmd, handlers, kppa_list=[1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000], force_gamma=True, backup=False, max_errors=10)[source]
Runs a series of VASP calculations with different k-point densities for convergence testing.
- Parameters:
path (str) – the path to the folder containing the VASP input files
vasp_cmd (list[str]) – the VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
kppa_list (list[float], optional) – k-point densities. Defaults to [ 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, ].
force_gamma (bool, optional) – If True, forces a gamma-centered mesh. Defaults to True.
backup (bool, optional) – If True, appends the original POSCAR, POTCAR, INCAR, and KPOINTS files with
False. (.orig. Defaults to)
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- dfttk.workflows.merge_custodian_json_files(path)[source]
Merges the custodian.json and prev_custodian.json files in the path. The prev_custodian.json file is the custodian.json file from the previous run, while the custodian.json file is the custodian.json file from the current restart run. The merged custodian.json file will contain the combined settings from the two files.
- Parameters:
path (str) – path to the folder containing the custodian.json and prev_custodian.json files.
- Return type:
None
- dfttk.workflows.move_folders(src_path, dest_path, folders)[source]
Moves folders from the source path to the destination path. It is used to move previous error folders when restarting a job to a temporary folder.
- Parameters:
src_path (str) – path to the source folder containing the error folders.
dest_path (str) – path to the destination folder to move the error folders.
folders (list[str]) – list of error folders to move.
- Return type:
None
- dfttk.workflows.phonons_parallel(path, phonon_volumes, kppa, run_file, scaling_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)))[source]
Runs the run_phonons function in parallel for a list of phonon volumes.
- Parameters:
path (
str
) – path to the folder containing the VASP input files.phonon_volumes (
list
[float
]) – a list of volumes to run the phonon calculations for.kppa (
float
) – k-point grid density.run_file (
str
) – bash script to run the phonon calculations.scaling_matrix (
tuple
[tuple
[int
]]) – scaling matrix for the supercell. The default is the identity matrix.
- Return type:
None
- dfttk.workflows.process_error_folders(path, prev_error_folders_count)[source]
Processes the error folders in the path by renaming and moving them. It is used to rename the error folders when restarting a job according to the number of error folders that were moved to a temporary folder from the previous run. For example, if the error folders in the temporary folder are error.1.tar and error.2.tar, the error folders in the path will be renamed from error.1.tar to error.3.tar and error.2.tar to error.4.tar. Then, the error folders in the temporary folder will be moved to the path and the temporary folder will be removed.
- Parameters:
path (str) – path to the folder containing the error folders.
prev_error_folders_count (int) – count of error folders that was moved using move_folders.
- Return type:
None
- dfttk.workflows.process_phonon_dos_YPHON(path)[source]
Processes the phonon DOS calculations using YPHON.
- Parameters:
path (str) – path to the folder containing all the phonon calculation folders. E.g. phonon_1, phonon_2, etc.
- dfttk.workflows.rename_error_folders(path, error_folders_old, prev_error_folders_count)[source]
Renames the error folders in the path. It is used to rename the error folders when restarting a job according to the number of error folders that were moved to a temporary folder from the previous run. For example, if the error folders in the temporary folder are error.1.tar and error.2.tar, the error folders in the path will be renamed from error.1.tar to error.3.tar and error.2.tar to error.4.tar.
- Parameters:
path (str) – path to the folder containing the error folders.
error_folders_old (list[str]) – list of error folders to rename.
prev_error_folders_count (int) – count of error folders that was moved using move_folders.
- Return type:
None
- dfttk.workflows.run_elec_dos(vasp_cmd, handlers, NEDOS=10001, copy_magmom=False, backup=False, max_errors=10)[source]
Runs an electronic DOS calculation.
- Parameters:
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
copy_magmom (bool, optional) – If True, copies the magmom from an OUTCAR file of one run to the INCAR
False. (.orig. Defaults to)
backup (bool, optional) – If True, appends the original POSCAR, POTCAR, INCAR, and KPOINTS files with
False.
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- dfttk.workflows.run_phonons(vasp_cmd, handlers, copy_magmom=False, backup=False, max_errors=10)[source]
Runs a relaxation followed by a phonon calculation.
- Parameters:
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
copy_magmom (bool, optional) – If True, copies the magmom from an OUTCAR file of one run to the INCAR
False. (.orig. Defaults to)
backup (bool, optional) – If True, appends the original POSCAR, POTCAR, INCAR, and KPOINTS files with
False.
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
- dfttk.workflows.three_step_relaxation(path, vasp_cmd, handlers, copy_magmom=False, backup=False, default_settings=True, override_2relax=None, override_3static=None, max_errors=10, restart=None)[source]
- Runs a three-step relaxation - two consecutive relaxations followed by
one static.
- Parameters:
path (str) – path to the folder containing the VASP input files
vasp_cmd (list[str]) – VASP commands to run VASP specific to your system. E.g. [“srun”, “vasp_std”].
handlers (list[str]) – custodian handlers to catch errors. See class ‘custodian.vasp.handlers.VaspErrorHandler’.
copy_magmom (bool, optional) – If True, copies the magmom from an OUTCAR file of one run to the INCAR
False. (.orig. Defaults to)
backup (bool, optional) – If True, appends the original POSCAR, POTCAR, INCAR, and KPOINTS files with
False.
default_settings (bool, optional) – if True, uses the default settings for the relaxation and static steps. Defaults to True.
override_2relax (list, optional) – override settings for the second relaxation step. Defaults to None.
override_3static (list, optional) – override settings for the final static step. Defaults to None.
max_errors (int, optional) – maximum number of errors before stopping the calculation. Defaults to 10.
restart (str, optional) – if not None, restarts the calculation from the specified step. Defaults to None.
- Return type:
None