next | previous | forward | backward | up | top | index | toc | directory | Macaulay 2 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 0x9532260

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

   -- registering gb 4 at 0x96c2d10

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

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

o11 = S

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

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

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

o14 = 3
i15 : time gens gb J;

   -- registering gb 6 at 0x9532be0

   -- [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.425935 seconds

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

o16 = | 109951076075589603607379639092920107191077842047433285281607021558810
      -----------------------------------------------------------------------
      049883707801600000c27-4686924695125355562559234266999248755751350152530
      -----------------------------------------------------------------------
      37290637037940007124467934215536640000c26d-
      -----------------------------------------------------------------------
      12888291820625910834073001746119126860044705851357375766895168428954565
      -----------------------------------------------------------------------
      25580988547072000c25d2+
      -----------------------------------------------------------------------
      95311851768318039167855679599244940831952767216781272775431316971641562
      -----------------------------------------------------------------------
      02287755783372800c24d3-
      -----------------------------------------------------------------------
      19720663914619462529571958494452271162838828009511110238198796727099147
      -----------------------------------------------------------------------
      391747155520716800c23d4+
      -----------------------------------------------------------------------
      22631931494755499156618325247568305540815947458458538169339088046843149
      -----------------------------------------------------------------------
      170261940368793600c22d5+
      -----------------------------------------------------------------------
      79180770775424934311786219321813577090903288687488746822676303042658723
      -----------------------------------------------------------------------
      947151877874736640c21d6-
      -----------------------------------------------------------------------
      70852865029503702076931394367454782497013534306955737456314674042082334
      -----------------------------------------------------------------------
      5481124281311806720c20d7-
      -----------------------------------------------------------------------
      63056696006154486460476392098586257274854299612350762644665814420335589
      -----------------------------------------------------------------------
      5854949894261658304c19d8-
      -----------------------------------------------------------------------
      17663164893499106882017960061881991268977192484964368197064177275083427
      -----------------------------------------------------------------------
      60407072362578802280c18d9-
      -----------------------------------------------------------------------
      23706232902010981845080453180190524362336194827712777118643619757153629
      -----------------------------------------------------------------------
      94585345774342091240c17d10-
      -----------------------------------------------------------------------
      36248816708024852747912681911690706186309968240027100522620311660437244
      -----------------------------------------------------------------------
      46325461005320349600c16d11-
      -----------------------------------------------------------------------
      38863052051014026424587160206641671418633853757001941879862235459260343
      -----------------------------------------------------------------------
      49271813881604730150c15d12-
      -----------------------------------------------------------------------
      42959781501395150748401784193043644329064842704838213752292269175783430
      -----------------------------------------------------------------------
      4388677844758267500c14d13+
      -----------------------------------------------------------------------
      75742107456609238709616906536179732666715184557906163317363104456553863
      -----------------------------------------------------------------------
      59558924864900861250c13d14+
      -----------------------------------------------------------------------
      56893630198252618257292705320362082297010112147121791406470851826037924
      -----------------------------------------------------------------------
      39139722553157791875c12d15-
      -----------------------------------------------------------------------
      40438448888370763841981288825165492438896938677878008146699569009349293
      -----------------------------------------------------------------------
      36101128769251225000c11d16-
      -----------------------------------------------------------------------
      75486844549582972533333155477247890096429994635256520997565687641033889
      -----------------------------------------------------------------------
      60351992505345662500c10d17-
      -----------------------------------------------------------------------
      35055422859066880578033780619139560310564026128104277379786246946290189
      -----------------------------------------------------------------------
      17189504723840537500c9d18-
      -----------------------------------------------------------------------
      13105445664092883265927311090374317649773893375042661029784648290644147
      -----------------------------------------------------------------------
      77285136774884375000c8d19+
      -----------------------------------------------------------------------
      19735417636311826225733525052852991499590850140339844318804800179871016
      -----------------------------------------------------------------------
      9840400773925000000c7d20+
      -----------------------------------------------------------------------
      20427445564098785302443614268027449606508541419343696274910467558869112
      -----------------------------------------------------------------------
      755446428012500000c6d21-
      -----------------------------------------------------------------------
      25532316737975998333943559832484179655919920706895946123659828966358680
      -----------------------------------------------------------------------
      760982658312500000c5d22-
      -----------------------------------------------------------------------
      54476682784538556757997883635539857254735345641479894160372762788175869
      -----------------------------------------------------------------------
      85121553750000000c4d23-
      -----------------------------------------------------------------------
      31813421210247519349180671637350302853585189848821503364452698068174585
      -----------------------------------------------------------------------
      7383125000000000c3d24-5394190915687107576430451947341829022667216566107
      -----------------------------------------------------------------------
      343532021994385600075028750000000000c2d25+
      -----------------------------------------------------------------------
      11971077024379141772176603915187908057028816122601812328775518067594270
      -----------------------------------------------------------------------
      000000000000cd26-253515663350606316265600092747204231107338737527376715
      -----------------------------------------------------------------------
      94905259844757031250000000d27 |

              1       1
o16 : Matrix S  <--- S

See also

Ways to use installHilbertFunction :