This module provides classes to represent ring homomorphisms between number fields (i.e. field embeddings).
Bases: 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
Bases: sage.rings.number_field.morphism.NumberFieldHomset
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
Return a list of all the elements of self (for which the domain is a cyclotomic field).
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()
[]
Bases: sage.rings.morphism.RingHomomorphism_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
Computes a preimage of in the domain, provided one exists.
Raises a ValueError if
has no preimage.
INPUT:
OUTPUT:
Returns the preimage of in the domain, if one exists.
Raises a ValueError if
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
Bases: sage.rings.homset.RingHomset_generic
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
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
Return a list of all the elements of self.
EXAMPLES:
sage: K.<a> = NumberField(x^3 - 3*x + 1)
sage: End(K).list()
[
Ring endomorphism of Number Field in a with defining polynomial x^3 - 3*x + 1
Defn: a |--> a,
Ring endomorphism of Number Field in a with defining polynomial x^3 - 3*x + 1
Defn: a |--> a^2 - 2,
Ring endomorphism of Number Field in a with defining polynomial x^3 - 3*x + 1
Defn: a |--> -a^2 - a + 2
]
sage: Hom(K, CyclotomicField(9))[0] # indirect doctest
Ring morphism:
From: Number Field in a with defining polynomial x^3 - 3*x + 1
To: Cyclotomic Field of order 9 and degree 6
Defn: a |--> -zeta9^4 + zeta9^2 - zeta9
An example where the codomain is a relative extension:
sage: K.<a> = NumberField(x^3 - 2)
sage: L.<b> = K.extension(x^2 + 3)
sage: Hom(K, L).list()
[
Ring morphism:
From: Number Field in a with defining polynomial x^3 - 2
To: Number Field in b with defining polynomial x^2 + 3 over its base field
Defn: a |--> a,
Ring morphism:
From: Number Field in a with defining polynomial x^3 - 2
To: Number Field in b with defining polynomial x^2 + 3 over its base field
Defn: a |--> -1/2*a*b - 1/2*a,
Ring morphism:
From: Number Field in a with defining polynomial x^3 - 2
To: Number Field in b with defining polynomial x^2 + 3 over its base field
Defn: a |--> 1/2*a*b - 1/2*a
]
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
Bases: sage.rings.morphism.RingHomomorphism
A homomorphism from a relative number field to some other ring, stored as a homomorphism from the corresponding absolute field.
Return the corresponding homomorphism from the absolute number field.
EXAMPLES:
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
Return the images of the generators under this map.
EXAMPLES:
sage: K.<a, b> = NumberField( [x^3 + 2, x^2 + x + 1] )
sage: K.hom(a, K).im_gens()
[a, b]
Bases: sage.rings.number_field.morphism.NumberFieldHomset
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
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
Return a list of all the elements of self (for which the domain is a relative number field).
EXAMPLES:
sage: K.<a, b> = NumberField([x^2 + x + 1, x^3 + 2])
sage: End(K).list()
[
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
]
An example with an absolute codomain:
sage: K.<a, b> = NumberField([x^2 - 3, x^2 + 2])
sage: Hom(K, CyclotomicField(24, 'z')).list()
[
Relative number field morphism:
From: Number Field in a with defining polynomial x^2 - 3 over its base field
To: Cyclotomic Field of order 24 and degree 8
Defn: a |--> z^6 - 2*z^2
b |--> -z^5 - z^3 + z,
...
Relative number field morphism:
From: Number Field in a with defining polynomial x^2 - 3 over its base field
To: Cyclotomic Field of order 24 and degree 8
Defn: a |--> -z^6 + 2*z^2
b |--> z^5 + z^3 - z
]