Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-29 Thread Dima Pasechnik
On 28 August 2024 16:05:43 BST, Georgi Guninski wrote: >All of the following return the complex branch: >pari/gp, mpmath, maxima > This is just them lacking functionality specifically for real fields, not something to copy. One can always coerse a real field element to an extension containin

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Dima Pasechnik
This looks like RR should be fixed to match AA here. On 28 August 2024 12:40:49 BST, Kwankyu Lee wrote: >sage: ZZ(-1).nth_root(3) >-1 >sage: _.parent() >Integer Ring >sage: QQ(-1).nth_root(3) >-1 >sage: _.parent() >Rational Field >sage: RR(-1).nth_root(3) >-1.00 >sage: _.parent() >Rea

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Dima Pasechnik
On 28 August 2024 12:28:54 BST, Kwankyu Lee wrote: > > >On Wednesday, August 28, 2024 at 7:57:43 PM UTC+9 john.c...@gmail.com wrote: > >Surely the output of -1 for AA(-1)^(1/3) is correct: AA is the "Algebraic >Real Field" and -1 has exactly one cube root in there, namely itself. On >the ot

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Georgi Guninski
All of the following return the complex branch: pari/gp, mpmath, maxima -- 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

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
[forwarded from Dima] This looks like RR should be fixed to match AA here. On 28 August 2024 12:40:49 BST, Kwankyu Lee wrote: sage: ZZ(-1).nth_root(3) -1 sage: _.parent() Integer Ring sage: QQ(-1).nth_root(3) -1 sage: _.parent() Rational Field sage: RR(-1).nth_root(3) -1.00 sage: _.

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
[fowarded from Dima] > >x^(1/n) and x.nth_root(n) do not behave in the same way. All x.nth_root(n) >gives an n-th root in the same field to which x belongs while all x^(1/n) >gives the primitive n-th root of unity, with the exception of AA(-1)^(1/n). the function 1/n : AA->AA is 1-1 on all AA, a

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
sage: ZZ(-1).nth_root(3) -1 sage: _.parent() Integer Ring sage: QQ(-1).nth_root(3) -1 sage: _.parent() Rational Field sage: RR(-1).nth_root(3) -1.00 sage: _.parent() Real Field with 53 bits of precision sage: CC(-1).nth_root(3) 0.500 + 0.866025403784439*I sage: _.parent() Co

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
On Wednesday, August 28, 2024 at 7:57:43 PM UTC+9 john.c...@gmail.com wrote: Surely the output of -1 for AA(-1)^(1/3) is correct: AA is the "Algebraic Real Field" and -1 has exactly one cube root in there, namely itself. On the other hand, QQbar(-1) has 3 cube roots and one is chosen (in som

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
It is puzzling, but it does not seem to be so. If 1/3 would be a python float, (-1)**(1/3) is not defined under the usual definition of x^y = exp(y*ln(x)) with the standard branch cut for the logarithmic function. If Python includes the negative axis in the domain of ln(x), and defines ln(

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread John Cremona
Surely the output of -1 for AA(-1)^(1/3) is correct: AA is the "Algebraic Real Field" and -1 has exactly one cube root in there, namely itself. On the other hand, QQbar(-1) has 3 cube roots and one is chosen (in some deterministic way). I do not think that AA(-1)^(1/3) should return a cubroot

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-28 Thread Kwankyu Lee
> >>> (-1)**(1/3) > (0.5001+0.8660254037844386j) Your example illustrates twice that an operation can lead to a bigger set : 1/3 is a python float :-) It is puzzling, but it does not seem to be so. If 1/3 would be a python float, (-1)**(1/3) is not defined under the usual defi

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-27 Thread Vincent Delecroix
On Wed, 28 Aug 2024 at 03:46, Kwankyu Lee wrote: > > > I think it is of doubtful correctness RR not being closed under coercion: > sage: RR(RR(-1)^(1/3)) > TypeError: unable to convert '0.500+0.866025403784439*I' > to a real number > > > "closed under coercion" sounds vague to me. I do

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-27 Thread Kwankyu Lee
I think it is of doubtful correctness RR not being closed under coercion: sage: RR(RR(-1)^(1/3)) TypeError: unable to convert '0.500+0.866025403784439*I' to a real number "closed under coercion" sounds vague to me. I doubt if there is such a concept in sage. Fractional powers n

Re: [sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-27 Thread Georgi Guninski
On Tue, Aug 27, 2024 at 3:37 PM Kwankyu Lee wrote: > > sage: RR(-1)^(1/3) > 0.500 + 0.866025403784439*I I think it is of doubtful correctness RR not being closed under coercion: sage: RR(RR(-1)^(1/3)) TypeError: unable to convert '0.500+0.866025403784439*I' to a real numbe

[sage-devel] QQbar(-1)^(1/3) != AA(-1)^(1/3)

2024-08-27 Thread Kwankyu Lee
Hi, I need advice from algebraic fields experts. Currently, sage: RR(-1)^(1/3) 0.500 + 0.866025403784439*I sage: CC(-1)^(1/3) 0.500 + 0.866025403784439*I sage: QQbar(-1)^(1/3) 0.500? + 0.866025403784439?*I sage: AA(-1)^(1/3) #