Changeset 3c4dcc in git for Singular/LIB/involut.lib


Ignore:
Timestamp:
May 6, 2005, 4:39:20 PM (19 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0d217d3f1cc4c0449bdb078c65fd1f43cd1a2b84
Parents:
e6fb5315eb32da00236163ce10f9bdafaaa0bd47
Message:
*hannes: DOS->UNIX and white space cleanup


git-svn-id: file:///usr/local/Singular/svn/trunk@8073 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/involut.lib

    re6fb531 r3c4dcc  
    1 version="$Id: involut.lib,v 1.3 2005-04-27 19:32:14 levandov Exp $";
     1version="$Id: involut.lib,v 1.4 2005-05-06 14:38:40 hannes Exp $";
    22category="Noncommutative";
    33info="
    4 LIBRARY:  involution.lib  Procedures for Computations and Operations with Involutions 
     4LIBRARY:  involution.lib  Procedures for Computations and Operations with Involutions
    55AUTHORS:  Oleksandr Iena,       yena@mathematik.uni-kl.de,
    66@*        Markus Becker,        mbecker@mathematik.uni-kl.de,
     
    3232EXAMPLE: example ncdetection; shows an example
    3333"{
    34 // in this procedure an involution map is generated from the NCRelations 
     34// in this procedure an involution map is generated from the NCRelations
    3535// that will be used in the function involution
    3636// in dieser proc. wird eine matrix erzeugt, die in der i-ten zeile die indices
    3737// der differential-, shift- oder advance-operatoren enthaelt mit denen die i-te
    38 // variable nicht kommutiert. 
     38// variable nicht kommutiert.
    3939  int i,j,k,LExp;
    4040  int NVars  = nvars(r);
     
    4242  intmat M[NVars][3];
    4343  int NRows = nrows(rel);
    44   intvec v,w; 
     44  intvec v,w;
    4545  poly d,d_lead;
    4646  ideal I;
     
    5353      continue;
    5454    }
    55     for( i=1; i<j; i++ )         
     55    for( i=1; i<j; i++ )
    5656    {
    5757      if( rel[i,j]==1 )        //relation of type var(j)*var(i) = var(i)*var(j) +1
     
    125125      {
    126126        I[M[i,1]] = -var(M[i,1]);
    127       }                 
    128       if( ( (M[i,2]!=0) && (M[i,3]==0) )|| ( (M[i,2]!=0) && (M[i,3]==0) ) 
     127      }
     128      if( ( (M[i,2]!=0) && (M[i,3]==0) )|| ( (M[i,2]!=0) && (M[i,3]==0) )
    129129)
    130130      {
     
    143143      {
    144144        I[i] = -var(i);
    145       } 
     145      }
    146146    }
    147147  }
     
    149149}
    150150example
    151 { 
     151{
    152152  "EXAMPLE:"; echo = 2;
    153153  ring r=0,(x,y,z,D(1..3)),dp;
     
    187187    {
    188188      if (v[j]!=0)
    189       { 
     189      {
    190190        pp = l[j];
    191191        zz = zz*(pp^v[j]);
    192192      }
    193     }   
     193    }
    194194    nn = nn + (leadcoef(mm[i])*zz);
    195     i++; 
     195    i++;
    196196  }
    197197  return(nn);
     
    216216    {
    217217      if (v[j]!=0)
    218       { 
     218      {
    219219        pp = l[j];
    220220        zz = (pp^v[j])*zz;
    221221      }
    222     }   
     222    }
    223223    nn = nn + (leadcoef(mm[i])*zz);
    224     i++; 
     224    i++;
    225225  }
    226226  return(nn);
     
    253253//     {
    254254//       if (v[j]!=0)
    255 //       { 
    256 //         p = var(j); 
     255//       {
     256//         p = var(j);
    257257//         p = theta(p);
    258258//         z = z*(p^v[j]);
    259259//       }
    260 //     }   
     260//     }
    261261//     n = n + (leadcoef(m[i])*z);
    262 //     i++; 
     262//     i++;
    263263//   }
    264264//   return(n);
     
    271271EXAMPLE: example involution; shows an example
    272272"{
    273   // applies the involution map theta to m, 
     273  // applies the involution map theta to m,
    274274  // where m= vector, polynomial, module, matrix, ideal
    275275  int i,j;
     
    278278  if (typeof(m)=="poly")
    279279  {
    280     return (invo_poly(m,theta)); 
     280    return (invo_poly(m,theta));
    281281  }
    282282  if ( typeof(m)=="ideal" )
     
    286286    {
    287287      n[i] = invo_poly(m[i], theta);
    288     } 
     288    }
    289289    return(n);
    290290  }
     
    295295      m[i] = invo_poly(m[i], theta);
    296296    }
    297     return (m); 
     297    return (m);
    298298  }
    299299  if ( (typeof(m)=="matrix") || (typeof(m)=="module"))
    300   { 
     300  {
    301301    matrix n = matrix(m);
    302302    int @R=nrows(n);
     
    306306      for(j=1; j<=@C; j++)
    307307      {
    308         if (m[i,j]!=0)
    309         {
    310           n[i,j] = invo_poly( m[i,j], theta);
    311         }
     308        if (m[i,j]!=0)
     309        {
     310          n[i,j] = invo_poly( m[i,j], theta);
     311        }
    312312      }
    313313    }
     
    326326}
    327327example
    328 { 
     328{
    329329  "EXAMPLE:";echo = 2;
    330330  ring r = 0,(x,d),dp;
     
    345345  module IM = involution(M,F);
    346346  print(IM);
    347   print(M - involution(IM,F)); 
     347  print(M - involution(IM,F));
    348348}
    349349///////////////////////////////////////////////////////////////////////////////////
     
    362362      {
    363363        s = s+ ","+NVAR(i,j);
    364       };   
     364      };
    365365    };
    366366  };
     
    400400    };
    401401  };
    402   return(Rel); 
     402  return(Rel);
    403403};
    404404/////////////////////////////////////////////////////////////////
    405405proc find_invo()
    406 "USAGE: find_invo(); 
     406"USAGE: find_invo();
    407407PURPOSE: describes a variety of linear involutions on a basering
    408408RETURN: a ring together with a list of pairs L, where
    409409@*        L[i][1]  =  Groebner Basis of an i-th associated prime,
    410410@*        L[i][2]  =  matrix, defining a linear map, with entries, reduced with respect to L[i][1]
    411 NOTE: for convenience, the full ideal of relations @code{idJ} 
     411NOTE: for convenience, the full ideal of relations @code{idJ}
    412412and the initial matrix with indeterminates @code{matD} are exported in the output ring.
    413413"{
     
    415415  int NVars = nvars(@B); //number of variables in basering
    416416  int i, j;
    417  
     417
    418418  matrix Rel = RelMatr(); //the matrix of relations
    419    
     419
    420420  string s   = new_var(); //string of new variables
    421421  string Par = parstr(@B); //string of parameters in old ring
    422  
     422
    423423  if (Par=="") // if there are no parameters
    424   { 
     424  {
    425425    execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables
    426426  }
    427427  else //if there exist parameters
    428   { 
     428  {
    429429     execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables
    430430  };
    431  
     431
    432432  matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring
    433  
     433
    434434  int Sz = NVars*NVars+NVars; // number of variables in new ring
    435  
     435
    436436  matrix M[Sz][Sz]; //to be the matrix of relations in new ring
    437  
     437
    438438  for(i=1; i<NVars; i++) //initialize that matrix of relations
    439439  {
     
    443443    };
    444444  };
    445  
     445
    446446  ncalgebra(1, M); //now new ring @@K become a noncommutative ring
    447  
     447
    448448  list l; //list to define an involution
    449449  poly @@F;
     
    454454    {
    455455      execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" );
    456     }; 
    457     l=l+list(@@F); 
    458   };
    459      
     456    };
     457    l=l+list(@@F);
     458  };
     459
    460460  matrix N = Rel; //imap(@B,Rel);
    461  
    462   for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 
     461
     462  for(i=1; i<NVars; i++)//get matrix by applying the involution to relations
    463463  {
    464464    for(j=i+1; j<=NVars; j++)
     
    470470  //---------------------------------------------
    471471  //get the ideal of coefficients of N
    472   ideal J; 
     472  ideal J;
    473473  ideal idN = simplify(ideal(N),2);
    474474  J = ideal(coeffs( idN, var(1) ) );
    475475  for(i=2; i<=NVars; i++)
    476476  {
    477     J = ideal( coeffs( J, var(i) ) ); 
     477    J = ideal( coeffs( J, var(i) ) );
    478478  };
    479479  J = simplify(J,2);
    480480  //-------------------------------------------------
    481   if ( Par=="" ) //initializes the ring of relations 
     481  if ( Par=="" ) //initializes the ring of relations
    482482  {
    483483    execute("ring @@KK=0,("+s+"), dp;");
     
    490490  string snv = "["+string(NVars)+"]";
    491491  execute("matrix @@D"+snv+snv+"="+s+";"); // matrix with entries=new variables
    492  
     492
    493493  J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity
    494494  J = simplify(J,2); // without extra zeros
    495495  list mL = minAssGTZ(J); // components not in GB
    496   int sL  = size(mL); 
     496  int sL  = size(mL);
    497497  option(redSB);       // important for reduced GBs
    498498  option(redTail);
     
    533533@*        L[i][1]  =  Groebner Basis of an i-th associated prime,
    534534@*        L[i][2]  =  matrix, defining a linear map, with entries, reduced with respect to L[i][1]
    535 NOTE: for convenience, the full ideal of relations @code{idJ} 
     535NOTE: for convenience, the full ideal of relations @code{idJ}
    536536and the initial matrix with indeterminates @code{matD} are exported in the output ring.
    537537"{
     
    539539  int NVars = nvars(@B); //number of variables in basering
    540540  int i, j;
    541  
     541
    542542  matrix Rel = RelMatr(); //the matrix of relations
    543    
     543
    544544  string s   = new_var_special(); //string of new variables
    545545  string Par = parstr(@B); //string of parameters in old ring
    546  
     546
    547547  if (Par=="") // if there are no parameters
    548   { 
     548  {
    549549    execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables
    550550  }
    551551  else //if there exist parameters
    552   { 
     552  {
    553553    execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables
    554554  };
    555  
     555
    556556  matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring
    557  
     557
    558558  int Sz = 2*NVars; // number of variables in new ring
    559  
     559
    560560  matrix M[Sz][Sz]; //to be the matrix of relations in new ring
    561561  for(i=1; i<NVars; i++) //initialize that matrix of relations
     
    566566    };
    567567  };
    568  
     568
    569569  ncalgebra(1, M); //now new ring @@K become a noncommutative ring
    570  
     570
    571571  list l; //list to define an involution
    572572
     
    574574  {
    575575    execute( "l["+string(i)+"]="+NVAR(i,i)+"*"+string( var(i) )+";" );
    576  
     576
    577577  };
    578578  matrix N = Rel; //imap(@B,Rel);
    579  
    580   for(i=1; i<NVars; i++)//get matrix by applying the involution to relations 
     579
     580  for(i=1; i<NVars; i++)//get matrix by applying the involution to relations
    581581  {
    582582    for(j=i+1; j<=NVars; j++)
     
    589589  //get the ideal of coefficients of N
    590590
    591   ideal J; 
     591  ideal J;
    592592  ideal idN = simplify(ideal(N),2);
    593593  J = ideal(coeffs( idN, var(1) ) );
    594594  for(i=2; i<=NVars; i++)
    595595  {
    596     J = ideal( coeffs( J, var(i) ) ); 
     596    J = ideal( coeffs( J, var(i) ) );
    597597  };
    598598  J = simplify(J,2);
    599599  //-------------------------------------------------
    600  
    601   if ( Par=="" ) //initializes the ring of relations 
     600
     601  if ( Par=="" ) //initializes the ring of relations
    602602  {
    603603    execute("ring @@KK=0,("+s+"), dp;");
     
    607607    execute("ring @@KK=(0,"+Par+"),("+s+"), dp;");
    608608  };
    609      
     609
    610610  ideal J = imap(@@K,J); // ideal, considered in @@KK now
    611  
     611
    612612  matrix @@D[NVars][NVars]; // matrix with entries=new variables to square i.e. @@D=@@D^2
    613613  for(i=1;i<=NVars;i++)
     
    617617  J = J, ideal( @@D*@@D - matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity
    618618  J = simplify(J,2); // without extra zeros
    619  
     619
    620620  list mL = minAssGTZ(J); // components not in GB
    621   int sL  = size(mL); 
     621  int sL  = size(mL);
    622622  option(redSB); // important for reduced GBs
    623623  option(redTail);
    624624  matrix IM = @@D; // involution map
    625625  list L = list(); // the answer
    626   list TL; 
     626  list TL;
    627627  ideal tmp = 0;
    628628  for (i=1; i<=sL; i++) // compute GBs of components
     
    658658@*        L[i][1]  =  Groebner Basis of an i-th associated prime,
    659659@*        L[i][2]  =  matrix, defining a linear map, with entries, reduced with respect to L[i][1]
    660 NOTE: for convenience, the full ideal of relations @code{idJ} 
     660NOTE: for convenience, the full ideal of relations @code{idJ}
    661661and the initial matrix with indeterminates @code{matD} are exported in the output ring.
    662662"{
     
    664664  int NVars = nvars(@B); //number of variables in basering
    665665  int i, j;
    666  
     666
    667667  matrix Rel = RelMatr(); //the matrix of relations
    668    
     668
    669669  string s   = new_var(); //string of new variables
    670670  string Par = parstr(@B); //string of parameters in old ring
    671  
     671
    672672  if (Par=="") // if there are no parameters
    673   { 
     673  {
    674674    execute("ring @@K=0,("+varstr(@B)+","+s+"), dp;"); //new ring with new variables
    675675  }
    676676  else //if there exist parameters
    677   { 
     677  {
    678678     execute("ring @@K=(0,"+Par+") ,("+varstr(@B)+","+s+"), dp;");//new ring with new variables
    679679  };
    680  
     680
    681681  matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring
    682  
     682
    683683  int Sz = NVars*NVars+NVars; // number of variables in new ring
    684  
     684
    685685  matrix M[Sz][Sz]; //to be the matrix of relations in new ring
    686  
     686
    687687  for(i=1; i<NVars; i++) //initialize that matrix of relations
    688688  {
     
    692692    };
    693693  };
    694  
     694
    695695  ncalgebra(1, M); //now new ring @@K become a noncommutative ring
    696  
     696
    697697  list l; //list to define a homomorphism(isomorphism)
    698698  poly @@F;
     
    703703    {
    704704      execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" );
    705     }; 
    706     l=l+list(@@F); 
    707   };
    708      
     705    };
     706    l=l+list(@@F);
     707  };
     708
    709709  matrix N = Rel; //imap(@B,Rel);
    710  
    711   for(i=1; i<NVars; i++)//get matrix by applying the homomorphism  to relations 
     710
     711  for(i=1; i<NVars; i++)//get matrix by applying the homomorphism  to relations
    712712  {
    713713    for(j=i+1; j<=NVars; j++)
     
    719719  //---------------------------------------------
    720720  //get the ideal of coefficients of N
    721   ideal J; 
     721  ideal J;
    722722  ideal idN = simplify(ideal(N),2);
    723723  J = ideal(coeffs( idN, var(1) ) );
    724724  for(i=2; i<=NVars; i++)
    725725  {
    726     J = ideal( coeffs( J, var(i) ) ); 
     726    J = ideal( coeffs( J, var(i) ) );
    727727  };
    728728  J = simplify(J,2);
    729729  //-------------------------------------------------
    730   if ( Par=="" ) //initializes the ring of relations 
     730  if ( Par=="" ) //initializes the ring of relations
    731731  {
    732732    execute("ring @@KK=0,("+s+"), dp;");
     
    739739  string snv = "["+string(NVars)+"]";
    740740  execute("matrix @@D"+snv+snv+"="+s+";"); // matrix with entries=new variables
    741  
     741
    742742  J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that homomorphism to square is just identity
    743743  J       = simplify(J,2); // without extra zeros
    744744  list mL = minAssGTZ(J); // components not in GB
    745   int sL  = size(mL); 
     745  int sL  = size(mL);
    746746  option(redSB); // important for reduced GBs
    747747  option(redTail);
    748748  matrix IM = @@D; //  map
    749749  list L = list(); // the answer
    750   list TL; 
     750  list TL;
    751751  ideal tmp = 0;
    752752  for (i=1; i<=sL; i++)// compute GBs of components
Note: See TracChangeset for help on using the changeset viewer.