Ask Your Question

Homomorphisms for relative number fields

asked 2014-09-17 20:36:11 -0500

jj gravatar image

updated 2015-01-13 14:48:17 -0500

FrédéricC gravatar image

How can I define a homomorphism from a relative number field K (containing F) to some other field L if I know where to send K.gens()?


F_pol  = x^2-x-1
F      = NumberField(F_pol, 'lam')
K_pol  = x^2 + 4
K      = F.extension(K_pol, 'e')
L      = QQbar
lam_im = L(F_pol.roots()[1][0])
e_im   = L(K_pol.roots()[1][0])

Wrong result:

K.hom([e_im], QQbar, check=False)

What we want (not working):

K.hom([e_im, lam_im], QQbar, check=False)

A working solution (edit):

K.Hom(L)(e_im, F.hom([lam_im], check=False))

New question/example: What if L is not exact?

x       = PolynomialRing(QQ,'x').gen()
F_pol   = x^3 - x^2 - 2*x + 1
F.<lam> = NumberField(F_pol, 'lam')
D       = 4*lam^2 + 4*lam - 4
K_pol   = x^2 - D
K       = F.extension(K_pol, 'e')
L       = CC
lam_im  = F_pol.roots(L)[2][0]
e_im    = F.hom([lam_im], check=False)(D).sqrt()

K.Hom(L)(e_im, F.hom([lam_im], check=False), check=False)

This gives the error:

TypeError: images do not define a valid homomorphism
edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2014-09-18 06:52:59 -0500

Francis Clarke gravatar image

updated 2014-09-25 05:43:16 -0500

First you need to write

sage: lam_im = F_pol.roots(L)[1][0]
sage: e_im = K_pol.roots(L)[1][0]

Then the following works

sage: HomKL = K.Hom(L)
sage: HomKL(e_im, F.hom([lam_im]))
Relative number field morphism:
  From: Number Field in e with defining polynomial x^2 + 4 over its base field
  To:   Algebraic Field
  Defn: e |--> 0.?e-53 + 2.000000000000000?*I
        lam |--> 1.618033988749895? + 0.?e-53*I


sage: HomKL.__call__?

explains the syntax. There should be an easier way to do this.

On the second question

This is a bug, the check parameter does not get passed on as it should be. I will raise a ticket to deal with this, but in the meantime you can get the result you want as follows.

sage: K_abs = K.absolute_field('a')
sage: from_abs = K_abs.structure()[0]
sage: a = from_abs(K_abs.gen())
sage: R = L['x']
sage: f = R(map(F.hom([lam_im], check=False), a))
sage: abs_hom = K_abs.hom([f(e_im)], check=False)
sage: from sage.rings.number_field.morphism import RelativeNumberFieldHomomorphism_from_abs
sage: RelativeNumberFieldHomomorphism_from_abs(K.Hom(L), abs_hom)
Relative number field morphism:
  From: Number Field in e with defining polynomial x^2 - 4*lam^2 - 4*lam + 4 over its base field
  To:   Complex Field with 53 bits of precision
  Defn: e |--> 4.02438434522465
        lam |--> 1.80193773580484

This is taken, with some slight modifications, from the code for _from_im in sage/rings/number_field/, the key difference being the addition of check=False where abs_hom is defined.

edit flag offensive delete link more


I get the following error after "lam_im = F_pol.roots(L)[1][0]": TypeError: Algebraic Field is not a valid variable. But with my "lam_im"-way it works. Thanks a lot!

jj gravatar imagejj ( 2014-09-18 09:32:37 -0500 )edit

Now I see. Your F_pol was a symbolic expression, but mine was a polynomial. Unfortunately the root methods for each are not compatible.

Francis Clarke gravatar imageFrancis Clarke ( 2014-09-18 10:49:41 -0500 )edit

Ok, that makes sense. Usually I use polynomial variables as well...

jj gravatar imagejj ( 2014-09-19 03:08:46 -0500 )edit

Hmm, how can I make it work for non-exact fields like CC? I tried to put a check=False flag everwhere but it still seems to fail. :(

jj gravatar imagejj ( 2014-09-19 09:47:07 -0500 )edit

Thanks for the updated answer!

jj gravatar imagejj ( 2014-10-20 12:26:28 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2014-09-17 20:36:11 -0500

Seen: 92 times

Last updated: Sep 25 '14