Question about number_field_elements_from_algebraics (Ticket 20181)

57 views
Skip to first unread message

jplab

unread,
Apr 9, 2018, 12:10:07 PM4/9/18
to sage-devel
Dear all,

In order to get algebraic polyhedra using the normaliz backend [1], we modify the function

number_field_elements_from_algebraics of qqbar.py to give embedded number fields and also accept a larger class of algebraic numbers, say coming from cyclotomic fields [2].

For example, this is now possible:

sage: UCF = UniversalCyclotomicField()
sage: E = UCF.gen(5)
sage: L.<b> = NumberField(x^2-189*x+16, embedding=200)
sage: my_nums = [-52*E - 136*E^2 - 136*E^3 - 52*E^4, L.gen()._algebraic_(AA),sqrt(2)]
sage: aa_my_nums = [AA(_) for _ in my_nums]
sage: res = number_field_elements_from_algebraics(aa_my_nums,embedded=True)
sage: res
(Number Field in a with defining polynomial y^8 - 35670*y^6 + 476899047*y^4 - 2832410271650*y^2 + 6305298701739921,
 [2310/26212773509*a^7 - 185432947/78638320527*a^5 + 1652517502195/78638320527*a^3 - 4904676315215467/78638320527*a + 94,
  -1238/2803377488467023*a^7 + 185460719/11213509953868092*a^5 - 2754936849443/11213509953868092*a^3 + 8180694680816975/3737836651289364*a + 189/2,
  -1979/1887160880826*a^7 + 26472586/943580440413*a^5 - 235822245043/943580440413*a^3 + 466325019915415/629053626942*a],
 Ring morphism:
   From: Number Field in a with defining polynomial y^8 - 35670*y^6 + 476899047*y^4 - 2832410271650*y^2 + 6305298701739921
   To:   Algebraic Real Field
   Defn: a |--> 96.9475535136628?)
sage: res[0].gen_embedding()
96.9475535136628?

The ticket 2018 needs review and it would be nice to have the opinion of experts on number fields in Sage...

For example, there is currently one failing doctest where it seems that the newer version is smarter, so that the test is not necessary anymore.

[1] https://trac.sagemath.org/ticket/25097
[2] https://trac.sagemath.org/ticket/20181

Dima Pasechnik

unread,
Apr 10, 2018, 5:02:38 AM4/10/18
to sage-devel
I misread this as "getting_number_field_elements_from_algebraists"...

jplab

unread,
Apr 12, 2018, 6:05:51 PM4/12/18
to sage-devel
Haha! That could be a good Easter egg...

... and I would not mind if some algebraists had a look at the NumberField elements that come out either from this adapted function either!
Reply all
Reply to author
Forward
0 new messages