You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sage: QQ["a"]["b,c"].coerce_map_from(QQ["a,c,b"])
Call morphism:
From: Multivariate Polynomial Ring in a, c, b over Rational Field
To: Multivariate Polynomial Ring in b, c over Univariate Polynomial Ring in a over Rational Field
sage: QQ["a"]["b,c"].coerce_map_from(QQ["a,c,b"])(QQ["a,c,b"].1)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
...
TypeError: c is not a constant polynomial
I found this while working on #39089 .
The coerce map is reported to exist by Sage only because __call__ is (incorrectly)
overridden by multipolynomial ring implementation (parents are not supposed to override __call__, they should override _element_constructor_ instead).
Issue 2: sometimes R ← S and S ← T has coerce map, but R ← T has no coerce map
done
sage: R=QQ["a,b"]["c,d"]
....: S=QQ["a,b,c,d"]
....: T=QQ["a,c,b,d"]
....: U=QQ["a,c"]["b,d"]
sage: R.coerce_map_from(U) is None
True
sage: R.coerce_map_from(S) * S.coerce_map_from(T) * T.coerce_map_from(U)
Composite map:
From: Multivariate Polynomial Ring in b, d over Multivariate Polynomial Ring in a, c over Rational Field
To: Multivariate Polynomial Ring in c, d over Multivariate Polynomial Ring in a, b over Rational Field
Defn: Coercion map:
From: Multivariate Polynomial Ring in b, d over Multivariate Polynomial Ring in a, c over Rational Field
To: Multivariate Polynomial Ring in a, c, b, d over Rational Field
then
Coercion map:
From: Multivariate Polynomial Ring in a, c, b, d over Rational Field
To: Multivariate Polynomial Ring in a, b, c, d over Rational Field
then
Call morphism:
From: Multivariate Polynomial Ring in a, b, c, d over Rational Field
To: Multivariate Polynomial Ring in c, d over Multivariate Polynomial Ring in a, b over Rational Field
Issue 3: nested polynomial ring with coinciding variable name lead to non-commuting coerce map
It looks impossible to resolve this issue, unless we deprecate the construction of nested polynomial/power series/Laurent polynomial/series ring/etc. with same variable names.
Issue 4: un-flattening morphism may or may not be coercion map depends on univariate/multivariate case
done
sage: R = QQ["a"]["b"]
sage: S = R.flattening_morphism().codomain()
sage: R.coerce_map_from(S)
sage: S.coerce_map_from(R)
Coercion map:
From: Univariate Polynomial Ring in b over Univariate Polynomial Ring in a over Rational Field
To: Multivariate Polynomial Ring in a, b over Rational Field
sage: R = QQ["a,b"]["c,d"]
sage: S = R.flattening_morphism().codomain()
sage: R.coerce_map_from(S)
Call morphism:
From: Multivariate Polynomial Ring in a, b, c, d over Rational Field
To: Multivariate Polynomial Ring in c, d over Multivariate Polynomial Ring in a, b over Rational
Field
sage: S.coerce_map_from(R)
Coercion map:
From: Multivariate Polynomial Ring in c, d over Multivariate Polynomial Ring in a, b over Rational
Field
To: Multivariate Polynomial Ring in a, b, c, d over Rational Field
Environment
OS: Linux
Sage Version: latest development source
Checklist
I have searched the existing issues for a bug report that matches the one I want to file, without success.
I have read the documentation and troubleshoot guide
The text was updated successfully, but these errors were encountered:
Issue 1: sometimes coerce map is not callable
I found this while working on #39089 .
The coerce
map
is reported to exist by Sage only because__call__
is (incorrectly)overridden by multipolynomial ring implementation (parents are not supposed to override
__call__
, they should override_element_constructor_
instead).Issue 2: sometimes
R ← S
andS ← T
has coerce map, butR ← T
has no coerce mapIssue 3: nested polynomial ring with coinciding variable name lead to non-commuting coerce map
It looks impossible to resolve this issue, unless we deprecate the construction of nested polynomial/power series/Laurent polynomial/series ring/etc. with same variable names.
It gets worse — what about quotient rings?
Issue 4: un-flattening morphism may or may not be coercion map depends on univariate/multivariate case
Environment
Checklist
The text was updated successfully, but these errors were encountered: