cif_to_gsinput

Module to write QE/VASP input files from .cif files

Functions

ciftoscf(calc_type, mpid[, cif2cell, keven])

Function to convert a CIF file to a Quantum ESPRESSO (QE) input file 'scf.in'.

main()

The main function of the script.

pos_to_kpt(structure_filename, kpoint_density)

Function to obtain a k-point mesh from a structure file.

pymatgen_cif(infile)

Function to convert (ICSD) CIF files to pymatgen format.

cif_to_gsinput.pos_to_kpt(structure_filename, kpoint_density, evenkpt=False)[source]

Function to obtain a k-point mesh from a structure file.

Parameters: - structure_filename (str): Path to the structure file (QE scf.in or VASP POSCAR). - kpoint_density (float): Desired k-point density. - evenkpt (bool): Flag indicating whether to enforce an even number of k-points along each axis.

Default is False.

Returns: - kmesh (list): K-point mesh according to the k-point density. .. rubric:: Example

>>> # Generating a k-point mesh for a VASP POSCAR with a k-point density of 0.05
>>> pos_to_kpt("POSCAR", 0.05, evenkpt=True)
cif_to_gsinput.pymatgen_cif(infile)[source]

Function to convert (ICSD) CIF files to pymatgen format.

Parameters: - infile (str): Path to the input CIF file.

Returns: - structure (Structure): Pymatgen Structure object representing the CIF structure. .. rubric:: Example

>>> # Convert a CIF file named 'example.cif' to pymatgen format
>>> pymatgen_cif("example.cif")
cif_to_gsinput.ciftoscf(calc_type, mpid, cif2cell=True, keven=False)[source]

Function to convert a CIF file to a Quantum ESPRESSO (QE) input file ‘scf.in’.

Parameters: - calc_type (str): The type of calculation, either ‘VASP’ or ‘QE’. - mpid (str): The Material ID. - cif2cell (bool): If True, uses cif2cell to process the CIF file. Default is True. - keven (bool): If True, even k-mesh is used. Default is False.

Returns: - compound (str): The compound name.

Writes the ‘scf-mpid.in’ file. .. rubric:: Example

>>> # Convert a CIF file to a Quantum ESPRESSO input file
>>> ciftoscf("QE", "mp-1234", cif2cell=False, keven=False)
cif_to_gsinput.main()[source]

The main function of the script.

This function performs the following operations: - Retrieves a list of CIF files in the current directory. - Sets the calculation type. - Sets the flag for using cif2cell. - Iterates over CIF files, converts them to QE input files, and writes data to ‘mpid.in’.

Parameters: - calc_type (str): Calculation type (e.g., ‘VASP’ or ‘QE’).

Returns: None