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

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

   -- registering gb 4 at 0x1913e40

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

   -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)m
removing gb 1 at 0x17af260
ooo{8}(2)oo
   -- number of (nonminimal) gb elements = 11
   -- number of monomials                = 267
   -- ncalls = 10
   -- nloop = 20
   -- nsaved = 0
   --      -- used 0.058585 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 0x1585f30

o11 = S

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

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

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

o14 = 3
i15 : time gens gb J;

   -- registering gb 6 at 0x1913980

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

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

o16 = | 902789818494588265793188817874962007487070867710992449181592733333180
      -----------------------------------------------------------------------
      7168c27+964663043641956021515913640341087673119254045819159778931449541
      -----------------------------------------------------------------------
      57772753376c26d+1411936630320430960681511773423293537713086636889459724
      -----------------------------------------------------------------------
      36682571904091445520c25d2-
      -----------------------------------------------------------------------
      93596700579746795399738147513156114634695450593550244806909136688158806
      -----------------------------------------------------------------------
      5800c24d3-2183362713097226939926355557404010074752482309849925671407195
      -----------------------------------------------------------------------
      321184099085160c23d4+68700885846997046711148323564078730259537323423113
      -----------------------------------------------------------------------
      66125787990419518292845996c22d5+
      -----------------------------------------------------------------------
      23132989042384126732295420242574410370858155161894294743242366043634083
      -----------------------------------------------------------------------
      891922c21d6-50805444469590908054102603466659709215532265831475946218489
      -----------------------------------------------------------------------
      268058419397748970c20d7-
      -----------------------------------------------------------------------
      25295782810188363280113412449907313808948937799446470909853008107629710
      -----------------------------------------------------------------------
      6996390c19d8-1246191986018801429410111584461570796652924916418314809761
      -----------------------------------------------------------------------
      13946206823293206015c18d9+
      -----------------------------------------------------------------------
      27103817047931091700398998327649507434422969497617723073903265534396459
      -----------------------------------------------------------------------
      1922930c17d10-114486890174628047503905050019569362204467411273629733348
      -----------------------------------------------------------------------
      5029403659004631817730c16d11-
      -----------------------------------------------------------------------
      49990866977345339091346677191824639543052240299020304855078020731116499
      -----------------------------------------------------------------------
      42575580c15d12-33576650708505682581779871569247986618312001081810803509
      -----------------------------------------------------------------------
      40072866298343560135995c14d13+
      -----------------------------------------------------------------------
      83807785896590438759909938478596635216530101325294318684248270925595212
      -----------------------------------------------------------------------
      09493400c13d14+13123793346551568196932214015165838817109881075812283238
      -----------------------------------------------------------------------
      332653386108502537742950c12d15+
      -----------------------------------------------------------------------
      13508976413827284071339035218450289450916224719480912291059301569808179
      -----------------------------------------------------------------------
      72054800c11d16-52826929822573747983905402289917359484276498763487170216
      -----------------------------------------------------------------------
      84533290883998548133075c10d17+
      -----------------------------------------------------------------------
      19401595270609005897588461661617962846090830639248297141449337400048609
      -----------------------------------------------------------------------
      92973100c9d18+413624264628741353464836008373412673301256515872344486117
      -----------------------------------------------------------------------
      2846092857887114331850c8d19-
      -----------------------------------------------------------------------
      38319862143341918907149178596338095635716342442714901790945262384863638
      -----------------------------------------------------------------------
      79478800c7d20-909053528459169785393608041580865334493281727259622229775
      -----------------------------------------------------------------------
      5062615709623980155875c6d21-
      -----------------------------------------------------------------------
      62473230346966299319987866479083529781998772108013924655654695210554416
      -----------------------------------------------------------------------
      86860750c5d22-195298534157932551432326743075760027969841543859932808588
      -----------------------------------------------------------------------
      7742681395670436476750c4d23-
      -----------------------------------------------------------------------
      10197991549113593137628886686082277217595319753781077375033249824433145
      -----------------------------------------------------------------------
      25903750c3d24-118308066298032234221723410047845000450275082119865556665
      -----------------------------------------------------------------------
      0353252518624537208500c2d25-
      -----------------------------------------------------------------------
      78520956960925223913969696887121797852828637378382200163973220935800676
      -----------------------------------------------------------------------
      1356250cd26-25422454648905150135468774272202249969073704540820198082726
      -----------------------------------------------------------------------
      4046943042234433750d27 |

              1       1
o16 : Matrix S  <--- S

See also

Ways to use installHilbertFunction :