Open rwst opened 8 years ago
Author: Ralf Stephan
New commits:
e1279df | 21754: Held symbolic powers cannot be approximated numerically |
Reviewer: Vincent Delecroix
You added a method without neither documentation nor tests.
The following still fails
sage: SR(2) ^ SR(QQbar(3).sqrt() + QQbar(2).sqrt())
Would it be possible to hold the power automatically when there is no simplification?
Replying to @videlec:
You added a method without neither documentation nor tests.
In a locally used class, come on, show me one example where this is done in Sage. It won't show in coverage, either:
ralf@ark:~/sage> ./sage -coverage src/sage/symbolic/expression.pyx
------------------------------------------------------------------------
SCORE src/sage/symbolic/expression.pyx: 100.0% (220 of 220)
------------------------------------------------------------------------
The test is in the containing function, of course.
The following still fails
sage: SR(2) ^ SR(QQbar(3).sqrt() + QQbar(2).sqrt())
Would it be possible to hold the power automatically when there is no simplification?
I can catch the type error, but then I will catch all type errors. Is this desireable?
Replying to @rwst:
The following still fails
sage: SR(2) ^ SR(QQbar(3).sqrt() + QQbar(2).sqrt())
Would it be possible to hold the power automatically when there is no simplification?
I can catch the type error, but then I will catch all type errors. Is this desireable?
See #21758.
Maybe a bit obscure but still a bug:
Reason is that in
Expression.n()
the special sum treatment viaclass DefiniteSumExpander(ExpressionTreeWalker)
leaves arithmetic operations to the superclass where (if all numeric) they are reduced to their non-symbolic calls, i.e. here,2^QQbar(...)
which gives the error (correctly, see https://groups.google.com/forum/?hl=en#!topic/sage-support/_7eGYj92Igw).As we want to hold the power until later numerical conversion we want to override
arithmetic
inDefiniteSumExpander
.Component: symbolics
Author: Ralf Stephan
Branch/Commit: u/rws/held_symbolic_powers_cannot_be_approximated_numerically @
e1279df
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/21754