arnum.tex 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. \chapter{ARNUM: An algebraic number package}
  2. \label{ARNUM}
  3. \typeout{{ARNUM: An algebraic number package}}
  4. {\footnotesize
  5. \begin{center}
  6. Eberhard Schr\"{u}fer \\
  7. Institute SCAI.Alg \\
  8. German National Research Center for Information Technology (GMD) \\
  9. Schloss Birlinghoven \\
  10. D-53754 Sankt Augustin, Germany \\[0.05in]
  11. e--mail: schruefer@gmd.de
  12. \end{center}
  13. }
  14. Algebraic numbers are the solutions of an irreducible polynomial over
  15. some ground domain. \index{i} The algebraic number $i$ (imaginary
  16. unit),\index{imaginary unit} for example, would be defined by the
  17. polynomial $i^2 + 1$. The arithmetic of algebraic number $s$ can be
  18. viewed as a polynomial arithmetic modulo the defining polynomial.
  19. The {\tt ARNUM}\ttindex{ARNUM} package provides a mechanism to
  20. define other algebraic numbers, and compute with them.
  21. \section{DEFPOLY}\ttindex{DEFPOLY}
  22. {\tt DEFPOLY} takes as its argument the defining polynomial for an
  23. algebraic number, or a number of defining polynomials for different
  24. algebraic numbers, and arranges that arithmetic with the new symbol(s) is
  25. performed relative to these polynomials.
  26. \begin{verbatim}
  27. load_package arnum;
  28. defpoly sqrt2**2-2;
  29. 1/(sqrt2+1);
  30. SQRT2 - 1
  31. (x**2+2*sqrt2*x+2)/(x+sqrt2);
  32. X + SQRT2
  33. on gcd;
  34. (x**3+(sqrt2-2)*x**2-(2*sqrt2+3)*x-3*sqrt2)/(x**2-2);
  35. 2
  36. X - 2*X - 3
  37. --------------
  38. X - SQRT2
  39. off gcd;
  40. sqrt(x**2-2*sqrt2*x*y+2*y**2);
  41. ABS(X - SQRT2*Y)
  42. \end{verbatim}
  43. The following example introduces both $\sqrt 2$ and $5^{1 \over 3}$:
  44. \begin{verbatim}
  45. defpoly sqrt2**2-2,cbrt5**3-5;
  46. *** defining polynomial for primitive element:
  47. 6 4 3 2
  48. A1 - 6*A1 - 10*A1 + 12*A1 - 60*A1 + 17
  49. sqrt2;
  50. 5 4 3 2
  51. 48/1187*A1 + 45/1187*A1 - 320/1187*A1 - 780/1187*A1 +
  52. 735/1187*A1 - 1820/1187
  53. sqrt2**2;
  54. 2
  55. \end{verbatim}
  56. \section{SPLIT\_FIELD}\ttindex{SPLIT\_FIELD}
  57. The function {\tt SPLIT\_FIELD} calculates a primitive element of
  58. minimal degree for which a given polynomial splits into linear
  59. factors.
  60. \begin{verbatim}
  61. split_field(x**3-3*x+7);
  62. *** Splitting field is generated by:
  63. 6 4 2
  64. A5 - 18*A5 + 81*A5 + 1215
  65. 4 2
  66. {1/126*A5 - 5/42*A5 - 1/2*A5 + 2/7,
  67. 4 2
  68. - (1/63*A5 - 5/21*A5 + 4/7),
  69. 4 2
  70. 1/126*A5 - 5/42*A5 + 1/2*A5 + 2/7}
  71. for each j in ws product (x-j);
  72. 3
  73. X - 3*X + 7
  74. \end{verbatim}