We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ab3d2dc commit aafec4dCopy full SHA for aafec4d
src/structuretoolkit/build/surface.py
@@ -281,10 +281,12 @@ def _hnf_and_U(P):
281
and U is unimodular such that P = U·H.
282
"""
283
from sympy import Matrix
284
+
285
P_sym = Matrix(P.tolist())
-
286
287
# The functional interface works for all recent SymPy releases.
288
from sympy.matrices.normalforms import hermite_normal_form
289
290
H_sym = hermite_normal_form(P_sym)
291
H = np.array(H_sym, dtype=int)
292
U = np.asarray(H_sym.inv() @ P_sym, dtype=int)
0 commit comments