# Unimodular transformation matrix of LLL algorithm

I also asked this question on sage-support.

I have a matrix M1 with integer entries with 90 rows and 6 columns. After applying the LLL algorithm to M1, I get M2 = M1.LLL(). I want to get the corresponding unimodular transformation matrix T such that T * M1 = M2.

We can find T by T = M2 * M1.pseudoinverse() or T = M1.solve_left(M2), but determinant of T becomes 0 i.e., T.det() equals 0. I want T.det() to equal 1.

edit retag close merge delete

Providing this is the object of

In the meantime, explore fpylll to figure out how to do it.

( 2020-09-27 15:28:57 +0200 )edit

Sort by ยป oldest newest most voted

Here is a workaround suggested by Martin Albrecht, the current developer of fpylll:

sage: from fpylll import *
sage: A = random_matrix(ZZ, 6, 90)
sage: U = IntegerMatrix.identity(6)
sage: B = LLL.reduction(IntegerMatrix.from_matrix(A), U).to_matrix(matrix(ZZ, 6, 90))
sage: U = U.to_matrix(matrix(ZZ, 6,6))
sage: B == U*A
True
sage: abs(U.det())
1

more

The following import should be enough:

from fpylll import (IntegerMatrix, LLL)

( 2020-09-27 23:09:40 +0200 )edit