mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Programming (https://www.mersenneforum.org/forumdisplay.php?f=29)
-   -   LLL in GP/Pari (https://www.mersenneforum.org/showthread.php?t=20670)

 paul0 2015-11-17 12:35

LLL in GP/Pari

I'm trying the qflll function Pari for lattice reduction. However, I'm not getting correct answers.

First, the wikipedia example: [url]https://en.wikipedia.org/wiki/Lenstra–Lenstra–Lovász_lattice_basis_reduction_algorithm[/url]
[CODE](20:32) gp > qflll([1,-1,3;1,0,5;1,2,6])
%50 =
[-4 5 0]

[-1 1 1]

[ 1 -1 0][/CODE]

[CODE](20:32) gp > qflll([1, 2, 3;4, 5, 6])
%51 =
[-1 4]

[ 1 -3]

[ 0 0][/CODE]

As you can see, both results are incorrect. What am I doing wrong?

 WraithX 2015-11-17 13:01

[QUOTE=paul0;416402]I'm trying the qflll function Pari for lattice reduction. However, I'm not getting correct answers.

First, the wikipedia example: [url]https://en.wikipedia.org/wiki/Lenstra–Lenstra–Lovász_lattice_basis_reduction_algorithm[/url]
[CODE](20:32) gp > qflll([1,-1,3;1,0,5;1,2,6])
%50 =
[-4 5 0]

[-1 1 1]

[ 1 -1 0][/CODE]
As you can see, both results are incorrect. What am I doing wrong?[/QUOTE]

Be sure to check the built-in documentation for what a function does, using either ?<func> or ??<func>:
[CODE]?qflll
qflll(x,{flag=0}): LLL reduction of the vectors forming the matrix x (gives the
unimodular transformation matrix T such that x*T is LLL-reduced). flag is...[/CODE]
Doing the following works:
[CODE]
(06:54) gp > x=[1,-1,3;1,0,5;1,2,6]
%1 =
[1 -1 3]
[1 0 5]
[1 2 6]

(06:54) gp > qflll(x)
%2 =
[-4 5 0]
[-1 1 1]
[ 1 -1 0]

(06:54) gp > x*qflll(x)
%3 =
[0 1 -1]
[1 0 0]
[0 1 2]
[/CODE]

 paul0 2015-11-17 13:04

[QUOTE=WraithX;416405]Be sure to check the built-in documentation for what a function does, using either ?<func> or ??<func>:
[CODE]?qflll
qflll(x,{flag=0}): LLL reduction of the vectors forming the matrix x (gives the
unimodular transformation matrix T such that x*T is LLL-reduced). flag is...[/CODE]
[/QUOTE]

Thank you :)

 All times are UTC. The time now is 02:06.