next | previous | forward | backward | up | top | index | toc | Macaulay2 web site

installHilbertFunction -- install a Hilbert function without computation

Synopsis

Description

If M is a module, then hf should be the poincare polynomial of M. If M is an ideal, then hf should be the poincare polynomial of comodule M. If M is a matrix, then hf should be the poincare polynomial of cokernel M.

An installed Hilbert function will be used by Gröbner basis computations when possible.

Sometimes you know or are very sure that you know the Hilbert function. For example, in the following example, the Hilbert function of 3 random polynomials should be the same as the Hilbert function for a complete intersection.

i1 : R = ZZ/101[a..g];
i2 : I = ideal random(R^1, R^{3:-3});

o2 : Ideal of R
i3 : hf = poincare ideal(a^3,b^3,c^3)

           3     6    9
o3 = 1 - 3T  + 3T  - T

o3 : ZZ[T]
i4 : installHilbertFunction(I, hf)
i5 : gbTrace=3

o5 = 3
i6 : time poincare I
     -- used 0. seconds

           3     6    9
o6 = 1 - 3T  + 3T  - T

o6 : ZZ[T]
i7 : time gens gb I;

   -- registering gb 3 at 0x2a34540

   -- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mmm{6}(2,6)mm{7}(1,4)m{8}(0,2)
   -- number of (nonminimal) gb elements = 11
   -- number of monomials                = 4187
   -- ncalls = 10
   -- nloop = 29
   -- nsaved = 0
   --      -- used 0.010998 seconds

             1       11
o7 : Matrix R  <--- R
In this case, the savings is minimal, but often it can be dramatic.

Another important situation is to compute a Gröbner basis using a different monomial order. In the example below

i8 : R = QQ[a..d];

   -- registering polynomial ring 5 at 0x215a600
i9 : I = ideal random(R^1, R^{3:-3});

   -- registering gb 4 at 0x2a34380

   -- [gb]
   -- number of (nonminimal) gb elements = 0
   -- number of monomials                = 0
   -- ncalls = 0
   -- nloop = 0
   -- nsaved = 0
   -- 
o9 : Ideal of R
i10 : time hf = poincare I

   -- registering gb 5 at 0x2a341c0

   -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)m
removing gb 1 at 0x2a34700
ooo{8}(2)oo
   -- number of (nonminimal) gb elements = 11
   -- number of monomials                = 267
   -- ncalls = 10
   -- nloop = 20
   -- nsaved = 0
   --      -- used 0.031995 seconds

            3     6    9
o10 = 1 - 3T  + 3T  - T

o10 : ZZ[T]
i11 : S = QQ[a..d,MonomialOrder=>Eliminate 2]

   -- registering polynomial ring 6 at 0x215a300

o11 = S

o11 : PolynomialRing
i12 : J = substitute(I,S)

             7 3   1 2    5   2    3   1 2    9        6 2    7 2    10     
o12 = ideal (-a  + -a b + -a*b  + b  + -a c + -a*b*c + -b c + -a d + --a*b*d
             6     2      3            3      5        7      5       9     
      -----------------------------------------------------------------------
          2    9   2   1   2   6                 2   2   1   2    3   1 2   
      + 2b d + -a*c  + -b*c  + -a*c*d + 2b*c*d + -a*d  + -b*d  + c  + -c d +
               5       2       7                 5       2            8     
      -----------------------------------------------------------------------
      8   2   1 3    3   3 2    8   2     3     2    3          2    1 2   
      -c*d  + -d , 4a  + -a b + -a*b  + 2b  + 2a c + -a*b*c + 4b c + -a d +
      5       2          5      9                    2               2     
      -----------------------------------------------------------------------
      2        1 2        2       2   3        5        1   2    3   2   4 3
      -a*b*d + -b d + 2a*c  + 3b*c  + -a*c*d + -b*c*d + -a*d  + --b*d  + -c 
      5        2                      4        7        3       10       3  
      -----------------------------------------------------------------------
         9 2    4   2    7 3   3 3   5 2    2   2   7 3    7 2    5       
      + --c d + -c*d  + --d , --a  + -a b + -a*b  + -b  + --a c + -a*b*c +
        10      9       10    10     4      5       4     10      4       
      -----------------------------------------------------------------------
       2     2    10        5 2    6   2   7   2   3        5        8   2  
      b c + a d + --a*b*d + -b d + -a*c  + -b*c  + -a*c*d + -b*c*d + -a*d  +
                   9        8      7       3       4        6        5      
      -----------------------------------------------------------------------
      2   2     3    2       2   1 3
      -b*d  + 5c  + c d + c*d  + -d )
      7                          8

o12 : Ideal of S
i13 : installHilbertFunction(J, hf)
i14 : gbTrace=3

o14 = 3
i15 : time gens gb J;

   -- registering gb 6 at 0x2a34e00

   -- [gb]{3}(3,3)mmm{4}(2,2)mm{5}(3,3)mmm{6}(3,7)mmm{7}(3,8)mmm{8}(3,9)mmm{9}(3,9)m
   -- mm{10}(2,8)mm{11}(1,5)m{12}(1,3)m{13}(1,3)m{14}(1,3)m{15}(1,3)m{16}(1,3)m
   -- {17}(1,3)m{18}(1,3)m{19}(1,3)m{20}(1,3)m{21}(1,3)m{22}(1,3)m{23}(1,3)m{24}(1,3)m
   -- {25}(1,3)m{26}(1,3)m{27}(1,3)m{28}(0,2)
   -- number of (nonminimal) gb elements = 39
   -- number of monomials                = 1051
   -- ncalls = 46
   -- nloop = 54
   -- nsaved = 0
   --      -- used 0.13198 seconds

              1       39
o15 : Matrix S  <--- S
i16 : selectInSubring(1,gens gb J)

o16 = | 228176594864827313524978572769797555273475699962871837686290465031192
      -----------------------------------------------------------------------
      576000000c27+3827986569020983554795728675708872122934345059948798168649
      -----------------------------------------------------------------------
      57860009305702400000c26d-
      -----------------------------------------------------------------------
      20290506750514376781862876375907486140751274433052682758449776853013574
      -----------------------------------------------------------------------
      45120000c25d2-137143282513457417077009891887018972541560381849785238244
      -----------------------------------------------------------------------
      3971698098774794240000c24d3+
      -----------------------------------------------------------------------
      26686529476158481968719174812997358902826280040804422327693303661274689
      -----------------------------------------------------------------------
      97427200c23d4+383125859452247668665122579481420478584351414137113462031
      -----------------------------------------------------------------------
      1180971114146762536960c22d5-
      -----------------------------------------------------------------------
      20835397179681066666822553153076487233283741803814209745525055273293391
      -----------------------------------------------------------------------
      01598720c21d6-648052612447883387705416704894789917841071515717959083800
      -----------------------------------------------------------------------
      7311091105164496186880c20d7-
      -----------------------------------------------------------------------
      19331244078769992464783181669900234528173982017569647240856814146811600
      -----------------------------------------------------------------------
      13889920c19d8+340058465426690470456657815217837521289937393356180553392
      -----------------------------------------------------------------------
      0352758032119090099640c18d9+
      -----------------------------------------------------------------------
      23721359952148103864264087640954736224146946754722013586898521928618988
      -----------------------------------------------------------------------
      84205592c17d10-35450090387460976958149298690875223430426018196587869415
      -----------------------------------------------------------------------
      2002566194366805030168c16d11-
      -----------------------------------------------------------------------
      19348442715336319561168872310175247775332789113003842611776798032884507
      -----------------------------------------------------------------------
      84759252c15d12-19933552318229164158394524397301176164477928640100694842
      -----------------------------------------------------------------------
      16098769574638029113748c14d13-
      -----------------------------------------------------------------------
      29863202677621682206883852573415536477279741578625565252699933677810247
      -----------------------------------------------------------------------
      8112540c13d14+173145436555835896741651537610429893756448639232344367859
      -----------------------------------------------------------------------
      93710544385896368616c12d15-
      -----------------------------------------------------------------------
      48129374260801208399034043677746855488312253430154867985584164868651932
      -----------------------------------------------------------------------
      8541134c11d16-240247971502834485416792975791627755754329240504971664233
      -----------------------------------------------------------------------
      290242574823469623049c10d17-
      -----------------------------------------------------------------------
      35957267489663859936671355507216039348572841049986545931741016502396263
      -----------------------------------------------------------------------
      493408c9d18-18399842962900756867859333567817357343430213037790397149233
      -----------------------------------------------------------------------
      49976798967363992c8d19+
      -----------------------------------------------------------------------
      16427742083865141678330675853873697827355061619592878589868288854000084
      -----------------------------------------------------------------------
      124960c7d20+87445035572515215874962443947854458514052239130937361975253
      -----------------------------------------------------------------------
      76626585676948496c6d21-
      -----------------------------------------------------------------------
      26692613977013662537958058728129547541809363542469310728946440195451325
      -----------------------------------------------------------------------
      55072c5d22-369815703919755578787354152001487147613814566699342764135870
      -----------------------------------------------------------------------
      284146633975808c4d23+33826935519550733311670054098814314233416586278996
      -----------------------------------------------------------------------
      92624000142297814106425600c3d24+
      -----------------------------------------------------------------------
      93135253974962680637249856352808701993804178467483960126234532706600312
      -----------------------------------------------------------------------
      3456c2d25-3507555703263293775341523301194184519841122879210166269481754
      -----------------------------------------------------------------------
      69312953871360cd26-2013522665488634247559473472734802403216771381524597
      -----------------------------------------------------------------------
      96664149793790609623040d27 |

              1       1
o16 : Matrix S  <--- S

See also

Ways to use installHilbertFunction :