ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 03 Oct 2019 04:39:10 -0500Matrix transformation of a LLL reduced basishttp://ask.sagemath.org/question/48163/matrix-transformation-of-a-lll-reduced-basis/Dear Sage Community,
I am trying the way to obtain the matrix transformation of a LLL reduced basis, that is a matrix that gives the expression of the new lattice basis in terms of the old.
In particular, I have a matrix X and the LLL reduced base Y (obtain by the LLL function of Sage: Y=X.LLL()) and I want a matrix T such that TX=Y.
I try to solve the problem using solve.left() but the result is different from Magma.
With a matrix X=[5 2]
[1 4]
[2 3],
the T matrix in Sage is [ 0 0 0]
[ 2/9 -1/9 0]
[ 1/18 -5/18 0] while in Magma is [ -3 -6 10]
[ -3 -7 11]
[ -5 -11 18]
Please could anyone help me to understand a way to have in SAGE the same result of Magma?A.CioThu, 03 Oct 2019 04:39:10 -0500http://ask.sagemath.org/question/48163/Finding short vectors kernelhttp://ask.sagemath.org/question/8625/finding-short-vectors-kernel/I am looking for quadratic forms with a given point - so I want short integer vectors which are perpendicular to
v=[X*X,X*Y,X*Z,X*T,Y*Y,Y*Z,Y*T,Z*Z,Z*T,T*T]
for (in this case) [X,Y,Z,T]=[4423,7583,8765,3459]
This sounds like a problem with LLL written all over it, so I do
L=[[Y,-X,0,0,0,0,0,0,0,0],[0,Z,-Y,0,0,0,0,0,0,0],[0,0,T,-Z,0,0,0,0,0,0],[0,0,0,Y*Y,-X*T,0,0,0,0,0],[0,0,0,0,Z,-Y,0,0,0,0],
[0,0,0,0,0,T,-Z,0,0,0],[0,0,0,0,0,0,Z*Z,-Y*T,0,0],[0,0,0,0,0,0,0,T,-Z,0],[0,0,0,0,0,0,0,0,T,-Z]]
M=matrix(L)
M.lll()
but this gives an error message AttributeError: 'sage.matrix.matrix_integer_dense.Matrix_integer_dense' object has no attribute 'lll'fivemackFri, 13 Jan 2012 10:39:28 -0600http://ask.sagemath.org/question/8625/Lattices in Sagehttp://ask.sagemath.org/question/39542/lattices-in-sage/I have the following Magma code, and I want to rewrite it in Sage.
L:=Lattice(Matrix(Rationals(),2,2,[N2t,0,tau,1]), Matrix(Rationals(),2,2,[1,0,0,D]));
"Lattice:\n",L;
"\nBasis matrix:\n",LLLBasisMatrix(L);
In Sage I have something like this:
M = Matrix(QQ, [(N2t,0,tau,1), (1,0,0,D)])
M.LLL()
Whose output is not exactly the same thing produced by the above Magma code. I think the main problem is that I use a matrix and just apply the LLL algorithm to it in the Sage part. Whereas, in Magma there a lattice created, and then the `LLLBasisMatrix` function (https://magma.maths.usyd.edu.au/magma/handbook/text/312#2964) called. Roughly speaking that function does this:
> Given a lattice L with basis matrix B,
> return the LLL basis matrix B' of L,
> together with the transformation
> matrix T such that B'=TB. The LLL
> basis matrix B' is simply defined to
> be a LLL-reduced form of B; it is
> stored in L when computed and
> subsequently used internally by many
> lattice functions. The LLL basis
> matrix will be created automatically
> internally as needed with δ=0.999 by
> default (note that this is different
> from the usual default of 0.75); by
> the use of parameters to this function
> one can ensure that the LLL basis
> matrix is created in a way which is
> different to the default.
How does one create a lattice in Sage? And does Sage have a function similar to `LLLBasisMatrix` above? If not, how can I achieve the same functionality in Sage?
As for numeric example, I have the following values:
N2t = 1136868377216160297393798828125
D = 53364935730486508893809772233249725927747397616650814998641
tau = 954690521650617175389887577728
and if I call the above Magma code with these values, I get the following result for the basis matrix:
[-182177855565543122003911250397 1]
[ 772512666085074053385976327331 2]
whereas if I call the above Sage code with the above values, I get the following result:
[1136868377216160297393798828125 0 954690521650617175389887577728 1]
[1 0 0 53364935730486508893809772233249725927747397616650814998641]whateverTue, 14 Nov 2017 09:44:25 -0600http://ask.sagemath.org/question/39542/How to know if [program] is still running? (LLL to be precise)http://ask.sagemath.org/question/26138/how-to-know-if-program-is-still-running-lll-to-be-precise/ I have not a lot of experience in running programs that take several hours to end.
I'm running an attack which complexity is dominated by the LLL function
It has been running for several hours now and I have no idea how well it's doing, or if the thing just crashed (I'm using sage in a virtualbox)
I've seen some people talking about [syslog](https://docs.python.org/2/library/syslog.html) to continuously log
But I'm sure some people here have been in my situation and could share some light on this problem :)
DavidmimooTue, 10 Mar 2015 11:09:43 -0500http://ask.sagemath.org/question/26138/Is this a bug in QuadraticForm?http://ask.sagemath.org/question/11042/is-this-a-bug-in-quadraticform/ QuadraticForm(ZZ, 2, [3, 2, 0]).lll()
gives a ValueError: a matrix from Full MatrixSpace of 2 by 1 dense matrices over
Integer Ring cannot be converted to a matrix in Full MatrixSpace of 2 by
2 dense matrices over Integer Ring!
Is this a bug or am I missing some precondition?petropolisSat, 21 Jun 2014 22:00:16 -0500http://ask.sagemath.org/question/11042/lattice reduction RealFieldhttp://ask.sagemath.org/question/10263/lattice-reduction-realfield/I have a basis for a lattice in three dimensional space and I need to keep it with very high precision and so I'm using RealField. I then tranform the basis linearly. I'd like to find the reduced basis for the lattice. My understanding is the LLL algorithms apply only to integer matrices. Is this correct?
To get around this I currently scale the basis by a very large number and round to the closest integer and reduce this approximation, find the transformation to the reduced basis and finally apply it to the exact basis. TomHuntThu, 20 Jun 2013 06:12:54 -0500http://ask.sagemath.org/question/10263/