[3754ca] | 1 | version="$Id: involut.lib,v 1.18 2009-04-15 11:14:36 seelisch Exp $"; |
---|
[3c4dcc] | 2 | category="Noncommutative"; |
---|
| 3 | info=" |
---|
[d41540] | 4 | LIBRARY: involut.lib Computations and operations with involutions |
---|
[3c4dcc] | 5 | AUTHORS: Oleksandr Iena, yena@mathematik.uni-kl.de, |
---|
| 6 | @* Markus Becker, mbecker@mathematik.uni-kl.de, |
---|
| 7 | @* Viktor Levandovskyy, levandov@mathematik.uni-kl.de |
---|
| 8 | |
---|
[d41540] | 9 | THEORY: Involution is an anti-isomorphism of a noncommutative algebra with the |
---|
[065ddc] | 10 | property that applied an involution twice, one gets an identity. Involution is linear with respect to the ground field. In this library we compute linear involutions, distinguishing the case of a diagonal matrix (such involutions are called homothetic) and a general one. |
---|
| 11 | |
---|
[3c4dcc] | 12 | SUPPORT: Forschungsschwerpunkt 'Mathematik und Praxis' (Project of Dr. E. Zerz |
---|
| 13 | and V. Levandovskyy), Uni Kaiserslautern |
---|
| 14 | |
---|
| 15 | NOTE: This library provides algebraic tools for computations and operations |
---|
[d41540] | 16 | with algebraic involutions and linear automorphisms of non-commutative algebras |
---|
[3c4dcc] | 17 | |
---|
| 18 | PROCEDURES: |
---|
[1fdee9] | 19 | findInvo(); computes linear involutions on a basering; |
---|
| 20 | findInvoDiag(); computes homothetic (diagonal) involutions on a basering; |
---|
| 21 | findAuto(); computes linear automorphisms of a basering; |
---|
| 22 | ncdetection(); computes an ideal, presenting an involution map on some particular noncommutative algebras; |
---|
| 23 | involution(m,theta); applies the involution to an object. |
---|
[3c4dcc] | 24 | "; |
---|
| 25 | |
---|
| 26 | LIB "ncalg.lib"; |
---|
| 27 | LIB "poly.lib"; |
---|
| 28 | LIB "primdec.lib"; |
---|
| 29 | /////////////////////////////////////////////////////////////////////////////// |
---|
[065ddc] | 30 | proc ncdetection() |
---|
| 31 | "USAGE: ncdetection(); |
---|
| 32 | RETURN: ideal, representing an involution map |
---|
| 33 | PURPOSE: compute classical involutions (i.e. acting rather on operators than on variables) for some particular noncommutative algebras |
---|
[d41540] | 34 | ASSUME: the procedure is aimed at non-commutative algebras with differential, shift or advance operators arising in Control Theory. |
---|
| 35 | It has to be executed in a ring. |
---|
[3c4dcc] | 36 | EXAMPLE: example ncdetection; shows an example |
---|
| 37 | "{ |
---|
| 38 | // in this procedure an involution map is generated from the NCRelations |
---|
| 39 | // that will be used in the function involution |
---|
| 40 | // in dieser proc. wird eine matrix erzeugt, die in der i-ten zeile die indices |
---|
| 41 | // der differential-, shift- oder advance-operatoren enthaelt mit denen die i-te |
---|
| 42 | // variable nicht kommutiert. |
---|
[065ddc] | 43 | if ( nameof(basering)=="basering" ) |
---|
| 44 | { |
---|
| 45 | "No current ring defined."; |
---|
| 46 | return(ideal(0)); |
---|
| 47 | } |
---|
| 48 | def r = basering; |
---|
| 49 | setring r; |
---|
[3c4dcc] | 50 | int i,j,k,LExp; |
---|
| 51 | int NVars = nvars(r); |
---|
[1fdee9] | 52 | matrix rel = ncRelations(r)[2]; |
---|
[3c4dcc] | 53 | intmat M[NVars][3]; |
---|
| 54 | int NRows = nrows(rel); |
---|
| 55 | intvec v,w; |
---|
| 56 | poly d,d_lead; |
---|
| 57 | ideal I; |
---|
| 58 | map theta; |
---|
| 59 | for( j=NRows; j>=2; j-- ) |
---|
| 60 | { |
---|
| 61 | if( rel[j] == w ) //the whole column is zero |
---|
| 62 | { |
---|
| 63 | j--; |
---|
| 64 | continue; |
---|
| 65 | } |
---|
| 66 | for( i=1; i<j; i++ ) |
---|
| 67 | { |
---|
| 68 | if( rel[i,j]==1 ) //relation of type var(j)*var(i) = var(i)*var(j) +1 |
---|
| 69 | { |
---|
| 70 | M[i,1]=j; |
---|
| 71 | } |
---|
| 72 | if( rel[i,j] == -1 ) //relation of type var(i)*var(j) = var(j)*var(i) -1 |
---|
| 73 | { |
---|
| 74 | M[j,1]=i; |
---|
| 75 | } |
---|
| 76 | d = rel[i,j]; |
---|
| 77 | d_lead = lead(d); |
---|
| 78 | v = leadexp(d_lead); //in the next lines we check wether we have a relation of differential or shift type |
---|
| 79 | LExp=0; |
---|
| 80 | for(k=1; k<=NVars; k++) |
---|
| 81 | { |
---|
| 82 | LExp = LExp + v[k]; |
---|
| 83 | } |
---|
| 84 | // if( (d-d_lead != 0) || (LExp > 1) ) |
---|
| 85 | if ( ( (d-d_lead) != 0) || (LExp > 1) || ( (LExp==0) && ((d_lead>1) || (d_lead<-1)) ) ) |
---|
| 86 | { |
---|
| 87 | return(theta); |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | if( v[j] == 1) //relation of type var(j)*var(i) = var(i)*var(j) -lambda*var(j) |
---|
| 91 | { |
---|
| 92 | if (leadcoef(d) < 0) |
---|
| 93 | { |
---|
| 94 | M[i,2] = j; |
---|
| 95 | } |
---|
| 96 | else |
---|
| 97 | { |
---|
| 98 | M[i,3] = j; |
---|
| 99 | } |
---|
| 100 | } |
---|
| 101 | if( v[i]==1 ) //relation of type var(j)*var(i) = var(i)*var(j) -lambda*var(i) |
---|
| 102 | { |
---|
| 103 | if (leadcoef(d) > 0) |
---|
| 104 | { |
---|
| 105 | M[j,2] = i; |
---|
| 106 | } |
---|
| 107 | else |
---|
| 108 | { |
---|
| 109 | M[j,3] = i; |
---|
| 110 | } |
---|
| 111 | } |
---|
| 112 | } |
---|
| 113 | } |
---|
| 114 | // from here on, the map is computed |
---|
| 115 | for(i=1;i<=NVars;i++) |
---|
| 116 | { |
---|
| 117 | I=I+var(i); |
---|
| 118 | } |
---|
| 119 | |
---|
| 120 | for(i=1;i<=NVars;i++) |
---|
| 121 | { |
---|
| 122 | if( M[i,1..3]==(0,0,0) ) |
---|
| 123 | { |
---|
| 124 | i++; |
---|
| 125 | continue; |
---|
| 126 | } |
---|
| 127 | if( M[i,1]!=0 ) |
---|
| 128 | { |
---|
| 129 | if( (M[i,2]!=0) && (M[i,3]!=0) ) |
---|
| 130 | { |
---|
| 131 | I[M[i,1]] = -var(M[i,1]); |
---|
| 132 | I[M[i,2]] = var(M[i,3]); |
---|
| 133 | I[M[i,3]] = var(M[i,2]); |
---|
| 134 | } |
---|
| 135 | if( (M[i,2]==0) && (M[i,3]==0) ) |
---|
| 136 | { |
---|
| 137 | I[M[i,1]] = -var(M[i,1]); |
---|
| 138 | } |
---|
| 139 | if( ( (M[i,2]!=0) && (M[i,3]==0) )|| ( (M[i,2]!=0) && (M[i,3]==0) ) |
---|
| 140 | ) |
---|
| 141 | { |
---|
| 142 | I[i] = -var(i); |
---|
| 143 | } |
---|
| 144 | } |
---|
| 145 | else |
---|
| 146 | { |
---|
| 147 | if( (M[i,2]!=0) && (M[i,3]!=0) ) |
---|
| 148 | { |
---|
| 149 | I[i] = -var(i); |
---|
| 150 | I[M[i,2]] = var(M[i,3]); |
---|
| 151 | I[M[i,3]] = var(M[i,2]); |
---|
| 152 | } |
---|
| 153 | else |
---|
| 154 | { |
---|
| 155 | I[i] = -var(i); |
---|
| 156 | } |
---|
| 157 | } |
---|
| 158 | } |
---|
| 159 | return(I); |
---|
| 160 | } |
---|
| 161 | example |
---|
| 162 | { |
---|
| 163 | "EXAMPLE:"; echo = 2; |
---|
[7ea9a58] | 164 | ring R = 0,(x,y,z,D(1..3)),dp; |
---|
[3c4dcc] | 165 | matrix D[6][6]; |
---|
| 166 | D[1,4]=1; D[2,5]=1; D[3,6]=1; |
---|
[7ea9a58] | 167 | def r = nc_algebra(1,D); setring r; |
---|
[065ddc] | 168 | ncdetection(); |
---|
[7ea9a58] | 169 | kill r, R; |
---|
[3c4dcc] | 170 | //---------------------------------------- |
---|
[7ea9a58] | 171 | ring R=0,(x,S),dp; |
---|
| 172 | def r = nc_algebra(1,-S); setring r; |
---|
[065ddc] | 173 | ncdetection(); |
---|
[7ea9a58] | 174 | kill r, R; |
---|
[3c4dcc] | 175 | //---------------------------------------- |
---|
[7ea9a58] | 176 | ring R=0,(x,D(1),S),dp; |
---|
[3c4dcc] | 177 | matrix D[3][3]; |
---|
| 178 | D[1,2]=1; D[1,3]=-S; |
---|
[7ea9a58] | 179 | def r = nc_algebra(1,D); setring r; |
---|
[065ddc] | 180 | ncdetection(); |
---|
[3c4dcc] | 181 | } |
---|
| 182 | |
---|
| 183 | static proc In_Poly(poly mm, list l, int NVars) |
---|
[3754ca] | 184 | // applies the involution to the polynomial mm |
---|
[3c4dcc] | 185 | // entries of a list l are images of variables under invo |
---|
| 186 | // more general than invo_poly; used in many rings setting |
---|
| 187 | { |
---|
| 188 | int i,j; |
---|
| 189 | intvec v; |
---|
| 190 | poly pp, zz; |
---|
| 191 | poly nn = 0; |
---|
| 192 | i = 1; |
---|
| 193 | while(mm[i]!=0) |
---|
| 194 | { |
---|
| 195 | v = leadexp(mm[i]); |
---|
| 196 | zz = 1; |
---|
| 197 | for( j=NVars; j>=1; j--) |
---|
| 198 | { |
---|
| 199 | if (v[j]!=0) |
---|
| 200 | { |
---|
| 201 | pp = l[j]; |
---|
| 202 | zz = zz*(pp^v[j]); |
---|
| 203 | } |
---|
| 204 | } |
---|
| 205 | nn = nn + (leadcoef(mm[i])*zz); |
---|
| 206 | i++; |
---|
| 207 | } |
---|
| 208 | return(nn); |
---|
| 209 | } |
---|
| 210 | |
---|
| 211 | static proc Hom_Poly(poly mm, list l, int NVars) |
---|
[3754ca] | 212 | // applies the endomorphism to the polynomial mm |
---|
[3c4dcc] | 213 | // entries of a list l are images of variables under endo |
---|
| 214 | // should not be replaced by map-based stuff! used in |
---|
| 215 | // many rings setting |
---|
| 216 | { |
---|
| 217 | int i,j; |
---|
| 218 | intvec v; |
---|
| 219 | poly pp, zz; |
---|
| 220 | poly nn = 0; |
---|
| 221 | i = 1; |
---|
| 222 | while(mm[i]!=0) |
---|
| 223 | { |
---|
| 224 | v = leadexp(mm[i]); |
---|
| 225 | zz = 1; |
---|
| 226 | for( j=NVars; j>=1; j--) |
---|
| 227 | { |
---|
| 228 | if (v[j]!=0) |
---|
| 229 | { |
---|
| 230 | pp = l[j]; |
---|
| 231 | zz = (pp^v[j])*zz; |
---|
| 232 | } |
---|
| 233 | } |
---|
| 234 | nn = nn + (leadcoef(mm[i])*zz); |
---|
| 235 | i++; |
---|
| 236 | } |
---|
| 237 | return(nn); |
---|
| 238 | } |
---|
| 239 | |
---|
| 240 | static proc invo_poly(poly m, map theta) |
---|
| 241 | // applies the involution map theta to m, where m=polynomial |
---|
| 242 | { |
---|
| 243 | // compatibility: |
---|
| 244 | ideal l = ideal(theta); |
---|
| 245 | int i; |
---|
| 246 | list L; |
---|
| 247 | for (i=1; i<=size(l); i++) |
---|
| 248 | { |
---|
| 249 | L[i] = l[i]; |
---|
| 250 | } |
---|
| 251 | int nv = nvars(basering); |
---|
| 252 | return (In_Poly(m,L,nv)); |
---|
| 253 | // if (m==0) { return(m); } |
---|
| 254 | // int i,j; |
---|
| 255 | // intvec v; |
---|
| 256 | // poly p,z; |
---|
| 257 | // poly n = 0; |
---|
| 258 | // i = 1; |
---|
| 259 | // while(m[i]!=0) |
---|
| 260 | // { |
---|
| 261 | // v = leadexp(m[i]); |
---|
| 262 | // z =1; |
---|
| 263 | // for(j=nvars(basering); j>=1; j--) |
---|
| 264 | // { |
---|
| 265 | // if (v[j]!=0) |
---|
| 266 | // { |
---|
| 267 | // p = var(j); |
---|
| 268 | // p = theta(p); |
---|
| 269 | // z = z*(p^v[j]); |
---|
| 270 | // } |
---|
| 271 | // } |
---|
| 272 | // n = n + (leadcoef(m[i])*z); |
---|
| 273 | // i++; |
---|
| 274 | // } |
---|
| 275 | // return(n); |
---|
| 276 | } |
---|
| 277 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 278 | proc involution(m, map theta) |
---|
| 279 | "USAGE: involution(m, theta); m is a poly/vector/ideal/matrix/module, theta is a map |
---|
| 280 | RETURN: object of the same type as m |
---|
[065ddc] | 281 | PURPOSE: applies the involution, presented by theta to the object m |
---|
| 282 | THEORY: for an involution theta and two polynomials a,b from the algebra, theta(ab) = theta(b) theta(a); theta is linear with respect to the ground field |
---|
[d41540] | 283 | NOTE: This is generalized ''theta(m)'' for data types unsupported by ''map''. |
---|
[3c4dcc] | 284 | EXAMPLE: example involution; shows an example |
---|
| 285 | "{ |
---|
| 286 | // applies the involution map theta to m, |
---|
| 287 | // where m= vector, polynomial, module, matrix, ideal |
---|
| 288 | int i,j; |
---|
| 289 | intvec v; |
---|
| 290 | poly p,z; |
---|
| 291 | if (typeof(m)=="poly") |
---|
| 292 | { |
---|
| 293 | return (invo_poly(m,theta)); |
---|
| 294 | } |
---|
| 295 | if ( typeof(m)=="ideal" ) |
---|
| 296 | { |
---|
| 297 | ideal n; |
---|
| 298 | for (i=1; i<=size(m); i++) |
---|
| 299 | { |
---|
| 300 | n[i] = invo_poly(m[i], theta); |
---|
| 301 | } |
---|
| 302 | return(n); |
---|
| 303 | } |
---|
| 304 | if (typeof(m)=="vector") |
---|
| 305 | { |
---|
| 306 | for(i=1; i<=size(m); i++) |
---|
| 307 | { |
---|
| 308 | m[i] = invo_poly(m[i], theta); |
---|
| 309 | } |
---|
| 310 | return (m); |
---|
| 311 | } |
---|
| 312 | if ( (typeof(m)=="matrix") || (typeof(m)=="module")) |
---|
| 313 | { |
---|
| 314 | matrix n = matrix(m); |
---|
| 315 | int @R=nrows(n); |
---|
| 316 | int @C=ncols(n); |
---|
| 317 | for(i=1; i<=@R; i++) |
---|
| 318 | { |
---|
| 319 | for(j=1; j<=@C; j++) |
---|
| 320 | { |
---|
| 321 | if (m[i,j]!=0) |
---|
| 322 | { |
---|
| 323 | n[i,j] = invo_poly( m[i,j], theta); |
---|
| 324 | } |
---|
| 325 | } |
---|
| 326 | } |
---|
| 327 | if (typeof(m)=="module") |
---|
| 328 | { |
---|
| 329 | return (module(n)); |
---|
| 330 | } |
---|
| 331 | else // matrix |
---|
| 332 | { |
---|
| 333 | return(n); |
---|
| 334 | } |
---|
| 335 | } |
---|
| 336 | // if m is not of the supported type: |
---|
| 337 | "Error: unsupported argument type!"; |
---|
| 338 | return(); |
---|
| 339 | } |
---|
| 340 | example |
---|
| 341 | { |
---|
| 342 | "EXAMPLE:";echo = 2; |
---|
[7ea9a58] | 343 | ring R = 0,(x,d),dp; |
---|
| 344 | def r = nc_algebra(1,1); setring r; // Weyl-Algebra |
---|
[3c4dcc] | 345 | map F = r,x,-d; |
---|
[d41540] | 346 | F(F); // should be maxideal(1) for an involution |
---|
[3c4dcc] | 347 | poly f = x*d^2+d; |
---|
| 348 | poly If = involution(f,F); |
---|
| 349 | f-If; |
---|
| 350 | poly g = x^2*d+2*x*d+3*x+7*d; |
---|
| 351 | poly tg = -d*x^2-2*d*x+3*x-7*d; |
---|
| 352 | poly Ig = involution(g,F); |
---|
| 353 | tg-Ig; |
---|
| 354 | ideal I = f,g; |
---|
| 355 | ideal II = involution(I,F); |
---|
| 356 | II; |
---|
| 357 | I - involution(II,F); |
---|
| 358 | module M = [f,g,0],[g,0,x^2*d]; |
---|
| 359 | module IM = involution(M,F); |
---|
| 360 | print(IM); |
---|
| 361 | print(M - involution(IM,F)); |
---|
| 362 | } |
---|
| 363 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 364 | static proc new_var() |
---|
| 365 | //generates a string of new variables |
---|
| 366 | { |
---|
| 367 | |
---|
| 368 | int NVars=nvars(basering); |
---|
| 369 | int i,j; |
---|
[1fdee9] | 370 | // string s="@_1_1"; |
---|
| 371 | string s="a11"; |
---|
[3c4dcc] | 372 | for(i=1; i<=NVars; i++) |
---|
| 373 | { |
---|
| 374 | for(j=1; j<=NVars; j++) |
---|
| 375 | { |
---|
| 376 | if(i*j!=1) |
---|
| 377 | { |
---|
| 378 | s = s+ ","+NVAR(i,j); |
---|
| 379 | }; |
---|
| 380 | }; |
---|
| 381 | }; |
---|
| 382 | return(s); |
---|
| 383 | }; |
---|
| 384 | |
---|
| 385 | static proc NVAR(int i, int j) |
---|
| 386 | { |
---|
[1fdee9] | 387 | // return("@_"+string(i)+"_"+string(j)); |
---|
| 388 | return("a"+string(i)+string(j)); |
---|
[3c4dcc] | 389 | }; |
---|
| 390 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 391 | static proc new_var_special() |
---|
| 392 | //generates a string of new variables |
---|
| 393 | { |
---|
| 394 | int NVars=nvars(basering); |
---|
| 395 | int i; |
---|
[1fdee9] | 396 | // string s="@_1_1"; |
---|
| 397 | string s="a11"; |
---|
[3c4dcc] | 398 | for(i=2; i<=NVars; i++) |
---|
| 399 | { |
---|
| 400 | s = s+ ","+NVAR(i,i); |
---|
| 401 | }; |
---|
| 402 | return(s); |
---|
| 403 | }; |
---|
| 404 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 405 | static proc RelMatr() |
---|
| 406 | // returns the matrix of relations |
---|
| 407 | // only Lie-type relations x_j x_i= x_i x_j + .. are taken into account |
---|
| 408 | { |
---|
| 409 | int i,j; |
---|
| 410 | int NVars = nvars(basering); |
---|
| 411 | matrix Rel[NVars][NVars]; |
---|
| 412 | for(i=1; i<NVars; i++) |
---|
| 413 | { |
---|
| 414 | for(j=i+1; j<=NVars; j++) |
---|
| 415 | { |
---|
| 416 | Rel[i,j]=var(j)*var(i)-var(i)*var(j); |
---|
| 417 | }; |
---|
| 418 | }; |
---|
| 419 | return(Rel); |
---|
| 420 | }; |
---|
| 421 | ///////////////////////////////////////////////////////////////// |
---|
[1fdee9] | 422 | proc findInvo() |
---|
| 423 | "USAGE: findInvo(); |
---|
[065ddc] | 424 | RETURN: a ring containing a list L of pairs, where |
---|
[d41540] | 425 | @* L[i][1] = ideal; a Groebner Basis of an i-th associated prime, |
---|
[3c4dcc] | 426 | @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] |
---|
[065ddc] | 427 | PURPOSE: computed the ideal of linear involutions of the basering |
---|
[3c4dcc] | 428 | NOTE: for convenience, the full ideal of relations @code{idJ} |
---|
[1fdee9] | 429 | and the initial matrix with indeterminates @code{matD} are exported in the output ring |
---|
| 430 | SEE ALSO: findInvoDiag, involution |
---|
| 431 | EXAMPLE: example findInvo; shows examples |
---|
| 432 | |
---|
[3c4dcc] | 433 | "{ |
---|
| 434 | def @B = basering; //save the name of basering |
---|
| 435 | int NVars = nvars(@B); //number of variables in basering |
---|
| 436 | int i, j; |
---|
| 437 | |
---|
| 438 | matrix Rel = RelMatr(); //the matrix of relations |
---|
| 439 | |
---|
[fa19d3] | 440 | string @ss = new_var(); //string of new variables |
---|
[3c4dcc] | 441 | string Par = parstr(@B); //string of parameters in old ring |
---|
| 442 | |
---|
| 443 | if (Par=="") // if there are no parameters |
---|
| 444 | { |
---|
[7ea9a58] | 445 | execute("ring @@@KK=0,("+varstr(@B)+","+@ss+"), dp;"); //new ring with new variables |
---|
[3c4dcc] | 446 | } |
---|
| 447 | else //if there exist parameters |
---|
| 448 | { |
---|
[7ea9a58] | 449 | execute("ring @@@KK=(0,"+Par+") ,("+varstr(@B)+","+@ss+"), dp;");//new ring with new variables |
---|
[3c4dcc] | 450 | }; |
---|
| 451 | |
---|
| 452 | matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring |
---|
| 453 | |
---|
| 454 | int Sz = NVars*NVars+NVars; // number of variables in new ring |
---|
| 455 | |
---|
| 456 | matrix M[Sz][Sz]; //to be the matrix of relations in new ring |
---|
| 457 | |
---|
| 458 | for(i=1; i<NVars; i++) //initialize that matrix of relations |
---|
| 459 | { |
---|
| 460 | for(j=i+1; j<=NVars; j++) |
---|
| 461 | { |
---|
| 462 | M[i,j] = Rel[i,j]; |
---|
| 463 | }; |
---|
| 464 | }; |
---|
| 465 | |
---|
[7ea9a58] | 466 | def @@K = nc_algebra(1, M); setring @@K; //now new ring @@K become a noncommutative ring |
---|
[3c4dcc] | 467 | |
---|
| 468 | list l; //list to define an involution |
---|
| 469 | poly @@F; |
---|
| 470 | for(i=1; i<=NVars; i++) //initializing list for involution |
---|
| 471 | { |
---|
| 472 | @@F=0; |
---|
| 473 | for(j=1; j<=NVars; j++) |
---|
| 474 | { |
---|
| 475 | execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" ); |
---|
| 476 | }; |
---|
| 477 | l=l+list(@@F); |
---|
| 478 | }; |
---|
| 479 | |
---|
[90dd0db] | 480 | matrix N = imap(@@@KK,Rel); |
---|
[3c4dcc] | 481 | |
---|
| 482 | for(i=1; i<NVars; i++)//get matrix by applying the involution to relations |
---|
| 483 | { |
---|
| 484 | for(j=i+1; j<=NVars; j++) |
---|
| 485 | { |
---|
| 486 | N[i,j]= l[j]*l[i] - l[i]*l[j] + In_Poly( N[i,j], l, NVars); |
---|
| 487 | }; |
---|
| 488 | }; |
---|
| 489 | kill l; |
---|
| 490 | //--------------------------------------------- |
---|
| 491 | //get the ideal of coefficients of N |
---|
| 492 | ideal J; |
---|
| 493 | ideal idN = simplify(ideal(N),2); |
---|
| 494 | J = ideal(coeffs( idN, var(1) ) ); |
---|
| 495 | for(i=2; i<=NVars; i++) |
---|
| 496 | { |
---|
| 497 | J = ideal( coeffs( J, var(i) ) ); |
---|
| 498 | }; |
---|
| 499 | J = simplify(J,2); |
---|
| 500 | //------------------------------------------------- |
---|
| 501 | if ( Par=="" ) //initializes the ring of relations |
---|
| 502 | { |
---|
[fa19d3] | 503 | execute("ring @@KK=0,("+@ss+"), dp;"); |
---|
[3c4dcc] | 504 | } |
---|
| 505 | else |
---|
| 506 | { |
---|
[fa19d3] | 507 | execute("ring @@KK=(0,"+Par+"),("+@ss+"), dp;"); |
---|
[3c4dcc] | 508 | }; |
---|
| 509 | ideal J = imap(@@K,J); // ideal, considered in @@KK now |
---|
| 510 | string snv = "["+string(NVars)+"]"; |
---|
[fa19d3] | 511 | execute("matrix @@D"+snv+snv+"="+@ss+";"); // matrix with entries=new variables |
---|
[3c4dcc] | 512 | |
---|
| 513 | J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity |
---|
| 514 | J = simplify(J,2); // without extra zeros |
---|
| 515 | list mL = minAssGTZ(J); // components not in GB |
---|
| 516 | int sL = size(mL); |
---|
| 517 | option(redSB); // important for reduced GBs |
---|
| 518 | option(redTail); |
---|
| 519 | matrix IM = @@D; // involution map |
---|
| 520 | list L = list(); // the answer |
---|
| 521 | list TL; |
---|
| 522 | ideal tmp = 0; |
---|
| 523 | for (i=1; i<=sL; i++) // compute GBs of components |
---|
| 524 | { |
---|
| 525 | TL = list(); |
---|
| 526 | TL[1] = std(mL[i]); |
---|
| 527 | tmp = NF( ideal(IM), TL[1] ); |
---|
| 528 | TL[2] = matrix(tmp, NVars,NVars); |
---|
| 529 | L[i] = TL; |
---|
| 530 | } |
---|
| 531 | export(L); // main export |
---|
| 532 | ideal idJ = J; // debug-comfortable exports |
---|
| 533 | matrix matD = @@D; |
---|
| 534 | export(idJ); |
---|
| 535 | export(matD); |
---|
| 536 | return(@@KK); |
---|
| 537 | } |
---|
| 538 | example |
---|
| 539 | { "EXAMPLE:"; echo = 2; |
---|
[3d7b7f] | 540 | def a = makeWeyl(1); |
---|
| 541 | setring a; // this algebra is a first Weyl algebra |
---|
[d41540] | 542 | a; |
---|
[3d7b7f] | 543 | def X = findInvo(); |
---|
| 544 | setring X; // ring with new variables, corr. to unknown coefficients |
---|
[d41540] | 545 | X; |
---|
[3d7b7f] | 546 | L; |
---|
| 547 | // look at the matrix in the new variables, defining the linear involution |
---|
| 548 | print(L[1][2]); |
---|
| 549 | L[1][1]; // where new variables obey these relations |
---|
[d41540] | 550 | idJ; |
---|
[3c4dcc] | 551 | } |
---|
| 552 | /////////////////////////////////////////////////////////////////////////// |
---|
[1fdee9] | 553 | proc findInvoDiag() |
---|
| 554 | "USAGE: findInvoDiag(); |
---|
[3c4dcc] | 555 | RETURN: a ring together with a list of pairs L, where |
---|
[d41540] | 556 | @* L[i][1] = ideal; a Groebner Basis of an i-th associated prime, |
---|
[3c4dcc] | 557 | @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] |
---|
[d41540] | 558 | PURPOSE: compute homothetic (diagonal) involutions of the basering |
---|
[3c4dcc] | 559 | NOTE: for convenience, the full ideal of relations @code{idJ} |
---|
[1fdee9] | 560 | and the initial matrix with indeterminates @code{matD} are exported in the output ring |
---|
| 561 | SEE ALSO: findInvo, involution |
---|
| 562 | EXAMPLE: example findInvoDiag; shows examples |
---|
[3c4dcc] | 563 | "{ |
---|
| 564 | def @B = basering; //save the name of basering |
---|
| 565 | int NVars = nvars(@B); //number of variables in basering |
---|
| 566 | int i, j; |
---|
| 567 | |
---|
| 568 | matrix Rel = RelMatr(); //the matrix of relations |
---|
| 569 | |
---|
[fa19d3] | 570 | string @ss = new_var_special(); //string of new variables |
---|
[3c4dcc] | 571 | string Par = parstr(@B); //string of parameters in old ring |
---|
| 572 | |
---|
| 573 | if (Par=="") // if there are no parameters |
---|
| 574 | { |
---|
[7ea9a58] | 575 | execute("ring @@@KK=0,("+varstr(@B)+","+@ss+"), dp;"); //new ring with new variables |
---|
[3c4dcc] | 576 | } |
---|
| 577 | else //if there exist parameters |
---|
| 578 | { |
---|
[7ea9a58] | 579 | execute("ring @@@KK=(0,"+Par+") ,("+varstr(@B)+","+@ss+"), dp;");//new ring with new variables |
---|
[3c4dcc] | 580 | }; |
---|
| 581 | |
---|
| 582 | matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring |
---|
| 583 | |
---|
| 584 | int Sz = 2*NVars; // number of variables in new ring |
---|
| 585 | |
---|
| 586 | matrix M[Sz][Sz]; //to be the matrix of relations in new ring |
---|
| 587 | for(i=1; i<NVars; i++) //initialize that matrix of relations |
---|
| 588 | { |
---|
| 589 | for(j=i+1; j<=NVars; j++) |
---|
| 590 | { |
---|
| 591 | M[i,j] = Rel[i,j]; |
---|
| 592 | }; |
---|
| 593 | }; |
---|
| 594 | |
---|
[7ea9a58] | 595 | def @@K = nc_algebra(1, M); setring @@K; //now new ring @@K become a noncommutative ring |
---|
[3c4dcc] | 596 | |
---|
| 597 | list l; //list to define an involution |
---|
| 598 | |
---|
| 599 | for(i=1; i<=NVars; i++) //initializing list for involution |
---|
| 600 | { |
---|
| 601 | execute( "l["+string(i)+"]="+NVAR(i,i)+"*"+string( var(i) )+";" ); |
---|
| 602 | |
---|
| 603 | }; |
---|
[90dd0db] | 604 | matrix N = imap(@@@KK,Rel); |
---|
[3c4dcc] | 605 | |
---|
| 606 | for(i=1; i<NVars; i++)//get matrix by applying the involution to relations |
---|
| 607 | { |
---|
| 608 | for(j=i+1; j<=NVars; j++) |
---|
| 609 | { |
---|
| 610 | N[i,j]= l[j]*l[i] - l[i]*l[j] + In_Poly( N[i,j], l, NVars); |
---|
| 611 | }; |
---|
| 612 | }; |
---|
| 613 | kill l; |
---|
| 614 | //--------------------------------------------- |
---|
| 615 | //get the ideal of coefficients of N |
---|
| 616 | |
---|
| 617 | ideal J; |
---|
| 618 | ideal idN = simplify(ideal(N),2); |
---|
| 619 | J = ideal(coeffs( idN, var(1) ) ); |
---|
| 620 | for(i=2; i<=NVars; i++) |
---|
| 621 | { |
---|
| 622 | J = ideal( coeffs( J, var(i) ) ); |
---|
| 623 | }; |
---|
| 624 | J = simplify(J,2); |
---|
| 625 | //------------------------------------------------- |
---|
| 626 | |
---|
| 627 | if ( Par=="" ) //initializes the ring of relations |
---|
| 628 | { |
---|
[fa19d3] | 629 | execute("ring @@KK=0,("+@ss+"), dp;"); |
---|
[3c4dcc] | 630 | } |
---|
| 631 | else |
---|
| 632 | { |
---|
[fa19d3] | 633 | execute("ring @@KK=(0,"+Par+"),("+@ss+"), dp;"); |
---|
[3c4dcc] | 634 | }; |
---|
| 635 | |
---|
| 636 | ideal J = imap(@@K,J); // ideal, considered in @@KK now |
---|
| 637 | |
---|
| 638 | matrix @@D[NVars][NVars]; // matrix with entries=new variables to square i.e. @@D=@@D^2 |
---|
| 639 | for(i=1;i<=NVars;i++) |
---|
| 640 | { |
---|
| 641 | execute("@@D["+string(i)+","+string(i)+"]="+NVAR(i,i)+";"); |
---|
| 642 | }; |
---|
| 643 | J = J, ideal( @@D*@@D - matrix( freemodule(NVars) ) ); // add the condition that involution to square is just identity |
---|
| 644 | J = simplify(J,2); // without extra zeros |
---|
| 645 | |
---|
| 646 | list mL = minAssGTZ(J); // components not in GB |
---|
| 647 | int sL = size(mL); |
---|
| 648 | option(redSB); // important for reduced GBs |
---|
| 649 | option(redTail); |
---|
| 650 | matrix IM = @@D; // involution map |
---|
| 651 | list L = list(); // the answer |
---|
| 652 | list TL; |
---|
| 653 | ideal tmp = 0; |
---|
| 654 | for (i=1; i<=sL; i++) // compute GBs of components |
---|
| 655 | { |
---|
| 656 | TL = list(); |
---|
| 657 | TL[1] = std(mL[i]); |
---|
| 658 | tmp = NF( ideal(IM), TL[1] ); |
---|
| 659 | TL[2] = matrix(tmp, NVars,NVars); |
---|
| 660 | L[i] = TL; |
---|
| 661 | } |
---|
| 662 | export(L); |
---|
| 663 | ideal idJ = J; // debug-comfortable exports |
---|
| 664 | matrix matD = @@D; |
---|
| 665 | export(idJ); |
---|
| 666 | export(matD); |
---|
| 667 | return(@@KK); |
---|
| 668 | } |
---|
| 669 | example |
---|
| 670 | { "EXAMPLE:"; echo = 2; |
---|
[3d7b7f] | 671 | def a = makeWeyl(1); |
---|
| 672 | setring a; // this algebra is a first Weyl algebra |
---|
[d41540] | 673 | a; |
---|
[3d7b7f] | 674 | def X = findInvoDiag(); |
---|
| 675 | setring X; // ring with new variables, corresponding to unknown coefficients |
---|
[d41540] | 676 | X; |
---|
[3d7b7f] | 677 | // print matrices, defining linear involutions |
---|
| 678 | print(L[1][2]); // a first matrix: we see it is constant |
---|
| 679 | print(L[2][2]); // and a second possible matrix; it is constant too |
---|
| 680 | L; // let us take a look on the whole list |
---|
[d41540] | 681 | idJ; |
---|
[3c4dcc] | 682 | } |
---|
| 683 | ///////////////////////////////////////////////////////////////////// |
---|
[f620218] | 684 | proc findAuto(int n) |
---|
| 685 | "USAGE: findAuto(n); n an integer |
---|
[3c4dcc] | 686 | RETURN: a ring together with a list of pairs L, where |
---|
[d41540] | 687 | @* L[i][1] = ideal; a Groebner Basis of an i-th associated prime, |
---|
[3c4dcc] | 688 | @* L[i][2] = matrix, defining a linear map, with entries, reduced with respect to L[i][1] |
---|
[d41540] | 689 | PURPOSE: compute the ideal of linear automorphisms of the basering, given by a matrix, n-th power of which gives identity (i.e. unipotent matrix) |
---|
[7e6727c] | 690 | NOTE: if n=0, a matrix, defining an automorphism is not assumed to be unipotent but just non-degenerate. A nonzero parameter @code{@@p} is introduced as the value of the determinant of the matrix above. |
---|
[3d7b7f] | 691 | @* For convenience, the full ideal of relations @code{idJ} and the initial matrix with indeterminates @code{matD} are mutually exported in the output ring |
---|
[1fdee9] | 692 | SEE ALSO: findInvo |
---|
| 693 | EXAMPLE: example findAuto; shows examples |
---|
[3c4dcc] | 694 | "{ |
---|
[f620218] | 695 | if ((n<0 ) || (n==1)) |
---|
| 696 | { |
---|
| 697 | "The index of unipotency is too small."; |
---|
| 698 | return(0); |
---|
| 699 | } |
---|
[3c4dcc] | 700 | def @B = basering; //save the name of basering |
---|
| 701 | int NVars = nvars(@B); //number of variables in basering |
---|
| 702 | int i, j; |
---|
| 703 | |
---|
| 704 | matrix Rel = RelMatr(); //the matrix of relations |
---|
| 705 | |
---|
[3d7b7f] | 706 | string @ss = new_var(); //string of new variables |
---|
[3c4dcc] | 707 | string Par = parstr(@B); //string of parameters in old ring |
---|
| 708 | |
---|
| 709 | if (Par=="") // if there are no parameters |
---|
| 710 | { |
---|
[7ea9a58] | 711 | execute("ring @@@K=0,("+varstr(@B)+","+@ss+"), dp;"); //new ring with new variables |
---|
[3c4dcc] | 712 | } |
---|
| 713 | else //if there exist parameters |
---|
| 714 | { |
---|
[7ea9a58] | 715 | execute("ring @@@K=(0,"+Par+") ,("+varstr(@B)+","+@ss+"), dp;");//new ring with new variables |
---|
[3c4dcc] | 716 | }; |
---|
| 717 | |
---|
| 718 | matrix Rel = imap(@B, Rel); //consider the matrix of relations in new ring |
---|
| 719 | |
---|
| 720 | int Sz = NVars*NVars+NVars; // number of variables in new ring |
---|
| 721 | |
---|
| 722 | matrix M[Sz][Sz]; //to be the matrix of relations in new ring |
---|
| 723 | |
---|
| 724 | for(i=1; i<NVars; i++) //initialize that matrix of relations |
---|
| 725 | { |
---|
| 726 | for(j=i+1; j<=NVars; j++) |
---|
| 727 | { |
---|
| 728 | M[i,j] = Rel[i,j]; |
---|
| 729 | }; |
---|
| 730 | }; |
---|
| 731 | |
---|
[7ea9a58] | 732 | def @@K = nc_algebra(1, M); setring @@K; //now new ring @@K become a noncommutative ring |
---|
[3c4dcc] | 733 | |
---|
| 734 | list l; //list to define a homomorphism(isomorphism) |
---|
| 735 | poly @@F; |
---|
| 736 | for(i=1; i<=NVars; i++) //initializing list for involution |
---|
| 737 | { |
---|
| 738 | @@F=0; |
---|
| 739 | for(j=1; j<=NVars; j++) |
---|
| 740 | { |
---|
| 741 | execute( "@@F = @@F+"+NVAR(i,j)+"*"+string( var(j) )+";" ); |
---|
| 742 | }; |
---|
| 743 | l=l+list(@@F); |
---|
| 744 | }; |
---|
| 745 | |
---|
[90dd0db] | 746 | matrix N = imap(@@@K,Rel); |
---|
[3c4dcc] | 747 | |
---|
| 748 | for(i=1; i<NVars; i++)//get matrix by applying the homomorphism to relations |
---|
| 749 | { |
---|
| 750 | for(j=i+1; j<=NVars; j++) |
---|
| 751 | { |
---|
| 752 | N[i,j]= l[j]*l[i] - l[i]*l[j] - Hom_Poly( N[i,j], l, NVars); |
---|
| 753 | }; |
---|
| 754 | }; |
---|
| 755 | kill l; |
---|
| 756 | //--------------------------------------------- |
---|
| 757 | //get the ideal of coefficients of N |
---|
| 758 | ideal J; |
---|
| 759 | ideal idN = simplify(ideal(N),2); |
---|
| 760 | J = ideal(coeffs( idN, var(1) ) ); |
---|
| 761 | for(i=2; i<=NVars; i++) |
---|
| 762 | { |
---|
| 763 | J = ideal( coeffs( J, var(i) ) ); |
---|
| 764 | }; |
---|
| 765 | J = simplify(J,2); |
---|
| 766 | //------------------------------------------------- |
---|
[3d7b7f] | 767 | if (( Par=="" ) && (n!=0)) //initializes the ring of relations |
---|
[3c4dcc] | 768 | { |
---|
[3d7b7f] | 769 | execute("ring @@KK=0,("+@ss+"), dp;"); |
---|
[3c4dcc] | 770 | } |
---|
[3d7b7f] | 771 | if (( Par=="" ) && (n==0)) //initializes the ring of relations |
---|
[3c4dcc] | 772 | { |
---|
[3d7b7f] | 773 | execute("ring @@KK=(0,@p),("+@ss+"), dp;"); |
---|
| 774 | } |
---|
| 775 | if ( Par!="" ) |
---|
| 776 | { |
---|
| 777 | execute("ring @@KK=(0,"+Par+"),("+@ss+"), dp;"); |
---|
[3c4dcc] | 778 | }; |
---|
[3d7b7f] | 779 | // execute("setring @@KK;"); |
---|
| 780 | // basering; |
---|
[3c4dcc] | 781 | ideal J = imap(@@K,J); // ideal, considered in @@KK now |
---|
| 782 | string snv = "["+string(NVars)+"]"; |
---|
[3d7b7f] | 783 | execute("matrix @@D"+snv+snv+"="+@ss+";"); // matrix with entries=new variables |
---|
[3c4dcc] | 784 | |
---|
[f620218] | 785 | if (n>=2) |
---|
| 786 | { |
---|
| 787 | J = J, ideal( @@D*@@D-matrix( freemodule(NVars) ) ); // add the condition that homomorphism to square is just identity |
---|
| 788 | } |
---|
[3d7b7f] | 789 | if (n==0) |
---|
| 790 | { |
---|
| 791 | J = J, det(@@D)-@p; // det of non-unipotent matrix is nonzero |
---|
| 792 | } |
---|
[3c4dcc] | 793 | J = simplify(J,2); // without extra zeros |
---|
| 794 | list mL = minAssGTZ(J); // components not in GB |
---|
| 795 | int sL = size(mL); |
---|
| 796 | option(redSB); // important for reduced GBs |
---|
| 797 | option(redTail); |
---|
| 798 | matrix IM = @@D; // map |
---|
| 799 | list L = list(); // the answer |
---|
| 800 | list TL; |
---|
| 801 | ideal tmp = 0; |
---|
| 802 | for (i=1; i<=sL; i++)// compute GBs of components |
---|
| 803 | { |
---|
| 804 | TL = list(); |
---|
| 805 | TL[1] = std(mL[i]); |
---|
| 806 | tmp = NF( ideal(IM), TL[1] ); |
---|
| 807 | TL[2] = matrix(tmp,NVars, NVars); |
---|
| 808 | L[i] = TL; |
---|
| 809 | } |
---|
| 810 | export(L); |
---|
| 811 | ideal idJ = J; // debug-comfortable exports |
---|
| 812 | matrix matD = @@D; |
---|
| 813 | export(idJ); |
---|
| 814 | export(matD); |
---|
| 815 | return(@@KK); |
---|
| 816 | } |
---|
| 817 | example |
---|
| 818 | { "EXAMPLE:"; echo = 2; |
---|
[3d7b7f] | 819 | def a = makeWeyl(1); |
---|
| 820 | setring a; // this algebra is a first Weyl algebra |
---|
[d41540] | 821 | a; |
---|
| 822 | def X = findAuto(2); // in contrast to findInvo look for automorphisms |
---|
[3d7b7f] | 823 | setring X; // ring with new variables - unknown coefficients |
---|
[d41540] | 824 | X; |
---|
[3d7b7f] | 825 | size(L); // we have (size(L)) families in the answer |
---|
| 826 | // look at matrices, defining linear automorphisms: |
---|
| 827 | print(L[1][2]); // a first one: we see it is the identity |
---|
| 828 | print(L[2][2]); // and a second possible matrix; it is diagonal |
---|
| 829 | // L; // we can take a look on the whole list, too |
---|
[d41540] | 830 | idJ; |
---|
[3d7b7f] | 831 | kill X; kill a; |
---|
| 832 | //----------- find all the linear automorphisms -------------------- |
---|
| 833 | //----------- use the call findAuto(0) -------------------- |
---|
[7ea9a58] | 834 | ring R = 0,(x,s),dp; |
---|
| 835 | def r = nc_algebra(1,s); setring r; // the shift algebra |
---|
[3d7b7f] | 836 | s*x; // the only relation in the algebra is: |
---|
[a2c2031] | 837 | def Y = findAuto(0); |
---|
[3d7b7f] | 838 | setring Y; |
---|
| 839 | size(L); // here, we have 1 parametrized family |
---|
| 840 | print(L[1][2]); // here, @p is a nonzero parameter |
---|
[d41540] | 841 | det(L[1][2]-@p); // check whether determinante is zero |
---|
[3c4dcc] | 842 | } |
---|