Changeset f7c7dd1 in git


Ignore:
Timestamp:
Oct 31, 2018, 8:16:23 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
68af17bc5a4c10eaffa6f54407718cc107013253
Parents:
d3a7e2ca36b32434582c39f116aad637b6d2dcf1
Message:
Update nchilb and fpadim
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    rd3a7e2 rf7c7dd1  
    20012001@*      - if you specify a different degree bound degbound,
    20022002@*        degbound <= attrib(basering,uptodeg) holds.
    2003 THEORY: Hilbert series of an algebra K<X>/<G> is @code{\sum_{i=0} h_i t^i},
    2004 where @code{h_i} is the K-dimension of the space of monomials of degree i,
     2003THEORY: Hilbert series of an algebra K<X>/<G> is sum h_i t^i,
     2004where h_i is the K-dimension of the space of monomials of degree i,
    20052005not contained in <G>. For finitely presented algebras Hilbert series NEED
    20062006NOT be a rational function, though it happens often. Therefore in general
     
    20112011@*      Default: attrib(basering, lV).
    20122012@*    - In the output intvec I, I[k] is the (k-1)-th coefficient of the Hilbert
    2013 @*      series, i.e. @code{h_{k-1}} as above.
     2013@*      series, i.e. h_(k-1) as above.
    20142014EXAMPLE: example lpHilbert; shows examples
    20152015SEE ALSO: ncHilb_lib
     
    27012701lpGkDim(J); // 3 == correct
    27022702 */
     2703
  • Singular/LIB/ncHilb.lib

    rd3a7e2 rf7c7dd1  
    11//////////////////////////////////////////////////////////////////////////////
    22version="version nc_hilb.lib 4.1.1.0 Dec_2017 "; // $Id$
    3 category="Noncommutative algebra";
     3category="Noncommutative";
    44info="
    5 LIBRARY:  ncHilb.lib: A library for computing graded and multi-graded Hilbert
    6                       series of non-commutative algebras. It also computes
    7                       the truncated Hilbert series of the algebras whose Hilbert
    8                       series are possibly not rational or unknown.
     5LIBRARY:  fpahilb.lib: Computation of graded and multi-graded Hilbert series of non-commutative algebras (Letterplace).
    96
    107AUTHOR:   Sharwan K. Tiwari   shrawant@gmail.com
    118          Roberto La Scala
     9                  Viktor Levandovskyy (adaptation to the new Letterplace release)
    1210
    1311REFERENCES:
    14           La Scala R.: Monomial right ideals and the Hilbert series of
    15           non-commutative modules, J. of Symb. Comp. (2016).
    16 
    17           La Scala R., Tiwari Sharwan K.: Multigraded Hilbert Series of
    18           noncommutative modules, https://arxiv.org/abs/1705.01083.
     12          La Scala R.: Monomial right ideals and the Hilbert series of non-commutative modules,
     13                  Journal of Symbolic Computation (2016).
     14
     15          La Scala R., Tiwari Sharwan K.: Multigraded Hilbert Series of noncommutative modules, https://arxiv.org/abs/1705.01083.
     16
     17KEYWORDS: finitely presented algebra; infinitely presented algebra; graded Hilbert series; multi-graded Hilbert series
    1918
    2019PROCEDURES:
    21           nchilb(L,d,#); Hilbert series of a non-commutative algebra
    22           rcolon(L, w, d); Right colon ideal of a two-sided monomial ideal
    23                            with respect to a monomial w
    24 
     20          fpahilb(L,d,#); Hilbert series of a non-commutative algebra
     21          rcolon(I, w, d); Right colon ideal of a two-sided monomial ideal with respect to a monomial w
    2522";
    2623
    2724LIB "freegb.lib";
    2825
     26// under construction by VL; need kernel adjustments by Tiwari
     27
     28proc fpahilb(ideal I, list #)
     29"USAGE: fpahilb(I[, L]), ideal I, optional list L
     30PURPOSE: compute Hilbert series of a non-commutative algebra, presented by I
     31RETURN: nothing (prints data out)
     32ASSUME: basering is a Letterplace ring, I is given via its Groebner basis
     33NOTE: the appearance of following values among the optional arguments triggers the following:
     34@* 1: computation for non-finitely generated regular ideals,
     35@* 2: computation of multi-graded Hilbert series,
     36@* N>2: computation of truncated Hilbert series up to degree N-1, and
     37@* nonempty string: the details about the orbit and system of equations will be printed.
     38Let the orbit be O_I = T_(w_1)(I),...,T_(w_r)(I)} (w_i in W), where we assume that if T_(w_i)(I)=T_(w_i')(I)
     39for some w'_i in W, then deg(w_i) <= deg(w'_i) follows.
     40Then the description of orbit in the form w_1,...,w_r will be printed.
     41It also prints the maximal degree and the cardinality of sum_j R(w_i, b_j) corresponding to each w_i,
     42where b_j is a basis of I.
     43Moreover, it also prints the linear system (for the information about adjacency matrix).
     44EXAMPLE: example fpahilb; shows an example "
     45{
     46        if (attrib(basering, "isLetterplaceRing")==0)
     47        {
     48      ERROR("Basering should be Letterplace ring");
     49        }
     50        def save = basering;
     51        int sz=size(#);
     52    int lV=attrib(save,"uptodeg");
     53    int ig=0;
     54    int mgrad=0;
     55    int tdeg=0;
     56    string odp="";
     57    int i;
     58    for(i=sz; i >= 1; i--)
     59    {
     60      if(typeof(#[i])=="string")
     61      {
     62        if(#[i]!="")
     63        {
     64          odp = "p";
     65        }
     66        # = delete(#,i);
     67        sz = sz-1;
     68        break;
     69      }
     70    }
     71    i=1;
     72// VL: changing the old "only one optional parameter (for printing the details) is allowed as a string."
     73    while( (typeof(#[i])=="int") && (i<=sz) )
     74    {
     75      if( (#[i] == 1) && (ig==0) )
     76      {
     77        ig = 1;
     78      }
     79      else
     80      {
     81        if ( (#[i] == 2) && (mgrad==0) )
     82        {
     83          mgrad = 2;
     84        }
     85        else
     86        {
     87          if ( (#[i] > 2) && (tdeg==0) )
     88          {
     89            tdeg = #[i];
     90          }
     91          else
     92          {
     93            ERROR("error: only int 1,2 and >2 are allowed as optional parameters");
     94          }
     95        }
     96      }
     97      i = i + 1;
     98    }
     99    if( i <= sz)
     100    {
     101      ERROR("error:only int 1,2, >2, and a string are allowed as optional parameters");
     102    }
     103    // new: truncation should be < than degbound/2
     104        if (tdeg > (lV-1) div 2)
     105        {
     106       ERROR("Degree bound on the basering Should be at least 2*N+1");
     107        }
     108        def save2 = basering;
     109        setring save2;
     110    ideal J_lm = imap(save,I);
     111    for(i=1;i<=size(J_lm);i++)
     112    {
     113        J_lm[i]=leadmonom(J_lm[i]);
     114    }
     115    //compute the Hilbert series
     116        // system call : HilbertSeries_OrbitData: sharwan need to change it as well...
     117        //(ideal S, int lV, bool IG_CASE, bool mgrad, bool odp, int trunDegHs)
     118
     119    if(odp == "")
     120    {
     121      system("nc_hilb", J_lm, lV, ig, mgrad,tdeg);
     122        }
     123    else
     124    {
     125      system("nc_hilb", J_lm, lV, ig, mgrad,tdeg, odp);
     126        }
     127        setring save;
     128        kill save2;
     129}
     130
     131example
     132{
     133"EXAMPLE:"; echo = 2;
     134  ring r=0,(X,Y,Z),dp;
     135  def R = makeLetterplaceRing(12); setring R;
     136  ideal I = Y*Z, Y*Z*X, Y*Z*Z*X, Y*Z*Z*Z*X;
     137  fpahilb(I,3,"p");
     138}
     139
     140static proc conversion_problems()
     141{
     142// problems:
     143// a) words description of the Orbit:
     144//1    x    z    // ** invalid letterplace monomial: --> Karim?
     145// caused by pWrite0 --> writemon
     146// b) HilbertSeries_OrbitData changes currRing [doesn't help while doing copies]
     147// second call of same procedure changes the input
     148
     149// (10,3) ok; (10,4) segfault
     150// (12,3) (12,4) (12,5) ok (12,6) bound violated
     151  LIB "./ncHilb.lib";
     152  ring r2=0,(x,y,z),dp;
     153  def R2 = makeLetterplaceRing(12); setring R2;
     154  ideal I = y*z-z*y, x*z*x-z*x*z, x*z^2*x*z-z*x*z^2*x, x*z^3*x*z-z*x*z^2*x^2;
     155  ideal J = std(I); // compute a Groebner basis up to degree bound, which is 12
     156  fpahilb(J,6,1,"p");
     157  // inspecting J we see that this is a homogeneous Groebner basis
     158  // which is potentially infinite, i.e. J is not finitely generated
     159  fpahilb(J,5,1,2,"p"); // '1' i for non-finitely generated case, string to print details
     160  //'5' here is to compute the truncated HS up to degree 5.
     161  //'2' is to compute multi-graded Hilbert series
     162  fpahilb(J,7,1,"p");
     163}
     164
     165
     166// overhauled by VL
     167proc rcolon(ideal I, poly W)
     168"USAGE:  rcolon(I,w); ideal I, poly w
     169RETURNS: ideal
     170ASSUME: - basering is a Letterplace ring
     171- W is a monomial
     172- I is a monomial ideal
     173PURPOSE: compute a right colon ideal of I by a monomial w
     174NOTE: Output is the set of generators, which should be added to I
     175EXAMPLE: example rcolon; shows an example"
     176{
     177        int lV =  attrib(R,"isLetterplaceRing"); //nvars(save);
     178        if (lV == 0)
     179        {
     180      ERROR("Basering must be a Letterplace ring");
     181        }
     182    poly wc = leadmonom(W);
     183        ideal II = lead(I);
     184    ideal J = system("rcolon", II, wc, lV);
     185    // VL: printlevel here? before only printing was there, no output
     186        return(J);
     187 }
     188example
     189{
     190"EXAMPLE:"; echo = 2;
     191  ring r=0,(X,Y,Z),dp;
     192  def R = makeLetterplaceRing(10); setring R;
     193  ideal I = Y*Z, Y*Z*X, Y*Z*Z*X, Y*Z*Z*Z*X, Y*Z*Z*Z*Z*X, Y*Z*Z*Z*Z*Z*X, Y*Z*Z*Z*Z*Z*Z*X, Y*Z*Z*Z*Z*Z*Z*Z*X;
     194  poly w = Y;
     195  ideal J = rcolon(I,w);
     196  J; // new generators, which need to be added to I
     197}
     198
     199/*
    29200proc nchilb(list L_wp, int d, list #)
    30 "USAGE:  nchilb(list of relations, an integer, optional);
    31          L is a list of modules (each module represents a free-polynomial),
    32          d is an integer for the degree bound (maximal total degree of
     201"USAGE: fpahilb(I, d[, L]), ideal I, int d, optional list L
     202PURPOSE: compute Hilbert series of a non-commutative algebra
     203ASSUME:
     204NOTE: d is an integer for the degree bound (maximal total degree of
    33205         polynomials of the generating set of the input ideal),
    34          #[]=1, computation for non-finitely generated regular ideals,
    35          #[]=2, computation of multi-graded Hilbert series,
    36          #[]=tdeg, for obtaining the truncated Hilbert series up to the
    37               total degree tdeg-1 (tdeg should be > 2), and
    38 
    39          #[]=string(p), to print the details about the orbit and system of
    40              equations. Let the orbit is O_I = {T_{w_1}(I),...,T_{w_r}(I)}
    41              ($w_i\in W$), where we assume that if T_{w_i}(I)=T_{w_i'}(I)$
    42              for some $w'_i\in W$, then $deg(w_i)\leq deg(w'_i)$.
    43              Then, it prints words description of orbit: w_1,...,w_r.
    44              It also prints the maximal degree and the cardinality of
    45              \sum_j R(w_i, b_j) corresponding to each w_i, where {b_j} is a
    46              basis of I. Moreover, it also prints the linear system (for the
    47              information about adjacency matrix) and its solving time.
     206#[]=1, computation for non-finitely generated regular ideals,
     207#[]=2, computation of multi-graded Hilbert series,
     208#[]=tdeg, for obtaining the truncated Hilbert series up to the total degree tdeg-1 (tdeg should be > 2), and
     209#[]=string(p), to print the details about the orbit and system of equations.
     210Let the orbit is O_I = {T_{w_1}(I),...,T_{w_r}(I)} ($w_i\in W$), where we assume that if T_{w_i}(I)=T_{w_i'}(I)$
     211for some $w'_i\in W$, then $deg(w_i)\leq deg(w'_i)$.
     212Then, it prints words description of orbit: w_1,...,w_r.
     213It also prints the maximal degree and the cardinality of \sum_j R(w_i, b_j) corresponding to each w_i,
     214where {b_j} is a basis of I.
     215Moreover, it also prints the linear system (for the information about adjacency matrix) and its solving time.
    48216
    49217NOTE  : A Groebner basis of two-sided ideal of the input should be given in a
     
    251419    //'11' is to compute the truncated HS up to degree 10.
    252420}
    253 
     421*/
     422
     423/*
     424// orig version of the procedure
    254425proc rcolon(list L_wp, module W, int d)
    255426"USAGE:  rcolon(list of relations, a monomial, an integer);
     
    351522    rcolon(l1,w,10);
    352523}
    353 
     524*/
     525
Note: See TracChangeset for help on using the changeset viewer.