File: permMatrix.gi

package info (click to toggle)
gap-hap 1.73%2Bds-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 58,508 kB
  • sloc: xml: 16,467; sh: 197; javascript: 155; makefile: 121; ansic: 47; perl: 24
file content (33 lines) | stat: -rw-r--r-- 621 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#(C) Graham Ellis, 2005-2006

#####################################################################
InstallGlobalFunction(PermToMatrixGroup,
function(arg)
local
	G, n, gensG, gensA, A, GhomA, M, g, row, i,j;

G:=arg[1];
if Length(arg)=2 then n:=arg[2];
else n:=Maximum(MovedPoints(G));
fi;
gensG:=GeneratorsOfGroup(G);
gensA:=[];

for g in gensG do
M:=[];
for i in [1..n] do
row :=List([1..n],x->0);
row[i^g]:=1;
Append(M,[row]);
od;
Append(gensA,[M]);
od;

A:=Group(gensA);
GhomA:=GroupHomomorphismByImagesNC(G,A,gensG,gensA);

return GhomA;


end);
#####################################################################