Macaulay2 » Documentation
Packages » DiffAlg :: random(DiffAlgElement,Ring)
next | previous | forward | backward | up | index | toc

random(DiffAlgElement,Ring) -- replaces the variables of the coefficient ring of a differential form or a vector field with random values

Description

i1 : random newForm(2,2,1,"a")

o1 = - x dx dx  + (- 4x  + 3x  + x )dx dx  + (- 4x  + x  + 5x )dx dx
        1  0  1        0     1    2   0  2        0    1     2   1  2

o1 : DiffAlgForm
i2 : random(newField(2,2,"a"),QQ)

        38 2   7       11 2   1       41       17 2         3 2   33      
o2 = (- --x  - -x x  + --x  + -x x  + --x x  + --x )ax  + (--x  + --x x  -
         9 0   6 0 1   90 1   7 0 2   10 1 2   18 2   0    10 0    5 0 1  
     ------------------------------------------------------------------------
     31 2   49       34        1 2          29 2   27        5       85      
     --x  + --x x  + --x x  + --x )ax  + (- --x  - --x x  - --x x  + --x x  -
     30 1    9 0 2   63 1 2   56 2   1      30 0   35 0 1   12 0 2    9 1 2  
     ------------------------------------------------------------------------
     31 2
     --x )ax
      6 2   2

o2 : DiffAlgField

Options Density and Height are implemented

i3 : random(newForm(2,2,1,"a"),Density => .2)

o3 = (- x  - 8x )dx dx  + (- 3x  + 4x )dx dx
         1     2   0  1        0     2   0  2

o3 : DiffAlgForm
i4 : random(newForm(2,2,1,"a"),Height => 100)

o4 = (71x  + 5x )dx dx  + (2x  - 42x  - 39x )dx dx  + (- 65x  + 35x  +
         0     2   0  1      0      1      2   0  2         0      1  
     ------------------------------------------------------------------------
     37x )dx dx
        2   1  2

o4 : DiffAlgForm

Caveat

This routine depends on the Macaulay2 method random which is not implemented in some rings. The option random(...,Density=>...) applied to a non-generic form (such us 2a logarithmic form) may return a form equal to 0

Ways to use this method:

  • random(DiffAlgElement)
  • random(DiffAlgElement,Ring) -- replaces the variables of the coefficient ring of a differential form or a vector field with random values

The source of this document is in /build/reproducible-path/macaulay2-1.25.05+ds/M2/Macaulay2/packages/DiffAlg.m2:737:0.