11from __future__ import annotations
2-
32from collections .abc import Callable , Sequence
43
54import numpy as np
65from ase .atoms import Atoms
76from ase .build import bulk , surface
7+ from sympy import Matrix
8+ from sympy .matrices .normalforms import hermite_normal_form
89
910from structuretoolkit .analyse import get_symmetry
10- from structuretoolkit .analyse .symmetry import Symmetry
1111from structuretoolkit .common .pymatgen import ase_to_pymatgen , pymatgen_to_ase
1212
1313
@@ -282,12 +282,8 @@ def _hnf_and_U(P):
282282 Return (H, U) where H is the Hermite normal form of the integer matrix P
283283 and U is unimodular such that P = U·H.
284284 """
285- from sympy import Matrix
286-
287285 P_sym = Matrix (P .tolist ())
288286 # The functional interface works for all recent SymPy releases.
289- from sympy .matrices .normalforms import hermite_normal_form
290-
291287 H_sym = hermite_normal_form (P_sym )
292288 H = np .array (H_sym , dtype = int )
293289 U = np .asarray (H_sym .inv () @ P_sym , dtype = int )
@@ -304,8 +300,8 @@ def _is_cubic(cell: np.ndarray | ase.cell.Cell) -> bool:
304300
305301 Returns True if the cell's symmetry group has 48 operations and no translational components.
306302 """
307- sym = Symmetry (
308- Atoms (
303+ sym = get_symmetry (
304+ structure = Atoms (
309305 symbols = "H" ,
310306 cell = cell ,
311307 positions = [
0 commit comments