Hi Ralf,
First of all, your opinon is more valuable than others since you are the
maintainer of Pynac.
That being said, the constraint specification of symbolic variables in
Sage is really poor. Ideally, we should be able to have symbolic
computation more tightly linked to Sage parents. It should involve some
kind of coercion under the hood and raise error when the operation is
not appropriate.
For example
sage: x = SR.variable(domain = GF(3))
sage: n = SR.variable(domain = ZZ)
sage: x^n + 1 # coercion: 1 is converted to GF(3)
x^n + 1
sage: x^3 # automatic simplification
x
sage: x + n # the domain of n becomes GF(3)
sage: (x + n)^3 # automatic simplification
x + n
sage: cos(x) # does not make sense
Traceback (most recent call last):
...
ValueError: undefined
However, for non-exact rings we might want to forbid the coercion, e.g.
as in "pi + 1.0". But even in this case the expression is well
identified as being "real".
In particular (and answering your question :-)
- in a single expression I would forbid the mix of elements which belong
to rings with different characteristic, unless it is an operation
associated to a valid coercion in Sage (e.g. GF(3) and ZZ)
- I would associate to each symbolic expression a domain (i.e. set of
numbers with constraints) that would define a set of available operations
Best,
Vincent
On 30/08/16 12:28, Ralf Stephan wrote:
As you know Pynac provides symbolic computation. In earlier times
this included polynomial manipulation and other things where Sage
has now dedicated and consistent algebraic structures. Pynac nowaday
is mostly calculus. For this reason, and because I'm tired of trying to fix
things that belong in other parts of Sage I propose to make it an error
to mix elements of rings with positive characteristics (or symbolic Mod)
and symbolic variables.
The error could also hint at a solution using the resp. polynomial rings.
I don't think there is much interest in the mentioned feature atm, because
the present behaviour IS already buggy, and no one complained.
But maybe I'm completely wrong, please state your opinion.
Regards,
--
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.