Ask Your Question

Mapping between isomorphic NumberFields

asked 2018-04-13 22:35:18 +0200

BrentBaccala gravatar image

If I set up two NumberFields that differ only in the variable used in their defining polynomials, they don't report equal:

sage: a=QQ['a'].0
sage: aRing = NumberField(a^2 + 1, 'a')
sage: b=QQ['b'].0
sage: bRing = NumberField(b^2 + 1, 'a')
sage: aRing is bRing

This I can live with. But shouldn't I be able to convert elements between them?

sage: aa=aRing.0
sage: bb=bRing.0
sage: bRing(aa)
TypeError: No compatible natural embeddings found for Number Field in a with defining polynomial b^2 + 1 and Number Field in a with defining polynomial a^2 + 1

I can convert like this:

sage: bbb = aa.polynomial()(bb)
sage: bbb.parent() == bRing

...but this seems awkward, and requires defining an auxilary function if you want to pass it to map or map_coefficients.

Is this a bug? Should I report it on Sage's Trac, or is there a good reason for this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-04-14 14:37:04 +0200

tmonteil gravatar image

updated 2018-04-15 19:38:49 +0200

Indeed, in Sage the name of the indeterminates matters, this is not a bug. Think about the multivariate case to be convinced of the reason why.

You can define the mapping as follows:

sage: h = bRing.hom([aa])
sage: h
Ring morphism:
  From: Number Field in a with defining polynomial b^2 + 1
  To:   Number Field in a with defining polynomial a^2 + 1
  Defn: a |--> a
sage: h(bb) == aa
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-04-13 22:35:18 +0200

Seen: 547 times

Last updated: Apr 15 '18