Changeset 59e9c8 in git


Ignore:
Timestamp:
Oct 31, 2018, 5:49:42 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
76491be567cebb99af1378835107ecaa47a8d2c8
Parents:
95dbdf7e046656f2ff7cfa85037f2c7dc486743d
Message:
Undo changes on ncHilb.lib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ncHilb.lib

    r95dbdf r59e9c8  
    11//////////////////////////////////////////////////////////////////////////////
    22version="version nc_hilb.lib 4.1.1.0 Dec_2017 "; // $Id$
    3 category="Noncommutative";
     3category="Noncommutative algebra";
    44info="
    5 LIBRARY:  fpahilb.lib: Computation of graded and multi-graded Hilbert series of non-commutative algebras (Letterplace).
     5LIBRARY:  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.
    69
    710AUTHOR:   Sharwan K. Tiwari   shrawant@gmail.com
    811          Roberto La Scala
    9                   Viktor Levandovskyy (adaptation to the new Letterplace release)
    10                  
     12
    1113REFERENCES:
    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 
    17 KEYWORDS: finitely presented algebra; infinitely presented algebra; graded Hilbert series; multi-graded Hilbert series
    18                  
     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.
     19
    1920PROCEDURES:
    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
     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
    2225";
    2326
    2427LIB "freegb.lib";
    2528
    26 // under construction by VL; need kernel adjustments by Tiwari
    27 
    28 proc fpahilb(ideal I, list #)
    29 "USAGE: fpahilb(I[, L]), ideal I, optional list L
    30 PURPOSE: compute Hilbert series of a non-commutative algebra, presented by I
    31 RETURN: nothing (prints data out)
    32 ASSUME: basering is a Letterplace ring, I is given via its Groebner basis
    33 NOTE: 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.
    38 Let the orbit be @code{O_I = {T_{w_1}(I),...,T_{w_r}(I)} ($w_i\in W$)}, where we assume that if @code{T_{w_i}(I)=T_{w_i'}(I)}
    39 for some @code{w'_i\in W}, then @code{deg(w_i)\leq deg(w'_i)} follows.
    40 Then the description of orbit in the form @code{w_1,...,w_r} will be printed.
    41 It also prints the maximal degree and the cardinality of @code{\sum_j R(w_i, b_j)} corresponding to each @code{w_i},
    42 where @code{{b_j}} is a basis of I.
    43 Moreover, it also prints the linear system (for the information about adjacency matrix).
    44 EXAMPLE: 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 
    131 example
    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 
    140 static 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
    167 proc rcolon(ideal I, poly W)
    168 "USAGE:  rcolon(I,w); ideal I, poly w
    169 RETURNS: ideal
    170 ASSUME: - basering is a Letterplace ring
    171 - W is a monomial
    172 - I is a monomial ideal
    173 PURPOSE: compute a right colon ideal of I by a monomial w
    174 NOTE: Output is the set of generators, which should be added to I
    175 EXAMPLE: 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  }
    188 example
    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 /*
    20029proc nchilb(list L_wp, int d, list #)
    201 "USAGE: fpahilb(I, d[, L]), ideal I, int d, optional list L
    202 PURPOSE: compute Hilbert series of a non-commutative algebra
    203 ASSUME:
    204 NOTE: d is an integer for the degree bound (maximal total degree of
     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
    20533         polynomials of the generating set of the input ideal),
    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.
    210 Let 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)$
    211 for some $w'_i\in W$, then $deg(w_i)\leq deg(w'_i)$.
    212 Then, it prints words description of orbit: w_1,...,w_r.
    213 It also prints the maximal degree and the cardinality of \sum_j R(w_i, b_j) corresponding to each w_i,
    214 where {b_j} is a basis of I.
    215 Moreover, it also prints the linear system (for the information about adjacency matrix) and its solving time.
     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.
    21648
    21749NOTE  : A Groebner basis of two-sided ideal of the input should be given in a
     
    419251    //'11' is to compute the truncated HS up to degree 10.
    420252}
    421 */
    422 
    423 /*
    424 // orig version of the procedure
     253
    425254proc rcolon(list L_wp, module W, int d)
    426255"USAGE:  rcolon(list of relations, a monomial, an integer);
     
    522351    rcolon(l1,w,10);
    523352}
    524 */
     353
Note: See TracChangeset for help on using the changeset viewer.