next | previous | forward | backward | up | top | index | toc | Macaulay2 website
RandomRationalPoints :: getRandomLinearForms

getRandomLinearForms -- retrieve a list of random degree 1 and 0 forms of specified types



This will give you a list of random forms (ring elements) of the specified types. This is useful, because in many cases, for instance when doing generic projection, you only need a a certain number of the forms in the map to be fully random. Furthermore, at the cost of some randomness, using monomial or binomial forms can be much faster.

The types of form are specified via the second argument, a list with 5 entries. The first entry is how many constant forms are allowed.

i1 : R = ZZ/31[a,b,c]

o1 = R

o1 : PolynomialRing
i2 : getRandomLinearForms(R, {2,0,0,0,0})

o2 = {1, -12}

o2 : List

The second entry in the list is how many monomial forms are returned. Note if Homogeneous=>false then these forms will usually have constant terms.

i3 : getRandomLinearForms(R, {0,2,0,0,0}, Homogeneous=>true)

o3 = {a, a}

o3 : List
i4 : getRandomLinearForms(R, {0,2,0,0,0}, Homogeneous=>false)

o4 = {b + 13, a + 7}

o4 : List

Next, the third entry is how many monomial forms (without constant terms, even if Homogeneous=>false).

i5 : getRandomLinearForms(R, {0,0,2,0,0}, Homogeneous=>false)

o5 = {c, c}

o5 : List

The fourth entry is how many binomial forms should be returned.

i6 : getRandomLinearForms(R, {0,0,0,1,0}, Homogeneous=>true)

o6 = {b - 12c}

o6 : List
i7 : getRandomLinearForms(R, {0,0,0,1,0}, Homogeneous=>false)

o7 = {- 14c + 2}

o7 : List

The ultimate entry is how many truly random forms to produce.

i8 : getRandomLinearForms(R, {0,0,0,0,1}, Homogeneous=>true)

o8 = {13a + 14b + 3c}

o8 : List
i9 : getRandomLinearForms(R, {0,0,0,0,1}, Homogeneous=>false)

o9 = {- 12a - 10b + 7c + 15}

o9 : List

You may combine the different specifications to create a list of the desired type. The order is randomized.

If the option Verify=>true, then this will check the jacobian of the list of forms (discounting the constant forms), to make sure it has maximal rank. Random forms in small numbers of variables over small fields will produce non-injective ring maps occasionally otherwise.

Ways to use getRandomLinearForms :

For the programmer

The object getRandomLinearForms is a method function with options.