Ask Your Question
1

Mapping between isomorphic NumberFields

asked 2018-04-13 15:35:18 -0500

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: 
sage: b=QQ['b'].0
sage: bRing = NumberField(b^2 + 1, 'a')
sage: 
sage: aRing is bRing
False

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
True

...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
1

answered 2018-04-14 07:37:04 -0500

tmonteil gravatar image

updated 2018-04-15 12:38:49 -0500

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
True
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

Stats

Asked: 2018-04-13 15:35:18 -0500

Seen: 35 times

Last updated: Apr 15