On 09/04/16 05:15, Volker Braun wrote:
Let me try to summarize the expected behavior: If there is a coercion of
the base rings, then there should be a coercion to the (laurent) polynomial
ring with additional variables. The variables in the different rings are
identified using their name (and not index in gens() or any other rule).

sage: cm = get_coercion_model()
sage: R.<x> = QQ[]
sage: S.<x,t> = QQ[]
sage: cm.explain(R, S, operator.add)
Coercion on left operand via
     Conversion map:
       From: Univariate Polynomial Ring in x over Rational Field
       To:   Multivariate Polynomial Ring in x, t over Rational Field
Arithmetic performed after coercions.
Result lives in Multivariate Polynomial Ring in x, t over Rational Field
Multivariate Polynomial Ring in x, t over Rational Field

No coercion if variable names are not strict subsets:

sage: T.<x,y> = QQ[]
sage: cm.explain(T, S, operator.add)
Unknown result parent.

But explicit conversion can still work, e.g. by falling back to the index
in gens():

sage: T(S.gen(0))
x
sage: T(S.gen(1))
y


Still, we have this strange (conversion) behavior

sage: R.<x,y> = QQ[]
sage: S.<y,t> = QQ[]
sage: R(S('y'))
x
sage: S(R('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 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.

Reply via email to