xdatbus.utils

Functions

read_lat_vec(xdatcar_dir)

Read the lattice vectors from the first image of the XDATCAR file.

unwrap_pbc_dis(coord_1, coord_2, box_length)

Unwrap the distance between two coordinates.

update_folder(folder)

Delete the folder and create a new one.

remove_file(file_path)

Delete the file.

skip_comments(file)

filter_files(files, pattern)

gauss_pot_1d(→ numpy.ndarray)

Calculate the Gaussian potential energy.

gauss_pot_2d(→ numpy.ndarray)

Calculate the Gaussian potential energy.

gauss_pot_3d(→ numpy.ndarray)

Calculate the Gaussian potential energy.

Module Contents

xdatbus.utils.read_lat_vec(xdatcar_dir)

Read the lattice vectors from the first image of the XDATCAR file.

xdatbus.utils.unwrap_pbc_dis(coord_1, coord_2, box_length)

Unwrap the distance between two coordinates.

coord_1ndarray

The first coordinate

coord_2ndarray

The second coordinate

box_length :

The length of the box

float

The unwrapped distance between the two coordinates

xdatbus.utils.update_folder(folder)

Delete the folder and create a new one.

folderstr

The path of the folder

xdatbus.utils.remove_file(file_path)

Delete the file.

file_pathstr

The path of the file

xdatbus.utils.skip_comments(file)
xdatbus.utils.filter_files(files, pattern)
xdatbus.utils.gauss_pot_1d(x: numpy.ndarray, x0: float, height: float, width: float) numpy.ndarray

Calculate the Gaussian potential energy.

Parameters: - x (np.ndarray): Array of positions at which to evaluate the potential. - x0 (float): The position of the potential minimum. - height (float): The height of the Gaussian potential. - width (float): The standard deviation (controls the width of the Gaussian).

Returns: - np.ndarray: The potential energy at each position x.

xdatbus.utils.gauss_pot_2d(x: numpy.ndarray, y: numpy.ndarray, x0: float, y0: float, height: float, width: float) numpy.ndarray

Calculate the Gaussian potential energy.

Parameters: - x (np.ndarray): Array of x positions at which to evaluate the potential. - y (np.ndarray): Array of y positions at which to evaluate the potential. - x0 (float): The x position of the potential minimum. - y0 (float): The y position of the potential minimum. - height (float): The height of the Gaussian potential. - width (float): The standard deviation (controls the width of the Gaussian).

Returns: - np.ndarray: The potential energy at each position (x, y).

xdatbus.utils.gauss_pot_3d(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, x0: float, y0: float, z0: float, height: float, width: float) numpy.ndarray

Calculate the Gaussian potential energy.

Parameters: - x (np.ndarray): Array of x positions at which to evaluate the potential. - y (np.ndarray): Array of y positions at which to evaluate the potential. - z (np.ndarray): Array of z positions at which to evaluate the potential. - x0 (float): The x position of the potential minimum. - y0 (float): The y position of the potential minimum. - z0 (float): The z position of the potential minimum. - height (float): The height of the Gaussian potential. - width (float): The standard deviation (controls the width of the Gaussian).

Returns: - np.ndarray: The potential energy at each position (x, y, z).