/usr/share/gap/lib/pcgsmodu.gi is in gap-libs 4r7p9-1.
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 | #############################################################################
##
#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" ] );
#############################################################################
##
#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;
# <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
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;
# 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
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;
else
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{wd};
new!.parentZeroVector:=ParentPcgs(pcgs)!.zeroVector;
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 )
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 )
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;
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;
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(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;
od;
return exp;
end );
#############################################################################
##
#M ExponentsOfPcElement( <modulo-pcgs>, <elm>, <subrange> )
##
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;
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
##
|