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 in another field/parent when there is one in the same field/parent. Compare sage: QQ(-1).nth_root(3) -1 sage: RR(-1).nth_root(3) -1.00000000000000 sage: CC(-1).nth_root(3) 0.500000000000000 + 0.866025403784439*I which is as it should be (in my opinion!) John On Wednesday 28 August 2024 at 11:51:13 UTC+1 Kwankyu Lee wrote: > > >>> (-1)**(1/3) > > (0.5000000000000001+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 > definition of x^y = exp(y*ln(x)) with the standard branch cut for the > logarithmic function. > > Python seems to deal with (-1)**(1/3) as a fractional power, and thus > gives the primitive cube root of -1 as a complex number. > > Python doc says math.pow(-1, 1/3) converts 1/3 to a python float, and > raises an error, unlike (-1)**(1/3). Thus math.pow seems to use the usual > definition of x^y. > -- 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/21147cd0-9ae4-45e0-be9d-5ea3c78dd151n%40googlegroups.com.