Opened 5 years ago

Last modified 3 years ago

#21161 closed enhancement

repr of NumberFields (the parents) should indicate its embedding if there is one — at Version 1

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-8.8
Component: number fields Keywords: number field
Cc: vdelecroix, jipilab, cremona, tscrim, mmezzarobba, jdemeyer Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mkoeppe)

As discussed in #21105, number fields with coercion embeddings, in particular with real embeddings, behave quite differently from those without - but there's no indication of embeddings in the print representation:

sage: K.<a> = NumberField(x^2 - 2)
sage: a.parent()
Number Field in a with defining polynomial x^2 - 2
sage: K.<sqrt2> = NumberField(x^2 - 2, embedding=1.4)
sage: sqrt2.parent()
Number Field in sqrt2 with defining polynomial x^2 - 2

I propose to change the print representation when there is an embedding, for example like this:

sage: K.<sqrt2> = NumberField(x^2 - 2, embedding=1.4)
sage: sqrt2.parent()
Real Number Field in sqrt2 as the root of the defining polynomial x^2 - 2 near 1.41421356237309?

Change History (1)

comment:1 Changed 5 years ago by mkoeppe

  • Description modified (diff)
Note: See TracTickets for help on using tickets.