Coverage for src/pqlattice/linalg/__init__.py: 88%

1 from .. import settings

2 from ..typing import Matrix, SquareMatrix

3 from ._linalg import cofactor, cofactor_matrix, det, left_kernel, left_nullity, minor, rank, right_kernel, right_nullity

4 from ._modint import mod_left_kernel, mod_left_nullity, mod_matinv, mod_ref, mod_right_kernel, mod_right_nullity, mod_rref

5 from ._utils import norm, norm2, per_row_norm, per_row_norm2, row_add, row_scale, row_swap

6

7

8 def hnf(matrix: SquareMatrix) -> tuple[Matrix, SquareMatrix]:

9 return settings.get_backend().hnf(matrix)

10

11

12 __all__ = [

13 "hnf",

14 "det",

15 "left_kernel",

16 "right_kernel",

17 "left_nullity",

18 "right_nullity",

19 "rank",

20 "minor",

21 "cofactor",

22 "cofactor_matrix",

23 "norm",

24 "norm2",

25 "per_row_norm",

26 "per_row_norm2",

27 "row_add",

28 "row_scale",

29 "row_swap",

30 "mod_ref",

31 "mod_rref",

32 "mod_right_kernel",

33 "mod_left_kernel",

34 "mod_left_nullity",

35 "mod_right_nullity",

36 "mod_matinv",

37]