On Fri, Oct 18, 2019 at 12:38 PM Frédéric Chapoton <fchapot...@gmail.com> wrote:
>
> The bug over the cyclotomic field is caused by
>
>
> sage: K = CyclotomicField(8)
> sage: K(-1/16) > 0
> True
>
This is not a bug, as the ordering of K has nothing to do with the ordering on
the real elements of K.

Note that

sage: K(-1/16).sign()
-1
sage: K(-1/16).sign()>0
False

works as it should. I have a pile of homeworks on my desk
and no time to look in the code now, but if indeed it can be fixed by
using `sign()` in appropriate places, it should be done.

I have opened https://trac.sagemath.org/ticket/28635


>
>
> Le vendredi 18 octobre 2019 13:24:51 UTC+2, Frédéric Chapoton a écrit :
>>
>> This works (in sage 8.9) when using
>>
>> K.<z>=QuadraticField(2)
>>
>>
>>
>> Le vendredi 18 octobre 2019 02:12:02 UTC+2, Ignat Soroko a écrit :
>>>
>>> I am computing the signature of a quadratic form having entries 0, 1, -1/2, 
>>> -sqrt(2)/2. I noticed that the result of signature_vector() is different if 
>>> we treat the number sqrt(2) as a cyclotomic or as a real number. Please 
>>> look at the example:
>>>
>>> sage: K.<z>=CyclotomicField(8)
>>> sage: a=z-z^3  # a is a square root of 2
>>> sage: a-sqrt(2)
>>> 0
>>> sage: 
>>> Q=QuadraticForm(K,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0,
>>> ....: 0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
>>> sage: Q.signature_vector()
>>> (8, 0, 0)
>>>
>>> this cannot be true since there exists an isotropic vector:
>>>
>>> sage: v=vector([1,a,1,0,0,0,0,0])
>>> sage: v*Q.matrix()*v
>>> 0
>>>
>>> Let's try it over reals:
>>>
>>> sage: a=sqrt(2)
>>> sage: 
>>> Q=QuadraticForm(RR,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0
>>> ....: ,0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
>>> sage: Q.signature_vector()
>>> (6, 2, 0)
>>>
>>> however, the isotropic vector above is not isotropic anymore:
>>>
>>> sage: v=vector([1,a,1,0,0,0,0,0])
>>> sage: v*Q.matrix()*v
>>> sqrt(2)*(1.00000000000000*sqrt(2) - 1.41421356237310) - 
>>> 1.41421356237310*sqrt(2) + 2.00000000000000
>>>
>>> I also tried to define
>>>
>>> sage: a=sqrt(AA(2))
>>> sage: 
>>> Q=QuadraticForm(AA,8,[1/2,-a/2,0,0,0,0,0,0,1/2,-a/2,0,0,0,0,0,1/2,-1/2,0,0
>>> ....: ,0,0,1/2,-1/2,0,0,0,1/2,-1/2,0,0,1/2,-a/2,0,1/2,-a/2,1/2])
>>>
>>> but Q.signature_vector() gives a runtime error with many lines of code 
>>> ending in:
>>>
>>> RuntimeError: maximum recursion depth exceeded
>>>
>>>
>>> Questions:
>>> 1) is Q.signature_vector() over cyclotomic field is interpreted in some 
>>> other way than for reals, thus making the result (8,0,0) somehow correct?
>>>
>>> 2) Which setting would guarantee both the correct result for 
>>> signature_vector() using the exact arithmetic and at the same time show 
>>> that v is actually an isotropic vector?
>>>
>>> Thank you!
>>>
>>>
>>>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-devel+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sage-devel/710cf4ab-c782-4ad0-a195-fcd47ed1abc5%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/CAAWYfq1qFMGymUuHLmswvLUoKAe%3DN8G30gfV8hO7byNik3y97Q%40mail.gmail.com.

Reply via email to