id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
26970 improve conversions from polynomial rings to the base ring mantepse "This ticket is a follow up on #26929. As pointed out there, conversions from univariate quotient rings to subrings of the base ring should be harmonized with those of multivariate quotient rings.
For example, we currently have the following:
{{{
sage: R. = QQ[]; S. = R.quo(x^2 + y^2);
sage: ZZ.coerce_map_from(S) is None
True
sage: ZZ.convert_map_from(S)
Conversion via _integer_ method map:
From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
To: Integer Ring
}}}
In the univariate case another map gets picked up; one that apparently always fails.
{{{
sage: R.=QQ[]; S.=R.quo(x^2+1)
sage: m=ZZ.convert_map_from(S); m
Conversion map:
From: Univariate Quotient Polynomial Ring in a over Rational Field with modulus x^2 + 1
To: Integer Ring
}}}
This map simply ends up calling `ZZ._element_constructor_()`, which fails.
So the difference seems to be whether an `_integer_` method is available on the elements.
(not sure whether this belongs to coercion or categories, or neither.)" defect new major coercion nbruin N/A