Skip to content

Correctly passing kwargs in short_vectors #39848

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 18, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/sage/modules/free_quadratic_module_integer_symmetric.py
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,15 @@ def short_vectors(self, n, **kwargs):
[[(0, 0)], [], [(1, 1), (-1, -1), (0, 1), (0, -1), (1, 0), (-1, 0)]]
sage: A2.short_vectors(3, up_to_sign_flag=True) # needs sage.graphs sage.libs.pari
[[(0, 0)], [], [(1, 1), (0, 1), (1, 0)]]

TESTS:

Check that keyword arguments are passed to :meth:`sage.quadratic_forms.short_vector_list_up_to_length`
(:issue:`39848`)::

sage: A2 = IntegralLattice('A2') # needs sage.graphs
sage: A2.short_vectors(3, up_to_sign_flag=False) # needs sage.graphs sage.libs.pari
[[(0, 0)], [], [(1, 1), (-1, -1), (0, 1), (0, -1), (1, 0), (-1, 0)]]
"""
p, m = self.signature_pair()
if p * m != 0:
Expand All @@ -1525,7 +1534,7 @@ def short_vectors(self, n, **kwargs):
e = -2
from sage.quadratic_forms.quadratic_form import QuadraticForm
q = QuadraticForm(e * self.gram_matrix())
short = q.short_vector_list_up_to_length(n, *kwargs)
short = q.short_vector_list_up_to_length(n, **kwargs)
return [[self(v * self.basis_matrix()) for v in L] for L in short]

def _fplll_enumerate(self, target=None):
Expand Down
Loading