Hi Jeroen,

On 2017-11-27, Jeroen Demeyer <[email protected]> wrote:
> I might be missing something, but is there a generic recipe in Sage to 
> get a map from S.base() to S? I want something which works in as much 
> generality as possible for any structure S. I feel like that should 
> exist but I couldn't find it.

  sage: R.<a,b>=QQ[]
  sage: R.from_base_ring?

Not sure if this answers your question, as this isn't a map but a
conversion method.

Other than that, if you really want the result as a map, just exploit
the coercion/conversion framework:

  sage: R.convert_map_from(R.base())
  Polynomial base injection morphism:
    From: Rational Field
    To:   Multivariate Polynomial Ring in a, b over Rational Field

I suppose you know the difference between a coercion and a conversion
map, and you know that in a non-unital algebra (which I think aren't
implemented in Sage) a conversion from the base ring doesn't really
make sense.

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to