How to calculate the intersection of a lattice with an affine subspace?

asked 2016-05-19 08:20:38 -0500

Matthias gravatar image

updated 2017-01-05 15:25:30 -0500

FrédéricC gravatar image

One can easily calculate the intersection of a lattice with a linear subspace of QQ^n:

sage: V = VectorSpace(QQ,3)
sage: L = ZZ^3
sage: U = V.subspace([(1,1,0), (0,1,1)])
sage: L.intersection(U)
Free module of degree 3 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1  0 -1]
[ 0  1  1]

If I try to calculate the intersection of an affine subspace and a lattice in the same way, I get an error message:

sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace
sage: A = AffineSubspace((1,0,0), U)
sage: L.intersection(A)
TypeError                                 Traceback (most recent call last)
<ipython-input-40-6458203faea4> in <module>()
----> 1 L.intersection(A)
TypeError: other must be a free module

Is there another way to do this?

edit retag flag offensive close merge delete