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

as_dict()[source]

Convert the model object to a dictionary representation.

copy()[source]

Create a copy of the LatticeStructure

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_matrix is provided. Site mapping is inferred from fractional coordinates unless structure_site_mapping is 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 by structure[j]. Passing this skips automatic site matching.

Returns:

The occupation object for the structure with proper basis.

Return type:

Occupation

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 data

  • sc_matrix – Supercell matrix for creating the supercell

Returns:

pymatgen Structure with species assigned based on match/mismatch

Return type:

Structure

make_supercell(sc_matrix)[source]

Create a supercell of the template structure

occupation_value_for_species(site_index, specie, allowed_species=None)[source]

Return the occupation value for a species at a template site.

species_for_occupation_value(site_index, value)[source]

Return the allowed species represented by an occupation value.