-
-
Notifications
You must be signed in to change notification settings - Fork 660
Description
For a polynomial f
defined over a number field K
, when replacing K
by its absolute field L = K.absolute_field(names='b')
there might be an error when changing f
with the appropriate isomorphism f.change_ring(L.structure()[1])
.
The problem arises from the fact that change_ring
wants to check whether the isomorphism is part of K.Hom(L)
by calling K.Hom(L)(L.structure()[1])
which gives an error if L.structure()[1]
is not an instance of NumberFieldHomomorphism_im_gens
which it not necessarily is. Here is a minimal working example
sage: K.<a> = CyclotomicField(8)
sage: L.<b> = K.absolute_field()
sage: phi = L.structure()[1]
sage: phi.parent() == K.Hom(L)
True
sage: K.Hom(L)(phi)
Traceback (most recent call last):
...
TypeError: unable to convert Isomorphism given by variable name change map:
From: Cyclotomic Field of order 8 and degree 4
To: Number Field in b with defining polynomial x^4 + 1 to an element of Number Field in b with defining polynomial x^4 + 1
The error seems a consequence of a call to K.Hom(L)
interpreting the argument as an element of the codomain if it is not an instance of NumberFieldHomomorphism_im_gens
.
Here is the example failing on change_ring
where the error message is even less insightful
sage: K.<a> = CyclotomicField(8)
sage: L.<b> = K.absolute_field()
sage: R.<x> = K[]
sage: f = x^2 + a
sage: f.change_ring(L.structure()[1])
Traceback (most recent call last):
...
TypeError:
Depends on #29008
Depends on #29010
Component: number fields
Keywords: absolute field
Author: Peter Bruin
Branch/Commit: 5939e98
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/28869