Changeset 637aa3 in git for Singular


Ignore:
Timestamp:
Sep 21, 2016, 8:50:47 PM (8 years ago)
Author:
Sharwan Tiwari <stiwari@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
340ab86324a89fa970583967bc2dc82e455bac1d
Parents:
579edfd1e445a134cdaeced2df1b8db73d9b7d9b
git-author:
Sharwan Tiwari <stiwari@gmail.com>2016-09-21 20:50:47+02:00
git-committer:
Sharwan Tiwari <stiwari@gmail.com>2016-10-11 17:40:28+02:00
Message:
modified nchilb
Location:
Singular
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/ncHilb.lib

    r579edfd r637aa3  
    1414
    1515PROCEDURES:
    16           nchilb(L, d, #); gives the Hilbert series of a monomial algebra
    17           (free algebra/two-sided monomial ideal).
    18           List L contains non-comm. polynomials.
    19           And d is a degree bound for the Groebner basis computation of
    20           the ideal generated by L. Third argument is optional, required for
    21           the non-finitely generated ideals.
     16          nchilb(L, d, #); Hilbert series of a non-commutative monomial algebra
     17
    2218";
    2319
     
    3935EXAMPLE: example nchilb; shows an example "
    4036{
    41     system("--ticks-per-sec",1000);
    42     if (d<1) {"bad degree bound"; return(0);}
    43     printlevel=1;
     37
     38    if (d<1)
     39    {
     40      ERROR("bad degree bound");
     41    }
     42   
    4443    def save = basering;
    4544    int sz=size(#);
     
    4948    setring R;
    5049    ideal I;
    51     poly p=0;
    52    
     50    poly p;
     51    poly q=0;
    5352    // convert list L_wp of free-poly to letterPlace-poly format
    5453    setring save;
    5554    module M;
    5655    int i,j,k,sw,sm,slm;
    57     vector w;                            // for words
    58     slm = size(L_wp);                    // number of polys in the given ideal
    59     string letpl;
     56    vector w;
     57    poly pc=0;
     58    intvec v;
     59    slm = size(L_wp);                  // number of polys in the given ideal
     60   
    6061    for (i=1; i<=slm; i++)
    61     {
     62    {   
    6263        M  = L_wp[i];
    63         sm = ncols(M);                   // number of words in the free-poly M
     64        sm = ncols(M);                 // number of words in the free-poly M
    6465        for (j=1; j<=sm; j++)
    6566        {
    6667            w  = M[j];
    6768            sw = size(w);
    68             letpl = "p = p + ";
    6969            for (k=2; k<=sw; k++)
    7070            {
    71                 letpl = letpl + string(w[k])+"("+string(k-1)+")*";
     71              v[k-1]=rvar(w[k]);
    7272            }
    73             letpl = letpl + string(w[1])+";";
    74            
     73            pc=w[1];
    7574            setring R;
    76             execute(letpl);
     75            p=imap(save,pc);
     76            for (k=2; k<=sw; k++)
     77            {
     78              p=p*var(v[k-1]+(k-2)*lV);
     79            }
     80            q=q+p;
    7781            setring save;
    7882        }
    7983        setring R;
    80         I = I,p; //lp-polynomial added to I
    81         p = 0;   //ready for the next polynomial 
     84        I = I,q; //lp-polynomial added to I
     85        q=0;   //ready for the next polynomial 
    8286        setring save;
    8387    }
    84     kill letpl;
    8588    setring R;
    86     int tt,rt;
    87    
    88     tt=timer;
    89     rt=rtimer;
     89
    9090    ideal J = system("freegb",I,d,lV);
    9191   
    92     if(printlevel >=2)
    93     {
    94          "CPU-time of GB computation="+string(timer-tt)+" milli-sec.";
    95          "Real-time of GB computation="+string(rtimer-rt)+" milli-sec.";
    96     }
    97    
    9892    //Groebner Basis is computed for the given ideal.
    99     //now compute the leading monomials of Groebner Basis
     93    //now compute the leading monomials of the Groebner Basis
    10094   
    10195    ideal J_lm;
     
    111105   
    112106    //compute the Hilbert series
    113     tt=timer;
    114     rt=rtimer;
    115     if(sz==1)
     107   
     108    if(sz==1)                     // non-finitely generated case
    116109    {
    117110        system("nc_hilb",I,lV,1);
    118111    }
    119     else
     112    else                         // finitely generated case
    120113    {
    121114        system("nc_hilb",I,lV);
    122115    }
    123     if(printlevel >=2)
    124     {
    125         "CPU-time of Hilbert series computation="+string(timer-tt)+" milli-sec.";
    126         "Real-time of Hilbert series computation="+string(rtimer-rt)+" milli-sec."; 
    127     }
    128 
    129116}
    130117example
     
    132119"EXAMPLE:"; echo = 2;
    133120    ring r=0,(x,y,z),dp;
    134     module p1=[1,y,z],[-1,z,y];      // represents the poly y*z-z*y
    135     module p2=[1,x,z,x],[-1,z,x,z]; //represents the poly x*z*x-z*x*z
     121    module p1=[1,y,z],[-1,z,y];           //represents the poly y*z-z*y
     122    module p2=[1,x,z,x],[-1,z,x,z];    //represents the poly x*z*x-z*x*z
    136123    list l1=list(p1,p2);
    137124    nchilb(l1,6,1); //third argument is for non-finitely generated case
    138125   
    139126    ring r=0,(x,y,z,w),dp;
    140     module p1=[1,y,x],[-1,x,y];
     127    module p1=[1,y,x],[-1,x,y];            //represents the poly y*x-x*y
    141128    module p2=[1,z,x],[-1,x,z];
    142129    module p3=[1,w,x],[-1,x,w];
     
    148135       
    149136    ring r=0,(X,Y,Z),dp;
    150     module p1 =[1,Y,Z];
     137    module p1 =[1,Y,Z];                //represents the poly Y*Z
    151138    module p2 =[1,Y,Z,X];
    152139    module p3 =[1,Y,Z,Z,X,Z];
  • Singular/extra.cc

    r579edfd r637aa3  
    30463046      else
    30473047  #endif
    3048         //==========================================================
    3049         // Hilbert series for non-comm. monomial algebras
    3050         // =========================================================
    3051   if(strcmp(sys_cmd,"nc_hilb")==0)
    3052         {
    3053                 ideal i;
    3054     int lV;
    3055                 bool ig=FALSE;
    3056                 if((h!=NULL)&&(h->Typ()==IDEAL_CMD))
    3057                         i=(ideal)h->Data();
    3058                         else return TRUE;
    3059                         h=h->next;
    3060       if((h!=NULL)&&(h->Typ()==INT_CMD))
    3061         lV=(int)(long)h->Data();
    3062       else return TRUE;
    3063       h=h->next;
    3064                         if(h!=NULL)
    3065                         ig=TRUE;
    3066                         HilbertSeries_OrbitData(i,lV,ig);
    3067                         return(FALSE);
    3068     }
    3069                 else
    3070 
    3071         /*==================== sca?AltVar ==================================*/
     3048    /*======================================================
     3049     * Hilbert series of non-commutative monomial algebras
     3050     *======================================================*/
     3051      if(strcmp(sys_cmd,"nc_hilb") == 0)
     3052      {
     3053        ideal i;
     3054        int lV;
     3055        bool ig = FALSE;
     3056        if((h != NULL)&&(h->Typ() == IDEAL_CMD))
     3057          i = (ideal)h->Data();
     3058        else
     3059        {
     3060          WerrorS("ideal expected");
     3061          return TRUE;
     3062        }
     3063        h = h->next;
     3064        if((h != NULL)&&(h->Typ() == INT_CMD))
     3065          lV = (int)(long)h->Data();
     3066        else
     3067        {
     3068          WerrorS("int expected");
     3069          return TRUE;
     3070        }
     3071        h = h->next;
     3072        if(h != NULL)
     3073          ig = TRUE;
     3074        HilbertSeries_OrbitData(i,lV,ig);
     3075        return(FALSE);
     3076      }
     3077      else
     3078
     3079    /*==================== sca?AltVar ==================================*/
    30723080  #ifdef HAVE_PLURAL
    30733081      if ( (strcmp(sys_cmd, "AltVarStart") == 0) || (strcmp(sys_cmd, "AltVarEnd") == 0) )
Note: See TracChangeset for help on using the changeset viewer.