Dear Waldek,

On 3/7/25 19:16, Waldek Hebisch wrote:
AFAICS you are interested in _very_ special cases.

Yes, of course. But this discussion helped me to realize,
that I actually have a bit more freedom. I have to anyway investigate
all the conjugates where in the end I only care about real roots.

Additionally, given an algebraic number z, it would be great if
FriCAS had a way to find a p \in Z[x] such that p(z)=0 (minimal
poly for z).

Yes, it would be nice to have this, but it is currently
unimplemented.

See attachment. That is only a proof-of-concept approach.
I haven't thought very much about it, but I am mostly interested in radical expressions (so, restriction to algebraic numbers. Am I right with the assumption that the only operator in a kernel of AlgebraicNumber is nthRoot?
Doesn't that say that the function (from AN)

  minPoly: Kernel % -> SparseUnivariatePolynomial %

always return a polynomial of the form (x^n - t) where t is a rational expression in "lower depth" kernels. In other words sorting the variables as I did for the lex Groebner basis computation doesn't actually waste time for the polynomials corresponding to the tower(q) (where q is the algebraic number I want to find the minimal polynomial for). So lexGroebner should be the optimal approach to find the minimal polynomial.

If you think that would be a reasonable approach, I will prepare a patch for

  minimalPolynomial: % -> SparseUnivariatePolynomial Integer

in AlgebraicNumber.

Ralf

PS: As can be seen in the attachment, the approach via minimal polynomial helped to "simplify" an unnecessarily complicated radical.

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fricas-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/b2936e02-67bf-4129-8d9b-ecd855c2be89%40hemmecke.org.
ZZ ==> Integer
QQ ==> Fraction ZZ
PQQ ==> Polynomial QQ
PL ==> PolynomialCategoryLifting(IndexedExponents K, K, ZZ, KPol, PQQ)
K ==> Kernel AN
KPol ==> SparseMultivariatePolynomial(ZZ, K)
TKV ==> Table(K,PQQ)

q:= 
(-9*sqrt(-1)*sqrt(34)+51*sqrt(2))*sqrt(17507429*sqrt(17)-72184979)*sqrt((976138161*sqrt(-1)+315664372)*sqrt(17)+4024720743*sqrt(-1)+1301517548)
q := (rootFactor(q)$AlgebraicManipulations(ZZ, Expression ZZ))::AN
twr := reverse tower(q)
mps := [minPoly(x) for x in twr]
dpol := definingPolynomial q
dq := denom q
nq := numer q
tkv: TKV := table()
resetNew()$Symbol
isyms := [new()$Symbol for v in twr]
xsyms := concat(isyms,x)
vpols := [s::PQQ for s in isyms]
for k in twr for v in vpols repeat tkv.k := v
smp2pol(pol) ==> map((k:K):PQQ+->tkv.k,(c:ZZ):PQQ+->c::QQ::PQQ, pol)$PL
p := smp2pol(dq)*x - smp2pol(nq)
lp := [smp2pol(denom(coefficient(mp,0))) * v^degree(mp) _
 + smp2pol numer coefficient(mp,0) for mp in mps for v in vpols]
gens := cons(p,lp)

gb := lexGroebner(gens, xsyms)
mp := last gb
factor mp

radicalRoots(mp,x)$RadicalSolvePackage(QQ)

Reply via email to