Skip to content
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

QuadraticForm.basis_of_short_vectors may not return an actual ZZ-basis #8693

Open
sagetrac-afiori mannequin opened this issue Apr 15, 2010 · 6 comments
Open

QuadraticForm.basis_of_short_vectors may not return an actual ZZ-basis #8693

sagetrac-afiori mannequin opened this issue Apr 15, 2010 · 6 comments

Comments

@sagetrac-afiori
Copy link
Mannequin

sagetrac-afiori mannequin commented Apr 15, 2010

QuadraticForm.basis_of_short_vectors() does not actually ensure the list of vectors it returns is a basis, it only assures that it spans a full rank sub-lattice.

In particular in the following example (E8):

Q = QuadraticForm( matrix( [[2,0,0,0,0,0,0,1],
                            [0,2,1,1,1,1,1,1],
                            [0,1,2,1,1,1,1,1],
                            [0,1,1,2,1,1,1,1],
                            [0,1,1,1,2,1,1,1],
                            [0,1,1,1,1,2,1,1],
                            [0,1,1,1,1,1,2,0],
                            [1,1,1,1,1,1,0,2]] ))
B = Q.basis_of_short_vectors()
matrix(B).det()

The result is -2, which indicates we did not get a basis.

I am attaching some sample code which (once properly merged {and tested}) could be used to correct the issue.

CC: @yyyyx4

Component: quadratic forms

Keywords: basis, automorphisms

Stopgaps: todo

Issue created by migration from https://trac.sagemath.org/ticket/8693

@sagetrac-afiori
Copy link
Mannequin Author

sagetrac-afiori mannequin commented Apr 15, 2010

Attachment: fix_basis.sage.gz

Sample code to correct a non-basis from basis_of_short_vectors

@jdemeyer
Copy link

comment:1

Isn't this just a matter of defining what "basis" means?

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer added this to the sage-6.9 milestone Aug 30, 2015
@jdemeyer jdemeyer changed the title QuadraticForm::basis_of_short_vectors may not return an actual basis. QuadraticForm.basis_of_short_vectors may not return an actual ZZ-basis Aug 30, 2015
@jdemeyer
Copy link

Stopgaps: todo

@sagetrac-afiori
Copy link
Mannequin Author

sagetrac-afiori mannequin commented Sep 25, 2015

comment:4

I suppose someone might want a rational basis for the associated rational vector space which consists only of integral vectors... but that seems unlikely to be a common use case.
In any case, if I recall correctly... the code which computes automorphism groups of lattices uses this function, and consequently computes the automorphism group of E8 incorrectly.
The simplest stopgap would be to check if you are returning a basis, and if not just return the original basis.
The code I had posted before (before I had learned to build patches under the old system) probably works, though as I don't currently have a working sage install to test it in (and still haven't done anything with current system for building patches) I am not really in a position to do much testing.

@nbruin
Copy link
Contributor

nbruin commented Aug 26, 2021

comment:6

It looks to me the well-defined notion here would be the "successive minima" of a lattice: a sequence of vectors in the lattice where each vector is of minimal length while being linearly independent from the previous ones. Such a set is indeed not necessarily a basis. So we should check that the routine actually computes this and then rename it.

I think for most applications, the lengths themselves are usually more important than the vectors that attain them.

Naturally, this notion needs a (positive) definite quadratic form.

@mkoeppe mkoeppe removed this from the sage-6.9 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants