macsyma on Wed, 14 Aug 2019 07:55:03 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

the minimal polynomial over the composite field

Dear All,

As I mentioned in ,
I have the following (sub)goal:

"For a given irreducible g in Q[x], to find any one factor
 (with the minimum positive degree) of g over the algebraic number field K
 defined by polcyclo(p_1),...,polcyclo(p_m) where P={p_1,...,p_m}
 is all of the odd prime factors of poldegree(g), in other words,
 to find the minimal polynomial over K of an algebraic number defined by g."

Probably the simplest way to achieve this is to use 
the factorization of g over the composite field,
which is obviously expensive for getting one factor.
So my current method is
(step1) For each p in P, extract one factor g_i from factorized g
        over the Q(zeta_p) using the factorization over a subfield of Q(zeta_p).
(step2) Get the result as the GCD of all of g_i.

The code below is an implementation:

tst001(g) =
  my(P = select(r -> r - 2, factor(poldegree(g))[, 1]),
     p, q, s, t, u, A = g, gi);
  for(i = 1, #P,
    q = polcyclo(p = P[i], u = eval(concat("c", p)));
    [s, t] = nfsubfields(q)[-2..-2][1];
    gi = nffactor(q, subst(liftpol(nffactor(s, g)[1, 1]), u, t))[1, 1];
    if(#variables(gi)>1, A = gcd(A, gi) /* or RgX_gcd_simple or polcompositum method */ ));

An example:
? tst001(nfsplitting(x^15-2,120))
%4 = x^15+((-15780*c5^3-15780*c5^2-25092)*c3+(-26520*c5^3-3740*c5^2-14480*c5-19786))

However, for large p in P, it still takes time to do nffactor.
Please let me know if there is a better way than the above.