Skip to content

Commit a184f89

Browse files
committed
Lint fixes and more
1 parent 1374ad6 commit a184f89

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/sage/modules/free_module_integer.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -901,11 +901,11 @@ def hadamard_ratio(self, use_reduced_basis=True):
901901
r"""
902902
Computes the normalized Hadamard ratio of the given basis.
903903
904-
The normalized Hadamard ratio of the basis `B = {v_1, v_2, \dots, v_n}` is defined as
904+
The normalized Hadamard ratio of the basis `B = \left{ v_1, v_2, \dots, v_n \right}` is defined as
905905
906906
.. MATH::
907907
908-
\mathcal{H}(B) = \dfrac{det L}{\|v_1\| \|v_2\| \cdots \|v_n\|}^{\dfrac{1}{n}}
908+
\mathcal{H}(B) = \left( \dfrac{\det L}{\|v_1\| \|v_2\| \cdots \|v_n\|} \right)^{\frac{1}{n}}
909909
910910
The closer this ratio is to 1, the more orthogonal the basis is.
911911
@@ -932,23 +932,24 @@ def hadamard_ratio(self, use_reduced_basis=True):
932932
basis = self.reduced_basis
933933
else:
934934
basis = self.basis_matrix()
935-
935+
936936
n = basis.nrows()
937937
r = self.rank()
938938
assert r == n
939-
939+
940940
ratio = (self.discriminant().sqrt() / prod([v.norm() for v in basis]))**(1/r)
941941
assert 0 < ratio <= 1
942942
return ratio
943-
943+
944944
def gaussian_heuristic(self, exact_form=False):
945945
r"""
946-
Computes the Gaussian expected shortest length, also known as the Gaussian
946+
Computes the Gaussian expected shortest length, also known as the Gaussian
947947
heuristic. This estimates the expected norm of the shortest non-zero vector
948948
in the lattice. The heuristic is independent of the chosen basis.
949949
950950
INPUT:
951-
- ``exact_form`` -- boolean (default: ``False``); uses exact formulation based on gamma function, instead of estimation of the gamma function
951+
- ``exact_form`` -- boolean (default: ``False``); uses exact formulation
952+
based on gamma function, instead of using stirling's approximation
952953
953954
OUTPUT: The Gaussian heuristic described above.
954955
@@ -965,13 +966,13 @@ def gaussian_heuristic(self, exact_form=False):
965966
21.375859827168494
966967
"""
967968
basis = self.basis_matrix()
968-
969+
969970
n = basis.nrows()
970971
r = self.rank()
971972
assert r == n
972973

973974
D = self.discriminant().sqrt()
974-
975+
975976
if exact_form:
976977
return (D * gamma(1 + (r/2)))**(1/r) / pi.sqrt()
977978
else:

0 commit comments

Comments
 (0)