Macaulay2 » Documentation
Packages » NumericalImplicitization :: realPoint
next | previous | forward | backward | up | index | toc

realPoint -- samples a real point on a variety

Synopsis

Description

This method samples a real point on a variety numerically, using a combination of the Nelder-Mead simplex method and line search with gradient descent. This can be much quicker than performing a numerical irreducible decomposition.

The option Tolerance specifies a requested error tolerance for the point, with respect to the generating set of the ideal.

The option Iterations specifies an upper limit on the number of iterations to run the approximation algorithms. If this value is too low, then the method will return a point which may not be within the specified error tolerance.

The following example shows how to sample a point from the 4 x 5 funtf variety.

i1 : (n,r) = (4,5)

o1 = (4, 5)

o1 : Sequence
i2 : R = RR[x_(1,1)..x_(n,r)]

o2 = R

o2 : PolynomialRing
i3 : A = transpose genericMatrix(R,r,n)

o3 = {-1} | x_(1,1) x_(1,2) x_(1,3) x_(1,4) x_(1,5) |
     {-1} | x_(2,1) x_(2,2) x_(2,3) x_(2,4) x_(2,5) |
     {-1} | x_(3,1) x_(3,2) x_(3,3) x_(3,4) x_(3,5) |
     {-1} | x_(4,1) x_(4,2) x_(4,3) x_(4,4) x_(4,5) |

             4      5
o3 : Matrix R  <-- R
i4 : I1 = ideal(A*transpose A - (r/n)*id_(R^n));

o4 : Ideal of R
i5 : I2 = ideal apply(entries transpose A, row -> sum(row, v -> v^2) - 1);

o5 : Ideal of R
i6 : I = I1 + I2;

o6 : Ideal of R
i7 : elapsedTime p = realPoint(I, Iterations => 100)
 -- 0.364641 seconds elapsed

o7 = p

o7 : Point
i8 : matrix pack(5, p#Coordinates)

o8 = | .722359  .289465  -.295808  .591752  -.454678 |
     | -.110166 .0700102 .908882   .630235  .0984753 |
     | .621173  -.330116 -.0305848 .0539234 .866787  |
     | .283207  .895726  .292392   -.499725 .179584  |

                4         5
o8 : Matrix RR    <-- RR
              53        53
i9 : norm evaluate(gens I, p)

o9 = .00000574047028989444

o9 : RR (of precision 53)

See also

Ways to use realPoint :

For the programmer

The object realPoint is a method function with options.