lattice_structure¶
- class kmcpy.structure.lattice_structure.LatticeStructure(template_structure, site_mapping, basis_type='chebyshev')[source]¶
LatticeStructure deal with the structure template which converts the structure to an occupation array and vice versa
- get_active_lattice_structure(supercell_shape=None)[source]¶
Return a lattice structure containing only mutable active sites.
- get_active_site_order(supercell_shape=None)[source]¶
Return the compact active-site order for this lattice.
- get_occ_from_structure(structure, tol=0.1, angle_tol=5, sc_matrix=None, structure_site_mapping=None)[source]¶
get_occ_from_structure() returns an Occupation object based on a comparison with the instance’s template_structure.
The supercell relationship is inferred from lattice vectors unless
sc_matrixis provided. Site mapping is inferred from fractional coordinates unlessstructure_site_mappingis provided.- Parameters:
structure (Structure) – The input structure, which may be a supercell of the template and may contain vacancies.
tol (float) – Tolerance for structure matching.
angle_tol (float) – Kept for API compatibility.
sc_matrix (np.ndarray, optional) – Supercell matrix if known.
structure_site_mapping (Sequence[int], optional) – Explicit mapping from each input structure site to a site in the supercell template. If provided,
structure_site_mapping[j]is the supercell-template index occupied bystructure[j]. Passing this skips automatic site matching.
- Returns:
The occupation object for the structure with proper basis.
- Return type:
- get_structure_from_occ(occ, sc_matrix=None)[source]¶
get_structure_from_occ() takes an Occupation object and returns a pymatgen Structure
- Parameters:
occ (
Occupation) – Occupation object containing site occupation datasc_matrix – Supercell matrix for creating the supercell
- Returns:
pymatgen Structure with species assigned based on match/mismatch
- Return type:
Structure