kpath

Module to handle kpath for high-symmetry lines

Functions

kpath(filename, npoint, kcutoff)

Function to write k-point mesh along the high-symmetry path of the Brillouin zone (BZ).

main()

Main function for executing different modes of k-point generation.

make_line_kpt([filename])

Function to create high symmetry points for line mode using pymatgen.

printk()

Print k-point mesh within high-symmetry points and between them.

kpath.kpath(filename, npoint, kcutoff)[source]

Function to write k-point mesh along the high-symmetry path of the Brillouin zone (BZ).

Parameters: - filename (str): Input file to read, which contains the structure or VASP ‘POSCAR’ file. - npoint (int): Size of k-point mesh. - kcutoff (int): Cutoff to use for k-point path in ASE.

‘0’ means full Brillouin zone, ‘1’ means to remove one symmetry point from the BZ path.

Returns: - kpoints (numpy.ndarray): K-mesh of size (npoint, 3). - sympoint (list): K-point in linear axis ready for plotting after processing. - symname (list): Naming for sympoint. - kpt (list): K-point in linear axis without processing. - spt (list): K-point in linear axis without processing at high-symmetry points. - sym (list): Naming for spt. Example: >>> kpoints, sympoint, symname, kpt, sym, spt = kpath(“POSCAR”, 100, 0)

kpath.printk()[source]

Print k-point mesh within high-symmetry points and between them.

This function generates and prints k-points for quantum mechanics calculations, focusing on the Brillouin zone (BZ) and high-symmetry points.

Parameters: None

Returns: None

Usage: The function expects command-line arguments in the following order: - sys.argv[2]: Filename containing the structure or VASP ‘POSCAR’ file. - sys.argv[3]: Number of k-points. - sys.argv[4]: Cutoff for the k-point path in ASE.

‘0’ for the full Brillouin zone, ‘1’ to remove one symmetry point from the BZ path.

  • sys.argv[5]: Weight of the k-point (optional).

Output: The function generates two files in the ‘scf_dir’ directory: - ‘kpathlines.dat’: Contains the k-point mesh within high-symmetry points and between them. - ‘kspecial-points.dat’: Lists the high-symmetry points.

kpath.make_line_kpt(filename='KPOINTS')[source]

Function to create high symmetry points for line mode using pymatgen.

This function generates high symmetry points for line mode using the provided structure file (“POSCAR”). The number of k-points for the line mode is specified by the second command-line argument.

Parameters: None

Returns: None

Usage: The function expects a command-line argument specifying the number of k-points for line mode.

Output: The function creates a KPOINTS file containing high symmetry points for line mode.

kpath.main()[source]

Main function for executing different modes of k-point generation.

Parameters: None

Returns: None