next | previous | forward | backward | up | top | index | toc | Macaulay2 website
RandomPoints :: randomPoints

randomPoints -- a function to find random points in a variety.

Synopsis

Description

Gives at most $n$ many point in a variety $V(I)$.

i1 : R = ZZ/5[t_1..t_3];
i2 : I = ideal(t_1,t_2+t_3);

o2 : Ideal of R
i3 : randomPoints(3, I)

o3 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}}

o3 : List
i4 : randomPoints(4, I, Strategy => Default)

o4 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}, {0, -1, 1}}

o4 : List
i5 : randomPoints(4, I, Strategy => LinearIntersection)

o5 = {{0, -1, 1}, {0, -1, 1}, {0, -1, 1}, {0, -1, 1}}

o5 : List

The default strategy switches between LinearIntersection and MultiplicationTable for the DecompositionStrategy (after first trying a brute force strategy).

Using DecompositionStrategy => MultiplicationTable (currently only implemented for Homogeneous ideals) is sometimes faster and other times not. It tends to work better in rings with few variables. Because of this, the default strategy runs MultiplicationTable first in rings with fewer variables and runs Decompose first in rings with more variables.

i6 : S=ZZ/103[y_0..y_30];
i7 : I=minors(2,random(S^3,S^{3:-1}));

o7 : Ideal of S
i8 : elapsedTime randomPoints(I, Strategy=>LinearIntersection, DecompositionStrategy=>MultiplicationTable)
 -- 2.94714 seconds elapsed

o8 = {{-4, -35, -7, 0, 0, 1, 5, -13, 0, -47, 0, 41, 0, -51, -46, 35, 0, 0,
     ------------------------------------------------------------------------
     -47, 14, -30, 42, 30, 4, -41, 24, 0, 0, 15, 20, 1}}

o8 : List
i9 : elapsedTime randomPoints(I, Strategy=>LinearIntersection, DecompositionStrategy=>Decompose)
 -- 1.38821 seconds elapsed

o9 = {{11, 9, -9, -15, -7, 27, 19, -36, 48, 26, -4, 3, 29, -8, 7, -32, 16,
     ------------------------------------------------------------------------
     11, 7, 7, 25, -14, -39, 17, -16, 4, -50, -12, 21, -50, 51}}

o9 : List

Ways to use randomPoints :

For the programmer

The object randomPoints is a method function with options.