Macaulay2 » Documentation
Packages » RealRoots :: realCount
next | previous | forward | backward | up | index | toc

realCount -- the number of real points of the spectrum of an Artinian ring (of characteristic 0)

Description

This computes the number of distinct real points of Spec S, not counting multiplicity. If f is a univariate polynomial (resp. if I is a zero-dimensional ideal), this computes the number of real points of Spec R/(f) (resp. R/I), where R is the ring generated by the variables that appear in f (resp. in I) to allow for elimination of variables. If l is a list of generators of an ideal I, then this computes the number of real points of Spec (R/I) as before.

If f is a univariate polynomial, then this counts its number of real roots.

i1 : R = QQ[x,y]

o1 = R

o1 : PolynomialRing
i2 : f = (x^2 + 1)*(x + 1)*(x - 2)^2

      5     4    3    2
o2 = x  - 3x  + x  + x  + 4

o2 : R
i3 : realCount(f)

o3 = 2

If I is a zero-dimensional ideal, this computes the number of distinct real points of Spec R/I.

i4 : I = ideal(5 - 3*x^2 - 3*y^2 + x^2*y^2, 1 + 2*x*y - 4*x*y^2 + 3*x^2*y)

             2 2     2     2        2        2
o4 = ideal (x y  - 3x  - 3y  + 5, 3x y - 4x*y  + 2x*y + 1)

o4 : Ideal of R
i5 : realCount(I)

o5 = 4

If l is a system of rational polynomials, then this computes the number of distinct real solutions.

i6 : l = {y^2 - x^2 - 1,x - y^2 + 4*y - 2}

         2    2         2
o6 = {- x  + y  - 1, - y  + x + 4y - 2}

o6 : List
i7 : realCount(l)

o7 = 2

See also

Ways to use realCount:

  • realCount(Ideal)
  • realCount(List)
  • realCount(QuotientRing)
  • realCount(RingElement)

For the programmer

The object realCount is a method function.


The source of this document is in RealRoots.m2:1059:0.