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 0x25fe380

   -- [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                = 4177
   -- ncalls = 10
   -- nloop = 29
   -- nsaved = 0
   --      -- used 0.020001 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 0x24ab800
i9 : I = ideal random(R^1, R^{3:-3});

   -- registering gb 4 at 0x25fe1c0

   -- [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 0x25fe000

   -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)mooo{8}(2)oo
   -- number of (nonminimal) gb elements = 11
   -- number of monomials                = 267
   -- ncalls = 10
   -- nloop = 20
   -- nsaved = 0
   --      -- used 0. 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 0x24ab500

o11 = S

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

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

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

o14 = 3
i15 : time gens gb J;

   -- registering gb 6 at 0x2a96e00

   -- [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
removing gb 1 at 0x25fe540

   -- 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.220013 seconds

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

o16 = | 496459565544627592810347602320230085374233009745649341731045840933829
      -----------------------------------------------------------------------
      276057600c27-3573162422522272740799431538399336115733239357063780571835
      -----------------------------------------------------------------------
      542850774896683827200c26d-
      -----------------------------------------------------------------------
      87732354541810266558402797017499076507130980176846298359164908890878416
      -----------------------------------------------------------------------
      163620864c25d2+70700089585345348479750430349880249480130089503441285539
      -----------------------------------------------------------------------
      7705902038707622048832512c24d3+
      -----------------------------------------------------------------------
      49230548433189373560536255583127181073384547375095195300676047651017536
      -----------------------------------------------------------------------
      41308396160c23d4+346538917066943520487262962943583335203915732993858028
      -----------------------------------------------------------------------
      29212109621453372148278585728c22d5+
      -----------------------------------------------------------------------
      16864912840373810842373338903717562149381277530074919383059679398327927
      -----------------------------------------------------------------------
      7795765152784c21d6+5550959552432522270711014662426970002652683457887375
      -----------------------------------------------------------------------
      35427480345492478219092043340664c20d7+
      -----------------------------------------------------------------------
      12918957837761518191737431326876985288954402585399848126345572848999003
      -----------------------------------------------------------------------
      38191110312128c19d8+263104711646443743987238184981037213174836341170044
      -----------------------------------------------------------------------
      9352735165970677194983590598544757c18d9+
      -----------------------------------------------------------------------
      41826164465019076473570414459577661122329950255660546093426302154694048
      -----------------------------------------------------------------------
      51759682823403c17d10+60503486352838425826597830108436209318796877397825
      -----------------------------------------------------------------------
      71861889090675166341175760969478231c16d11+
      -----------------------------------------------------------------------
      72785952481220640331702563709550893471796003510656199560966495210832893
      -----------------------------------------------------------------------
      06656317605641c15d12+79251119819916162750764473157100390207605382762927
      -----------------------------------------------------------------------
      61781633678549890287400497365973132c14d13+
      -----------------------------------------------------------------------
      74843770336652367604688118063954185028202385543311914092985758446261105
      -----------------------------------------------------------------------
      62693000253476c13d14+62687103784263982121730448813223606097326594748660
      -----------------------------------------------------------------------
      74997477979278074972909156895274800c12d15+
      -----------------------------------------------------------------------
      46571743838346883405850542337799986053355289549911537002870980689547683
      -----------------------------------------------------------------------
      01125344706328c11d16+30040699695410945374835793310355024571943732481550
      -----------------------------------------------------------------------
      25177318295656709730050276702630208c10d17+
      -----------------------------------------------------------------------
      17091814645505446092579806565079465722002808627156834735067337983275567
      -----------------------------------------------------------------------
      38638782928096c9d18+836653698753894112146307692457137356238722869118644
      -----------------------------------------------------------------------
      848897735561196401309447769441024c8d19+
      -----------------------------------------------------------------------
      34172839196461419839374538740906379568276516747976666005175349406458666
      -----------------------------------------------------------------------
      8707277251840c7d20+1205180208822931428877698626539786758827424571388545
      -----------------------------------------------------------------------
      66078344238189590005818428014080c6d21+
      -----------------------------------------------------------------------
      37124381730923916387507274108805456231166459107886132566491034900215089
      -----------------------------------------------------------------------
      394647626752c5d22+91869394280744352116755312049460419614603826689827589
      -----------------------------------------------------------------------
      13371597309176895982027507712c4d23+
      -----------------------------------------------------------------------
      16878967229107194049335236638306684814385814810215342325486359140999839
      -----------------------------------------------------------------------
      63416002560c3d24+228122625612331900326446171094312288616314907997752460
      -----------------------------------------------------------------------
      596935841948174766994227200c2d25+
      -----------------------------------------------------------------------
      20956334376132969207416756444674086188647524374695854670554321530386452
      -----------------------------------------------------------------------
      421017600cd26+808102999129241145309506363218010322271305519011239285825
      -----------------------------------------------------------------------
      595349262571588812800d27 |

              1       1
o16 : Matrix S  <--- S

See also

Ways to use installHilbertFunction :