Morphisms between number fields¶

This module provides classes to represent ring homomorphisms between number fields (i.e. field embeddings).

class sage.rings.number_field.morphism.CyclotomicFieldHomomorphism_im_gens

EXAMPLES:

sage: R.<x,y> = QQ[]
sage: phi = R.hom([x,x+y]); phi
Ring endomorphism of Multivariate Polynomial Ring in x, y over Rational Field
Defn: x |--> x
y |--> x + y
sage: type(phi)
<type 'sage.rings.morphism.RingHomomorphism_im_gens'>


Here’s another example where the domain isn’t free:

sage: S.<xx,yy> = R.quotient(x - y)
sage: phi = S.hom([xx+1,xx+1])


Note that one has to specify valid images:

sage: phi = S.hom([xx+1,xx-1])
Traceback (most recent call last):
...
TypeError: images do not define a valid homomorphism


There is a check option, but it may be ignored in some cases – it’s purpose isn’t so you can lie to Sage, but to sometimes speed up creation of a homomorphism:

sage: phi = S.hom([xx+1,xx-1],check=False)
Traceback (most recent call last):
...
TypeError: images do not define a valid homomorphism

class sage.rings.number_field.morphism.CyclotomicFieldHomset(R, S, category=None)

Set of homomorphisms with domain a given cyclotomic field.

EXAMPLES:

sage: End(CyclotomicField(16))
Automorphism group of Cyclotomic Field of order 16 and degree 8

list()

Return a list of all the elements of self.

EXAMPLES:

sage: K.<z> = CyclotomicField(12)
sage: G = End(K); G
Automorphism group of Cyclotomic Field of order 12 and degree 4
sage: [g(z) for g in G]
[z, z^3 - z, -z, -z^3 + z]
sage: L.<a, b> = NumberField([x^2 + x + 1, x^4 + 1])
sage: L
Number Field in a with defining polynomial x^2 + x + 1 over its base field
sage: Hom(CyclotomicField(12), L)[3]
Ring morphism:
From: Cyclotomic Field of order 12 and degree 4
To:   Number Field in a with defining polynomial x^2 + x + 1 over its base field
Defn: zeta12 |--> -b^2*a
sage: list(Hom(CyclotomicField(5), K))
[]
sage: Hom(CyclotomicField(11), L).list()
[]

class sage.rings.number_field.morphism.NumberFieldHomomorphism_im_gens

EXAMPLES:

sage: R.<x,y> = QQ[]
sage: phi = R.hom([x,x+y]); phi
Ring endomorphism of Multivariate Polynomial Ring in x, y over Rational Field
Defn: x |--> x
y |--> x + y
sage: type(phi)
<type 'sage.rings.morphism.RingHomomorphism_im_gens'>


Here’s another example where the domain isn’t free:

sage: S.<xx,yy> = R.quotient(x - y)
sage: phi = S.hom([xx+1,xx+1])


Note that one has to specify valid images:

sage: phi = S.hom([xx+1,xx-1])
Traceback (most recent call last):
...
TypeError: images do not define a valid homomorphism


There is a check option, but it may be ignored in some cases – it’s purpose isn’t so you can lie to Sage, but to sometimes speed up creation of a homomorphism:

sage: phi = S.hom([xx+1,xx-1],check=False)
Traceback (most recent call last):
...
TypeError: images do not define a valid homomorphism

preimage(y)

Computes a preimage of $$y$$ in the domain, provided one exists. Raises a ValueError if $$y$$ has no preimage.

INPUT:

• $$y$$ – an element of the codomain of self.

OUTPUT:

Returns the preimage of $$y$$ in the domain, if one exists. Raises a ValueError if $$y$$ has no preimage.

EXAMPLES:

sage: K.<a> = NumberField(x^2 - 7)
sage: L.<b> = NumberField(x^4 - 7)
sage: f = K.embeddings(L)[0]
sage: f.preimage(3*b^2 - 12/7)
3*a - 12/7
sage: f.preimage(b)
Traceback (most recent call last):
...
ValueError: Element 'b' is not in the image of this homomorphism.

sage: F.<b> = QuadraticField(23)
sage: G.<a> = F.extension(x^3+5)
sage: f = F.embeddings(G)[0]
sage: f.preimage(a^3+2*b+3)
2*b - 2

class sage.rings.number_field.morphism.NumberFieldHomset(R, S, category=None)

Set of homomorphisms with domain a given number field.

TESTS:

sage: H = Hom(QuadraticField(-1, 'a'), QuadraticField(-1, 'b'))
sage: TestSuite(H).run()
Failure in _test_category:
...
The following tests failed: _test_elements

list()

Return a list of all the elements of self.

EXAMPLES:

sage: K.<a> = NumberField( [x^2 + x + 1, x^3 + 2] )
sage: L = K.absolute_field('b')
sage: G = End(L); G
Automorphism group of Number Field in b with defining polynomial x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9
sage: G.order()
6
sage: G.list()
[
Ring endomorphism of Number Field in b with defining polynomial x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9
Defn: b |--> b,
...
Ring endomorphism of Number Field in b with defining polynomial x^6 + 3*x^5 + 6*x^4 + 3*x^3 + 9*x + 9
Defn: b |--> -5/9*b^5 - b^4 - 2*b^3 + 2/3*b^2 - b - 5
]
sage: Hom(L, CyclotomicField(3)).list()
[]

order()

Return the order of this set of field homomorphism.

EXAMPLES:

sage: k.<a> = NumberField(x^2 + 1)
sage: End(k)
Automorphism group of Number Field in a with defining polynomial x^2 + 1
sage: End(k).order()
2
sage: k.<a> = NumberField(x^3 + 2)
sage: End(k).order()
1

sage: K.<a> = NumberField( [x^3 + 2, x^2 + x + 1] )
sage: End(K).order()
6

class sage.rings.number_field.morphism.RelativeNumberFieldHomomorphism_from_abs(parent, abs_hom)

A homomorphism from a relative number field to some other ring, stored as a homomorphism from the corresponding absolute field.

abs_hom()

Return the corresponding homomorphism from the absolute number field.

EXAMPLE:

sage: K.<a, b> = NumberField( [x^3 + 2, x^2 + x + 1] )
sage: K.hom(a, K).abs_hom()
Ring morphism:
From: Number Field in a with defining polynomial x^6 - 3*x^5 + 6*x^4 - 3*x^3 - 9*x + 9
To:   Number Field in a with defining polynomial x^3 + 2 over its base field
Defn: a |--> a - b

im_gens()

Return the images of the generators under this map.

EXAMPLE:

sage: K.<a, b> = NumberField( [x^3 + 2, x^2 + x + 1] )
sage: K.hom(a, K).im_gens()
[a, b]

class sage.rings.number_field.morphism.RelativeNumberFieldHomset(R, S, category=None)

Set of homomorphisms with domain a given relative number field.

EXAMPLES:

We construct a homomorphism from a relative field by giving the image of a generator:

sage: L.<cuberoot2, zeta3> = CyclotomicField(3).extension(x^3 - 2)
sage: phi = L.hom([cuberoot2 * zeta3]); phi
Relative number field endomorphism of Number Field in cuberoot2 with defining polynomial x^3 - 2 over its base field
Defn: cuberoot2 |--> zeta3*cuberoot2
zeta3 |--> zeta3
sage: phi(cuberoot2 + zeta3)
zeta3*cuberoot2 + zeta3


In fact, this phi is a generator for the Kummer Galois group of this cyclic extension:

sage: phi(phi(cuberoot2 + zeta3))
(-zeta3 - 1)*cuberoot2 + zeta3
sage: phi(phi(phi(cuberoot2 + zeta3)))
cuberoot2 + zeta3

default_base_hom()

Pick an embedding of the base field of self into the codomain of this homset. This is done in an essentially arbitrary way.

EXAMPLES:

sage: L.<a, b> = NumberField([x^3 - x + 1, x^2 + 23])
sage: M.<c> = NumberField(x^4 + 80*x^2 + 36)
sage: Hom(L, M).default_base_hom()
Ring morphism:
From: Number Field in b with defining polynomial x^2 + 23
To:   Number Field in c with defining polynomial x^4 + 80*x^2 + 36
Defn: b |--> 1/12*c^3 + 43/6*c

list()

Return a list of all the elements of self.

EXAMPLES:

sage: K.<a, b> = NumberField( [x^2 + x + 1, x^3 + 2] )
sage: G = End(K); G
Automorphism group of Number Field in a with defining polynomial x^2 + x + 1 over its base field
sage: v = G.list(); v
[
Relative number field endomorphism of Number Field in a with defining polynomial x^2 + x + 1 over its base field
Defn: a |--> a
b |--> b,
...
Relative number field endomorphism of Number Field in a with defining polynomial x^2 + x + 1 over its base field
Defn: a |--> a
b |--> -b*a - b
]


Previous topic

Relative Number Field Ideals

Next topic

Embeddings into ambient fields