On Apr 15, 6:26 pm, LBerlioz <schaffer...@gmail.com> wrote:

Hi Luiz,

> When I do:
> sage: A=matrix(QQ,3,3,[-3,2,0 , 2,3,-2 , 0,-2,5 ])
> sage: Q=QuadraticForm(2*A)
> sage: Q
> Quadratic form in 3 variables over Rational Field with coefficients:
> [ -3 4 0 ]
> [ * 3 -4 ]
> [ * * 5 ]
>
> If I try to get the diagonal form:
> sage: Q.rational_diagonal_form()
> Quadratic form in 3 variables over Rational Field with coefficients:
> [ -3 -32 5184 ]
> [ * -81 26240 ]
> [ * * -2125111 ]
> which is clearly not diagonal...
> or:
> sage: Q.rational_diagonal_form().Gram_matrix()
> [      -3      -16     2592]
> [     -16      -81    13120]
> [    2592    13120 -2125111]
> the signature() method uses rational_diagonal_from() so it is also
> gives strange results:
> sage: Q.signature()
> -3
> where:
> sage: Q.Gram_matrix().eigenvalues()
> [-3.646808552172955?, 2.284147264963001?, 6.362661287209955?]
> sage: Q.matrix().eigenvalues()
> [0, -11.47177122123975?, -1.409895056381797?, 10.88166627762154?]
>
> I want to confirm that this is a bug, because I have written a fix
> that works the way I believe it should.

It looks like you know what you are doing, so could you open a ticket
and attach the patch you made. I have pinged Jon Hanke about the issue
and he should respond in the morning.

> Luis Berlioz

Cheers,

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

Reply via email to