[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5 Summary of functions for algebraic numbers


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.1 newalg

newalg(defpoly)

:: Creates a new root.

return

algebraic number (root)

defpoly

polynomial

[0] A0=newalg(x^2-2);
(#0)
Reference

defpoly


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.2 defpoly

defpoly(alg)

:: Returns the defining polynomial of root alg.

return

polynomial

alg

algebraic number (root)

[1] defpoly(A0);
t#0^2-2
Reference

newalg, alg, algv


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.3 alg

alg(i)

:: Returns a root which correspond to the index i.

return

algebraic number (root)

i

integer

[2] x+#0;
syntax error
0
[3] alg(0);
(#0)
Reference

newalg, algv


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.4 algv

algv(i)

:: Returns the associated indeterminate with alg(i).

return

polynomial

i

integer

[4] var(defpoly(A0));
t#0
[5] t#0;
syntax error
0
[6] algv(0);
t#0
Reference

newalg, defpoly, alg


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.5 simpalg

simpalg(rat)

:: Simplifies algebraic numbers in a rational expression.

return

rational expression

rat

rational expression

[7] simpalg((1+A0)/(1-A0));
simpalg undefined
return to toplevel
[7] load("sp")$
[46] simpalg((1+A0)/(1-A0));
(-2*#0-3)
[47] simpalg((2-A0)/(2+A0)*x^2-1/(3+A0));
(-2*#0+3)*x^2+(1/7*#0-3/7)
[48] simpalg((x+1/(A0-1))/(x-1/(A0+1))); 
(x+(#0+1))/(x+(-#0+1))

[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.6 algptorat

algptorat(poly)

:: Substitutes the associated indeterminate for every root

return

polynomial

poly

polynomial

[49] algptorat((-2*alg(0)+3)*x^2+(1/7*alg(0)-3/7));
(-2*t#0+3)*x^2+1/7*t#0-3/7
Reference

defpoly, algv


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.7 rattoalgp

rattoalgp(poly,alglist)

:: Substitutes a root for the associated indeterminate with the root.

return

polynomial

poly

polynomial

alglist

list

[51] rattoalgp((-2*algv(0)+3)*x^2+(1/7*algv(0)-3/7),[alg(0)]);
(-2*#0+3)*x^2+(1/7*#0-3/7)
Reference

alg, algv


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.8 cr_gcda

cr_gcda(poly1,poly2)

:: GCD of two uni-variate polynomials over an algebraic number field.

return

polynomial

poly1 poly2

polynomial

[76] X=x^6+3*x^5+6*x^4+x^3-3*x^2+12*x+16$
[77] Y=x^6+6*x^5+24*x^4+8*x^3-48*x^2+384*x+1024$
[78] A=newalg(X);
(#0)
[79] cr_gcda(X,subst(Y,x,x+A));
x+(-#0)
Reference

gr, hgr, gr_mod, dgr, asq, af, af_noalg


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.9 sp_norm

sp_norm(alg,var,poly,alglist)

:: Norm computation over an algebraic number field.

return

polynomial

var

The main variable of poly

poly

univariate polynomial

alg

root

alglist

root list

[0] load("sp")$
[39] A0=newalg(x^2+1)$                 
[40] A1=newalg(x^2+A0)$
[41] sp_norm(A1,x,x^3+A0*x+A1,[A1,A0]);
x^6+(2*#0)*x^4+(#0^2)*x^2+(#0)
[42] sp_norm(A0,x,@@,[A0]);            
x^12+2*x^8+5*x^4+1
Reference

res, asq, af, af_noalg


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.10 asq, af, af_noalg

asq(poly)

:: Square-free factorization of polynomial poly over an algebraic number field.

af(poly,alglist)
af_noalg(poly,defpolylist)

:: Factorization of polynomial poly over an algebraic number field.

return

list

poly

polynomial

alglist

root list

defpolylist

root list of pairs of an indeterminate and a polynomial

[98] A = newalg(t^2-2);
(#0)
[99] asq(-x^4+6*x^3+(2*alg(0)-9)*x^2+(-6*alg(0))*x-2);
[[-x^2+3*x+(#0),2]]
[100] af(-x^2+3*x+alg(0),[alg(0)]);
[[x+(#0-1),1],[-x+(#0+2),1]]
[101] af_noalg(-x^2+3*x+a,[[a,x^2-2]]);
[[x+a-1,1],[-x+a+2,1]]
Reference

cr_gcda, fctr, sqfr


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.11 sp, sp_noalg

sp(poly)
sp_noalg(poly)

:: Finds the splitting field of polynomial poly and splits.

return

list

poly

polynomial

[101] L=sp(x^9-54);
[[x+(-#2),-54*x+(#1^6*#2^4),54*x+(#1^6*#2^4+54*#2),
54*x+(-#1^8*#2^2),-54*x+(#1^5*#2^5),54*x+(#1^5*#2^5+#1^8*#2^2),
-54*x+(-#1^7*#2^3-54*#1),54*x+(-#1^7*#2^3),x+(-#1)],
[[(#2),t#2^6+t#1^3*t#2^3+t#1^6],[(#1),t#1^9-54]]]
[102] for(I=0,M=1;I<9;I++)M*=L[0][I];
[111] M=simpalg(M);
-1338925209984*x^9+72301961339136
[112] ptozp(M);
-x^9+54
Reference

asq, af, af_noalg, defpoly, algptorat, sp_norm.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.12 set_field

set_field(rootlist)

:: Set an algebraic number field as the currernt ground field.

return

0

rootlist

A list of root

[0] A=newalg(x^2+1);
(#0)
[1] B=newalg(x^3+A);
(#1)
[2] C=newalg(x^4+B);
(#1)
[3] set_field([C,B,A]);
0
Reference

algtodalg, dalgtoalg, dptodalg, dalgtodp


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.5.13 algtodalg, dalgtoalg, dptodalg, dalgtodp

algtodalg(alg)

:: Converts an algebraic number alg to a DAlg.

dalgtoalg(dalg)

:: Converts a DAlg dalg to an algebraic number.

dptodalg(dp)

:: Converts an algebraic number alg to a DAlg.

dalgtodp(dalg)

:: Converts a DAlg dalg to an algebraic number.

return

An algebraic number, a DAlg or a list [distributed polynomial,denominator]

alg

an algebraic number containing root

dp

a distributed polynomial over Q

[0] A=newalg(x^2+1);
(#0)
[1] B=newalg(x^3+A*x+A);
(#1)
[2] set_field([B,A]);
0
[3] C=algtodalg((A+B)^10);
((408)*<<2,1>>+(103)*<<2,0>>+(-36)*<<1,1>>+(-446)*<<1,0>>
+(-332)*<<0,1>>+(-218)*<<0,0>>)
[4] dalgtoalg(C);
((408*#0+103)*#1^2+(-36*#0-446)*#1-332*#0-218)
[5] D=dptodalg(<<10,10>>/10+2*<<5,5>>+1/3*<<0,0>>);
((-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>>
+(-60)*<<0,1>>+(1)*<<0,0>>)/30
[6] dalgtodp(D);
[(-9)*<<2,1>>+(57)*<<2,0>>+(-63)*<<1,1>>+(-12)*<<1,0>>
+(-60)*<<0,1>>+(1)*<<0,0>>,30]
Reference

set_field


[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on December 15, 2017 using texi2html 5.0.