/usr/share/gap/lib/pcgsmodu.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 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | #############################################################################
##
#W pcgsmodu.gi GAP Library Frank Celler
##
##
#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
##
## This file contains the methods for polycylic generating systems modulo
## another such system.
##
#############################################################################
##
#R IsModuloPcgsRep
##
DeclareRepresentation( "IsModuloPcgsRep", IsPcgsDefaultRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap" ] );
#############################################################################
##
#R IsModuloTailPcgsRep
##
DeclareRepresentation( "IsModuloTailPcgsRep", IsModuloPcgsRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap" ] );
#############################################################################
##
#R IsSubsetInducedNumeratorModuloTailPcgsRep(<obj>)
##
DeclareRepresentation( "IsSubsetInducedNumeratorModuloTailPcgsRep",
IsModuloTailPcgsRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap","depthsInParent","numeratorParent","parentZeroVector" ] );
#############################################################################
##
#R IsModuloTailPcgsByListRep(<obj>)
##
DeclareRepresentation( "IsModuloTailPcgsByListRep", IsModuloTailPcgsRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap","depthsInParent","numeratorParent","parentZeroVector" ] );
#############################################################################
##
#R IsNumeratorParentForExponentsRep(<obj>)
##
## modulo pcgs in this representation can use the numerator parent for
## computing exponents
DeclareRepresentation( "IsNumeratorParentForExponentsRep",
IsModuloPcgsRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap","depthsInParent","numeratorParent","parentZeroVector" ] );
#############################################################################
##
#R IsNumeratorParentLayersForExponentsRep(<obj>)
##
## modulo pcgs in this representation can use the numerator parent for
## computing exponents by working in elementary abelian layers (but not in
## one chunk, as there are cofactors).
DeclareRepresentation( "IsNumeratorParentLayersForExponentsRep",
IsModuloPcgsRep,
[ "moduloDepths", "moduloMap", "numerator", "denominator",
"depthMap","depthsInParent","numeratorParent","parentZeroVector" ] );
#############################################################################
##
#M IsBound[ <pos> ]
##
InstallMethod( IsBound\[\],
true,
[ IsModuloPcgs,
IsPosInt ],
0,
function( pcgs, pos )
return pos <= Length(pcgs);
end );
#############################################################################
##
#M Length( <pcgs> )
##
InstallMethod( Length,"modulo pcgs",
true,
[ IsModuloPcgs ],
0,
pcgs -> Length(pcgs!.pcSequence) );
#############################################################################
##
#M Position( <pcgs>, <elm>, <from> )
##
InstallMethod( Position,"modulo pcgs",
true,
[ IsModuloPcgs ,
IsObject,
IsInt ],
0,
function( pcgs, obj, from )
return Position( pcgs!.pcSequence, obj, from );
end );
#############################################################################
##
#M PrintObj( <modulo-pcgs> )
##
InstallMethod( PrintObj,"modulo pcgs",
true,
[ IsModuloPcgs ],
0,
function( obj )
Print( "(", NumeratorOfModuloPcgs(obj), " mod ",
DenominatorOfModuloPcgs(obj), ")" );
end );
#############################################################################
##
#M <pcgs> [ <pos> ]
##
InstallMethod( \[\],"modulo pcgs",
true,
[ IsModuloPcgs,
IsPosInt ],
0,
function( pcgs, pos )
return pcgs!.pcSequence[pos];
end );
#############################################################################
##
#M ModuloTailPcgsByList( <home>, <list>, <taildepths> )
##
InstallGlobalFunction( ModuloTailPcgsByList,
function( home, factor, wm )
local wd, filter, new, i,nupa;
if IsSubset(home,factor) then
wd:=List(factor,i->Position(home,i));
else
wd:=List(factor,i->DepthOfPcElement(home,i));
fi;
# check which filter to use
filter := IsModuloPcgs and IsModuloTailPcgsRep
and IsModuloTailPcgsByListRep;
if IsSubset(home,factor) then
filter:=filter and IsSubsetInducedNumeratorModuloTailPcgsRep;
fi;
if Length(wd)=Length(Set(wd)) then
# the depths are all different. We can get the exponetnts from the
# parent pcgs
filter:=filter and IsNumeratorParentForExponentsRep;
nupa:=true;
fi;
# this can be more messy -- do not use
if HasIsFamilyPcgs(home)
and IsFamilyPcgs(home) then
filter:=filter and IsNumeratorParentPcgsFamilyPcgs;
fi;
if IsPrimeOrdersPcgs(home) then
filter := filter and HasIsPrimeOrdersPcgs and IsPrimeOrdersPcgs
and HasIsFiniteOrdersPcgs and IsFiniteOrdersPcgs;
elif IsFiniteOrdersPcgs(home) then
filter := filter and HasIsFiniteOrdersPcgs and IsFiniteOrdersPcgs;
fi;
# construct a pcgs from <pcs>
new := PcgsByPcSequenceCons(
IsPcgsDefaultRep,
filter,
FamilyObj(OneOfPcgs(home)),
factor,[]);
SetRelativeOrders(new,RelativeOrders(home){wd});
# store other useful information
new!.moduloDepths := wm;
# setup the maps
new!.moduloMap := [];
for i in [ 1 .. Length(wm) ] do
new!.moduloMap[wm[i]] := i;
od;
new!.depthMap := [];
for i in [ 1 .. Length(wd) ] do
new!.depthMap[wd[i]] := i;
od;
new!.numeratorParent:=home;
new!.depthsInParent:=wd;
new!.parentZeroVector:=home!.zeroVector;
# and return
return new;
end);
#############################################################################
##
#M ModuloPcgsByPcSequenceNC( <home>, <pcs>, <modulo> )
##
InstallMethod( ModuloPcgsByPcSequenceNC, "generic method for pcgs mod pcgs",
true, [ IsPcgs, IsList, IsPcgs ], 0,
function( home, list, modulo )
local pcgs, wm, wp, wd, pcs, filter, new,
i,depthsInParent,dd,par,
pcsexp,denexp,bascha,idx,sep,sed,mat;
# <list> is a pcgs for the sum of <list> and <modulo>
if IsPcgs(list) and (ParentPcgs(modulo) = list or IsSubset(list,modulo))
then
pcgs := list;
wm := List( modulo, x -> DepthOfPcElement( pcgs, x ) );
wp := [ 1 .. Length(list) ];
wd := Difference( wp, wm );
pcs := list{wd};
# otherwise compute the sum
else
pcgs := SumPcgs( home, modulo, list );
wm := List( modulo, x -> DepthOfPcElement( pcgs, x ) );
wp := List( list, x -> DepthOfPcElement( pcgs, x ) );
if not IsSubset( pcgs, list ) then
pcgs := List(pcgs);
for i in [ 1 .. Length(list) ] do
pcgs[wp[i]] := list[i];
od;
pcgs := InducedPcgsByPcSequenceNC( home, pcgs );
fi;
wd := Difference( wp, wm );
pcs := list{ List( wd, x -> Position( wp, x ) ) };
fi;
# check which filter to use
filter := IsModuloPcgs and
HasDenominatorOfModuloPcgs and HasNumeratorOfModuloPcgs;
depthsInParent:=fail; # do not set by default
dd:=fail; # do not set by default
if IsEmpty(wd) or wd[Length(wd)] = Length(wd) then
filter := filter and IsModuloTailPcgsRep;
# are we even: tail mod further tail?
if IsSubsetInducedPcgsRep(pcgs) and IsModuloTailPcgsRep(pcgs)
and IsBound(pcgs!.depthsInParent) then
filter:=filter and IsSubsetInducedNumeratorModuloTailPcgsRep;
depthsInParent:=pcgs!.depthsInParent{wd};
# is everything even family induced?
if HasIsParentPcgsFamilyPcgs(pcgs)
and IsParentPcgsFamilyPcgs(pcgs) then
filter:=filter and IsNumeratorParentPcgsFamilyPcgs;
fi;
elif HasIsFamilyPcgs(pcgs) and IsFamilyPcgs(pcgs) then
# the same if the enumerator is not induced but actually the
# familypcgs
filter:=filter and IsSubsetInducedNumeratorModuloTailPcgsRep
and IsNumeratorParentPcgsFamilyPcgs;
depthsInParent:=[1..Length(pcgs)]; # not stored in FamilyPcgs
depthsInParent:=depthsInParent{wd};
fi;
else
if Length(wd)=Length(Set(wd)) and IsSubset(list,modulo) then
# the depths are all different and the modulus is just a tail. We
# can get the exponents from the parent pcgs.
filter:=filter and IsNumeratorParentForExponentsRep;
if not IsBound(pcgs!.depthsInParent) then
pcgs!.depthsInParent:=List(pcgs,i->DepthOfPcElement(Parent(pcgs),i));
fi;
depthsInParent:=pcgs!.depthsInParent{wd};
else
if HasParentPcgs(pcgs) and
IsPcgsElementaryAbelianSeries(ParentPcgs(pcgs)) then
par:=ParentPcgs(pcgs);
depthsInParent:=List(pcs,x->DepthOfPcElement(par,x));
dd:=List(modulo,x->DepthOfPcElement(par,x));
if
Length(Union(depthsInParent,dd))=Length(depthsInParent)+Length(dd)
then
# we can use the parent layers to calculate exponents
filter:=filter and IsNumeratorParentLayersForExponentsRep;
else
depthsInParent:=fail;
fi;
fi;
filter := filter and IsModuloPcgsRep;
fi;
fi;
if IsPrimeOrdersPcgs(home) then
filter := filter and HasIsPrimeOrdersPcgs and IsPrimeOrdersPcgs
and HasIsFiniteOrdersPcgs and IsFiniteOrdersPcgs;
elif IsFiniteOrdersPcgs(home) then
filter := filter and HasIsFiniteOrdersPcgs and IsFiniteOrdersPcgs;
fi;
# store the one and other information
# construct a pcgs from <pcs>
new := PcgsByPcSequenceCons(
IsPcgsDefaultRep,
filter,
FamilyObj(OneOfPcgs(pcgs)),
pcs,
[DenominatorOfModuloPcgs, modulo,
NumeratorOfModuloPcgs, pcgs ]);
SetRelativeOrders(new,RelativeOrders(pcgs){wd});
# store other useful information
new!.moduloDepths := wm;
# setup the maps
new!.moduloMap := [];
for i in [ 1 .. Length(wm) ] do
new!.moduloMap[wm[i]] := i;
od;
new!.depthMap := [];
for i in [ 1 .. Length(wd) ] do
new!.depthMap[wd[i]] := i;
od;
if depthsInParent<>fail then
new!.numeratorParent:=ParentPcgs(pcgs);
new!.depthsInParent:=depthsInParent;
new!.parentZeroVector:=ParentPcgs(pcgs)!.zeroVector;
fi;
if dd<>fail then
new!.denpardepths:=dd;
wm:=[];
for i in [1..Length(dd)] do
wm[dd[i]]:=i;
od;
new!.parentDenomMap:=wm;
wm:=[];
for i in [1..Length(depthsInParent)] do
wm[depthsInParent[i]]:=i;
od;
new!.parentDepthMap:=wm;
if HasIndicesEANormalSteps(par) then
i:=IndicesEANormalSteps(par);
else
i:=IndicesNormalSteps(par);
fi;
new!.layranges:=List([1..Length(i)-1],x->[i[x]..i[x+1]-1]);
pcsexp:=List(pcs,x->ExponentsOfPcElement(par,x));
denexp:=List(modulo,x->ExponentsOfPcElement(par,x));
bascha:=List(new!.layranges,x->fail);
new!.basechange:=bascha;
idx:=[];
new!.indices:=idx;
for i in [1..Length(new!.layranges)] do
if new!.layranges[i][1]<=Length(wm) then
dd:=GF(RelativeOrders(par)[new!.layranges[i][1]]);
sep:=Filtered([1..Length(pcs)],
x->PositionNonZero(pcsexp[x]) in new!.layranges[i]);
sed:=Filtered([1..Length(modulo)],
x->PositionNonZero(denexp[x]) in new!.layranges[i]);
if Length(sep)>0 or Length(sed)>0 then
mat:=Concatenation(pcsexp{sep}{new!.layranges[i]},
denexp{sed}{new!.layranges[i]})*One(dd);
mat:=ImmutableMatrix(dd,mat);
while Length(mat)<Length(mat[1]) do
mat:=Concatenation(mat,[First(IdentityMat(Length(mat[1]),dd),
x->SolutionMat(mat,x)=fail)]);
mat:=ImmutableMatrix(dd,mat);
od;
bascha[i]:=mat^-1;
idx[i]:=[sep,sed];
fi;
fi;
od;
fi;
# and return
return new;
end );
#############################################################################
##
#M ModuloPcgsByPcSequence( <home>, <pcs>, <modulo> )
##
InstallMethod( ModuloPcgsByPcSequence,
"generic method",
true,
[ IsPcgs,
IsList,
IsInducedPcgs ],
0,
function( home, list, modulo )
return ModuloPcgsByPcSequenceNC( home, list, modulo );
end );
#############################################################################
##
#M <pcgs1> mod <induced-pcgs2>
##
InstallMethod( MOD,"parent pcgs mod induced pcgs",
IsIdenticalObj,
[ IsPcgs,
IsInducedPcgs ],
0,
function( pcgs, modulo )
if ParentPcgs(modulo) <> pcgs then
TryNextMethod();
fi;
return ModuloPcgsByPcSequenceNC( pcgs, pcgs, modulo );
end );
#############################################################################
##
#M <pcgs1> mod <pcgs2>
##
InstallMethod( MOD,"two parent pcgs",
IsIdenticalObj,
[ IsPcgs,
IsPcgs ],
0,
function( pcgs, modulo )
if modulo <> pcgs then
TryNextMethod();
fi;
return ModuloPcgsByPcSequenceNC( pcgs, pcgs, modulo );
end );
#############################################################################
##
#M <induced-pcgs1> mod <induced-pcgs2>
##
InstallMethod( MOD,"two induced pcgs",
IsIdenticalObj,
[ IsInducedPcgs,
IsInducedPcgs ],
0,
function( pcgs, modulo )
if ParentPcgs(modulo) <> ParentPcgs(pcgs) then
TryNextMethod();
fi;
return ModuloPcgsByPcSequenceNC( ParentPcgs(pcgs), pcgs, modulo );
end );
#############################################################################
##
#M <modulo-pcgs1> mod <modulo-pcgs2>
##
InstallMethod( MOD,"two modulo pcgs",
IsIdenticalObj,
[ IsModuloPcgs,
IsModuloPcgs ],
0,
function( pcgs, modulo )
if DenominatorOfModuloPcgs(pcgs) <> DenominatorOfModuloPcgs(modulo) then
Error( "denominators of <pcgs> and <modulo> are not equal" );
fi;
return NumeratorOfModuloPcgs(pcgs) mod NumeratorOfModuloPcgs(modulo);
end );
#############################################################################
##
#M <(induced)pcgs1> mod <(induced)pcgs 2>
##
InstallMethod( MOD,"two induced pcgs",
IsIdenticalObj, [ IsPcgs, IsPcgs ], 0,
function( pcgs, modulo )
# enforce the same parent pcgs
if ParentPcgs(modulo) <> ParentPcgs(pcgs) then
modulo:=InducedPcgsByGeneratorsNC(ParentPcgs(pcgs),AsList(modulo));
fi;
return ModuloPcgsByPcSequenceNC( ParentPcgs(pcgs), pcgs, modulo );
end);
#############################################################################
##
#M DepthOfPcElement( <modulo-pcgs>, <elm>, <min> )
##
InstallOtherMethod( DepthOfPcElement,
"pcgs modulo pcgs, ignoring <min>",
function(a,b,c) return IsCollsElms(a,b); end,
[ IsModuloPcgs,
IsObject,
IsInt ],
0,
function( pcgs, elm, min )
local dep;
dep := DepthOfPcElement( pcgs, elm );
if dep < min then
Error( "minimal depth <min> is incorrect" );
fi;
return dep;
end );
#############################################################################
##
#M ExponentOfPcElement( <modulo-pcgs>, <elm>, <pos> )
##
InstallOtherMethod( ExponentOfPcElement,
"pcgs modulo pcgs, ExponentsOfPcElement", IsCollsElmsX,
[ IsModuloPcgs, IsObject, IsPosInt ], 0,
function( pcgs, elm, pos )
return ExponentsOfPcElement(pcgs,elm)[pos];
end );
#############################################################################
##
#M ExponentsOfPcElement( <pcgs>, <elm>, <poss> )
##
InstallOtherMethod( ExponentsOfPcElement,
"pcgs mod. pcgs,range, falling back to Exp.OfPcElement", IsCollsElmsX,
[ IsModuloPcgs, IsObject, IsList ], 0,
function( pcgs, elm, pos )
return ExponentsOfPcElement(pcgs,elm){pos};
end );
#############################################################################
##
#M IsFiniteOrdersPcgs( <modulo-pcgs> )
##
InstallOtherMethod( IsFiniteOrdersPcgs, true, [ IsModuloPcgs ], 0,
function( pcgs )
return ForAll( RelativeOrders(pcgs), x -> x <> 0 and x <> infinity );
end );
#############################################################################
##
#M IsPrimeOrdersPcgs( <modulo-pcgs> )
##
InstallOtherMethod( IsPrimeOrdersPcgs,
true,
[ IsModuloPcgs ],
0,
function( pcgs )
return ForAll( RelativeOrders(pcgs), x -> IsPrimeInt(x) );
end );
#############################################################################
##
#M LeadingExponentOfPcElement( <modulo-pcgs>, <elm> )
##
InstallOtherMethod( LeadingExponentOfPcElement,
"pcgs modulo pcgs, use ExponentsOfPcElement", IsCollsElms,
[ IsModuloPcgs, IsObject ], 0,
function( pcgs, elm )
local exp, dep;
exp := ExponentsOfPcElement( pcgs, elm );
dep := PositionNot( exp, 0 );
if Length(exp) < dep then
return fail;
else
return exp[dep];
fi;
end );
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <empty-list> )
##
InstallOtherMethod( PcElementByExponentsNC, "generic method for empty lists",
true, [ IsModuloPcgs, IsList and IsEmpty ], 0,
function( pcgs, list )
return OneOfPcgs(pcgs);
end );
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <list> )
##
InstallOtherMethod( PcElementByExponentsNC, "generic method: modulo", true,
[ IsModuloPcgs, IsRowVector and IsCyclotomicCollection ], 0,
function( pcgs, list )
return DoPcElementByExponentsGeneric(pcgs,pcgs,list);
end);
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <ffe-list> )
##
InstallOtherMethod( PcElementByExponentsNC, "generic method: modulo, FFE",
true, [ IsModuloPcgs, IsRowVector and IsFFECollection ], 0,
function( pcgs, list )
return DoPcElementByExponentsGeneric(pcgs,pcgs,list);
end);
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <basis>, <empty-list> )
##
InstallOtherMethod( PcElementByExponentsNC,
"generic method for empty list as basis or basisindex, modulo", true,
[ IsModuloPcgs, IsList and IsEmpty, IsList ],
SUM_FLAGS, #this is better than everything else
function( pcgs, basis, list )
return OneOfPcgs(pcgs);
end );
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <basis>, <list> )
##
InstallOtherMethod( PcElementByExponentsNC, "generic method: modulo, basis",
IsFamFamX, [IsModuloPcgs,IsList,IsRowVector and IsCyclotomicCollection], 0,
DoPcElementByExponentsGeneric );
#############################################################################
##
#M PcElementByExponentsNC( <pcgs>, <basis>, <list> )
##
InstallOtherMethod( PcElementByExponentsNC,
"generic method: modulo, basis, FFE", IsFamFamX,
[ IsModuloPcgs, IsList, IsRowVector and IsFFECollection ], 0,
DoPcElementByExponentsGeneric );
#############################################################################
##
#M ReducedPcElement( <pcgs>, <left>, <right> )
##
InstallOtherMethod( ReducedPcElement,
"pcgs modulo pcgs",
IsCollsElmsElms,
[ IsModuloPcgs,
IsObject,
IsObject ],
0,
function( pcgs, left, right )
# Avoid infinite recursion
if IsIdenticalObj(NumeratorOfModuloPcgs(pcgs),pcgs) then
TryNextMethod();
fi;
return ReducedPcElement( NumeratorOfModuloPcgs(pcgs), left, right );
end );
#############################################################################
##
#M RelativeOrderOfPcElement( <pcgs>, <elm> )
##
InstallOtherMethod( RelativeOrderOfPcElement,
"pcgs modulo pcgs",
IsCollsElms,
[ IsModuloPcgs and IsPrimeOrdersPcgs,
IsObject ],
# as we fall back on the code for pcgs, we must be sure that the method
# has lower value
RankFilter(IsModuloPcgs)
-RankFilter(IsModuloPcgs and IsPrimeOrdersPcgs),
function( pcgs, elm )
# Avoid infinite recursion
if IsIdenticalObj(NumeratorOfModuloPcgs(pcgs),pcgs) then
TryNextMethod();
fi;
return RelativeOrderOfPcElement( NumeratorOfModuloPcgs(pcgs), elm );
end );
#############################################################################
##
#M DepthOfPcElement( <modulo-pcgs>, <elm> )
##
InstallOtherMethod( DepthOfPcElement,
"pcgs modulo pcgs",
IsCollsElms,
[ IsModuloPcgs and IsModuloPcgsRep,
IsObject ],
0,
function( pcgs, elm )
local d, num;
# Avoid infinite recursion
if IsIdenticalObj(NumeratorOfModuloPcgs(pcgs),pcgs) then
TryNextMethod();
fi;
num := NumeratorOfModuloPcgs(pcgs);
d := DepthOfPcElement( num, elm );
if d > Length(num) then
return Length(pcgs)+1;
elif d in pcgs!.moduloDepths then
return PositionNot( ExponentsOfPcElement( pcgs, elm ), 0 );
else
return pcgs!.depthMap[d];
fi;
end );
#############################################################################
##
#M ExponentsOfPcElement( <modulo-pcgs>, <elm> )
##
InstallOtherMethod( ExponentsOfPcElement, "pcgs modulo pcgs", IsCollsElms,
[ IsModuloPcgs and IsModuloPcgsRep, IsObject ], 0,
function( pcgs, elm )
local id, exp, ros, den, num, wm, mm, pm, d, ll, lr,lede;
# Avoid infinite recursion
if IsIdenticalObj(NumeratorOfModuloPcgs(pcgs),pcgs) then
TryNextMethod();
fi;
id := OneOfPcgs(pcgs);
exp := ListWithIdenticalEntries(Length(pcgs),0);
if not IsBound(pcgs!.lede) then pcgs!.lede:=[];fi;
lede:=pcgs!.lede;
den := DenominatorOfModuloPcgs(pcgs);
num := NumeratorOfModuloPcgs(pcgs);
if not IsPrimeOrdersPcgs(num) then TryNextMethod(); fi;
wm := pcgs!.moduloDepths;
mm := pcgs!.moduloMap;
pm := pcgs!.depthMap;
ros := RelativeOrders(num);
while elm <> id do
d := DepthOfPcElement( num, elm );
if d>Length(pm) then
# all lower will only be in denominator
return exp;
fi;
ll := LeadingExponentOfPcElement( num, elm );
if IsBound(mm[d]) then
if not IsBound(lede[d]) then
lede[d]:=LeadingExponentOfPcElement( num, den[mm[d]] );
fi;
lr := lede[d];
elm := LeftQuotient( den[mm[d]]^(ll / lr mod ros[d]), elm );
else
#ll := LeadingExponentOfPcElement( num, elm );
if not IsBound(lede[d]) then
lede[d]:=LeadingExponentOfPcElement( num, pcgs[pm[d]] );
fi;
lr := lede[d];
exp[pm[d]] := ll / lr mod ros[d];
elm := LeftQuotient( pcgs[pm[d]]^exp[pm[d]], elm );
fi;
od;
return exp;
end );
#############################################################################
##
#M ExponentsOfPcElement( <modulo-pcgs>, <elm> )
##
InstallOtherMethod( ExponentsOfPcElement, "modpcgs numerator parent layers",
IsCollsElms,
[ IsModuloPcgs and IsModuloPcgsRep and
IsNumeratorParentLayersForExponentsRep, IsObject ], 0,
function( pcgs, elm )
local id,exp,den,par,ll,lr,idx,bascha,e,ee,prd,i,la,lap,pm;
#elm0:=elm;
id := OneOfPcgs(pcgs);
exp := ListWithIdenticalEntries(Length(pcgs),0);
if not IsBound(pcgs!.lede) then pcgs!.lede:=[];fi;
den := DenominatorOfModuloPcgs(pcgs);
par := ParentPcgs(NumeratorOfModuloPcgs(pcgs));
if not IsPrimeOrdersPcgs(par) then TryNextMethod(); fi;
idx:=pcgs!.indices;
bascha:=pcgs!.basechange;
pm:=Length(pcgs!.parentDepthMap);
for lap in [1..Length(pcgs!.layranges)] do
if bascha[lap]<>fail then
la:=pcgs!.layranges[lap];
ee:=ExponentsOfPcElement(par,elm,la);
ee:=ee*bascha[lap]; # coefficients as needed
if lap<Length(pcgs!.layranges) and pcgs!.layranges[lap+1][1]<=pm then
prd:=id;
else
prd:=fail;
fi;
ll:=idx[lap][1];
for i in [1..Length(ll)] do
e:=Int(ee[i]);
exp[ll[i]]:=e;
if prd<>fail and not IsZero(e) then
prd:=prd*pcgs[ll[i]]^e;
fi;
od;
if prd<>fail then
ll:=Length(ll);
lr:=idx[lap][2];
for i in [1..Length(lr)] do
e:=Int(ee[i+ll]);
if not IsZero(e) then;
prd:=prd*den[lr[i]]^e;
fi;
od;
fi;
if prd<>fail and not IsIdenticalObj(prd,id) then
# divide off
elm:=LeftQuotient(prd,elm);
fi;
if prd=fail then
#if exp<>basiccmp(pcgs,elm0) then Error("err1");fi;
return exp;
fi;
fi;
od;
#if exp<>basiccmp(pcgs,elm0) then Error("err2");fi;
return exp;
end );
#############################################################################
##
#M ExponentsOfPcElement( <modulo-pcgs>, <elm>, <subrange> )
##
# this methoid ought to be obsolete
InstallOtherMethod( ExponentsOfPcElement, "pcgs modulo pcgs, subrange",
IsCollsElmsX, [ IsModuloPcgs and IsModuloPcgsRep, IsObject,IsList ], 0,
function( pcgs, elm,range )
local id, exp, ros, den, num, wm, mm, pm, d, ll, lr,max;
# Avoid infinite recursion
if IsIdenticalObj(NumeratorOfModuloPcgs(pcgs),pcgs) then
TryNextMethod();
fi;
Info(InfoWarning,1,"Obsolete exponents method");
if not IsSSortedList(range) then
TryNextMethod(); # the range may be unsorted or contain duplicates,
# then we would have to be more clever.
fi;
max:=Maximum(range);
id := OneOfPcgs(pcgs);
exp := ListWithIdenticalEntries(Length(pcgs),0);
den := DenominatorOfModuloPcgs(pcgs);
num := NumeratorOfModuloPcgs(pcgs);
if not IsPrimeOrdersPcgs(num) then TryNextMethod(); fi;
wm := pcgs!.moduloDepths;
mm := pcgs!.moduloMap;
pm := pcgs!.depthMap;
ros := RelativeOrders(num);
while elm <> id do
d := DepthOfPcElement( num, elm );
if IsBound(pm[d]) and pm[d]>max then
# we have reached the maximum of the range we asked for. Thus we
# can stop calculating exponents now, all further exponents would
# be discarded anyhow.
# Note that the depthMap is sorted!
elm:=id;
else
if IsBound(mm[d]) then
ll := LeadingExponentOfPcElement( num, elm );
lr := LeadingExponentOfPcElement( num, den[mm[d]] );
elm := LeftQuotient( den[mm[d]]^(ll / lr mod ros[d]), elm );
else
ll := LeadingExponentOfPcElement( num, elm );
lr := LeadingExponentOfPcElement( num, pcgs[pm[d]] );
exp[pm[d]] := ll / lr mod ros[d];
elm := LeftQuotient( pcgs[pm[d]]^exp[pm[d]], elm );
fi;
fi;
od;
exp:=exp{range};
return exp;
end );
#############################################################################
##
#M ExponentsOfPcElement( <tail-pcgs>, <elm> )
##
InstallOtherMethod( ExponentsOfPcElement, "pcgs modulo tail-pcgs", IsCollsElms,
[ IsModuloPcgs and IsModuloTailPcgsRep, IsObject ], 0,
function( pcgs, elm )
return ExponentsOfPcElement(
NumeratorOfModuloPcgs(pcgs), elm, pcgs!.depthMap );
end );
#############################################################################
##
#M ExponentsOfPcElement( <tail-pcgs>, <elm>, <subrange> )
##
InstallOtherMethod( ExponentsOfPcElement, "pcgs modulo tail-pcgs, subrange",
IsCollsElmsX, [ IsModuloPcgs and IsModuloTailPcgsRep, IsObject,IsList ], 0,
function( pcgs, elm,range )
return ExponentsOfPcElement(
NumeratorOfModuloPcgs(pcgs), elm, pcgs!.depthMap{range} );
end );
#############################################################################
##
#M ExponentOfPcElement( <tail-pcgs>, <elm>, <pos> )
##
InstallOtherMethod( ExponentOfPcElement,
"pcgs modulo tail-pcgs, ExponentsOfPcElement",IsCollsElmsX,
[ IsModuloPcgs and IsModuloTailPcgsRep,
IsObject,
IsPosInt ], 0,
function( pcgs, elm, pos )
return ExponentOfPcElement(
NumeratorOfModuloPcgs(pcgs), elm, pcgs!.depthMap[pos] );
end );
#############################################################################
##
#M ExponentsConjugateLayer( <mpcgs>,<elm>,<e> )
##
InstallMethod( ExponentsConjugateLayer,"default: compute brute force",
IsCollsElmsElms,[IsModuloPcgs,IsMultiplicativeElementWithInverse,
IsMultiplicativeElementWithInverse],0,
function(m,elm,e)
return ExponentsOfPcElement(m,elm^e);
end);
#############################################################################
##
#M PcGroupWithPcgs( <modulo-pcgs> )
##
InstallMethod( PcGroupWithPcgs, "pcgs modulo pcgs", true, [ IsModuloPcgs ], 0,
function( pcgs )
# the following only works for finite orders
if not IsFiniteOrdersPcgs(pcgs) then
TryNextMethod();
fi;
return GROUP_BY_PCGS_FINITE_ORDERS(pcgs);
end );
#############################################################################
##
#M GroupOfPcgs( <modulo-pcgs> )
##
InstallOtherMethod( GroupOfPcgs, true, [ IsModuloPcgs ], 0,
function( pcgs )
return GroupOfPcgs( NumeratorOfModuloPcgs( pcgs ) );
end );
#############################################################################
##
#M NumeratorOfModuloPcgs( <modolo-tail-pcgs-by-list-rep> )
##
InstallMethod( NumeratorOfModuloPcgs,
"modolo-tail-pcgs-by-list-rep", true,
[ IsModuloPcgs and IsModuloTailPcgsByListRep],0,
function( mpcgs )
local home;
home:=mpcgs!.numeratorParent;
return InducedPcgsByPcSequenceNC(home,
Concatenation(mpcgs!.pcSequence,home{mpcgs!.moduloDepths}));
end );
#############################################################################
##
#M DenominatorOfModuloPcgs( <modolo-tail-pcgs-by-list-rep> )
##
InstallMethod( DenominatorOfModuloPcgs,
"modolo-tail-pcgs-by-list-rep", true,
[ IsModuloPcgs and IsModuloTailPcgsByListRep],0,
function( mpcgs )
local home;
home:=mpcgs!.numeratorParent;
return InducedPcgsByPcSequenceNC(home,home{mpcgs!.moduloDepths});
end );
#############################################################################
##
#M NumeratorOfModuloPcgs( <pcgs> )
##
InstallMethod(NumeratorOfModuloPcgs,"for pcgs",true,[IsPcgs],0,
function(pcgs)
if IsModuloPcgs(pcgs) and not IsPcgs(pcgs) then
TryNextMethod();
fi;
return pcgs;
end);
#############################################################################
##
#M DenominatorOfModuloPcgs( <pcgs> )
##
InstallMethod(DenominatorOfModuloPcgs,"for pcgs",true,[IsPcgs],0,
function(pcgs)
if IsModuloPcgs(pcgs) and not IsPcgs(pcgs) then
TryNextMethod();
fi;
return InducedPcgsByGeneratorsNC(pcgs,[]);
end);
#############################################################################
##
#M ModuloPcgs( <G>,<H> )
##
InstallMethod(ModuloPcgs,"for groups",IsIdenticalObj,[IsGroup,IsGroup],0,
function(G,H)
local home;
home:=HomePcgs(G);
RelativeOrders(home);
G:=InducedPcgs(home,G);
return G mod InducedPcgs(home,H);
end);
#############################################################################
##
#M PcElementByExponentsNC( <family pcgs modulo>, <list> )
##
InstallMethod( PcElementByExponentsNC,
"modulo subset induced wrt family pcgs", true,
[ IsModuloPcgs and
IsSubsetInducedNumeratorModuloTailPcgsRep and IsPrimeOrdersPcgs
and IsNumeratorParentPcgsFamilyPcgs,
IsRowVector and IsCyclotomicCollection ], 0,
function( pcgs, list )
local exp;
exp:=ShallowCopy(pcgs!.parentZeroVector);
exp{pcgs!.depthsInParent}:=list;
return ObjByVector(TypeObj(OneOfPcgs(pcgs)),exp);
end);
InstallOtherMethod( PcElementByExponentsNC,
"modulo subset induced wrt family pcgs,index", true,
[ IsModuloPcgs and
IsSubsetInducedNumeratorModuloTailPcgsRep and IsPrimeOrdersPcgs
and IsNumeratorParentPcgsFamilyPcgs,
IsRowVector and IsCyclotomicCollection,
IsRowVector and IsCyclotomicCollection ], 0,
function( pcgs,ind, list )
local exp;
#Assert(1,ForAll(list,i->i>=0));
exp:=ShallowCopy(pcgs!.parentZeroVector);
exp{pcgs!.depthsInParent{ind}}:=list;
return ObjByVector(TypeObj(OneOfPcgs(pcgs)),exp);
end);
#############################################################################
##
#M PcElementByExponentsNC( <family pcgs modulo>, <list> )
##
InstallMethod( PcElementByExponentsNC,
"modulo subset induced wrt family pcgs, FFE", true,
[ IsModuloPcgs and
IsSubsetInducedNumeratorModuloTailPcgsRep and IsPrimeOrdersPcgs
and IsNumeratorParentPcgsFamilyPcgs,
IsRowVector and IsFFECollection ], 0,
function( pcgs, list )
local exp;
list:=IntVecFFE(list);
exp:=ShallowCopy(pcgs!.parentZeroVector);
exp{pcgs!.depthsInParent}:=list;
return ObjByVector(TypeObj(OneOfPcgs(pcgs)),exp);
end);
InstallOtherMethod( PcElementByExponentsNC,
"modulo subset induced wrt family pcgs, FFE, index", true,
[ IsModuloPcgs and
IsSubsetInducedNumeratorModuloTailPcgsRep and IsPrimeOrdersPcgs
and IsNumeratorParentPcgsFamilyPcgs,
IsRowVector and IsCyclotomicCollection,
IsRowVector and IsFFECollection ], 0,
function( pcgs,ind, list )
local exp;
list:=IntVecFFE(list);
exp:=ShallowCopy(pcgs!.parentZeroVector);
exp{pcgs!.depthsInParent{ind}}:=list;
return ObjByVector(TypeObj(OneOfPcgs(pcgs)),exp);
end);
InstallMethod( ExponentsConjugateLayer,"subset induced modulo pcgs",
IsCollsElmsElms,
[ IsModuloPcgs and
IsSubsetInducedNumeratorModuloTailPcgsRep and IsPrimeOrdersPcgs
and IsNumeratorParentPcgsFamilyPcgs,
IsMultiplicativeElementWithInverse,IsMultiplicativeElementWithInverse],0,
function(m,e,c)
return DoExponentsConjLayerFampcgs(m!.numeratorParent,m,e,c);
end);
#############################################################################
##
#M ExponentsOfPcElement( <subset-induced,modulo-tail-pcgs>,<elm>,<subrange> )
##
InstallOtherMethod( ExponentsOfPcElement,
"subset induced pcgs modulo tail-pcgs, subrange",
IsCollsElmsX,
[ IsModuloPcgs and IsModuloTailPcgsRep
and IsNumeratorParentForExponentsRep, IsObject,IsList ], 0,
function( pcgs, elm, range )
return
ExponentsOfPcElement(pcgs!.numeratorParent,elm,pcgs!.depthsInParent{range});
end );
#############################################################################
##
#M ExponentsOfPcElement( <subset-induced,modulo-tail-pcgs>, <elm> )
##
InstallOtherMethod( ExponentsOfPcElement,
"subset induced pcgs modulo tail-pcgs", IsCollsElms,
[ IsModuloPcgs and IsModuloTailPcgsRep
and IsNumeratorParentForExponentsRep, IsObject ], 0,
function( pcgs, elm )
return
ExponentsOfPcElement(pcgs!.numeratorParent,elm,pcgs!.depthsInParent);
end );
#############################################################################
##
#M ExponentsOfConjugate( <subset-induced,modulo-tail-pcgs>, <> )
##
InstallOtherMethod( ExponentsOfConjugate,
"subset induced pcgs modulo tail-pcgs", true,
[ IsModuloPcgs and IsModuloTailPcgsRep
and IsNumeratorParentForExponentsRep, IsPosInt,IsPosInt ], 0,
function( pcgs, i,j )
return ExponentsOfConjugate(ParentPcgs(pcgs!.numeratorParent),
pcgs!.depthsInParent[i], # depth of the element in the parent
pcgs!.depthsInParent[j]) # depth of the element in the parent
{pcgs!.depthsInParent};
end );
#############################################################################
##
#M ExponentsOfRelativePower( <subset-induced,modulo-tail-pcgs>, <> )
##
InstallOtherMethod( ExponentsOfRelativePower,
"subset induced pcgs modulo tail-pcgs", true,
[ IsModuloPcgs and IsModuloTailPcgsRep
and IsNumeratorParentForExponentsRep, IsPosInt ], 0,
function( pcgs, ind )
return ExponentsOfRelativePower(ParentPcgs(pcgs!.numeratorParent),
pcgs!.depthsInParent[ind]) # depth of the element in the parent
{pcgs!.depthsInParent};
end );
#############################################################################
##
#E pcgs.gi . . . . . . . . . . . . . . . . . . . . . . . . . . . . ends here
##
|