def _generic_convert_map(self, S): if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)
def _generic_convert_map(self, S): if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)
def _generic_convert_map(self, S): """ Return a generic map from a given homset to ``self``. INPUT: - ``S`` -- a homset OUTPUT: A map (by default: a Call morphism) from ``S`` to ``self``. EXAMPLES:: sage: H = Hom(ZZ,QQ['t'], CommutativeAdditiveGroups()) sage: P.<t> = ZZ[] sage: f = P.hom([2*t]) sage: H._generic_convert_map(f.parent()) Call morphism: From: Set of Homomorphisms from Univariate Polynomial Ring in t over Integer Ring to Univariate Polynomial Ring in t over Integer Ring To: Set of Morphisms from Integer Ring to Univariate Polynomial Ring in t over Rational Field in Category of commutative additive groups sage: H._generic_convert_map(f.parent())(f) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring Defn: Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then Conversion map: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field """ if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)
def _generic_convert_map(self, S): """ Return a generic map from a given homset to ``self``. INPUT: - ``S`` -- a homset OUTPUT: A map (by default: a Call morphism) from ``S`` to ``self``. EXAMPLES:: sage: H = Hom(ZZ,QQ['t'], CommutativeAdditiveGroups()) sage: P.<t> = ZZ[] sage: f = P.hom([2*t]) sage: H._generic_convert_map(f.parent()) Call morphism: From: Set of Homomorphisms from Univariate Polynomial Ring in t over Integer Ring to Univariate Polynomial Ring in t over Integer Ring To: Set of Morphisms from Integer Ring to Univariate Polynomial Ring in t over Rational Field in Category of commutative additive groups sage: H._generic_convert_map(f.parent())(f) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring Defn: Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then Conversion map: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field """ if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)
def _generic_convert_map(self, S): """ Return a generic map from a given homset to ``self``. INPUT: - ``S`` -- a homset OUTPUT: A map (by default: a Call morphism) from ``S`` to ``self``. EXAMPLES: By :trac:`14711`, conversion and coerce maps should be copied before using them outside of the coercion system:: sage: H = Hom(ZZ,QQ['t'], CommutativeAdditiveGroups()) sage: P.<t> = ZZ[] sage: f = P.hom([2*t]) sage: phi = H._generic_convert_map(f.parent()); phi Call morphism: From: Set of Homomorphisms from Univariate Polynomial Ring in t over Integer Ring to Univariate Polynomial Ring in t over Integer Ring To: Set of Morphisms from Integer Ring to Univariate Polynomial Ring in t over Rational Field in Category of commutative additive groups sage: H._generic_convert_map(f.parent())(f) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: (map internal to coercion system -- copy before use) Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then (map internal to coercion system -- copy before use) Ring morphism: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field sage: copy(H._generic_convert_map(f.parent())(f)) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then Ring morphism: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Induced from base ring by Natural morphism: From: Integer Ring To: Rational Field """ if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)
def _generic_convert_map(self, S): """ Return a generic map from a given homset to ``self``. INPUT: - ``S`` -- a homset OUTPUT: A map (by default: a Call morphism) from ``S`` to ``self``. EXAMPLES: By :trac:`14711`, conversion and coerce maps should be copied before using them outside of the coercion system:: sage: H = Hom(ZZ,QQ['t'], CommutativeAdditiveGroups()) sage: P.<t> = ZZ[] sage: f = P.hom([2*t]) sage: phi = H._generic_convert_map(f.parent()); phi Call morphism: From: Set of Homomorphisms from Univariate Polynomial Ring in t over Integer Ring to Univariate Polynomial Ring in t over Integer Ring To: Set of Morphisms from Integer Ring to Univariate Polynomial Ring in t over Rational Field in Category of commutative additive groups sage: H._generic_convert_map(f.parent())(f) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring Defn: (map internal to coercion system -- copy before use) Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then (map internal to coercion system -- copy before use) Ring morphism: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field sage: copy(H._generic_convert_map(f.parent())(f)) Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Composite map: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring Defn: Polynomial base injection morphism: From: Integer Ring To: Univariate Polynomial Ring in t over Integer Ring then Ring endomorphism of Univariate Polynomial Ring in t over Integer Ring Defn: t |--> 2*t then Ring morphism: From: Univariate Polynomial Ring in t over Integer Ring To: Univariate Polynomial Ring in t over Rational Field Defn: Induced from base ring by Natural morphism: From: Integer Ring To: Rational Field """ if self._element_constructor is None: from sage.categories.morphism import CallMorphism from sage.categories.homset import Hom return CallMorphism(Hom(S, self)) else: return Parent._generic_convert_map(self, S)