The lattice generated by a sequence of elements of a rational vector space

30 views
Skip to first unread message

Michel VAN DEN BERGH

unread,
Jan 22, 2026, 5:32:27 AM (3 days ago) Jan 22
to sage-support
If somebody could help me with the following problem I would appreciate it!

Let V=QQ^n be an n-dimensional vector space over the rationals, equipped with a symmetric bilinear form B (given by its evaluation on the standard basis vectors of QQ^n).

Assume given v1,..,vm in V. I would like to construct the IntegralLattice spanned
by the (vi)_i, equipped with the restriction of the bilinear form B. If it helps: v1, ..., vm generate V.

Any ideas on how to do this in a nice way?


Nils Bruin

unread,
Jan 22, 2026, 1:45:08 PM (3 days ago) Jan 22
to sage-support
You can get Z^m with the bilinear form on it simply by computing the Gram matrix G of the pairing relative to v1,...,vm.

If your pairing is non-degenerate, the lattice you're looking for is Z^m/ker(G). and the bilinear form can be induced on that quotient from the information that you have in G already.
(you may well have to clear denominators from G in order to get sage to compute ker(G) for you)

If your pairing is degenerate then getting the Z^n -lattice that v1,...,vm span needs to use the actual embedding in V. In that case, you can just scale out the denominators of the coordinates of your v1,...,vm and compute a Hermite normal form of the resulting integer matrix. That's a scaling away from the actual lattice generated by v1,...,vm. Getting the Gram matrix on that representation is also straightforward.

These are not quite one-liners, but they do use fairly high-level linear algebra, so it shouldn't be too onerous to do.

Once you have the Gram matrix you can construct an "IntegralLattice" from that.

Michel VAN DEN BERGH

unread,
Jan 22, 2026, 4:14:08 PM (3 days ago) Jan 22
to sage-support
Thanks! That makes sense. I will try!
Reply all
Reply to author
Forward
0 new messages