LLL reduced basis
I am using Sage to find the LLL reduced log-unit lattices of number fields and this is how I do it:
bnf = K.pari_bnf()
UL = [[bnf[2][j][i].sage().real() for i in range(r+1)] for j in range(r)]
G=Matrix(RR, r, [u.dot_product(v) for u in UL for v in UL])
L = pari.qflllgram(pari(G)
In above, K is my number field and UL is the basis matrix. I use it to get the corresponding Gram matrix. When I use but L always is an identity matrix.
If I input the above Gram matrix directly in PARI to qflll(G), it outputs the correct transformation LLL reduction basis. why I always get identity matrix in Sage??
Thank you!
Please add some complete code that actually runs. Do you mean something like this?