################################################# 5-20-97 ## ## ## Dynkin is a Maple package which ## 1. draws the Dynkin diagram of a simple Lie ## algebra, ## 2. plots weight systems (in various ways) for rank ## 2 and 3 simple Lie algebras, ## 2. creates the basis matrices and structure constants ## for the classical Lie algebras. ## This package uses the plot, linalg packages and the ## coxeter, weyl packages in the Maple share library. ## (The procedures dynkin_diagram, weight_system, addweight ## below are the same as in the crystal package, written with ## R. Martin.) ## ## AUTHOR: David Joyner, wdj@nadn.navy.mil ## ## ################################################# `dynkin/reader` := proc(x) eval(`dynkin/`.x) end: `dynkin/weight_system` := proc(x,y) local i,n,s,Cartan,HighestWeight,Nbase,Sbase; Sbase := coxeter[base](y); Nbase := nops(Sbase); for i to Nbase do Cartan[i] := [seq(2*coxeter[iprod](s,op(i,Sbase))/coxeter[iprod](s,s),s = Sbase)]; od; HighestWeight := [[seq(-2*coxeter[iprod](s,x)/coxeter[iprod](s,s),s = Sbase)]]; dynkin[addweight](HighestWeight,y) end: `dynkin/addweight` := proc(x,y) local a,b,i,j,k,s,Cartan,CartanVector,Nbase,Sbase,Weights,WeightVector; Sbase := coxeter[base](y); Nbase := nops(Sbase); for i to Nbase do Cartan[i] := [seq(2*coxeter[iprod](s,op(i,Sbase))/coxeter[iprod](s,s),s = Sbase)]; od; Weights := x; for i to nops(x) do WeightVector[i] := linalg[vector](op(i,x)); for j to Nbase do if 0 < WeightVector[i][j] then for k to WeightVector[i][j] do CartanVector[j] := linalg[vector](Cartan[j]); a[j] := evalm(WeightVector[i]-k*CartanVector[j]); b[j] := convert(a[j],list); if not member(b[j],[op(Weights)]) then Weights := [op(Weights),b[j]]; fi; od; fi; od; od; if nops(x) <> nops(Weights) then dynkin[addweight](Weights,y); else RETURN(Weights); fi; end: `dynkin/ex_dynkin_A1`:=proc() local P,Q,R,Sa,Sb,i,n; n:=2: P:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Q:=plots[polygonplot]([[1/n,0],[1,0]]): for i from 1 to n do R.i:=plots[textplot]([i/n,1/(10*n),convert(i,string)],scaling=constrained): od; i:=o; Sa:=plots[textplot]([3/4-0.004,1/(16*n),i],scaling=constrained): i:=o; Sb:=plots[textplot]([3/4+0.004,1/(16*n),i],scaling=constrained): plots[display]([P,Q,seq(R.i,i=1..n),Sa,Sb], title=`extended Dynkin diagram for A`.1,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_A`:=proc(n::integer) local P1,P2,Q1,Q2,Q3,R,i; P1:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): P2:=plots[pointplot]([(n+1)/(2*n),1/n],symbol=CIRCLE): Q1:=plots[polygonplot]([[1/n,0],[1,0]]): Q2:=plots[polygonplot]([[1/n,0],[(n+1)/(2*n),1/n]]): Q3:=plots[polygonplot]([[1,0],[(n+1)/(2*n),1/n]]): for i from 1 to n do R.i:=plots[textplot]([i/n,-1/20,convert(i,string)]): od; i:=0; R.i:=plots[textplot]([(n+1)/(2*n),0.1+1/n,convert(i,string)]): plots[display]([P1,P2,Q1,Q2,Q3,seq(R.i,i=0..n)], title=`extended Dynkin diagram for A`.n,axes=none, scaling=constrained); end: `dynkin/ex_dynkin_B2`:=proc() local Pa,Qa1,Qa2,Qa3,Ra,Sa,Pb,Qb1,Qb2,Qb3,Rb,Sb,i,n; n:=2; Pa:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Qa1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Qa2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Qa3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): for i from 1 to n do Ra.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; Sa:=plots[polygonplot]([[1-(.75)/(2*n),0],[1-(1.25)/(2*n),(.75)/(4*n)], [1-(.75)/(2*n),0],[1-(1.25)/(2*n),-(.75)/(4*n)]],scaling=constrained): Pb:=plots[pointplot]([seq([1/2+i/n,0],i=1..n)],symbol=CIRCLE): Qb1:=plots[polygonplot]([[1/2+1/n,0],[1.5-1/n,0]]): Qb2:=plots[polygonplot]([[1.5-1/n,1/(15*n)],[1.5,1/(15*n)]]): Qb3:=plots[polygonplot]([[1.5-1/n,-1/(15*n)],[1.5,-1/(15*n)]]): Rb:=plots[textplot]([3/2,1/(2*n),`0`]): Sb:=plots[polygonplot]([[1.5-(1.25)/(2*n),0],[1.5-(.75)/(2*n),(.75)/(4*n)], [1.5-(1.25)/(2*n),0],[1.5-(.75)/(2*n),-(.75)/(4*n)]],scaling=constrained): plots[display]([Pa,Qa1,Qa2,Qa3,seq(Ra.i,i=1..n),Sa,Pb,Rb,Qb2,Qb3,Sb], title=`extended Dynkin diagram for B`.n, axes=none,scaling=constrained); end: `dynkin/ex_dynkin_B`:=proc(n::integer) local P,Pa,Pb,Qa,Qb,Q1,Q2,Q3,R,S,i; Pa:=plots[pointplot]([[1/n,1/(2*n)]],symbol=CIRCLE): Pb:=plots[pointplot]([[1/n,-1/(2*n)]],symbol=CIRCLE): Qa:=plots[polygonplot]([[1/n,1/(2*n)],[2/n,0]]): Qb:=plots[polygonplot]([[1/n,-1/(2*n)],[2/n,0]]): P:=plots[pointplot]([seq([i/n,0],i=2..n)],symbol=CIRCLE): Q1:=plots[polygonplot]([[2/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): R.0:=plots[textplot]([-0.1+1/n,1/(2*n),convert(1,string)]): R.1:=plots[textplot]([-0.1+1/n,-1/(2*n),convert(0,string)]): for i from 2 to n do R.i:=plots[textplot]([i/n,1/20,convert(i,string)]): od; S:=plots[polygonplot]([[1-(.75)/(2*n),0],[1-(1.25)/(2*n),(1.25)/(4*n)], [1-(.75)/(2*n),0],[1-(1.25)/(2*n),-(1.25)/(4*n)]]): plots[display]([P,Pa,Pb,Qa,Qb,Q1,Q2,Q3,seq(R.i,i=0..n),S], title=`extended Dynkin diagram for B`.n,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_C2`:=proc() local Pa,Qa1,Qa2,Qa3,Ra,Sa,Pb,Qb1,Qb2,Qb3,Rb,Sb,i,n; n:=2; Pa:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Qa1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Qa2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Qa3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): for i from 1 to n do Ra.i:=plots[textplot]([1/2+i/n,1/(2*n),convert(i,string)]): od; Sa:=plots[polygonplot]([[1-(.75)/(2*n),0],[1-(1.25)/(2*n),(.75)/(4*n)], [1-(.75)/(2*n),0],[1-(1.25)/(2*n),-(.75)/(4*n)]],scaling=constrained): Pb:=plots[pointplot]([seq([1/2+i/n,0],i=1..n)],symbol=CIRCLE): Qb1:=plots[polygonplot]([[1/2+1/n,0],[1.5-1/n,0]]): Qb2:=plots[polygonplot]([[1.5-1/n,1/(15*n)],[1.5,1/(15*n)]]): Qb3:=plots[polygonplot]([[1.5-1/n,-1/(15*n)],[1.5,-1/(15*n)]]): Rb:=plots[textplot]([1/2,1/(2*n),`0`]): Sb:=plots[polygonplot]([[1.5-(1.25)/(2*n),0],[1.5-(.75)/(2*n),(.75)/(4*n)], [1.5-(1.25)/(2*n),0],[1.5-(.75)/(2*n),-(.75)/(4*n)]],scaling=constrained): plots[display]([Pa,Qa1,Qa2,Qa3,seq(Ra.i,i=1..n),Sa,Pb,Rb,Qb2,Qb3,Sb], title=`extended Dynkin diagram for C`.n, axes=none,scaling=constrained); end: `dynkin/ex_dynkin_C`:=proc(n::integer) local P,Pa,Qa,Qb,Sa,Q1,Q2,Q3,R,S,i; P:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Pa:=plots[pointplot]([[0,0]],symbol=CIRCLE): Qa:=plots[polygonplot]([[0,1/(15*n)],[1/n,1/(15*n)]]): Qb:=plots[polygonplot]([[0,-1/(15*n)],[1/n,-1/(15*n)]]): Q1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): for i from 0 to n do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; S:=plots[polygonplot]([[1-(1.25)/(2*n),0],[1-(.75)/(2*n),(.75)/(4*n)], [1-(1.25)/(2*n),0],[1-(.75)/(2*n),-(.75)/(4*n)]]): Sa:=plots[polygonplot]([[1/(n)-(.75)/(2*n),0],[1/(n)-(1.25)/(2*n),(.75)/(4*n)], [1/(n)-(.75)/(2*n),0],[1/(n)-(1.25)/(2*n),-(.75)/(4*n)]]): plots[display]([P,Pa,Qa,Qb,Q1,Q2,Q3,seq(R.i,i=0..n),S,Sa], title=`extended Dynkin diagram for C`.n,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_D`:=proc(n::integer) local Pa,Pb,Pc,Pd,Qa,Qb,Qc,Qd,Ra,Rb1,Rb2,i; if n<4 then ERROR(`rank should be >3`); fi; Pa:=plots[pointplot]([seq([i/n,0],i=2..n-2)],symbol=CIRCLE): Pc:=plots[pointplot]([[1/n,1/n]],symbol=CIRCLE): Pd:=plots[pointplot]([[1/n,-1/n]],symbol=CIRCLE): Qc:=plots[polygonplot]([[1/n,1/n],[2/n,0]]): Qd:=plots[polygonplot]([[1/n,-1/n],[2/n,0]]): Qa:=plots[polygonplot]([[2/n,0],[1-2/n,0]]): Ra.0:=plots[textplot]([-0.05+1/n,1/n,convert(1,string)]): Ra.1:=plots[textplot]([-0.05+1/n,-1/n,convert(0,string)]): for i from 2 to n-2 do Ra.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; Pb:=plots[pointplot]([[1-1/n,1/n],[1-1/n,-1/n]],symbol=CIRCLE): Qb:=plots[polygonplot]([[(n-2)/n,0],[1-1/n,1/n],[(n-2)/n,0],[1-1/n,-1/n]]): Rb1:=plots[textplot]([1-1/(2*n),1/n,convert(n-1,string)]): Rb2:=plots[textplot]([1-1/(2*n),-1/n,convert(n,string)]): plots[display]([Pa,Pb,Pc,Pd,Qa,Qb,Qc,Qd,seq(Ra.i,i=0..n-2),Rb1,Rb2], title=`extended Dynkin diagram for D`.n,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_E`:=proc(n::integer) local Pa,Pc,Rc,Qa,Ra,Pb,Qb,Rb,i; Pa:=plots[pointplot]([seq([i/n,0],i=1..n-1)],symbol=CIRCLE): Qa:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): for i from 1 to n-1 do Ra.i:=plots[textplot]([i/n,-1/(2*n),convert(i,string)]): od; Pb:=plots[pointplot]([[3/n,1/n]],symbol=CIRCLE): Pc:=plots[pointplot]([[3/n,2/n]],symbol=CIRCLE): Qb:=plots[polygonplot]([[3/n,0],[3/n,2/n]]): Rb:=plots[textplot]([3/n-0.05,1/n,convert(n,string)]): Rc:=plots[textplot]([3/n-0.05,2/n,convert(0,string)]): plots[display]([Pa,Qa,seq(Ra.i,i=1..n-1),Pb,Pc,Qb,Rb,Rc], title=`extended Dynkin diagram for E`.n,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_F`:=proc() local P,Pa,Q0,Q1,Q2,Q3,Q4,n,R,S0,i; n:=3; P:=plots[pointplot]([seq([i/n,0],i=1..n+1)],symbol=CIRCLE): Pa:=plots[pointplot]([[0,0]],symbol=CIRCLE): Q0:=plots[polygonplot]([[0,0],[1/n,0]]): Q1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): Q4:=plots[polygonplot]([[1,0],[1+1/n,0]]): for i from 0 to n+1 do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; S0:=plots[polygonplot]([[1-(1.25)/(2*n),0],[1-(0.75)/(2*n),(0.75)/(4*n)],[1-(1.25)/(2*n),0], [1-(0.75)/(2*n),-(0.75)/(4*n)]]): plots[display]([P,Pa,Q0,Q1,Q2,Q3,Q4,seq(R.i,i=0..(n+1)),S0], title=`extended Dynkin diagram for F4`, axes=none,scaling=constrained); end: `dynkin/ex_dynkin_G`:=proc() local P,Q1,Q2,Q3,R,S,i; P:=plots[pointplot]([[0,0],[1,0],[2,0]],symbol=CIRCLE): Q1:=plots[polygonplot]([[0,0],[2,0]]): Q2:=plots[polygonplot]([[0,1/(35)],[1,1/(35)]]): Q3:=plots[polygonplot]([[0,-1/(35)],[1,-1/(35)]]): for i from 0 to 1 do R.i:=plots[textplot]([i,1/(10),convert(i,string)]): od; R.2:=plots[textplot]([2,1/(10),convert(0,string)]): S:=plots[polygonplot]([[1-(1.25)/(2),0],[1-(.75)/(2),(.75)/6],[1-(1.25)/(2),0], [1-(.75)/(2),-(.75)/6]]): plots[display]([P,Q1,Q2,Q3,seq(R.i,i=0..2),S], title=`extended Dynkin diagram for G`.2,axes=none,scaling=constrained); end: `dynkin/ex_dynkin_diagram`:=proc(R::name) ## ## require coxeter ## if `A`=substring(R,1) and R=`A1` then RETURN(`dynkin/ex_dynkin_A1`()); fi; if `A`=substring(R,1) and 1`B2` then RETURN(`dynkin/ex_dynkin_B`(coxeter[rank](R))); fi; if `C`=substring(R,1) and R=`C2` then RETURN(`dynkin/ex_dynkin_C2`()); fi; if `C`=substring(R,1) and R<>`C2` then RETURN(`dynkin/ex_dynkin_C`(coxeter[rank](R))); fi; if `D`=substring(R,1) then RETURN(`dynkin/ex_dynkin_D`(coxeter[rank](R))); fi; if `E`=substring(R,1) then RETURN(`dynkin/ex_dynkin_E`(coxeter[rank](R))); fi; if `F`=substring(R,1) then RETURN(`dynkin/ex_dynkin_F`()); fi; if `G`=substring(R,1) then RETURN(`dynkin/ex_dynkin_G`()); fi; end: `dynkin/dynkin_A`:=proc(n::integer) local P,Q,R,i; P:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Q:=plots[polygonplot]([[1/n,0],[1,0]]): for i from 1 to n do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; plots[display]([P,Q,seq(R.i,i=1..n)],title=`Dynkin diagram for A`.n,axes=none, scaling=constrained); end: `dynkin/dynkin_B`:=proc(n::integer) local P,Q1,Q2,Q3,R,S,i; P:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Q1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): for i from 1 to n do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; S:=plots[polygonplot]([[1-(.75)/(2*n),0],[1-(1.25)/(2*n),(1.25)/(4*n)], [1-(.75)/(2*n),0],[1-(1.25)/(2*n),-(1.25)/(4*n)]]): plots[display]([P,Q1,Q2,Q3,seq(R.i,i=1..n),S],title=`Dynkin diagram for B`.n, axes=none,scaling=constrained); end: `dynkin/dynkin_C`:=proc(n::integer) local P,Q1,Q2,Q3,R,S,i; P:=plots[pointplot]([seq([i/n,0],i=1..n)],symbol=CIRCLE): Q1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): for i from 1 to n do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; S:=plots[polygonplot]([[1-(1.25)/(2*n),0],[1-(.75)/(2*n),(.75)/(4*n)], [1-(1.25)/(2*n),0],[1-(.75)/(2*n),-(.75)/(4*n)]]): plots[display]([P,Q1,Q2,Q3,seq(R.i,i=1..n),S],title=`Dynkin diagram for C`.n, axes=none,scaling=constrained); end: `dynkin/dynkin_D`:=proc(n::integer) local Pa,Qa,Ra,Pb,Qb,Rb1,Rb2,i; Pa:=plots[pointplot]([seq([i/n,0],i=1..n-2)],symbol=CIRCLE): Qa:=plots[polygonplot]([[1/n,0],[1-2/n,0]]): for i from 1 to n-2 do Ra.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; Pb:=plots[pointplot]([[1-1/n,1/n],[1-1/n,-1/n]],symbol=CIRCLE): Qb:=plots[polygonplot]([[(n-2)/n,0],[1-1/n,1/n],[(n-2)/n,0],[1-1/n,-1/n]]): Rb1:=plots[textplot]([1-1/(2*n),1/n,convert(n-1,string)]): Rb2:=plots[textplot]([1-1/(2*n),-1/n,convert(n,string)]): plots[display]([Pa,Qa,seq(Ra.i,i=1..n-2),Pb,Qb,Rb1,Rb2],title=`Dynkin diagram for D`.n, axes=none,scaling=constrained); end: `dynkin/dynkin_E`:=proc(n::integer) local Pa,Qa,Ra,Pb,Qb,Rb,i; Pa:=plots[pointplot]([seq([i/n,0],i=1..n-1)],symbol=CIRCLE): Qa:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): for i from 1 to n-1 do Ra.i:=plots[textplot]([i/n,-1/(2*n),convert(i,string)]): od; Pb:=plots[pointplot]([[3/n,1/n]],symbol=CIRCLE): Qb:=plots[polygonplot]([[3/n,0],[3/n,1/n]]): Rb:=plots[textplot]([3/n,1.25/n,convert(n,string)]): plots[display]([Pa,Qa,seq(Ra.i,i=1..n-1),Pb,Qb,Rb],title=`Dynkin diagram for E`.n, axes=none,scaling=constrained); end: `dynkin/dynkin_F`:=proc() local P,Q1,Q2,Q3,Q4,n,R,S,i; n:=3; P:=plots[pointplot]([seq([i/n,0],i=1..n+1)],symbol=CIRCLE): Q1:=plots[polygonplot]([[1/n,0],[1-1/n,0]]): Q2:=plots[polygonplot]([[1-1/n,1/(15*n)],[1,1/(15*n)]]): Q3:=plots[polygonplot]([[1-1/n,-1/(15*n)],[1,-1/(15*n)]]): Q4:=plots[polygonplot]([[1,0],[1+1/n,0]]): for i from 1 to n+1 do R.i:=plots[textplot]([i/n,1/(2*n),convert(i,string)]): od; S:=plots[polygonplot]([[1-(1.25)/(2*n),0],[1-(.75)/(2*n),(.75)/(4*n)],[1-(1.25)/(2*n),0], [1-(.75)/(2*n),-(.75)/(4*n)]]): plots[display]([P,Q1,Q2,Q3,Q4,seq(R.i,i=1..n+1),S],title=`Dynkin diagram for F`.4, axes=none,scaling=constrained); end: `dynkin/dynkin_G`:=proc() local P,Q1,Q2,Q3,R,S,i; P:=plots[pointplot]([[0,0],[1,0]],symbol=CIRCLE): Q1:=plots[polygonplot]([[0,0],[1,0]]): Q2:=plots[polygonplot]([[0,1/(35)],[1,1/(35)]]): Q3:=plots[polygonplot]([[0,-1/(35)],[1,-1/(35)]]): for i from 0 to 1 do R.i:=plots[textplot]([i,1/(10),convert(i,string)]): od; S:=plots[polygonplot]([[1-(1.25)/(2),0],[1-(.75)/(2),(.75)/6],[1-(1.25)/(2),0], [1-(.75)/(2),-(.75)/6]]): plots[display]([P,Q1,Q2,Q3,seq(R.i,i=0..1),S],title=`Dynkin diagram for G`.2, axes=none,scaling=constrained); end: `dynkin/dynkin_diagram`:=proc(R::name) ## ## require coxeter ## if `A`=substring(R,1) then RETURN(`dynkin/dynkin_A`(coxeter[rank](R))); fi; if `B`=substring(R,1) then RETURN(`dynkin/dynkin_B`(coxeter[rank](R))); fi; if `C`=substring(R,1) then RETURN(`dynkin/dynkin_C`(coxeter[rank](R))); fi; if `D`=substring(R,1) then RETURN(`dynkin/dynkin_D`(coxeter[rank](R))); fi; if `E`=substring(R,1) then RETURN(`dynkin/dynkin_E`(coxeter[rank](R))); fi; if `F`=substring(R,1) then RETURN(`dynkin/dynkin_F`()); fi; if `G`=substring(R,1) then RETURN(`dynkin/dynkin_G`()); fi; end: `dynkin/plot2d_weights`:=proc(v,R::name) ## ##plots the weights of the repn associated to the ##highest weight v of R, rank R=2 ## local L,i,P,T,d; if R<>A2 and R<>B2 and R<>C2 and R<>D2 and R<>G2 then ERROR(`root system must be rank 2`); fi; L:=dynkin[weight_system](-v,R); P:=[]; d:=weyl[weyl_dim](v,R); T:=`dimension = `.d; for i from 1 to nops(L) do P.i:=plots[polygonplot]([[0,0],L[i],[0,0]]): P:=[op(P),P.i]: od: display(P,color=black,title=T); end: `dynkin/plot3d_weights`:=proc(v,R::name) ## ##plots the weights of the repn associated to the ##highest weight v of R, rank R=3 ## local L,i,P,T,d; if R<>A3 and R<>B3 and R<>C3 and R<>D3 then ERROR(`root system must be rank 3`); fi; L:=dynkin[weight_system](-v,R); P:=[]; d:=weyl[weyl_dim](v,R); T:=`dimension = `.d; for i from 1 to nops(L) do P.i:=plots[polygonplot3d]([[0,0,0],L[i],[0,0,0]]): P:=[op(P),P.i]: od: display3d(P,color=black,title=T); end: `dynkin/plot2d_highest_weights`:=proc(R::name) local L,i1,i2,w,Q,PP,P,T,d,n1,n2,M; if R<>A2 and R<>B2 and R<>C2 and R<>D2 and R<>G2 then ERROR(`root system must be rank 2`); fi; w:=weyl[weights](R); PP:=[]; n1:=2; n2:=2; for i1 from -n1 to n1 do for i2 from -n2 to n2 do L[i1+1,i2+1]:=i1*w[1]+i2*w[2]: M[i1+1,i2+1]:=weyl[weight_coords](L[i1+1,i2+1],R); d[i1+1,i2+1]:=convert(weyl[weyl_dim](L[i1+1,i2+1],R),string): P[i1+1,i2+1]:=plots[polygonplot]([[0,0],M[i1+1,i2+1],[0,0]]): Q[i1+1,i2+1]:=plots[textplot]([op(M[i1+1,i2+1]),d[i1+1,i2+1]]): PP:=[op(PP),P[i1+1,i2+1],Q[i1+1,i2+1]]: od; od; T:=`dimensions of highest wts of `.R; display(PP,color=black,title=T,axes=none); end: `dynkin/plot3d_highest_weights`:=proc(R::name) local L,i1,i2,i3,w,Q,PP,P,T,d,n1,n2,n3,M; if R<>A3 and R<>B3 and R<>C3 and R<>D3 then ERROR(`root system must be rank 3`); fi; w:=weyl[weights](R); PP:=[]; n1:=1; n2:=1; n3:=1; for i1 from 0 to n1 do for i2 from 0 to n2 do for i3 from 0 to n3 do L[i1+1,i2+1,i3+1]:=i1*w[1]+i2*w[2]+i3*w[3]: M[i1+1,i2+1,i3+1]:=weyl[weight_coords](L[i1+1,i2+1,i3+1],R); d[i1+1,i2+1,i3+1]:=convert(weyl[weyl_dim](L[i1+1,i2+1,i3+1],R),string): P[i1+1,i2+1,i3+1]:=plots[polygonplot3d]([[0,0,0],M[i1+1,i2+1,i3+1] ,[0,0,0]]): Q[i1+1,i2+1,i3+1]:=plots[textplot3d]([op(M[i1+1,i2+1,i3+1]),d[i1+1,i2+1,i3+1]]): PP:=[op(PP),P[i1+1,i2+1,i3+1],Q[i1+1,i2+1,i3+1]]: od; od; od; T:=`dimensions of highest wts of `.R; display3d(PP,color=black,title=T,orientation=[20,80]); end: `dynkin/nhbr_wts`:=proc(L::list,wt::list,R::name) ## ## this proc returns the list of weights in L ## connected to wt in L as a pair [wt1,i] ## where wt1 is connected to wt by root i ## local i,j,k,a,s,Sbase,Nbase,Cartan,Weights,WeightVector,nbrs; nbrs:=[]; Sbase := coxeter[base](R); Nbase := nops(Sbase); for i to Nbase do Cartan[i] := [seq(2*coxeter[iprod](s,op(i,Sbase))/coxeter[iprod](s,s),s = Sbase)]; od; # this for loop was taken from a program of Stembridge for i from 1 to Nbase do for k from 1 to wt[i] do if member(expand(wt-k*Cartan[i]),L) then nbrs:=[op(nbrs),[expand(wt-k*Cartan[i]),i]]; fi; od; od; RETURN(nbrs); end: `dynkin/plot3d_wts`:=proc(v,R::name) ## ## v is a highest weight (the same as Stembridge's) ## R is a simple Lie alg ## local L,i,P,T,d,j,W,label,label0,H; if R<>A3 and R<>B3 and R<>C3 and R<>D3 then ERROR(`root system must be rank 3`); fi; L:=dynkin[weight_system](-v,R); P:=[]; d:=weyl[weyl_dim](v,R); T:=`3d crystal graph in the wt lattice, dim rep = `.d; for i from 1 to nops(L) do W:=`dynkin/nhbr_wts`(L,L[i],R); for j from 1 to nops(W) do label:=convert(op(2,W[j]),string); P.i.j:=textplot3d([op(expand((op(1,W[j])+L[i])/2)),label]); Q.i.j:=plots[polygonplot3d]([L[i],op(1,W[j]),L[i]]): P:=[op(P),P.i.j,Q.i.j]: od; od: for i from 1 to nops(L) do label0:=convert(L[i],string); H:=textplot3d([op(L[i]), label0],color=red); P:=[op(P),H]; od; display3d(P,color=black,title=T,orientation=[20,80],axes=framed); end: `dynkin/plot2d_wts`:=proc(v,R::name) local L,i,P,T,d,j,W,label,label0,H; if R<>A2 and R<>B2 and R<>C2 and R<>D2 and R<>G2 then ERROR(`root system must be rank 2`); fi; L:=dynkin[weight_system](-v,R); P:=[]; d:=weyl[weyl_dim](v,R); T:=`2d crystal graph in wt space, dim rep = `.d; for i from 1 to nops(L) do W:=`dynkin/nhbr_wts`(L,L[i],R); for j from 1 to nops(W) do label:=convert(op(2,W[j]),string); P.i.j:=textplot([op(expand([-.1,.1]+(op(1,W[j])+L[i])/2)),label]); Q.i.j:=plots[polygonplot]([L[i],op(1,W[j]),L[i]]): P:=[op(P),P.i.j,Q.i.j]: od; od: for i from 1 to nops(L) do label0:=convert(L[i],string); H:=textplot([op(L[i]), label0],color=red); P:=[op(P),H]; od; display(P,color=black,title=T,axes=none,scaling=unconstrained); end: `dynkin/listofentries`:=proc(A::array) local i,j,L; L:=[]; for j from 1 to coldim(A) do for i from 1 to rowdim(A) do if A[i,j]<>0 then L:=[op(L),[[i,j],A[i,j]]]; fi; od; od; RETURN(L); end: `dynkin/mate`:=proc(i,j,n) local k,l,E; E.i.j:=matrix(n,n); for k from 1 to n do for l from 1 to n do if (k=i and j=l) then E.i.j[k,l]:=1; else E.i.j[k,l]:=0; fi; od; od; RETURN(E.i.j); end: `dynkin/cc`:=proc(A,B::array) RETURN(evalm(A&*B-B&*A)); end: `dynkin/Liebasiselement_A`:=proc(n::integer,i::integer) #returns the ith basis element of the Lie #algebra of type A_n local j,N,A,n0; n0:=n+1; N:=(n0-1)*n0-((n0-2)*(n0-1)/2); if (0 < i and iN then for j from 1 to n0-1 do if (j*n0-(j-1)*j/2<= i-N+n0-1 and i-N+n0-1<= (j+1)*n0-((j+1)*j/2+1)) then A:=transpose(dynkin[mate](i-N+n0-1-(j*n0-(j-1)*j/2)+1,i-N+n0-1-(j*n0-(j-1)*j/2)+j+1,n0)); RETURN(A); fi; od; fi; end: `dynkin/structure_A` :=proc(i::integer,j::integer,k::integer,n::integer) ## ##In A_n the i-th basis matrix X.i is multiplied on the right ##by the j-th basis matrix X.j. Write [X.i,X.j] as a linear ##combo of the basis matrices. The proc returns the ##coefficient of the k-th basis matrix. ## local a,X1,X2,X3,L1,L2,L3,l1,l3; X1:=evalm(dynkin[Liebasiselement_A](n,i)); X2:=evalm(dynkin[Liebasiselement_A](n,j)); X3:=evalm(dynkin[Liebasiselement_A](n,k)); L1:=dynkin[listofentries](dynkin[cc](X1,X2)); if nops(L1)=1 then for a from -2 to 2 do if ((a<>0 and equal(dynkin[cc](X1,X2),a*X3)) or (a=0 and iszero(dynkin[cc](X1,X2)))) then RETURN(a); fi; od; fi; L3:=dynkin[listofentries](X3); for l1 in L1 do for l3 in L3 do if l1[1]=l3[1] then RETURN(l1[2]); fi; od; od; RETURN(0); end: `dynkin/Liebasiselement_B`:=proc(n::integer,i::integer) #returns the ith basis element of the Lie #algebra of type B_n local j,N,A,X; N:=(n-1)*n-((n-2)*(n-1)/2); if (1 <= i and i<=n) then RETURN(dynkin[mate](i+1,i+1,2*n+1)-dynkin[mate](i+n+1,i+n+1,2*n+1)); fi; if (n< i and i <= N+1) then for j from 1 to n-1 do if (j*n-(j-1)*j/2+1<= i and i<= (j+1)*n-((j+1)*j/2+1)+1) then RETURN (dynkin[mate](i-(j*n-(j-1)*j/2)+1,i-(j*n-(j-1)*j/2)+j+1,2*n+1) -dynkin[mate](i-(j*n-(j-1)*j/2)+j+n+1,i-(j*n-(j-1)*j/2)+n+1,2*n+1)); fi; od; fi; if (i>N+1 and i<=n^2) then for j from 1 to n-1 do if (j*n-(j-1)*j/2+1<= i-N+n-1 and i-N+n-1<= (j+1)*n-((j+1)*j/2+1)+1) then A:=transpose( dynkin[mate](i-N+n-(j*n-(j-1)*j/2), i-N+n-(j*n-(j-1)*j/2)+j,2*n+1) -dynkin[mate](i-N+n-(j*n-(j-1)*j/2)+j+n, i-N+n-(j*n-(j-1)*j/2)+n,2*n+1)): RETURN(A); fi; od; fi; if (i>n^2 and i<=n^2+n) then RETURN(dynkin[mate](1,1+i-n^2,2*n+1)-dynkin[mate](i-n^2+n+1,1,2*n+1)): fi; if (i>n^2+n and i<=n^2+2*n) then RETURN(dynkin[mate](1,i-n^2+1,2*n+1)-dynkin[mate](i-n^2-n+1,1,2*n+1)): fi; if (2*n+n^2< i and i <= N+n^2+n+1) then for j from 1 to n-1 do if (n^2+j*n-(j-1)*j/2+n+1<= i and i<= n^2+(j+1)*n-((j+1)*j/2+1)+n+1) then RETURN( dynkin[mate](i-(n^2+j*n-(j-1)*j/2+n)+1, i-(n^2+j*n-(j-1)*j/2)+j+1,2*n+1) -dynkin[mate](i-(n^2+j*n-(j-1)*j/2+n)+1+j, i-(n^2+j*n-(j-1)*j/2)+1,2*n+1)): fi; od; fi; if i>n^2+N+n+1 then for j from 1 to n-1 do if (n^2+N+1+j*n-(j-1)*j/2+1<= i and i<= n^2+N+1+(j+1)*n-((j+1)*j/2+1)+1) then A:=dynkin[mate](i-(n^2+N+j*n-(j-1)*j/2+n)+n, i-(n^2+j*n+N-(j-1)*j/2)+j+n,2*n+1) -dynkin[mate](i-(n^2+j*n+N-(j-1)*j/2+n)+n+j, i-(n^2+j*n+N-(j-1)*j/2)+n,2*n+1): RETURN(transpose(A)); fi; od; fi; end: `dynkin/structure_B` :=proc(i::integer,j::integer,k::integer,n::integer) local a,X1,X2,X3,L1,L2,L3; X1:=evalm(dynkin[Liebasiselement_B](n,i)); X2:=evalm(dynkin[Liebasiselement_B](n,j)); X3:=evalm(dynkin[Liebasiselement_B](n,k)); L1:=dynkin[listofentries](dynkin[cc](X1,X2)); if nops(L1)=1 then for a from -2 to 2 do if ((a<>0 and equal(dynkin[cc](X1,X2),a*X3)) or (a=0 and iszero(dynkin[cc](X1,X2)))) then RETURN(a); fi; od; fi; L3:=dynkin[listofentries](X3); while member(l1,L1) do while member(l3,L3) do if l1[1]=l3[1] then RETURN(l1[2]); fi; od; od; RETURN(0); end: `dynkin/Liebasiselement_C`:=proc(n::integer,i::integer) #returns the ith basis element of the Lie #algebra of type C_n local j,N,A,X; N:=(n-1)*n-((n-2)*(n-1)/2); if (0 < i and i<=n) then RETURN(dynkin[mate](i,i,2*n)-dynkin[mate](i+n,i+n,2*n)); fi; if (n< i and i <= N+1) then for j from 1 to n-1 do if (j*n-(j-1)*j/2+1<= i and i<= (j+1)*n-((j+1)*j/2+1)+1) then RETURN (dynkin[mate](i-(j*n-(j-1)*j/2),i-(j*n-(j-1)*j/2)+j,2*n) -dynkin[mate](i-(j*n-(j-1)*j/2)+j+n,i-(j*n-(j-1)*j/2)+n,2*n)); fi; od; fi; if (i>N+1 and i<=n^2) then for j from 1 to n-1 do if (j*n-(j-1)*j/2+1<= i-N+n-1 and i-N+n-1<= (j+1)*n-((j+1)*j/2+1)+1) then A:=transpose( dynkin[mate](i-N+n-1-(j*n-(j-1)*j/2), i-N+n-1-(j*n-(j-1)*j/2)+j,2*n) -dynkin[mate](i-N+n-1-(j*n-(j-1)*j/2)+j+n, i-N+n-1-(j*n-(j-1)*j/2)+n,2*n)): RETURN(A); fi; od; fi; if (i>n^2 and i<=n^2+n) then RETURN(dynkin[mate](i-n^2,i-n^2+n,2*n)): fi; if (n+n^2< i and i <= N+n^2+1) then for j from 1 to n-1 do if (n^2+j*n-(j-1)*j/2+1<= i and i<= n^2+(j+1)*n-((j+1)*j/2+1)+1) then RETURN( dynkin[mate](i-(n^2+j*n-(j-1)*j/2),i-(n^2+j*n-(j-1)*j/2)+j+n,2*n) +dynkin[mate](i-(n^2+j*n-(j-1)*j/2)+j,i-(n^2+j*n-(j-1)*j/2)+n,2*n)): fi; od; fi; if (i>N+n^2+1 and i<=N+n^2+n+1) then A:=dynkin[mate](i-n^2-N-1,i-n^2-N-1+n,2*n); RETURN(transpose(A)): fi; if i>n^2+N+n+1 then for j from 1 to n-1 do if (n^2+N+1+j*n-(j-1)*j/2+1<= i and i<= n^2+N+1+(j+1)*n-((j+1)*j/2+1)+1) then A:=dynkin[mate](i-(N+1)-(n^2+j*n-(j-1)*j/2), i-(N+1)-(n^2+j*n-(j-1)*j/2)+j+n,2*n) +dynkin[mate](i-(N+1)-(n^2+j*n-(j-1)*j/2)+j, i-(N+1)-(n^2+j*n-(j-1)*j/2)+n,2*n): RETURN(transpose(A)); fi; od; fi; end: `dynkin/structure_C` :=proc(i::integer,j::integer,k::integer,n::integer) local a,X1,X2,X3,L1,L2,L3; X1:=evalm(dynkin[Liebasiselement_C](n,i)); X2:=evalm(dynkin[Liebasiselement_C](n,j)); X3:=evalm(dynkin[Liebasiselement_C](n,k)); L1:=dynkin[listofentries](dynkin[cc](X1,X2)); if nops(L1)=1 then for a from -2 to 2 do if ((a<>0 and equal(dynkin[cc](X1,X2),a*X3)) or (a=0 and iszero(dynkin[cc](X1,X2)))) then RETURN(a); fi; od; fi; L3:=dynkin[listofentries](X3); while member(l1,L1) do while member(l3,L3) do if l1[1]=l3[1] then RETURN(l1[2]); fi; od; od; RETURN(0); end: `dynkin/Liebasiselement_D`:=proc(n::integer,i::integer) #returns the ith basis element of the Lie #algebra of type B_n local j,N,A,X; N:=(n-1)*n-((n-2)*(n-1)/2); if (1 <= i and i<=n) then RETURN(dynkin[mate](i,i,2*n)-dynkin[mate](i+n,i+n,2*n)); fi; if (n< i and i <= N+1) then for j from 1 to n-1 do if (j*n-(j-1)*j/2+1<= i and i<= (j+1)*n-((j+1)*j/2+1)+1) then RETURN (dynkin[mate](i-(j*n-(j-1)*j/2),i-(j*n-(j-1)*j/2)+j,2*n) -dynkin[mate](i-(j*n-(j-1)*j/2)+j+n,i-(j*n-(j-1)*j/2)+n,2*n)); fi; od; fi; if (i>N+1 and in^2+N-n+1 then for j from 1 to n-1 do if (n^2+N-n+1+(j-1)*n-(j-1)*j/2<= i and i<= n^2+N-n+1+j*n-((j+1)*j/2+1)+1) then A:=dynkin[mate](i-(n^2+N+(j-1)*n-(j-1)*j/2-n)+j-1, i-(n^2+(j-1)*n+N-(j-1)*j/2-n)+n-1,2*n) -dynkin[mate](i-(n^2+j*n+N-(j-1)*j/2-n)+n-1, i-(n^2+j*n+N-(j-1)*j/2-n)+j+n-1+n,2*n): RETURN(transpose(A)); fi; od; fi; end: `dynkin/structure_D` :=proc(i::integer,j::integer,k::integer,n::integer) local a,X1,X2,X3,L1,L2,L3; X1:=evalm(dynkin[Liebasiselement_D](n,i)); X2:=evalm(dynkin[Liebasiselement_D](n,j)); X3:=evalm(dynkin[Liebasiselement_D](n,k)); L1:=dynkin[listofentries](dynkin[cc](X1,X2)); if nops(L1)=1 then for a from -2 to 2 do if ((a<>0 and equal(dynkin[cc](X1,X2),a*X3)) or (a=0 and iszero(dynkin[cc](X1,X2)))) then RETURN(a); fi; od; fi; L3:=dynkin[listofentries](X3); while member(l1,L1) do while member(l3,L3) do if l1[1]=l3[1] then RETURN(l1[2]); fi; od; od; RETURN(0); end: init_dynkin := proc() global dynkin; dynkin[plot2d_highest_weights] := `dynkin/reader`(plot2d_highest_weights); dynkin[plot3d_highest_weights] := `dynkin/reader`(plot3d_highest_weights); dynkin[plot2d_weights] := `dynkin/reader`(plot2d_weights); dynkin[plot3d_weights] := `dynkin/reader`(plot3d_weights); dynkin[plot2d_wts] := `dynkin/reader`(plot2d_wts); dynkin[plot3d_wts] := `dynkin/reader`(plot3d_wts); dynkin[dynkin_diagram] := `dynkin/reader`(dynkin_diagram); dynkin[ex_dynkin_diagram] := `dynkin/reader`(ex_dynkin_diagram); dynkin[addweight] := `dynkin/reader`(addweight); dynkin[weight_system] := `dynkin/reader`(weight_system); dynkin[listofentries] := `dynkin/reader`(listofentries); dynkin[mate] := `dynkin/reader`(mate); dynkin[cc] := `dynkin/reader`(cc); dynkin[structure_A] := `dynkin/reader`(structure_A); dynkin[structure_B] := `dynkin/reader`(structure_B); dynkin[structure_C] := `dynkin/reader`(structure_C); dynkin[structure_D] := `dynkin/reader`(structure_D); dynkin[Liebasiselement_A] := `dynkin/reader`(Liebasiselement_A); dynkin[Liebasiselement_B] := `dynkin/reader`(Liebasiselement_B); dynkin[Liebasiselement_C] := `dynkin/reader`(Liebasiselement_C); dynkin[Liebasiselement_D] := `dynkin/reader`(Liebasiselement_D); print(`Dynkin initialized.`); end: print(`type init_dynkin(); to initialize.`);