New number field functions

Algebraic

Algebraic[f,{c0,...,cl},k] represents the algebraic number c0+c1*r+c2*r^2+...+cl*r^l, where r=Root[f,k]. If f is a monic irreducible polynomial of degree l with integer coefficients, and {c0,...,cl} are rational numbers, Algebraic[f,{c0,...,cl},k] is an inert numeric object. For any f and k for which r=Root[f,k] evaluates to an algebraic number, and for any list of rational numbers {c0,...,cl}, Algebraic[f,{c0,...,cl},k] evaluates to Algebraic[g,{d0,...,dm},n], such that s=Root[g,n]==d*r, where r is a factor of the leading coefficient lc of the minimal polynomial of r, such that s is an algebraic integer, m is the degree of g, and c0+c1*r+c2*r^2+...+cl*r^l==d0+d1*s+d2*s^2+...+dm*s^m. If FactorInteger[lc,FactorComplete->False] gives the complete factorization, d is equal to AlgebraicNumberDenominator[r].

a = Algebraic[#^3 - 3 # + 11 &, {1, 2, 3, 4}, 1]

Algebraic objects representing rational numbers evaluate to the rational numbers.

Algebraic[#^5 - 3  #^2 - 19 &, {2, 0, -3, 0, 0, 1}, 2]

Algebraic[#^2 - 3, {3, 4}, 1]

RootReduce[%%]

Plus and Times of Algebraic objects with same first elements evaluate automatically,and so do integral powers of Algebraic objects. (Implemented as upvalues on Algebraic.)

b = 
        Algebraic[#^3 - 3 # + 11 &, {9, 8, 7}, 
          1];
(2 a^2 - 3 a b + 5 b^5 - 3)/(a^8 - b^4 + 1/2)

Adding a rational number to an Algebraic object yields an Algebraic object.

a + 2/3

RootReduce transforms Algebraic objects to Root objects.

RootReduce[a]

N computes numerical approximations of Algebraic objects.

N[a, 20]

NumberFieldSignature

NumberFieldSignature[f], for an irreducible polynomial function f with rational coefficients, gives a pair of integers {s,t}, where s is the number of real roots of f, and t is the number of pairs of complex roots of f.

NumberFieldSignature[a], for an algebraic number a, gives a pair of integers {s,t}, where s is the number of real embeddings of Q(a) and t is the number of pairs of conjugate complex embeddings of Q(a).

c = 
        Sqrt[2] + Root[#^3 - 11  # - 2 &, 1] + 
          Algebraic[#^4 - 3  # + 1 &, {1, 2, 3}, 2];

NumberFieldSignature[c]

NumberFieldDiscriminant

NumberFieldDiscriminant[f], for an irreducible polynomial function f with rational coefficients, gives the discriminant of the number field generated by a root of f. (It does not depend on the choice of root.)

NumberFieldDiscriminant[a], for an algebraic number a,gives the discriminant of Q(a).

NumberFieldDiscriminant[
  #1^5 - 12*#1 + 21 & ]

NumberFieldRegulator

NumberFieldRegulator[f], for an irreducible polynomial function f with rational coefficients, gives the regulator of the number field generated by a root of f.  (It does not depend on the choice of root.)

NumberFieldRegulator[a], for an algebraic number a, gives the regulator of Q(a).

NumberFieldRegulator[#^4 - # + 11 &]

N[%]

IntegralBasis

IntegralBasis[f,k], for an irreducible polynomial function f with rational coefficients and an integer 1≤k≤degree(f), gives a list of Algebraic objects forming a basis of the Z-module of algebraic integers in the field Q(Root[f,k]).

IntegralBasis[a], for an algebraic number a,gives a list of Algebraic objects forming a basis of the Z-module of algebraic integers in the field Q(a).

IntegralBasis[#1^5 - 2*#1^3 - 11*#1 + 
    17 & , 1]

RootsOfUnity

RootsOfUnity[f,k], for an irreducible polynomial function f with rational coefficients and an integer 1≤k≤degree(f), gives a list of all roots of unity in the field Q(Root[f,k]), represented as Algebraic objects.

RootsOfUnity[a], for an algebraic number a,gives a list of all roots of unity in the field Q(a), represented as Algebraic objects.

RootsOfUnity[9 - 2*#1^2 + #1^4 & , 4]

ToRadicals[RootReduce[%]]

Element[#, Reals] & /@ %19

FundamentalUnits

FundamentalUnits[f,k], for an irreducible polynomial function f with rational coefficients and an integer 1≤k≤degree(f), gives a list of fundamental units in the field Q(Root[f,k]), represented as Algebraic objects.

FundamentalUnits[a], for an algebraic number a, gives a list of fundamental units in the field Q(a), represented as Algebraic objects.

FundamentalUnits[#1^4 - 10*#1^2 + 1 & , 3]

AlgebraicUnitQ /@ %

NormRepresentatives

NormRepresentatives[m,f,k], for a positive integer m,an irreducible polynomial function f with rational coefficients, and an integer 1≤k≤degree(f),  gives a list of representatives of classes elements of norm m in the field Q(Root[f,k]) up to multiplication by a unit, represented as Algebraic objects.

NormRepresentatives[m,a], for a positive integer m and an algebraic number a, gives a list of representatives of classes elements of norm m in the field Q(a) up to multiplication by a unit, represented as Algebraic objects.

NormRepresentatives[2, Sqrt[2] + Sqrt[3]]

Abs[NumberFieldNorm[%[[1]]]]

NumberFieldCharacteristicPolynomial

NumberFieldCharacteristicPolynomial[a] gives the characteristic polynomial of the Algebraic object a (relative to its number field). Returns a pure function.

NumberFieldCharacteristicPolynomial[a,x] gives the characteristic polynomial of the Algebraic object a (relative to its number field). Returns a polynomial in x.

g = ToCommonField[{GoldenRatio, 3^(1/3)}][[1]]

NumberFieldCharacteristicPolynomial[g, x]

MinimalPolynomial[g, x]

NumberFieldTrace

NumberFieldTrace[a] gives the trace of the Algebraic object a (relative to its number field).

NumberFieldTrace[a]

NumberFieldNorm

NumberFieldNorm[a] gives the norm of the Algebraic object a (relative to its number field).

NumberFieldNorm[a]

MinimalPolynomial

MinimalPolynomial[a] gives the minimal polynomial (over the integers) of the algebraic number a.Returns a pure function.

MinimalPolynomial[a,x] gives the minimal polynomial (over the integers) of the algebraic number a.Returns a polynomial in x.

MinimalPolynomial[c,  x]

MinimalPolynomial[Sqrt[2] + 1]

AlgebraicNumberTrace

AlgebraicNumberTrace[a] gives the trace of the algebraic number a.

AlgebraicNumberTrace[g]

NumberFieldTrace[g]

AlgebraicNumberNorm

AlgebraicNumberNorm[a] gives the norm of the algebraic number a.

AlgebraicNumberNorm[Root[#^5 - 7 #^4 + 11 &, 1]]

AlgebraicNumberDenominator

AlgebraicNumberDenominator[a] gives the smallest positive integer n such that n*a is an algebraic integer.

AlgebraicNumberDenominator[(Sqrt[29] - 1)/6]

AlgebraicNumberDenominator[1/5]

AlgebraicIntegerQ

AlgebraicIntegerQ[a] whether algebraic number a is an algebraic integer.

d = Algebraic[#^3 - 4  # + 17 &, {1, 2, 3}, 1];

AlgebraicIntegerQ /@ {(1 + Sqrt[5])/2, (1 + Sqrt[5])/4, d, 
        d/2}

AlgebraicUnitQ

AlgebraicUnitQ[a] whether algebraic number a is a unit.

e = Algebraic[#^3 - 3  # + 5 &, {2, -2, 1}, 3];

AlgebraicUnitQ /@ {d, e, GoldenRatio, 
        Root[#^11 - 2  # + 1 &, 7]}

RootOfUnityQ

RootOfUnityQ[a] whether algebraic number a is a root of unity.

f = 
        Algebraic[#^4 - 2  #^3 + 5  #^2 - 4  # + 1 &, {4, -8, 3, -2}, 
          4];

RootOfUnityQ /@ {e, f, I, -f^2*I}

ToNumberFieldElement

ToNumberFieldElement[a,f,k], for an irreducible polynomial function f with rational coefficients, an integer 1≤k≤degree(f), and an algebraic number a in Q(Root[f,k]), represents a as an Algebraic object in the number field given by f and k.

ToNumberFieldElement[(-1)^(1/3), 
  57 + 12*#1 - 11*#1^2 - 2*#1^3 + 
    #1^4 & , 1]

ToNumberFieldElement[Sqrt[5], 
  57 + 12*#1 - 11*#1^2 - 2*#1^3 + 
    #1^4 & , 1]

ToCommonField

ToCommonField[{a1,...,an}] represents each of the algebraic numbers ai, for i=1,...,n, as
Algebraic[f,cfsi,k], where f and k are the same for all i=1,...,n.

ToCommonField[{I, Sqrt[2]}]

RootReduce[%]