auto_kappa.structure.two module
- auto_kappa.structure.two.adjust_vacuum_size(orig_structure, scell_matrix=[[1, 0, 0], [0, 1, 0], [0, 0, 1]])
Modify the vacuum size of a 2D structure so that the cell size in the out-of-plane direction is larger than the in-plane dimensions.
- Return type:
Structure
- auto_kappa.structure.two.check_2d_structure(struct_orig)
Check if the structure is a 2D structure.
- Parameters:
structure (Atoms) – Atoms object
struct_orig (Atoms)
- Returns:
True if the structure is 2D, False otherwise
- Return type:
bool
- auto_kappa.structure.two.estimate_supercell_matrix_2d(struct_orig, max_num_atoms=120)
Estimate the supercell matrix for 2D structures.
- Parameters:
structure – unitcell structure
max_num_atoms (int) – Maximum number of atoms in the supercell
max_iter (int) – Maximum number of iterations to find a suitable supercell
- Returns:
Supercell matrix
- Return type:
np.ndarray
- auto_kappa.structure.two.get_diagonal_length(struct_orig, norm_idx_abc=None, which='long')
Calculate the longer diagonal length of a 2D structure.
- Return type:
float
- auto_kappa.structure.two.get_normal_index(struct_orig, base='abc')
Estimate the vacuum direction by analyzing the real space gaps in a structure.
- Parameters:
struct_orig – Structure object
base (str) – ‘abc’ for lattice vectors or ‘xyz’ for Cartesian axes
- Returns:
- Index of the direction with the largest vacuum gap
For base=’abc’: (0 for a-axis, 1 for b-axis, 2 for c-axis) For base=’xyz’: (0 for x-axis, 1 for y-axis, 2 for z-axis)
- Return type:
int
- auto_kappa.structure.two.get_thickness(structure, norm_idx=None)
Calculate the thickness of a 2D structure.
- Parameters:
structure – pymatgen.Structure object or ase.Atoms object
out_idx (int) – Index of the out-of-plane direction (default is 2 for z-axis)
- Returns:
Thickness of the structure
- Return type:
float
- auto_kappa.structure.two.is_perpendicular(struct_orig, norm_idx_abc, tol=1e-05)
Check if the angles of the structure are 90 degrees.
- Parameters:
structure (Structure) – pymatgen Structure object
norm_idx (int) – Index of the out-of-plane direction (default is None)
- Returns:
True if the angles are 90 degrees, False otherwise
- Return type:
bool
- auto_kappa.structure.two.print_2d_system_notation()
Print the notation for 2D systems.
- auto_kappa.structure.two.print_length_info(structure)
- auto_kappa.structure.two.set_center(struct_orig)
Set the position center of the structure to the center of the cell.
- Parameters:
structure (Structure) – pymatgen Structure object
- Returns:
Centered structure
- Return type:
Structure
- auto_kappa.structure.two.set_vacuum_to_2d_structure(struct_orig, vacuum_thickness=30.0)
Add vacuum to a 2D structure by modifying the c-axis length.
- Parameters:
vacuum_thickness (float)
- Return type:
Structure
- auto_kappa.structure.two.suggest_fc2_cutoff(orig_sc, buffer=5.0)
Suggest a cutoff for harmonic force constants based on the structure’s diagonal length.
- Returns:
Suggested cutoff value in Angstrom.
- Return type:
float
- auto_kappa.structure.two.switch_abc_axis(struct_orig, idx1, idx2)
Switch the abc axes of the structure.
- Parameters:
struct_orig (Atoms)
idx1 (int)
idx2 (int)
- Return type:
Atoms