> An orthogonal lattice might not exist in general, but you can use LLL  
> to get close (and, perhaps, hit it right on).
>
> sage: m = matrix([[1,2,3],[2,3,4]])
> sage: m.LLL()
> [-1  0  1]
> [ 1  1  1]

You might also want to try BKZ algorithm too.

sage: m
[ 1  0 -1 -2 -1]
[ 1 -2  0  1  0]
[ 1  2  0 -1  2]
[-1  1 -2  0  2]
[-1  0  0  2 -1]
sage: m.LLL()
[ 2  0 -1  0  0]
[ 1 -2  0  1  0]
[-1  0  0 -2 -1]
[ 1  0  0 -2  1]
[-1 -1 -2 -1  1]
sage: m.BKZ()
[ 2  0 -1  0  0]
[ 0  0  1  0  2]
[-1  0  0 -2 -1]
[ 1 -2  0  1  0]
[-1 -1 -2 -1  1]
sage: sorted(b.norm()**2 for b in m.LLL())
[5, 6, 6, 6, 8]
sage: sorted(b.norm()**2 for b in m.BKZ())
[5, 5, 6, 6, 8]
sage: (prod(b.norm() for b in m.LLL())/
(m*m.transpose()).det().sqrt()).n()
1.78753077517265
sage: (prod(b.norm() for b in m.BKZ())/
(m*m.transpose()).det().sqrt()).n()
1.63178487966126

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

To unsubscribe from this group, send email to 
sage-support+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to