next | previous | forward | backward | up | top | index | toc | Macaulay2 website
RationalPoints2 > rationalPoints > zeros

zeros -- List the zeros of a polynomial

Synopsis

Description

Get a list of zeros of a polynomial using factor, baby version of rationalPoints.

i1 : QQ[x]; p = (x-2)^2 * (x^2-2) * (x^3-x-1); zeros p

o3 = {2}

o3 : List
i4 : F = toField(QQ[q]/(q^2-2)); zeros_F p

o5 = {2, q, -q}

o5 : List
i6 : F = splittingField p; #zeros_F p

o7 = 6

Note that when the degree is big, the expression of each zero in terms of a primitive element is usually complicated.

i8 : last zeros_F p

          2918037   11      43736   10     176511427  9     1742239  8  
o8 = - ------------a   + ----------a   + ------------a  - ----------a  -
       194598748990      3926880585      194598748990     2617920390    
     ------------------------------------------------------------------------
      7776041337  7    54520588  6    38282000079 5    50576753 4  
     ------------a  + ----------a  + ------------a  - ---------a  -
     389197497980     3926880585     194598748990     436320065    
     ------------------------------------------------------------------------
     382379122373 3   1544138762 2   456488667029     137345843
     ------------a  + ----------a  + ------------a + ----------
     389197497980     3926880585     389197497980    1308960195

o8 : F
i9 : (map(F, ring p, {oo})) p

o9 = 0

o9 : F

Over finite fields.

i10 : q = baseChange_13 p; zeros q

o11 = {2}

o11 : List
i12 : F = splittingField q; describe F

o13 = GF 4826809
i14 : #zeros_F q

o14 = 6

Ways to use zeros :

For the programmer

The object zeros is a method function with options.