convergence_test

Module to submit convergence tests. Runs with ‘mainprogram convtest’

Functions

kpoint_qe(kpoint, mpid)

Insert k-points into the SCF input file.

kpoint_vasp(kpoint[, kconv])

Function to write kpoint.

main_qe(file_name, parameter, start, end)

Execute convergence test calculations for kinetic energy cutoff.

main_vasp(file_name, parameter, start, end)

Execute convergence test calculations for kinetic energy cutoff.

submission(param, jobscript, A, B, jj)

Submit a jobscript for computation based on parameters.

convergence_test.kpoint_vasp(kpoint, kconv=False)[source]

Function to write kpoint.

Parameters: - kpoint (list): List containing the k-point coordinates. - mpid (str): The ID of the compound. - compound (str): The name of the compound.

Returns: - None

Example: To write kpoints for a convergence calculation: >>> kpoint_vasp([2, 2, 2], kconv=True)

To write kpoints for a regular calculation: >>> kpoint_vasp([4, 4, 4])

convergence_test.submission(param, jobscript, A, B, jj)[source]

Submit a jobscript for computation based on parameters.

Parameters: - param (str): Parameter type, ‘ecut’ or ‘kpoint’. - jobscript (str): Name of the jobscript to be submitted. - A (str): Materials Id. - B (str): Name for the compound. - jj (str or tuple): The value of the parameter. If param is ‘ecut’, it’s a string;

if param is ‘kpoint’, it’s a list (e.g., (kx, ky, kz)).

Returns: None Example:

To submit a jobscript named ‘myjob.sh’ for computation with parameter type ‘ecut’, Materials Id ‘mp-123’, compound name ‘Si’, and parameter value ‘500’: >>> submission(‘ecut’, ‘myjob.sh’, ‘mp-123’, ‘Si’, ‘500’)

convergence_test.main_vasp(file_name, parameter, start, end)[source]

Execute convergence test calculations for kinetic energy cutoff.

Parameters: - file_name (str): File holding materials id and name information. - parameter (str): Parameter to control the type of calculation. - start (int) : Starting index - end (int) : Ending index (not included)

Returns: - None

This function iterates through the specified range of indices and performs convergence test calculations. It modifies input files, creates directories, and submits jobs based on the provided parameter.

Example: To perform a convergence test for kinetic energy cutoff (‘ecut’) from index 1 to 10: >>> main_vasp(“mpid.in”, “ecut”, 1, 10)

convergence_test.kpoint_qe(kpoint, mpid)[source]

Insert k-points into the SCF input file.

Parameters: - kpoint (list): List containing the k-point coordinates. - mpid (str): The ID of the compound.

Returns: - None

Example: >>> kpoint_qe([0.5, 0.5, 0.5], “mp-12345”)

convergence_test.main_qe(file_name, parameter, start, end)[source]

Execute convergence test calculations for kinetic energy cutoff.

Parameters: - file_name (str): File holding materials id and name information. - parameter (str): Parameter to control the type of calculation. - start (int) : Starting index - end (int) : Ending index (not included)

Returns: - None

This function iterates through the specified range of indices and performs convergence test calculations. It modifies input files, creates directories, and submits jobs based on the provided parameter.

Example: >>> main_qe(“mpid.in”, “ecut”, 1, 5)