Defining a 'nice' Compositum

I'm having two difficulties which I assume are simple to resolve. I have a set field, say $K= \mathbb{Q}(x^2+1)$, and a set of polynomials I want to check if they are irreducible over $K$. If they are irreducible, I would like to form the compositum of $K$ and this field generated by $f$ and then find a 'nice' generator. For example,

K.<root> = NumberField(x^2+1);
R = K['x'];
poly = [x^2 + 1, x^2 + 2, x^2 + x + 1];
f = R(poly[0]);
if f.is_irreducible:
L = NumberField([x^2+1, f]);


There are two issues:

1. Even when f.is_irreducible() gives True, the polynomial is not always irreducible, as in the case above, so that the construction of L gives an error.

2. Even if L can be formed, how do I find a 'nice' generator for L, i.e. a single polynomial $g$ which generates L so that I can form a 'better' (in terms of computation speed) field $M= \mathbb{Q}(g)$?

edit retag close merge delete

Sort by » oldest newest most voted

The following works for me:

S.<X> = QQ[]
R.<x> = K[]

polynomials = [X^2 + 1, X^2 + 2, X^2 + X + 1]

count = 0
for f in polynomials:
count += 1
print "[%s]" % count
if R(f).is_irreducible():
print "\tIrreductible case for %s over K..." % f
L = NumberField( [X^2+1, f], names='a');
print "\tThe number field L is:"
print "\t%s" % L
print "\tThe base field of L is:"
print "\t%s" % L.base_field()
print "\tL has absolute degree %s" % L.absolute_degree()
print "\tL has relative degree %s" % L.relative_degree()
else:
print "\tReducible case for %s over K" % f


Results:

[1]
Reducible case for X^2 + 1 over K
[2]
Irreductible case for X^2 + 2 over K...
The number field L is:
Number Field in a0 with defining polynomial X^2 + 1 over its base field
The base field of L is:
Number Field in a1 with defining polynomial X^2 + 2
L has absolute degree 4
L has relative degree 2
[3]
Irreductible case for X^2 + X + 1 over K...
The number field L is:
Number Field in a0 with defining polynomial X^2 + 1 over its base field
The base field of L is:
Number Field in a1 with defining polynomial X^2 + X + 1
L has absolute degree 4
L has relative degree 2


Note that f.is_irreducible is only a method, as a boolean it always avaluates to True, one has to call it, f.is_irreducible() to have the needed True or False. Also, always make the difference between the transcendentals like x over different fields.

more

Something like a0 + a1, which may be obtained like this:

sage: sum(L.gens())
a0 + a1


should be a simple generator, but this should be checked in an ad-hoc manner.

( 2019-04-23 11:28:05 +0200 )edit

Once you have the field as a relative extension, you can get it as a primitive extension of Q via L.absolute_field('b'). You can then use L.optimized_representation() to get a nice representation.

( 2019-04-23 17:39:39 +0200 )edit

( 2019-04-24 10:42:16 +0200 )edit