This page is devoted to answering some basic linear algebra or matrix-theoretic questions along the line "How do I construct ... in GAP?" You may view the html source code for the GAP commands without the output or GAP prompt.
Please send suggestions, additions, corrections to
David Joyner.
|
How
do I compute the ... of a matrix?
|
How do I find the ... of a group
representation?
|
|
How
do I compute ..., where A is a matrix?
|
How
do I compute a basis for the ... of A, where A is a matrix?
|
gap> M:=[[1,2,3,4,5],[1,2,1,2,1],[1,1,0,0,0]]; [ [ 1, 2, 3, 4, 5 ], [ 1, 2, 1, 2, 1 ], [ 1, 1, 0, 0, 0 ] ] gap> TriangulizeMat(M); gap> M; [ [ 1, 0, 0, -1, 1 ], [ 0, 1, 0, 1, -1 ], [ 0, 0, 1, 1, 2 ] ] gap> Display(M); [ [ 1, 0, 0, -1, 1 ], [ 0, 1, 0, 1, -1 ], [ 0, 0, 1, 1, 2 ] ] gap> M:=Z(3)^0*[[1,2,3,4,5],[1,2,1,2,1],[1,1,0,0,0]]; [ [ Z(3)^0, Z(3), 0*Z(3), Z(3)^0, Z(3) ], [ Z(3)^0, Z(3), Z(3)^0, Z(3), Z(3)^0 ], [ Z(3)^0, Z(3)^0, 0*Z(3), 0*Z(3), 0*Z(3) ] ] gap> TriangulizeMat(M); gap> Display(M); 1 . . 2 1 . 1 . 1 2 . . 1 1 2 gap>
For integer entries, related commands include "NullspaceIntMat" and "SolutionNullspaceIntMat" in section 25.1 "Linear equations over the integers and Integral Matrices" of the reference manual.
gap> M:=[[1,2,3],[4,5,6],[7,8,9]]; [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] gap> NullspaceIntMat(M); [ [ 1, -2, 1 ] ] gap> SolutionNullspaceIntMat(M,[0,0,1]); [ fail, [ [ 1, -2, 1 ] ] ] gap> SolutionNullspaceIntMat(M,[0,0,0]); [ [ 0, 0, 0 ], [ [ 1, -2, 1 ] ] ] gap> SolutionNullspaceIntMat(M,[1,2,3]); [ [ 1, 0, 0 ], [ [ 1, -2, 1 ] ] ]Here (0,0,1) is not in the image of M (under v-> v*M) but (0,0,0) and (1,2,3) are.
For field entries, related commands include "NullspaceMat" and "TriangulizedNullspaceMat" in section 24.6 "Matrices Representing Linear Equations and the Gaussian Algorithm" of the reference manual.
gap> M:=[[1,2,3],[4,5,6],[7,8,9]]; [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] gap> NullspaceMat(M); [ [ 1, -2, 1 ] ] gap> TriangulizedNullspaceMat(M); [ [ 1, -2, 1 ] ] gap> M:=[[1,2,3,1,1],[4,5,6,1,1],[7,8,9,1,1],[1,2,3,1,1]]; [ [ 1, 2, 3, 1, 1 ], [ 4, 5, 6, 1, 1 ], [ 7, 8, 9, 1, 1 ], [ 1, 2, 3, 1, 1 ] ] gap> NullspaceMat(M); [ [ 1, -2, 1, 0 ], [ -1, 0, 0, 1 ] ] gap> TriangulizedNullspaceMat(M); [ [ 1, 0, 0, -1 ], [ 0, 1, -1/2, -1/2 ] ]
gap> G:=Group((1,2)(3,4),(1,2,3));
Group([ (1,2)(3,4), (1,2,3) ])
gap> T:=CharacterTable(G);
CharacterTable( Alt( [ 1 .. 4 ] ) )
gap> Display(T);
CT1
2 2 2 . .
3 1 . 1 1
1a 2a 3a 3b
2P 1a 1a 3b 3a
3P 1a 2a 1a 1a
X.1 1 1 1 1
X.2 1 1 A /A
X.3 1 1 /A A
X.4 3 -1 . .
A = E(3)^2
= (-1-ER(-3))/2 = -1-b3
gap> irr:=Irr(G);
[ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ),
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3)^2, E(3) ] ),
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3), E(3)^2 ] ),
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, -1, 0, 0 ] ) ]
gap> Display(irr);
[ [ 1, 1, 1, 1 ],
[ 1, 1, E(3)^2, E(3) ],
[ 1, 1, E(3), E(3)^2 ],
[ 3, -1, 0, 0 ] ]
gap> chi:=irr[2]; gamma:=CG[3]; g:=Representative(gamma); g^chi;
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3)^2, E(3) ] )
(1,2,3)^G
(1,2,3)
E(3)^2
For further details and examples, see chapters
69-
72 of the
GAP reference manual.
gap> G:=Group((1,2)(3,4),(1,2,3));
Group([ (1,2)(3,4), (1,2,3) ])
gap> irr:=IrreducibleRepresentations(G,GF(7));
[ [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^0 ] ] ],
[ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^4 ] ] ],
[ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^2 ] ] ],
[ (1,2)(3,4), (1,2,3) ] -> [
[ [ 0*Z(7), Z(7)^3, Z(7)^0 ], [ 0*Z(7), Z(7)^3, 0*Z(7) ], [ Z(7)^0, Z(7)^3, 0*Z(7) ] ],
[ [ 0*Z(7), Z(7)^0, 0*Z(7) ], [ 0*Z(7), 0*Z(7), Z(7)^0 ], [ Z(7)^0, 0*Z(7), 0*Z(7) ] ]
] ]
gap> brvals := List(irr,chi-> List(ConjugacyClasses(G),c-> BrauerCharacterValue(Image(chi, Representative(c)))));
[ [ 1, 1, 1, 1 ], [ 1, 1, E(3)^2, E(3) ], [ 1, 1, E(3), E(3)^2 ], [ 3, -1, 0, 0 ] ]
gap> Display(brvals);
[ [ 1, 1, 1, 1 ],
[ 1, 1, E(3)^2, E(3) ],
[ 1, 1, E(3), E(3)^2 ],
[ 3, -1, 0, 0 ] ]
gap>
gap> A:=[[1,2],[3,4]]; n:=100000; m:=123; [ [ 1, 2 ], [ 3, 4 ] ] 100000 123 gap> A^n mod m; [ [ 1, 41 ], [ 0, 1 ] ]
Last modified 10-14-2005 by David Joyner.