Singular
https://www.singular.uni-kl.de/forum/

Hilbert Series with multi weights in each variable
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=1640
Page 1 of 1

Author:  E. Javier Elizondo [ Tue May 29, 2007 2:45 am ]
Post subject:  Hilbert Series with multi weights in each variable

Hi, I am trying to compute the hilbert series for each module in a minimal free resolution of an ideal with each variable having 5 weights (it is graded under Z^5).

I looked at the manual but I do not see how to put the multiweights in each variable, I can only see how to put one weight to each variable.

I hope someone can help to compute this.

Thanks in adavance, Javier.

Author:  Noppadol Mekareeya [ Wed Jul 07, 2010 5:28 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

Hi! I am interested in a similar problem on multigraded Hilbert series. I know that Macaulay2 can compute this, but I was wondering how to do so using Singular. It would be great if someone could give me an example. Thank you very much.

Author:  Wolfram Decker [ Fri Aug 13, 2010 1:32 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

Multigradings are currently under development in SINGULAR.
We will keep you updated on this. If you have further wishes
in this direction, please let us know. You may also follow our
discussion via the Events link on the SINGULAR webpage:
see the wiki under
Software Workshop Geometry and Combinatorics 2010 - Part 2

Author:  lk [ Thu Aug 26, 2010 4:33 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

There is a library called "mgrad.lib" which can be downloaded from
code.google.com/p/convex-singular/source/browse/#svn/trunk/srcs/Singular/samples
. A description of the contained methods is provided on
code.google.com/p/convex-singular/wiki/Multigrading
. This is still work in progress. You can take a Singular intmat g with as many columns as your ring has variables and assign this to your ring with setBaseMultigrading(g). Then you can use most of the methods provided in the library.
There is also a method hilbertSeries(module/ideal) which will provide the multigraded Hilbert series as described in [Miller/Sturmfels]. I am working on it, but so far it does not work for ideals and I haven't checked correctness for modules yet.

lk

Author:  vinay [ Fri Aug 27, 2010 3:30 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

I downloaded OO.lib, mgrad.lib & test.sing from th ethe link you gave.
After executing test.sing, I an getting fatal error:
Code:
A:
Singular : signal 11 (v: 3042/2010010208):
Segment fault/Bus error occurred at 80f13ca because of 12 (r:1282917352)
please inform the authors
trying to restart...
   ? error occurred in OO.lib::CallMethod line 60: `    return (M(P)); // P? O?`
   ? last reserved name was `return`
   ? leaving OO.lib::CallMethod
   skipping text from `;` error at token `)`
   ? leaving OO.lib::CallMethod
Auf Wiedersehen.

option(prot) and TRACE doesnt give much information, just that there is some problem with CallMethod().

Singular --version gives:
Code:
Singular for ix86-Linux version 3-0-4 (3042-2010010208)  Jan  2 2010 08:45:44



-- VInay

Author:  gorzel [ Fri Aug 27, 2010 5:55 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

Your Singular version 3-0-4 is too old -- you need Singular 3-1-1.

(the file test.sing does not show the functionality)

Put the libraries in the directory Singular/3-1-1/LIB.
Then you may run:

Code:
> system("version");
3115
> LIB "mgrad.lib";
// ** loaded /data/tmp/sing311/Singular/3-1-1/LIB/mgrad.lib (0.1,2010-02-13)
> example mDegResolution;
// proc mDegResolution from lib mgrad.lib
EXAMPLE:
 
  ring r = 0,(x,y,z,w),dp;
  intmat g[2][4]=1,1,1,1,0,1,3,4;
  setBaseMultigrading(g);
  module m= ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
  isHomogenous(ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3), "checkGens");
1
  ideal A = xw-yz, x2z-y3, xz2-y2w, yw2-z3;
  for( int i=1; i<=ncols(A); i++)
    {
      mDegPartition(A[i]);
_[1]=-yz+xw
_[1]=-y3+x2z
_[1]=xz2-y2w
_[1]=-z3+yw2
  intmat v[2][1]=1,0;
  m = setModuleGrading(m, v);

  // Let's compute Syzygy!
  def S = mDegSyzygy(m); S;
S[1]=yw*gen(1)-x*gen(4)-z*gen(3)
S[2]=z2*gen(1)-y*gen(4)-w*gen(3)
S[3]=xz*gen(1)+y*gen(3)-w*gen(2)
S[4]=y2*gen(1)+x*gen(3)-z*gen(2)
  "Module Units Multigrading: "; print( getModuleGrading(S) );
Module Units Multigrading:
     3     4     4     4
     4     3     6     9
  "Multidegrees: "; print(mDeg(S));
Multidegrees:
     5     5     5     5
     9    10     7     6

  S = mDegGroebner(S); S;
S[1]=yw*gen(1)-x*gen(4)-z*gen(3)
S[2]=z2*gen(1)-y*gen(4)-w*gen(3)
S[3]=xz*gen(1)+y*gen(3)-w*gen(2)
S[4]=y2*gen(1)+x*gen(3)-z*gen(2)
S[5]=xy*gen(4)+yz*gen(3)+xw*gen(3)-zw*gen(2)
S[6]=xz2*gen(4)+z3*gen(3)-y2w*gen(4)-yw2*gen(3)
S[7]=x2z*gen(4)+xz2*gen(3)+y2w*gen(3)-yw2*gen(2)
S[8]=y3*gen(3)-x2z*gen(3)+xz2*gen(2)-y2w*gen(2)
S[9]=y3*gen(4)+xz2*gen(3)-z3*gen(2)+y2w*gen(3)
  "Module Units Multigrading: "; print( getModuleGrading(S) );
Module Units Multigrading:
     3     4     4     4
     4     3     6     9
  "Multidegrees: "; print(mDeg(S));
Multidegrees:
     5     5     5     5     6     7     7     7     7
     9    10     7     6    10    15    12     9    12


  def L = mDegResolution(m, 0, 1);

  for( int j =1; j<=size(L); j++)
    {
      "----------------------------------- ", j, " -----------------------------";
-----------------------------------  1  -----------------------------
_[1]=yz*gen(1)-xw*gen(1)
_[2]=z3*gen(1)-yw2*gen(1)
_[3]=xz2*gen(1)-y2w*gen(1)
_[4]=y3*gen(1)-x2z*gen(1)
Module Multigrading:
     1
     0
Multigrading:
     3     4     4     4
     4     9     6     3
-----------------------------------  2  -----------------------------
_[1]=yw*gen(1)-x*gen(2)+z*gen(3)
_[2]=z2*gen(1)-y*gen(2)+w*gen(3)
_[3]=xz*gen(1)-y*gen(3)-w*gen(4)
_[4]=y2*gen(1)-x*gen(3)-z*gen(4)
Module Multigrading:
     3     4     4     4
     4     9     6     3
Multigrading:
     5     5     5     5
     9    10     7     6
-----------------------------------  3  -----------------------------
_[1]=x*gen(2)-y*gen(1)-z*gen(3)+w*gen(4)
Module Multigrading:
     5     5     5     5
     9    10     7     6
Multigrading:
     6
    10
-----------------------------------  4  -----------------------------
_[1]=0
Module Multigrading:
     6
    10
Multigrading:
0,
0

  def h = hilbertSeries(m);
This proc returns a ring with polynomials called 'numerator' and 'denominator!
  setring h;

  numerator;
t_(1)^6*t_(2)^10-t_(1)^5*t_(2)^10-t_(1)^5*t_(2)^9+t_(1)^4*t_(2)^9-t_(1)^5*t_(2)^7-t_(1)^5*t_(2)^6+t_(1)^4*t_(2)^6+t_(1)^4*t_(2)^3+t_(1)^3*t_(2)^4
  denominator;
t_(1)^4*t_(2)^8-t_(1)^3*t_(2)^8-t_(1)^3*t_(2)^7+t_(1)^2*t_(2)^7-t_(1)^3*t_(2)^5-t_(1)^3*t_(2)^4+t_(1)^2*t_(2)^5+2*t_(1)^2*t_(2)^4+t_(1)^2*t_(2)^3-t_(1)*t_(2)^4-t_(1)*t_(2)^3+t_(1)^2*t_(2)-t_(1)*t_(2)-t_(1)+1
  poly d = gcd(numerator, denominator);
  numerator/d;
t_(1)^6*t_(2)^10-t_(1)^5*t_(2)^10-t_(1)^5*t_(2)^9+t_(1)^4*t_(2)^9-t_(1)^5*t_(2)^7-t_(1)^5*t_(2)^6+t_(1)^4*t_(2)^6+t_(1)^4*t_(2)^3+t_(1)^3*t_(2)^4
  denominator/d;
t_(1)^4*t_(2)^8-t_(1)^3*t_(2)^8-t_(1)^3*t_(2)^7+t_(1)^2*t_(2)^7-t_(1)^3*t_(2)^5-t_(1)^3*t_(2)^4+t_(1)^2*t_(2)^5+2*t_(1)^2*t_(2)^4+t_(1)^2*t_(2)^3-t_(1)*t_(2)^4-t_(1)*t_(2)^3+t_(1)^2*t_(2)-t_(1)*t_(2)-t_(1)+1


> example hilbertSeries;
// proc hilbertSeries from lib mgrad.lib
EXAMPLE:
 
  ring r = 0,(x,y,z,w),dp;
  intmat g[2][4]=
    1,1,1,1,
    0,1,3,4;
  setBaseMultigrading(g);
 
  module M = ideal(xw-yz, x2z-y3, xz2-y2w, yw2-z3);
  intmat V[2][1]=
    1,
    0;

  M = setModuleGrading(M, V);

  def h = hilbertSeries(M);
This proc returns a ring with polynomials called 'numerator' and 'denominator!
  setring h;
 
  numerator;
t_(1)^6*t_(2)^10-t_(1)^5*t_(2)^10-t_(1)^5*t_(2)^9+t_(1)^4*t_(2)^9-t_(1)^5*t_(2)^7-t_(1)^5*t_(2)^6+t_(1)^4*t_(2)^6+t_(1)^4*t_(2)^3+t_(1)^3*t_(2)^4
  denominator;
t_(1)^4*t_(2)^8-t_(1)^3*t_(2)^8-t_(1)^3*t_(2)^7+t_(1)^2*t_(2)^7-t_(1)^3*t_(2)^5-t_(1)^3*t_(2)^4+t_(1)^2*t_(2)^5+2*t_(1)^2*t_(2)^4+t_(1)^2*t_(2)^3-t_(1)*t_(2)^4-t_(1)*t_(2)^3+t_(1)^2*t_(2)-t_(1)*t_(2)-t_(1)+1
 
  kill g, h; setring r;

  intmat g[2][4]=
    1,2,3,4,
    0,0,5,8;
 
  setBaseMultigrading(g);
 
  ideal I = x^2, y, z^3;

  def L = mDegResolution(I, 0, 1);

  for( int j = 1; j<=size(L); j++)
  {
    "----------------------------------- ", j, " -----------------------------";
-----------------------------------  1  -----------------------------
_[1]=y
_[2]=x2
_[3]=z3
Module Multigrading:
     0
     0
Multigrading:
     2     2     9
     0     0    15
-----------------------------------  2  -----------------------------
_[1]=-x2*gen(1)+y*gen(2)
_[2]=-z3*gen(1)+y*gen(3)
_[3]=-z3*gen(2)+x2*gen(3)
Module Multigrading:
     2     2     9
     0     0    15
Multigrading:
     4    11    11
     0    15    15
-----------------------------------  3  -----------------------------
_[1]=z3*gen(1)-x2*gen(2)+y*gen(3)
Module Multigrading:
     4    11    11
     0    15    15
Multigrading:
    13
    15
-----------------------------------  4  -----------------------------
_[1]=0
Module Multigrading:
    13
    15
Multigrading:
0,
0

 
  def hh = hilbertSeries(I); setring hh;
This proc returns a ring with polynomials called 'numerator' and 'denominator!
 
  numerator;
t_(1)^13*t_(2)^15-2*t_(1)^11*t_(2)^15+t_(1)^9*t_(2)^15-t_(1)^4+2*t_(1)^2
  denominator;
t_(1)^10*t_(2)^13-t_(1)^9*t_(2)^13-t_(1)^8*t_(2)^13+t_(1)^7*t_(2)^13-t_(1)^7*t_(2)^8+t_(1)^6*t_(2)^8+t_(1)^5*t_(2)^8-t_(1)^4*t_(2)^8-t_(1)^6*t_(2)^5+t_(1)^5*t_(2)^5+t_(1)^4*t_(2)^5-t_(1)^3*t_(2)^5+t_(1)^3-t_(1)^2-t_(1)+1

  poly d = gcd(numerator, denominator);
 
  numerator/d;
t_(1)^13*t_(2)^15-2*t_(1)^11*t_(2)^15+t_(1)^9*t_(2)^15-t_(1)^4+2*t_(1)^2
  denominator/d;
t_(1)^10*t_(2)^13-t_(1)^9*t_(2)^13-t_(1)^8*t_(2)^13+t_(1)^7*t_(2)^13-t_(1)^7*t_(2)^8+t_(1)^6*t_(2)^8+t_(1)^5*t_(2)^8-t_(1)^4*t_(2)^8-t_(1)^6*t_(2)^5+t_(1)^5*t_(2)^5+t_(1)^4*t_(2)^5-t_(1)^3*t_(2)^5+t_(1)^3-t_(1)^2-t_(1)+1



Author:  vinay [ Sun Aug 29, 2010 6:16 am ]
Post subject:  Re: Hilbert Series with multi weights in each variable

Thanks! It worked...
I was being lazy for the upgrade to 3-1-1. But I did it now :-)

-- VInay

Author:  lkastner [ Wed Sep 01, 2010 1:53 pm ]
Post subject:  Re: Hilbert Series with multi weights in each variable

hilbertSeries() might work now. You need to get the latest verseion of mgrad.lib, then you can test it in the following way:

ring R = 0,(x,y,z,w),dp;
intmat W[1][4] =
1,1, 1,1;
setBaseMultigrading(W);
ideal I = z3,y3zw2,x2y4w2xyz2;

def h = hilbertSeries(I); setring h;

numerator1;
denumerator1;

numerator2;
denumerator2;

The fraction numerator1/denumerator1 represents the Hilbert series of the ideal I. numerator2/denumerator2 is the same with the gcd divided out.
We do not check whether the multigrading is positive, i.e. if the degree zero part of the ring is finite dimensional.
Please tell us about any bug or wrong result you might encounter.

lk

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/