Skip to content

Commit

Permalink
fix for primitive cells
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Aug 23, 2023
1 parent 0e6d435 commit b43de77
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions structuretoolkit/analyse/symmetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,13 @@ def get_primitive_cell(
new_structure = self._structure.copy()
new_structure.cell = cell
new_structure = new_structure[: len(indices)]
new_structure = structuretoolkit.common.helper.set_indices(
structure=new_structure, indices=indices
)
indices_dict = {
v: k
for k, v in structuretoolkit.common.helper.get_species_indices_dict(
structure=self._structure
).items()
}
new_structure.symbols = [indices_dict[i] for i in indices]
new_structure.positions = positions
return new_structure

Expand Down

0 comments on commit b43de77

Please sign in to comment.