Macaulay2 » Documentation
Packages » QuaternaryQuartics :: randomPoints
next | previous | forward | backward | up | index | toc

randomPoints -- create a matrix whose columns are random points

Synopsis

Description

There are two usages of this function. The first creates a matrix over a base field. This is not much different from using random(kk^m, kk^n), unless the Normalize option is given, in which case the first set of points are normalized to be the coordinate points and the point each of whose coordinates are 1.

i1 : kk = ZZ/101;
i2 : randomPoints(kk, 5, 10)

o2 = | 24  19  -29 21  -18 -47 45  19  39  36  |
     | -36 -10 -24 34  -13 38  -34 -16 43  35  |
     | -30 -29 -38 19  -43 2   -48 7   -17 11  |
     | -29 -8  -16 -47 -15 16  -47 15  -11 -38 |
     | 19  -22 39  -39 -28 22  47  -23 48  33  |

              5       10
o2 : Matrix kk  <-- kk
i3 : randomPoints(kk, 5, 10, Normalize => true)

o3 = | 1 0 0 0 0 1 40  -3  2   -13 |
     | 0 1 0 0 0 1 11  22  29  -10 |
     | 0 0 1 0 0 1 46  -47 -47 30  |
     | 0 0 0 1 0 1 -28 -23 15  -18 |
     | 0 0 0 0 1 1 1   -7  -37 39  |

              5       10
o3 : Matrix kk  <-- kk

The second version is perhaps used the most in this package. One can leave out the number of variables/rows if the ring given is a polynomial ring.

i4 : S = kk[a..d];
i5 : M1 = randomPoints(S, 10)

o5 = | 27  -32 -48 33  17  36  13  -11 36  41  |
     | -22 -20 -15 -49 -20 9   -26 -8  -3  16  |
     | 32  24  39  -33 44  -39 22  43  -22 -28 |
     | -9  -30 0   -19 -39 4   -49 -8  -30 -6  |

             4      10
o5 : Matrix S  <-- S
i6 : M2 = randomPoints(S, 6, Normalize=>true)

o6 = | 1 0 0 0 1 35  |
     | 0 1 0 0 1 -9  |
     | 0 0 1 0 1 -35 |
     | 0 0 0 1 1 6   |

             4      6
o6 : Matrix S  <-- S
i7 : pointsIdeal M1

             2               2                          2         2        2
o7 = ideal (a d + 4a*b*d + 2b d + 9a*c*d - 49b*c*d + 19c d - 33a*d  - 28b*d 
     ------------------------------------------------------------------------
            2      3     2      3                2                       
     - 27c*d  + 30d , b*c  + 47c  + 43a*b*d + 11b d + 17a*c*d - 31b*c*d -
     ------------------------------------------------------------------------
        2         2        2       2      3     2     3                2   
     22c d - 48a*d  + 40b*d  - 7c*d  + 10d , a*c  + 9c  - 46a*b*d + 23b d +
     ------------------------------------------------------------------------
                            2        2        2        2     3   2       3  
     45a*c*d + 37b*c*d - 19c d - 3a*d  - 39b*d  - 26c*d  - 9d , b c + 13c  +
     ------------------------------------------------------------------------
                  2                          2         2        2        2  
     43a*b*d - 24b d + 2a*c*d + 42b*c*d + 32c d + 32a*d  - 30b*d  + 38c*d  -
     ------------------------------------------------------------------------
        3             3                                    2         2  
     44d , a*b*c - 19c  - 27a*b*d - 13a*c*d - 49b*c*d - 21c d - 37a*d  +
     ------------------------------------------------------------------------
          2        2     3   2       3                2                     
     36b*d  + 39c*d  + 5d , a c + 20c  - 49a*b*d - 35b d - 11a*c*d - 25b*c*d
     ------------------------------------------------------------------------
          2         2        2        2     3   3     3                2   
     - 48c d + 47a*d  + 46b*d  + 33c*d  - 9d , b  - 5c  + 48a*b*d - 28b d +
     ------------------------------------------------------------------------
                            2         2        2        2     2      3  
     20a*c*d - 15b*c*d - 10c d - 16a*d  - 34b*d  + 35c*d , a*b  - 16c  +
     ------------------------------------------------------------------------
                  2                           2         2        2      2  
     47a*b*d - 35b d - 30a*c*d + 25b*c*d + 45c d - 37a*d  - 20b*d  - c*d  +
     ------------------------------------------------------------------------
        3   2       3               2                        2        2  
     21d , a b - 31c  + 22a*b*d + 7b d - a*c*d - 49b*c*d - 4c d - 8a*d  +
     ------------------------------------------------------------------------
          2        2     3   3      3                2                      
     40b*d  - 46c*d  + 4d , a  + 22c  + 12a*b*d - 16b d - 3a*c*d - 39b*c*d -
     ------------------------------------------------------------------------
       2         2        2        2      3
     3c d + 11a*d  - 29b*d  + 24c*d  - 11d )

o7 : Ideal of S
i8 : pointsIdeal M2

o8 = ideal (a*d - 26b*d + 25c*d, b*c + 18b*d - 19c*d, a*c + 46b*d - 47c*d,
     ------------------------------------------------------------------------
     a*b - 44b*d + 43c*d)

o8 : Ideal of S

Another useful way to generate a matrix of points is to use randomBlockMatrix.

For example, the following creates the ideal of 6 points, 3 on one line and 3 on a skew line.

i9 : M3 = randomBlockMatrix({S^2, S^2}, {S^3, S^3}, {{random, 0}, {0, random}})

o9 = | 40 -31 -2  0   0  0   |
     | 3  25  -41 0   0  0   |
     | 0  0   0   -49 4  -47 |
     | 0  0   0   -13 30 27  |

             4      6
o9 : Matrix S  <-- S
i10 : pointsIdeal M3

                                  3      2         2      3   3     2   
o10 = ideal (b*d, a*d, b*c, a*c, c  + 49c d - 15c*d  + 28d , a  - 6a b +
      -----------------------------------------------------------------------
           2    3
      35a*b  - b )

o10 : Ideal of S

See also

Ways to use randomPoints :

For the programmer

The object randomPoints is a method function with options.