On Tuesday 3 September 2024 at 19:44:43 UTC-7 Kwankyu Lee wrote: I think that only valid argument for AA(-1)^(1/3) = -1 is that it is the status quo. It is just human that likes what she/he used to. Removing inconsistency is for the future.
The fact that powers with odd denominator do not leave AA is also a documented design decision: https://doc.sagemath.org/html/en/reference/number_fields/sage/rings/qqbar.html#sage.rings.qqbar.AlgebraicNumber_base (thanks to hgranath https://github.com/sagemath/sage/pull/38362#issuecomment-2325700870 for finding that one) There is good precedent that the parent of a power depends on the value of the exponent. For instance, parent(3^2) is ZZ and parent(3^-1) is QQ. So I'd add as a valid argument for the branch choice in AA that it makes sense to choose a branch that does *not* require an extension of the parent, if possible. Yes, it's a different branch choice than the one made in Qbar, but AA and Qbar are different objects, with AA coercible into Qbar. Once again, the design decisions for powering for floats in Python are made in the absence of representable non-integer rationals. OTOH, it seems the coercion system may force our hand here (at least I think what happens below is a consequence of an overeager coercion system): sage: parent(AA(-2)^(1/3)) Algebraic Real Field sage: a=AA(2)^(1/2) sage: a^a TypeError: unsupported operand parent(s) for ^: 'Algebraic Real Field' and 'Algebraic Real Field' sage: parent(AA(-2)^(0.3333333)) Complex Field with 53 bits of precision sage: parent(AA(-2)^RealField(1000)(1/3)) Complex Field with 1000 bits of precision I don't think there are many people who would be unhappy if the last two would raise an error, but here we are: algebraic numbers CAN be raised to "non-rational" exponents (represented as floats) and the result is a floating point result, with the precision gleaned from the exponent. So there IS a continuity concept for the exponent when the base is an element of AA. Unfortunately, by that argument, we're forced to take the principal branch. I'd much rather see that exponentiation on AA with a not-explicitly-rational exponent would yield an error on account of the result not being (reliably) algebraic. Then there's not an obvious topology on QQ that needs to be respected with continuity for exponentiation and then it would be reasonable to choose a branch that does not need a larger parent. But curtailing the mechanics of coercion around exponentiation would be an even bigger change. -- 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/12fba54d-aa64-4d64-b866-6d97e5dd133an%40googlegroups.com.