/* Sessionlog of second demo session of Magma, Wed June 27, 2007 */ iload "demo.txt"; 2+2; load "~/tue/research/paloalto/magma_demo/demo_defs.txt"; sheet_head(); sheet_contents(); prm("Magma in general"); /* Syntax */ 2+2; Random(GF(25)); Random(GF(25))*Random(GF(25)); P := PolynomialRing(Rationals()); d := Xgcd(x^5 + x^3 + 3*x^2 + 3, x^10 + 3*x^7 + x^4 + 2*x^3 + 3*x + 6); d; d,a,b := Xgcd(x^5 + x^3 + 3*x^2 + 3, x^10 + 3*x^7 + x^4 + 2*x^3 + 3*x + 6); a*(x^5+x^3+3*x^2+3) + b*(x^10+3*x^7+x^4+2*x^3+3*x+6); // l := [ i : i in [1..100] | IsPrime(i) ]; #l; #[ i : i in l | i mod 4 eq 1 ]; // sub where G is SymmetricGroup(4); sub where G is SymmetricGroup(4); H, phi := sub where G is SymmetricGroup(4); H; phi; phi(Identity(H)); #H; #$1; /* Error handling */ try for i in [3..0 by -1] do print 1/i; end for; catch e print "Whoops: ", e`Object; end try; try for i in [3..0 by -1] do print 1/i; end for; catch e print "whoops"; print i; end try; /* The profiler */ fib := func; fib(8); SetProfile(true); time _ := fib(20); G := ProfileGraph(); SetProfile(false); ProfilePrintByTotalTime(G); fib := func; fib(8); SetProfile(true); time _ := fib(20); G := ProfileGraph(); SetProfile(false); ProfilePrintByTotalTime(G); prm("Support for Lie groups"); f := function(a,b) return a+b; end function; /* Root data */ R := RootDatum("A4" : Isogeny := "Ad"); G := GroupOfLieType(R, GF(59)); Order(G); FactoredOrder(G); Dimension(G); CenterPolynomials(G); // DynkinDiagram(G); CartanMatrix(G); DynkinDiagram("D4"); DynkinDiagram("G2"); DynkinDiagram("~G2"); DynkinDiagram("~G2"); // W := WeylGroup(G); W; // g := GraphAutomorphism(G, Sym(4)!(1,4)(2,3)); g; [ g(elt >) : i in [1..4] ]; // x := Random(G); x; [ IsSemisimple(x), IsUnipotent(x), IsCentral(x) ]; //By default, the Steinberg presentation is used: // G = UTWU x := elt, <7, 31>, <10, 29> ], Vector([58, 43, 9, 15]), 1, 2, 1, 3, 2, 1, 4, [ <9, 44>, <11, 19>, <12, 24>, <3, 23> ] *]>; x; //But it is easy to go to other presentations: sr := StandardRepresentation(G); X := sr(x); X; Determinant(X); //And, due to an algorithm by Cohen, Murray, and // Taylor, we can go back as well: X @@ sr; X @@ sr eq x; //Galois Cohomology: // (Due to Haller) // Compute the cohomology of A_3(5^2) q := 5; k := GF(q); K := GF(q^2); G := GroupOfLieType( "A3", K : Isogeny:="SC" ); A := AutomorphismGroup(G); AGRP := GammaGroup( k, A ); Gamma,m := ActingGroup(AGRP); Gamma; m; time GaloisCohomology(AGRP); // And now the cocycle defining the group 2A_3(5) // and check for two elements if they are contained // in 2A_3(5): c := OneCocycle( AGRP, [GraphAutomorphism(G, Sym(3)!(1,3))] ); x := Random(G); IsInTwistedForm( x, c ); x := elt< G | <1,y>, <3,y @ m(Gamma.1)> > where y is Random(K); IsInTwistedForm( x, c ); //The twisted group 2 A_3(5) as a subgroup of A_3(5^2). R := RootDatum("A3" : Twist := 2); G := TwistedGroupOfLieType(R,5,25); G; BaseRing(G); DefRing(G); iload "demo.txt"; load "~/tue/research/paloalto/magma_demo/demo_defs.txt"; sheet_head(); sheet_contents(); prm("Magma in general"); /* Syntax */ 2+2; P := PolynomialRing(Rationals()); P := PolynomialRing(Rationals()); d := Xgcd(x^5 + x^3 + 3*x^2 + 3, x^10 + 3*x^7 + x^4 + 2*x^3 + 3*x + 6); d; d,a,b := Xgcd(x^5 + x^3 + 3*x^2 + 3, x^10 + 3*x^7 + x^4 + 2*x^3 + 3*x + 6); a*(x^5+x^3+3*x^2+3) + b*(x^10+3*x^7+x^4+2*x^3+3*x+6); // l := [ i : i in [1..100] | IsPrime(i) ]; l; #l; #[ i : i in l | i mod 4 eq 1 ]; // sub where G is SymmetricGroup(4); G := SymmetricGroup(4); H,phi := sub; phi; #H; Random(H); Random(H); Random(H); phi(Random(H)); phi(H!(1,3,2)); GmodH, psi := G/H; #$1; /* Error handling */ try for i in [3..0 by -1] do print 1/i; end for; catch e print "Whoops: ", e`Object; end try; try for i in [3..0 by -1] do print 1/i; end for; catch e; end try; for i in [3..0 by -1] do print 1/i; end for; for i in [300..0 by -1] do print 1/i; end for; /* The profiler */ fib := func; fib := function(n) if n in {1,2} then return 1; else return $$(n-1) + $$(n-2); end if; end function; fib(8); SetProfile(true); time _ := fib(20); G := ProfileGraph(); SetProfile(false); ProfilePrintByTotalTime(G); fib := func; fib(8); SetProfile(true); time _ := fib(20); G := ProfileGraph(); SetProfile(false); ProfilePrintByTotalTime(G); prm("Support for Lie groups"); /* Root data */ R := RootDatum("A4" : Isogeny := "Ad"); G := GroupOfLieType("A4", GF(59) : Isogeny := "Ad"); G := GroupOfLieType(R, GF(59)); Order(G); FactoredOrder(G); Dimension(G); CenterPolynomials(G); // DynkinDiagram(G); DynkinDiagram("G2"); DynkinDiagram("D4"); CartanMatrix(G); GeneralLinearGroup(GF(59),4); GeneralLinearGroup(4,GF(59)); GL := GeneralLinearGroup(4,GF(59)); CenterPolynomials(GL); // W := WeylGroup(G); W; // g := GraphAutomorphism(G, Sym(4)!(1,4)(2,3)); g; [ g(elt >) : i in [1..4] ]; // x := Random(G); x; [ IsSemisimple(x), IsUnipotent(x), IsCentral(x) ]; //By default, the Steinberg presentation is used: // G = UTWU x := elt, <7, 31>, <10, 29> ], Vector([58, 43, 9, 15]), 1, 2, 1, 3, 2, 1, 4, [ <9, 44>, <11, 19>, <12, 24>, <3, 23> ] *]>; x; //But it is easy to go to other presentations: sr := StandardRepresentation(G); X := sr(x); X; Determinant(X); //And, due to an algorithm by Cohen, Murray, and // Taylor, we can go back as well: X @@ sr; X @@ sr eq x; x @ StandardRepresentation(G); (x @ StandardRepresentation(G)) @@ StandardRepresentation(G); StandardRepresentation(G)(x); rrh := RowReductionHomomorphism(StandardRepresentation(G)\ ); rrh( X ); //Galois Cohomology: // (Due to Haller) // Compute the cohomology of A_3(5^2) q := 5; k := GF(q); K := GF(q^2); G := GroupOfLieType( "A3", K : Isogeny:="SC" ); A := AutomorphismGroup(G); AGRP := GammaGroup( k, A ); Gamma,m := ActingGroup(AGRP); Gamma; m; time GaloisCohomology(AGRP); // And now the cocycle defining the group 2A_3(5) // and check for two elements if they are contained // in 2A_3(5): c := OneCocycle( AGRP, [GraphAutomorphism(G, Sym(3)!(1,3))] ); x := Random(G); IsInTwistedForm( x, c ); x := elt< G | <1,y>, <3,y @ m(Gamma.1)> > where y is Random(K); IsInTwistedForm( x, c ); //The twisted group 2 A_3(5) as a subgroup of A_3(5^2). R := RootDatum("A3" : Twist := 2); G := TwistedGroupOfLieType(R,5,25); G; BaseRing(G); DefRing(G); UntwistedOvergroup(G); prm("LiE"); /* "Combinatorics with representations" */ A2 := RootDatum("A2" : Isogeny := "SC"); L := LieAlgebra(A2, Rationals()); _,_,T := StandardBasis(L); rho := AdjointRepresentation(L); V := VectorSpace(Rationals(), 8); //Now V is an L-module by v --> x.v = rho(x).v MT := [ Transpose(Matrix(rho(t))) : t in T ]; MT; //Weights are: (-1,1), (1,-2), ... ,(1,1) //Dominant weights: (0,0),(0,0),(1,1) rho1 := HighestWeightRepresentation(L, [1,1]); rho2 := HighestWeightRepresentation(L, [2,0]); MT := [ Transpose(TensorProduct(Matrix(rho1(t)), Matrix(rho2(t)))) : t in T ] ; {* Vector([(B[i]*m)[i] : m in MT]):i in [1..#B] *} where B is Basis(VectorSpace(Rationals(),48)); //But these dimensions quickly grow! //We can find out a lot about the representations // by just considering the highest weights //LiE, by Van Leeuwen, Cohen, Lisser // Ported to Magma in summer 2006 drho1 := LieRepresentationDecomposition(A2, [1,1]); drho2 := LieRepresentationDecomposition(A2, [2,0]); dtp := Tensor(drho1, drho2); dtp:Maximal; RepresentationDimension(dtp); [ RepresentationDimension(LieRepresentationDecomposition(\ A2, w)) : w in dtp`WtsMps[1] ]; &+$1; prm("THE END"); // // // // // // // // //Branch //Branch A1T1 := RootDatum("A1T1" : Isogeny := "SC"); M := RestrictionMatrix(A2, A1T1); M; M := RestrictionMatrix(A2, A1T1); D := Branch(A1T1, dtp, M); RepresentationDimension(D); D:Maximal; E8 := RootDatum("E8" : Isogeny := "SC"); iload ""; E8 := RootDatum("E8" : Isogeny := "SC"); D1 := LieRepresentationDecomposition(E8, [1,0,0,0,0,0,0,0]); D2 := LieRepresentationDecomposition(E8, [0,1,0,0,0,0,0,0]); time D3 := Tensor(D1, D2); D3; D3:Maximal; http://www-math.univ-poitiers.fr/~maavl/LiE/ ;; W := CoxeterGroup("A2"); KLPolynomial(W!(1,2),W!(1,2)); x := Random(W); y := Random(W); W; W!(1,2); W!(1,4)(2,3)(5,6); KLPolynomial(x,y); W := CoxeterGroup("A4"); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y); x := Random(W); y := Random(W); KLPolynomial(x,y);