Ask Your Question

Unimodular transformation matrix of LLL algorithm

asked 2020-09-27 12:00:58 +0200

Santanu gravatar image

updated 2020-09-27 14:16:54 +0200

slelievre gravatar image

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 flag offensive close merge delete


Providing this is the object of

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

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

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-27 20:52:35 +0200

tmonteil gravatar image

updated 2020-09-27 20:52:59 +0200

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
sage: abs(U.det())

See this sage-devel thread

edit flag offensive delete link more


The following import should be enough:

from fpylll import (IntegerMatrix, LLL)
slelievre gravatar imageslelievre ( 2020-09-27 23:09:40 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-09-27 12:00:58 +0200

Seen: 118 times

Last updated: Sep 27 '20