/usr/share/gap/lib/pcgsspec.gi is in gap-libs 4r8p8-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 | #############################################################################
##
#W pcgsspec.gi GAP library Bettina Eick
##
#Y Copyright (C) 1996, Lehrstuhl D für Mathematik, RWTH Aachen, Germany
#Y (C) 1998 School Math and Comp. Sci., University of St Andrews, Scotland
#Y Copyright (C) 2002 The GAP Group
##
#############################################################################
##
#F PrimePowerPcSequence( <pcgs> )
##
PrimePowerPcSequence := function( pcgs )
local new, i, p;
new := List( [1..Length(pcgs)], x -> false );
p := RelativeOrders( pcgs );
for i in [1..Length(pcgs)] do
new[i] := PrimePowerComponent( pcgs[i], p[i] );
od;
return new;
end;
#############################################################################
##
#F ModifyPcgs( ... )
##
ModifyPcgs := function( pcgs, wf, list, weights, work, g, wt )
local d, h, S, s, min, tmp, i;
# the trivial case
d := DepthOfPcElement( pcgs, g );
if d > Length( pcgs ) then return d; fi;
h := ReducedPcElement( pcgs, list[d], g );
S := PrimePowerComponents( h );
# insert h in base
if weights[ d ] < wt then
Info(InfoSpecPcgs, 3, " insert ", g );
Info(InfoSpecPcgs, 3, " at position ",d," with weight ", wt);
tmp := weights[ d ];
weights[ d ] := wt;
list[ d ] := g;
# correct work-flag
work[ d ] := List( work[ d ], x -> true );
for i in [d..Length( pcgs )] do
work[ i ][ d ] := true;
od;
# ModifyPcgs with components of h
for s in S do
ModifyPcgs( pcgs, wf, list, weights, work, s,
wf.adj( pcgs, s, tmp ));
od;
return d;
# base is not changed
else
# modify with components of gg
min := Length( pcgs ) + 1;
for s in S do
tmp := wf.adj( pcgs, s, wt );
min := Minimum( min,
ModifyPcgs(pcgs, wf, list, weights, work , s, tmp) );
od;
return min;
fi;
end;
#############################################################################
##
#F PcgsSystemWithWf( <pcgs> <wf> )
##
PcgsSystemWithWf := function( pcgs, wf )
local ppcgs, m, list, weights, work, nilp, h, i, j, g, S,
pos, s, wt, newpcgs, wset, layers, first;
ppcgs := PrimePowerPcSequence( pcgs );
# initialise
m := Length( pcgs );
list := ShallowCopy( ppcgs );
weights := List( list, x -> wf.one( pcgs, x ) );
work := List( [1..m], x -> List( [1..x], y -> true ) );
# run down series
nilp := 1;
h := 1;
while h <= nilp+1 do
# run through powers and commutators
Info(InfoSpecPcgs, 2, " start layer ",h);
i := 1;
while i <= m do
j := 1;
while j <= i do
if wf.relevant( pcgs, weights, i, j, h ) and work[i][j] then
Info(InfoSpecPcgs, 3, " try ",i," ",j);
# set work flag new
if wf.useful( weights, i, j, h ) then
work[ i ][ j ] := false;
fi;
# modify with components of power or commutator
if i = j then
g := list[ i ] ^ weights[i][3];
else
g := Comm( list[ i ], list[ j ] );
fi;
S := PrimePowerComponents( g );
pos := m + 1;
for s in S do
wt := wf.weight( pcgs, weights, i, j, h, s );
pos := Minimum( pos,
ModifyPcgs( pcgs, wf, list, weights, work, s, wt ) );
od;
# if necessary, set indices new
if pos <= i then
i := pos;
j := 0;
fi;
fi;
j := j+1;
od;
i := i+1;
od;
h := h+1;
# set nilp
for i in [1..m] do
nilp := Maximum( nilp, weights[i][1] );
od;
od;
# sort
SortParallel( weights, list );
# compute pcgs - be careful!
if ppcgs = AsList( pcgs ) and
ForAll( [1..m], x -> DepthOfPcElement(pcgs, list[x]) = x )
then
newpcgs := pcgs;
else
newpcgs := PcgsByPcSequenceNC( FamilyObj(OneOfPcgs(pcgs)), list );
SetRelativeOrders(newpcgs, List(weights, x -> x[3]));
SetOneOfPcgs( newpcgs, OneOfPcgs(pcgs) );
fi;
# set up layers
wset := Set( weights );
layers := List( [1..m], x -> Position( wset, weights[x] ) );
# set up first
first := [1];
for i in [2..m] do
if weights[i] <> weights[i-1] then
Add( first, i );
fi;
od;
Add( first, m+1 );
return rec( pcgs := newpcgs,
weights := weights,
layers := layers,
first := first );
end;
#############################################################################
##
#F PcgsSystemLGSeries( <pcgs> )
##
PcgsSystemLGSeries := function( pcgs )
local wf;
# set up weight function
wf := rec(
adj := function( pcgs, g, wt )
wt := ShallowCopy( wt );
wt[ 3 ] := RelativeOrderOfPcElement( pcgs, g );
return wt;
end,
one := function( pcgs, g )
return [ 1, 1, RelativeOrderOfPcElement( pcgs, g ) ];
end,
relevant := function( pcgs, w, i, j, h )
if i = j and (w[i][1] = h-1 or w[i][1] = h+1) then
return true;
else
if w[i][1] = w[j][1] then
if w[i][1] = h-1 and w[i][3] = w[j][3] and
(w[i][2] = 1 or w[j][2] = 1) then
return true;
elif w[i][1] = h and w[i][3] <> w[j][3] then
return true;
elif w[i][1] >= h+1 then
return true;
else
return false;
fi;
elif w[i][1] >= h+1 and w[j][1] >= h+1 then
return true;
elif w[i][1] = h+1 and w[j][1] <= h and w[j][2] = 1 then
return true;
elif w[i][1] <= h and w[j][1] = h+1 and w[i][2] = 1 then
return true;
else
return false;
fi;
fi;
end,
weight := function( pcgs, w, i, j, h, g )
local p;
p := RelativeOrderOfPcElement(pcgs, g);
if i = j then
if w[i][1] = h-1 then
return [ w[i][1], w[i][2]+1, w[i][3] ];
else
return w[i];
fi;
else
if w[i][1] = w[j][1] and w[i][1] = h-1 then
return [ w[i][1], w[i][2]+w[j][2], w[i][3] ];
elif w[i][1] = w[j][1] and w[i][1] = h then
return [ w[i][1]+1, 1, p ];
elif w[i][1] = w[j][1] and w[j][1] >= h+1 then
if w[i][3] <> w[j][3] or w[i][3] <> p then
return [w[i][1]+1, 1, p];
else
return [w[i][1], 1, p];
fi;
else
return [ Maximum( w[i][1],w[j][1] ), 1, p ];
fi;
fi;
end,
useful := function( w, i, j, h )
if i = j and w[i][1] >= h+1 then
return false;
elif i<>j and w[i][1] = w[j][1] and w[i][1] >= h+1 and
w[i][3] = w[j][3] then
return false;
else
return true;
fi;
end
);
return PcgsSystemWithWf( pcgs, wf );
end;
#############################################################################
##
#F LeastBadHallLayer( <pcgssys>, <i> )
##
LeastBadHallLayer := function( pcgssys, i )
local m, pi, bad, j, w, pj, k, exponents;
m := Length( pcgssys.pcgs );
pi := pcgssys.weights[ i ][ 3 ];
# run through powers/commutators and search for bad one
bad := m + 1;
for j in [ i .. m ] do
if j = i then
w := pcgssys.pcgs[ i ] ^ pi;
pj := pi;
else
w := Comm( pcgssys.pcgs[ j ], pcgssys.pcgs[ i ] );
pj := pcgssys.weights[ j ][ 3 ];
fi;
if DepthOfPcElement( pcgssys.pcgs, w ) <= m then
exponents := ExponentsOfPcElement( pcgssys.pcgs, w, [i+1..m] );
k := 1;
# run through exponent list until bad entry is found
while k <= Length( exponents ) do
# test primes
if exponents[k] <> 0 and
pi <> pcgssys.weights[k+i][3] and
pj <> pcgssys.weights[k+i][3]
then
bad := Minimum( bad, k+i );
k := Length( exponents ) + 1;
else
k := k + 1;
fi;
od;
fi;
# if bad is minimal return; otherwise go on
if i = bad -1 then
return bad;
fi;
od;
return bad;
end;
#############################################################################
##
#F PcgsSystemWithHallSystem( <pcgssys> )
##
PcgsSystemWithHallSystem := function( pcgssys )
local m, i, k, n, F,
layer, start, next, size, base,
V, M,
pi, pk, field, id,
g, v, A, I, B, l, test, aij,
new, solution, j, subs;
# set up
m := Length( pcgssys.pcgs );
F := FamilyObj(OneOfPcgs(pcgssys.pcgs));
# find starting index
n := m;
while 1 <= n and pcgssys.weights[n][1] = pcgssys.weights[m][1] do
n := n - 1;
od;
if n = 1 and pcgssys.weights[n][1] = pcgssys.weights[m][1] then
return pcgssys;
fi;
# run up the composition series
for i in Reversed( [1..n] ) do
Info(InfoSpecPcgs, 2, " start ",i,"th pcgs element");
k := LeastBadHallLayer( pcgssys, i );
while k <= m do
Info(InfoSpecPcgs, 2, " bad layer ",k);
layer := pcgssys.layers[k];
start := pcgssys.first[ layer ];
next := pcgssys.first[ layer+1 ];
size := next - start;
base := pcgssys.pcgs{[start..next-1]};
# InitializeSystem inhomogenous system
V := [];
M := List([1..size], x -> []);
# get primes and field
pi := pcgssys.weights[ i ][ 3 ];
pk := pcgssys.weights[ k ][ 3 ];
field := GF(pk);
id := One( field );
# add the power
g := pcgssys.pcgs[ i ] ^ pi;
v := ExponentsOfPcElement( pcgssys.pcgs, g, [start..next-1] );
v := v * id;
# set up matrix
A := List( base, x -> ExponentsOfPcElement(
pcgssys.pcgs, x^pcgssys.pcgs[i], [start..next-1] ) );
A := A * id;
I := A ^ 0;
B := I;
for l in [ 1..pi-1 ] do
B := B * A + I;
od;
B := (- 1) * B;
# append to system
for l in [ 1..size ] do
Append( M[ l ], B[ l ] );
od;
Append( V, v );
# add the commutators
test := Filtered([i+1..start-1], x -> pcgssys.weights[x][3] <> pk);
for j in test do
g := Comm( pcgssys.pcgs[j], pcgssys.pcgs[i] );
v := ExponentsOfPcElement( pcgssys.pcgs, g, [start..next-1] );
v := v * id;
# corresponding matrix
aij := pcgssys.pcgs[j] ^ pcgssys.pcgs[i];
A := List( base, x -> ExponentsOfPcElement(
pcgssys.pcgs, x^aij, [start..next-1] ) );
A := A * id;
I := A ^ 0;
I := (-1) * I;
B := A + I;
# append to system
for l in [ 1..size ] do
Append( M[ l ], B[ l ] );
od;
Append( V, v );
od;
# solve system simultaneously
solution := SolutionMat( M, V );
# calculate new i-th base element
new := ShallowCopy( pcgssys.pcgs!.pcSequence );
subs := PcElementByExponentsNC(pcgssys.pcgs, base, solution);
new[i] := new[i] * subs;
pcgssys.pcgs := PcgsByPcSequenceNC( F, new );
# change k
k := LeastBadHallLayer( pcgssys, i );
od;
od;
return pcgssys;
end;
#############################################################################
##
#F LeastBadComplementLayer( <pcgssys>, <i> )
##
LeastBadComplementLayer := function( pcgssys, i )
local m, p, bad, j, w, exponents, k;
m := Length( pcgssys.pcgs );
p := pcgssys.weights[i][3];
bad := m + 1;
# look through commutators
for j in [ 1 .. m ] do
if pcgssys.weights[j][1] >= pcgssys.weights[i][1] and
pcgssys.weights[j][3] <> p then
w := Comm( pcgssys.pcgs[j], pcgssys.pcgs[i] );
if DepthOfPcElement( pcgssys.pcgs, w ) <= m then
exponents := ExponentsOfPcElement( pcgssys.pcgs, w, [i+1..m] );
k := 1;
# run through exponent list until bad entry is found
while k <= Length( exponents ) do
if exponents[k] <> 0 and
pcgssys.weights[i+k][1] = pcgssys.weights[j][1] + 1 and
pcgssys.weights[i+k][2] = 1 and
pcgssys.weights[i+k][3] = p then
if i+k < bad then
bad := i+k;
fi;
k := Length( exponents ) + 1;
else
k := k + 1;
fi;
od;
fi;
fi;
## if bad is minimal return; otherwise go on
if i = bad - 1 then
return bad;
fi;
od;
return bad;
end;
#############################################################################
##
#F PcgsSystemWithComplementSystem( <pcgssys> )
##
PcgsSystemWithComplementSystem := function( pcgssys )
local m, F, n, i, k,
layer, start, next, size, base,
V, M, l,
pi, pk, field,
nil, test, j, g, v, aij, A, B,
solution, new, subs;
m := Length( pcgssys.pcgs );
F := FamilyObj( OneOfPcgs(pcgssys.pcgs) );
# find starting index
n := m;
while 1 <= n and pcgssys.weights[n][1] = pcgssys.weights[m][1] do
n := n - 1;
od;
if n = 1 and pcgssys.weights[n][1] = pcgssys.weights[m][1] then
return pcgssys;
fi;
# run up the composition series
for i in Reversed( [1..n] ) do
Info(InfoSpecPcgs, 2, " start ",i,"th pcgs element");
k := LeastBadComplementLayer( pcgssys, i );
while k <= m do
Info(InfoSpecPcgs, 2, " bad index ",k);
layer := pcgssys.layers[ k ];
start := pcgssys.first[ layer ];
next := pcgssys.first[ layer+1 ];
size := next - start;
base := pcgssys.pcgs{[start..next-1]};
# InitializeSystem inhomogenous system
V := [];
M := List([1..size], x -> []);
# get primes
pi := pcgssys.weights[ i ][ 3 ];
pk := pcgssys.weights[ k ][ 3 ];
field := GF( pk );
# pic the p'-generators in the head above
nil := pcgssys.weights[k][1]-1;
test := Filtered( [1..m], x -> pcgssys.weights[x][3] <> pi
and pcgssys.weights[x][1] = nil );
for j in test do
g := Comm( pcgssys.pcgs[j], pcgssys.pcgs[i] );
v := ExponentsOfPcElement( pcgssys.pcgs, g, [start..next-1] );
v := v * One(field);
# corresponding matrix
aij := pcgssys.pcgs[j] ^ pcgssys.pcgs[i];
A := List( base, x -> ExponentsOfPcElement(
pcgssys.pcgs, x^aij, [start..next-1] ) );
A := A * One(field);
B := A - A ^ 0;
# append to system
for l in [ 1..size ] do
Append( M[ l ], B[ l ] );
od;
Append( V, v );
od;
# solve system simultaneously
solution := SolutionMat( M, V );
# calculate new i-th base element
new := ShallowCopy( pcgssys.pcgs!.pcSequence );
subs:= PcElementByExponentsNC(pcgssys.pcgs, base, solution);
new[i] := new[i] * subs;
pcgssys.pcgs := PcgsByPcSequenceNC( F, new );
# change k
k := LeastBadComplementLayer( pcgssys, i );
od;
od;
return pcgssys;
end;
#############################################################################
##
#M SpecialPcgs( <pcgs> )
##
InstallMethod( SpecialPcgs, "method for special pcgs", true,
[ IsSpecialPcgs ],
# we need to rank this method higher -- otherwise the extra filters in
# the follwoing method give it the same rank...
10,IdFunc);
InstallMethod( SpecialPcgs,
"generic method for pcgs",
true,
[ IsPcgs and IsFiniteOrdersPcgs and IsPrimeOrdersPcgs ],
0,
function( pcgs )
local newpcgs, pcgssys,w;
# catch the trivial case
if Length( pcgs ) = 0 then
newpcgs := pcgs;
SetIsSpecialPcgs( pcgs, true );
SetLGWeights( pcgs, [ ] );
SetLGLayers( pcgs, [ ] );
SetLGFirst( pcgs, [1] );
else
# compute Leedham-Green series
Info(InfoSpecPcgs, 1, "compute LG series");
pcgssys := PcgsSystemLGSeries( pcgs );
# change to hall base
Info(InfoSpecPcgs, 1, "exhibit hall system");
pcgssys := PcgsSystemWithHallSystem( pcgssys );
# change to complement base
Info(InfoSpecPcgs, 1, "exhibit complement system");
pcgssys := PcgsSystemWithComplementSystem( pcgssys );
if IsBound(pcgssys.pcgs!.LGWeights) then
# pcgs is reused -- force new one
pcgssys.pcgs:=PcgsByPcSequence(FamilyObj(OneOfPcgs(pcgs)),
pcgssys.pcgs!.pcSequence);
fi;
# create the special pcgs
newpcgs := pcgssys.pcgs;
SetIsSpecialPcgs( newpcgs, true );
w:=pcgssys.weights;
if w[Length(w)][1]=1 then
SetIndicesCentralNormalSteps( newpcgs, pcgssys.first );
if Length(Set(RelativeOrders(newpcgs)))=1 then
SetIndicesPCentralNormalStepsPGroup( newpcgs, pcgssys.first );
fi;
fi;
SetLGWeights( newpcgs, pcgssys.weights );
SetLGLayers( newpcgs, pcgssys.layers );
SetLGFirst( newpcgs, pcgssys.first );
SetIndicesEANormalSteps( newpcgs, pcgssys.first );
SetIndicesChiefNormalSteps( newpcgs, pcgssys.first );
SetIsFiniteOrdersPcgs( newpcgs, true );
SetIsPrimeOrdersPcgs( newpcgs, true );
fi;
if HasGroupOfPcgs (pcgs) then
SetGroupOfPcgs (newpcgs, GroupOfPcgs (pcgs));
fi;
return newpcgs;
end );
#############################################################################
##
#M LGHeads( <pcgs> )
##
InstallMethod( LGHeads, "for special pcgs", true,
[ IsSpecialPcgs ], 0,
function( pcgs )
local h, i, w, j;
h := [];
i := 1;
w := LGWeights( pcgs );
for j in [1..Length(w)] do
if w[j][1] = i then
Add( h, j );
i := i + 1;
fi;
od;
Add( h, Length( w ) + 1 );
return h;
end);
#############################################################################
##
#M LGTails( <pcgs> )
##
InstallMethod( LGTails, "for special pcgs", true,
[ IsSpecialPcgs ], 0,
function( pcgs )
local h, w, i, j, t;
h := LGHeads( pcgs );
w := LGWeights( pcgs );
t := [];
for i in [1..Length(h)-1] do
j := h[i];
while j <= Length( w ) and w[h[i]][1] = w[j][1] and w[j][2] = 1 do
j := j + 1;
od;
Add( t, j );
od;
return t;
end);
#############################################################################
##
#M SpecialPcgs( <group> )
##
InstallOtherMethod( SpecialPcgs,
"generic method for groups",
true,
[ IsGroup ],
0,
function( group )
local spec;
if HasPcgs(group) then
spec := SpecialPcgs( Pcgs( group ) );
else
spec := SpecialPcgs( Pcgs( group ) );
SetPcgs( group, spec );
fi;
SetGroupOfPcgs (spec, group);
return spec;
end );
InstallOtherMethod( SpecialPcgs,"last resort method which tests solvability",
true,[IsGroup],0,
function(G)
# this test should always fail (because otherwise the other method
# that uses 'CanEasilyComputePcgs' will have been called). It is there
# just to avoid infinite recursion if methods get sorted in a strange way.
if HasIsSolvableGroup(G) then
TryNextMethod();
fi;
if not IsSolvableGroup(G) then
Error("<G> must be solvable to permit computation of a special pcgs");
else
return SpecialPcgs(G);
fi;
end);
#############################################################################
##
#M IsomorphismSpecialPcGroup( <group> )
##
InstallMethod( IsomorphismSpecialPcGroup, "method for pc groups",
true, [ IsPcGroup ], 0,
function(G)
local s,H,iso,pc,w;
s:=SpecialPcgs(G);
H:=PcGroupWithPcgs(s);
pc:=FamilyPcgs(H);
SetLGWeights(pc,LGWeights(s));
SetLGLayers(pc,LGLayers(s));
SetLGFirst(pc,LGFirst(s));
SetIsSpecialPcgs(pc,true);
if Length(LGWeights(pc)) = 0 or LGWeights(pc)[Length(LGWeights(pc))][1]=1 then
SetIsPcgsCentralSeries(pc,true);
fi;
SetIndicesEANormalSteps( pc, LGFirst(pc) );
SetIndicesChiefNormalSteps( pc, LGFirst(pc) );
w:=LGWeights(pc);
if Length(w) > 0 and w[Length(w)][1]=1 then
SetIndicesCentralNormalSteps( pc, LGFirst(pc));
if Length(Set(RelativeOrders(pc)))=1 then
SetIndicesPCentralNormalStepsPGroup( pc, LGFirst(pc) );
fi;
fi;
iso:=GroupHomomorphismByImagesNC(G,H,s,pc);
SetIsBijective( iso, true );
SetSpecialPcgs(H,pc);
SetPcgs(H,pc);
# note: `ImagesSource' might be
# physically a different group than the `Range' H.
SetSpecialPcgs(ImagesSource(iso),pc);
SetPcgs(ImagesSource(iso),pc);
return iso;
end);
InstallMethod( IsomorphismSpecialPcGroup, "generic method for groups",
true, [ IsGroup ], 0,
function(G)
local iso;
iso:=IsomorphismPcGroup(G);
return iso*IsomorphismSpecialPcGroup(Range(iso));
end);
#############################################################################
##
#M InducedPcgsWrtSpecialPcgs( <group> )
##
InstallOtherMethod( InducedPcgsWrtSpecialPcgs, "method for pc groups",
true, [ IsPcGroup ], 0,
function( U )
local spec, ind;
spec := SpecialPcgs( FamilyPcgs( U ) );
if HasPcgs(U) and spec=HomePcgs(U) then
return InducedPcgsWrtHomePcgs(U);
fi;
ind := InducedPcgsByGeneratorsNC( spec, GeneratorsOfGroup(U) );
SetGroupOfPcgs (ind, U);
return ind;
end );
InstallOtherMethod( InducedPcgsWrtSpecialPcgs, "generic method for groups",
true, [ IsGroup ], 0,
function( U )
local spec, ind;
spec := SpecialPcgs( Parent( U ) );
ind := InducedPcgsByGeneratorsNC( spec, GeneratorsOfGroup(U) );
SetGroupOfPcgs (ind, U);
return ind;
end );
IndPcgsWrtSpecFromFamOrHome:=function( U )
local spec, ind;
spec := SpecialPcgs( FamilyPcgs( U ) );
if spec=HomePcgs(U) then
return InducedPcgsWrtHomePcgs(U);
elif IsSortedPcgsRep(spec) and spec!.sortingPcgs=HomePcgs(U) then
ind := InducedPcgsByPcSequenceNC(spec,AsList(InducedPcgsWrtHomePcgs(U)));
else
ind := InducedPcgsByGeneratorsNC( spec, InducedPcgsWrtHomePcgs(U) );
fi;
SetGroupOfPcgs (ind, U);
return ind;
end;
InstallOtherMethod( InducedPcgsWrtSpecialPcgs,
"for groups that have already an induced pcgs wrt home pcgs", true,
[ IsGroup and HasInducedPcgsWrtHomePcgs], 0,
IndPcgsWrtSpecFromFamOrHome);
InstallOtherMethod( InducedPcgsWrtSpecialPcgs,
"for groups that have already an induced pcgs wrt family pcgs", true,
[ IsGroup and HasInducedPcgsWrtFamilyPcgs], 0,
IndPcgsWrtSpecFromFamOrHome);
#############################################################################
##
#M LGWeights( pcgs )
##
InstallMethod( LGWeights,
"for induced wrt special",
true,
[IsInducedPcgsWrtSpecialPcgs],
0,
function( pcgs )
local spec, sweights, weights, i, g, d;
# catch special pcgs
spec := ParentPcgs( pcgs );
sweights := LGWeights( spec );
# rewrite weights
weights := List( pcgs, x -> true );
for i in [1..Length(pcgs)] do
g := pcgs[i];
d := DepthOfPcElement( spec, g );
weights[i] := sweights[d];
od;
return weights;
end );
#############################################################################
##
#M LGLayers( pcgs )
##
InstallMethod( LGLayers,
"for induced wrt special",
true,
[IsInducedPcgsWrtSpecialPcgs],
0,
function( pcgs )
local weights, layers, layer, o, i, w;
weights := LGWeights( pcgs );
layers := List( pcgs, x -> true );
layer := 1;
o := weights[1];
for i in [1..Length( pcgs )] do
w := weights[i];
if w <> o then
o := w;
layer := layer + 1;
fi;
layers[i] := layer;
od;
return layers;
end );
#############################################################################
##
#M LGFirst( pcgs )
##
InstallMethod( LGFirst,
"for induced wrt special",
true,
[IsInducedPcgsWrtSpecialPcgs],
0,
function( pcgs )
local weights, first, o, i, w;
weights := LGWeights( pcgs );
first := [1];
o := weights[1];
for i in [1..Length( pcgs )] do
w := weights[i];
if w <> o then
o := w;
Add( first, i );
fi;
od;
Add( first, Length(pcgs) + 1 );
return first;
end );
#############################################################################
##
#M LGLength( G )
##
InstallMethod( LGLength,
"for groups",
true,
[ IsGroup ],
0,
function( G )
if not IsSolvableGroup( G ) then
return fail;
fi;
return Length( Set( LGWeights( SpecialPcgs( G ) ) ) );
end );
#############################################################################
##
#M PClassPGroup( <G> ) . . . . . . . . . . . . . . . . <p>-central series
##
InstallMethod( PClassPGroup,
"for groups with special pcgs",
true, [ IsPGroup and HasSpecialPcgs ], 1,
function( G )
return LGLength( G );
end );
#############################################################################
##
#M RankPGroup( <G> ) . . . . . . . . . . . . . . . . . . <p>-central series
##
InstallMethod( RankPGroup,
"for groups with special pcgs",
true, [ IsPGroup and HasSpecialPcgs ], 1,
function( G )
return LGFirst( SpecialPcgs( G ) )[ 2 ] - 1;
end );
#############################################################################
##
#F SpecialPcgsSubgroup( G, i )
##
SpecialPcgsSubgroup := function( G, i )
local spec, firs, sub;
spec := SpecialPcgs( G );
firs := LGFirst( spec );
sub := InducedPcgsByPcSequenceNC( spec, spec{[firs[i]..Length(spec)]} );
return SubgroupByPcgs( G, sub );
end;
#############################################################################
##
#F SpecialPcgsFactor( G, i )
##
SpecialPcgsFactor := function( G, i )
return G / SpecialPcgsSubgroup( G, i );
end;
#############################################################################
##
#M IndicesEANormalSteps( <pcgs> )
##
InstallMethod( IndicesEANormalSteps, "special pcgs: LGFirst", true,
[ IsSpecialPcgs ], 0, LGFirst );
DoCentralSeriesPcgsIfNilpot:=function(G)
local w;
w:=LGWeights(SpecialPcgs(G));
if w[Length(w)][1]<>1 then
Error("The group is not nilpotent");
fi;
return SpecialPcgs(G);
end;
InstallOtherMethod( PcgsCentralSeries, "if special pcgs is known",
true,[HasSpecialPcgs],0,DoCentralSeriesPcgsIfNilpot);
InstallOtherMethod( PcgsCentralSeries, "for pc groups use SpecialPcgs",
true,[IsPcGroup],0,DoCentralSeriesPcgsIfNilpot);
InstallOtherMethod( PcgsPCentralSeriesPGroup, "for pc groups use SpecialPcgs",
true,[IsPcGroup],0,DoCentralSeriesPcgsIfNilpot);
InstallOtherMethod( PcgsCentralSeries, "for pcgs computable use SpecialPcgs",
true,[CanEasilyComputePcgs],0,DoCentralSeriesPcgsIfNilpot);
InstallOtherMethod( PcgsPCentralSeriesPGroup,
"for pcgs computable use SpecialPcgs",
true,[CanEasilyComputePcgs],0,DoCentralSeriesPcgsIfNilpot);
PcgsElAbSerFromSpecPcgs:=function(G)
local s;
if HasHomePcgs(G)
and IsPcgsElementaryAbelianSeries(InducedPcgsWrtHomePcgs(G)) then
return InducedPcgsWrtHomePcgs(G);
# prefer the `HomePcgs' because wrt. it we store inducedness and for pc
# groups its the family pcgs wrt. calculations are quicker
fi;
s:=SpecialPcgs(G);
return s;
end;
InstallOtherMethod(PcgsElementaryAbelianSeries, "if special pcgs is known",
true,[HasSpecialPcgs],0,PcgsElAbSerFromSpecPcgs);
InstallMethod(PcgsElementaryAbelianSeries,"for PCgroups via SpecialPcgs",
true,[IsPcGroup],0,PcgsElAbSerFromSpecPcgs);
#############################################################################
##
#E pcgsspec.gi . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
##
|