next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: installHilbertFunction

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

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

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

   -- registering gb 2 at 0x7fdd7205f700

   -- [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                = 4186
   -- #reduction steps = 38
   -- #spairs done = 11
   -- ncalls = 10
   -- nloop = 29
   -- nsaved = 0
   --      -- used 0.0244881 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 4 at 0x7fdd715d5c00
i9 : I = ideal random(R^1, R^{3:-3});

   -- registering gb 3 at 0x7fdd7205f540

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

   -- registering gb 4 at 0x7fdd7205f380

   -- [gb]{3}(3)mmm{4}(2)mm{5}(3)mmm{6}(6)mmoooo{7}(4)mooo{8}(2)oonumber of (nonminimal) gb elements = 11
   -- number of monomials                = 267
   -- #reduction steps = 236
   -- #spairs done = 30
   -- ncalls = 10
   -- nloop = 20
   -- nsaved = 0
   --      -- used 0.00726301 seconds

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

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

   -- registering polynomial ring 5 at 0x7fdd715d5a00

o11 = S

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

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

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

o14 = 3
i15 : time gens gb J;

   -- registering gb 5 at 0x7fdd7205f1c0

   -- [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
 --removing gb 0 at 0x7fdd7205f8c0
{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
   -- #reduction steps = 284
   -- #spairs done = 53
   -- ncalls = 46
   -- nloop = 54
   -- nsaved = 0
   --      -- used 0.250291 seconds

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

o16 = | 243873059890414515367459726418219472801881021280016638460434780718278
      -----------------------------------------------------------------------
      1440000c27+680473430096987971146702628170541552971659410296860500064419
      -----------------------------------------------------------------------
      8659321541120000c26d+11597364228740720976813725657514406124738091415081
      -----------------------------------------------------------------------
      708788717896930979185664000c25d2+
      -----------------------------------------------------------------------
      23593854948820747270541718485240316584065850799950623007351199460826287
      -----------------------------------------------------------------------
      616000c24d3+32743644647016475216170069528641722426835477775253543592889
      -----------------------------------------------------------------------
      918133322668441600c23d4+
      -----------------------------------------------------------------------
      33158095190154155829221377356630179888238312515669425233096064578894340
      -----------------------------------------------------------------------
      119040c22d5+15028595287222793638671643791164484488028666170821129484464
      -----------------------------------------------------------------------
      0913474618113410688c21d6-
      -----------------------------------------------------------------------
      21512804869970961505730654467974378533992989635620845013046053149115691
      -----------------------------------------------------------------------
      376640c20d7+28431980514156020200015862091261060783608362711779183901930
      -----------------------------------------------------------------------
      9806045574261823520c19d8+
      -----------------------------------------------------------------------
      16650730381353978595863327607516214447500495532056234936672555655369716
      -----------------------------------------------------------------------
      831120c18d9+87968827795245198558720802391460287994055816649663973831801
      -----------------------------------------------------------------------
      513286446550410048c17d10+
      -----------------------------------------------------------------------
      22959959692503790373650797595979928852024328895071866607353571279986753
      -----------------------------------------------------------------------
      6198896c16d11-186238464624475812059215969192404399881338554287087040105
      -----------------------------------------------------------------------
      246208136582238056824c15d12+
      -----------------------------------------------------------------------
      24548920676014640650981729325587232424855337187862713658240676351249839
      -----------------------------------------------------------------------
      5829972c14d13-141132193544414336210863578442532364572117789942199579134
      -----------------------------------------------------------------------
      726132062555878780658c13d14+
      -----------------------------------------------------------------------
      80520443561444628031196207946045746850357450872252370351009550385550378
      -----------------------------------------------------------------------
      086681c12d15-2278233247601720373545720827573468959013067281967477143592
      -----------------------------------------------------------------------
      7358914316617821352c11d16+
      -----------------------------------------------------------------------
      12315466375513693509230290342016673656670249832613715660807956483127262
      -----------------------------------------------------------------------
      733880c10d17+4719437472003410614922275085496115471668279624745540404962
      -----------------------------------------------------------------------
      433899525703062436c9d18+
      -----------------------------------------------------------------------
      74497958923598706042158991668350708405967894269886723021144934645580613
      -----------------------------------------------------------------------
      74608c8d19+334728676747320315154276056749403769663819349640069418486913
      -----------------------------------------------------------------------
      9937175077192912c7d20+2106534096122290217776886174919161239203477897917
      -----------------------------------------------------------------------
      158167686354319461999466336c6d21+
      -----------------------------------------------------------------------
      46016969029446996772206730674250118343258593659063037978247047403425711
      -----------------------------------------------------------------------
      5680c5d22+1542848777781200461682672598621194432349177258865304071672664
      -----------------------------------------------------------------------
      34720712424352c4d23+209766195470884862406436228545283251810588018452908
      -----------------------------------------------------------------------
      50471734381682038429280c3d24+
      -----------------------------------------------------------------------
      70221637578010351138072776173836055657918796706303534104710104349853120
      -----------------------------------------------------------------------
      0c2d25+9531871659255442565995582182062188830769684462513069209840585989
      -----------------------------------------------------------------------
      184000cd26+127037175535596202927970476797708894400916603090057099058781
      -----------------------------------------------------------------------
      42251744000d27 |

              1       1
o16 : Matrix S  <--- S

See also

Ways to use installHilbertFunction :

For the programmer

The object installHilbertFunction is a method function.