Ask Your Question

Revision history [back]

How do you check if a lattice contains a coordinate?

Suppose I have an integer lattice $L\subset\mathbb{Z}^2$ generated by $v_1$ and $v_2$. How do I check if $(x,y)\in L$?

I can easily create the lattice:

from sage.modules.free_module_integer import IntegerLattice
v1 = [3,4]
v2 = [4,5]
M = [v1,v2]
IL = IntegerLattice(M)

but nowhere in the documentation can I find a command to check for inclusion. I would like a solution that generalizes to lattices of any rank.