Ticket #5542: trac_5542-docstring-fixes.patch
| File trac_5542-docstring-fixes.patch, 37.9 KB (added by mvngu, 4 years ago) |
|---|
-
sage/groups/perm_gps/permgroup.py
# HG changeset patch # User Minh Van Nguyen <nguyenminh2@gmail.com> # Date 1237275995 25200 # Node ID 664f5d732bc8c38fa5df8c48c054201eee39eaba # Parent 5f82fbe330b31b7707d99f60c0ad8ea867a0057d Docstring fixes for permgroup.py; follow up to #5536 diff -r 5f82fbe330b3 -r 664f5d732bc8 sage/groups/perm_gps/permgroup.py
a b 1 1 r""" 2 2 Permutation groups 3 3 4 A permutation group is a finite group Gwhose elements are5 permutations of a given finite set X (i.e., bijections X -> X) and6 whose group operation is the composition of permutations. The 7 number of elements of `X` is called the degree of G.4 A permutation group is a finite group `G` whose elements are 5 permutations of a given finite set `X` (i.e., bijections 6 `X \longrightarrow X`) and whose group operation is the composition of 7 permutations. The number of elements of `X` is called the degree of `G`. 8 8 9 In Sage a permutation is represented as either a string that9 In Sage, a permutation is represented as either a string that 10 10 defines a permutation using disjoint cycle notation, or a list of 11 tuples, which represent disjoint cycles. 12 13 :: 11 tuples, which represent disjoint cycles. That is:: 14 12 15 13 (a,...,b)(c,...,d)...(e,...,f) <--> [(a,...,b), (c,...,d),..., (e,...,f)] 16 14 () = identity <--> [] … … 20 18 constructions: 21 19 22 20 - permutation group generated by elements, 23 - direct_product_permgroups, which takes a list of permutation21 - ``direct_product_permgroups``, which takes a list of permutation 24 22 groups and returns their direct product. 25 23 26 24 JOKE: Q: What's hot, chunky, and acts on a polygon? A: Dihedral … … 137 135 def load_hap(): 138 136 """ 139 137 Load the GAP hap package into the default GAP interpreter 140 interface , and if this fails, try one more time to load it.138 interface. If this fails, try one more time to load it. 141 139 142 EXAMPLES: 140 EXAMPLES:: 141 143 142 sage: sage.groups.perm_gps.permgroup.load_hap() 144 143 """ 145 144 try: … … 149 148 150 149 def direct_product_permgroups(P): 151 150 """ 152 Takes the direct product of the permutation groups listed in P.151 Takes the direct product of the permutation groups listed in ``P``. 153 152 154 153 EXAMPLES:: 155 154 … … 180 179 181 180 def from_gap_list(G, src): 182 181 r""" 183 Convert a string giving a list of GAP permutations into a list of elements of G. 182 Convert a string giving a list of GAP permutations into a list of 183 elements of ``G``. 184 184 185 185 EXAMPLES:: 186 186 … … 210 210 INPUT: 211 211 212 212 213 - ``gens`` - list of generators 213 - ``gens`` - list of generators (default: ``None``) 214 214 215 - ``gap_group`` - a gap permutation group 215 - ``gap_group`` - a gap permutation group (default: ``None``) 216 216 217 - ``canonicalize`` - bool (default: True), if True217 - ``canonicalize`` - bool (default: ``True``); if ``True``, 218 218 sort generators and remove duplicates 219 219 220 220 221 OUTPUT: a permutation group 221 OUTPUT: 222 223 - A permutation group. 222 224 223 225 EXAMPLES:: 224 226 … … 237 239 [(1,2,3,4), (1,3)] 238 240 239 241 We can also create permutation groups whose generators are Gap 240 permutation objects. 241 242 :: 242 permutation objects:: 243 243 244 244 sage: p = gap('(1,2)(3,7)(4,6)(5,8)'); p 245 245 (1,2)(3,7)(4,6)(5,8) 246 246 sage: PermutationGroup([p]) 247 247 Permutation Group with generators [(1,2)(3,7)(4,6)(5,8)] 248 248 249 EXAMPLES: There is an underlying gap object that implements each 250 permutation group. 251 252 :: 249 There is an underlying gap object that implements each 250 permutation group:: 253 251 254 252 sage: G = PermutationGroup([[(1,2,3,4)]]) 255 253 sage: G._gap_() … … 299 297 INPUT: 300 298 301 299 302 - ``gens`` - list of generators 300 - ``gens`` - list of generators (default: ``None``) 303 301 304 - ``gap_group`` - a gap permutation group 302 - ``gap_group`` - a gap permutation group (default: ``None``) 305 303 306 - ``canonicalize`` - bool (default: True), if True304 - ``canonicalize`` - bool (default: ``True``); if ``True``, 307 305 sort generators and remove duplicates 308 306 309 307 310 OUTPUT: a permutation group 308 OUTPUT: 309 310 - A permutation group. 311 311 312 EXAMPLES: We explicitly construct the alternating group on four313 elements. 314 315 ::312 EXAMPLES: 313 314 We explicitly construct the alternating group on four 315 elements:: 316 316 317 317 sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 318 318 Permutation Group with generators [(2,3,4), (1,2,3)] … … 368 368 369 369 def _gap_init_(self): 370 370 r""" 371 Returns a string showing how to declare / initialize selfin Gap.371 Returns a string showing how to declare / initialize ``self`` in Gap. 372 372 Stored in the ``self._gap_string`` attribute. 373 373 374 EXAMPLES: The ``_gap_init_`` method shows how you 374 EXAMPLES: 375 376 The ``_gap_init_`` method shows how you 375 377 would define the Sage ``PermutationGroup_generic`` 376 378 object in Gap:: 377 379 … … 384 386 385 387 def _magma_init_(self, magma): 386 388 r""" 387 Returns a string showing how to declare / in tialize self in Magma.389 Returns a string showing how to declare / initialize self in Magma. 388 390 389 EXAMPLES: We explicitly construct the alternating group on four 391 EXAMPLES: 392 393 We explicitly construct the alternating group on four 390 394 elements. In Magma, one would type the string below to construct 391 the group. 392 393 :: 395 the group:: 394 396 395 397 sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 396 398 Permutation Group with generators [(2,3,4), (1,2,3)] … … 402 404 403 405 def __cmp__(self, right): 404 406 """ 405 Compare self and right.407 Compare ``self`` and ``right``. 406 408 407 409 The ordering is whatever it is in Gap. 408 410 … … 422 424 423 425 def __call__(self, x, check=True): 424 426 """ 425 Coerce xinto this permutation group.427 Coerce ``x`` into this permutation group. 426 428 427 429 The input can be either a string that defines a permutation in 428 430 cycle notation, a permutation group element, a list of integers 429 431 that gives the permutation as a mapping, a list of tuples, or the 430 432 integer 1. 431 433 432 EXAMPLES: We illustrate each way to make a permutation in S4:: 434 EXAMPLES: 435 436 We illustrate each way to make a permutation in `S_4`:: 433 437 434 438 sage: G = SymmetricGroup(4) 435 439 sage: G((1,2,3,4)) … … 482 486 483 487 def _coerce_impl(self, x): 484 488 r""" 485 Implicit coercion of x into self.489 Implicit coercion of ``x`` into ``self``. 486 490 487 EXAMPLES: We illustrate some arithmetic that involves implicit488 coercion of elements in different permutation groups. 489 490 ::491 EXAMPLES: 492 493 We illustrate some arithmetic that involves implicit 494 coercion of elements in different permutation groups:: 491 495 492 496 sage: g1 = PermutationGroupElement([(1,2),(3,4,5)]) 493 497 sage: g1.parent() … … 540 544 541 545 def __contains__(self, item): 542 546 """ 543 Returns boolean value of "item in self"547 Returns boolean value of ``item`` in ``self``. 544 548 545 549 EXAMPLES:: 546 550 … … 567 571 568 572 def has_element(self, item): 569 573 """ 570 Returns boolean value of "item in self"- however *ignores*574 Returns boolean value of ``item`` in ``self`` - however *ignores* 571 575 parentage. 572 576 573 577 EXAMPLES:: … … 610 614 sage: G.gens() 611 615 [(1,2), (1,2,3)] 612 616 613 Note that the generators need not be minimal though duplicates are 614 removed. 615 616 :: 617 Note that the generators need not be minimal, though duplicates are 618 removed:: 617 619 618 620 sage: G = PermutationGroup([[(1,2)], [(1,3)], [(2,3)], [(1,2)]]) 619 621 sage: G.gens() 620 622 [(2,3), (1,2), (1,3)] 621 623 622 :: 624 We can use index notation to access the generators returned by 625 ``self.gens``:: 623 626 624 627 sage: G = PermutationGroup([[(1,2,3,4), (5,6)], [(1,2)]]) 625 628 sage: g = G.gens() … … 628 631 sage: g[1] 629 632 (1,2,3,4)(5,6) 630 633 631 TESTS: We make sure that the trivial group gets handled correctly.632 633 ::634 TESTS: 635 636 We make sure that the trivial group gets handled correctly:: 634 637 635 638 sage: SymmetricGroup(1).gens() 636 639 [()] … … 640 643 641 644 def gens_small(self): 642 645 """ 643 Returns a generating set of G which has few elements. As neither644 irredundancy,nor minimal length is proven, it is fast.646 Returns a generating set of a group `G`, which has few elements. 647 As neither irredundancy nor minimal length is proven, it is fast. 645 648 646 649 EXAMPLES:: 647 650 … … 660 663 661 664 def gen(self, i): 662 665 r""" 663 Returns the i th generator of self; that is, the ith element of the664 list ``self.gens()``.666 Returns the i-th generator of ``self``; that is, the i-th element 667 of the list ``self.gens()``. 665 668 666 EXAMPLES: We explicitly construct the alternating group on four 669 EXAMPLES: 670 671 We explicitly construct the alternating group on four 667 672 elements:: 668 673 669 674 sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 … … 683 688 def cayley_table(self, names="x"): 684 689 """ 685 690 Returns the multiplication table, or Cayley table, of the finite 686 group Gin the form of a matrix with symbolic coefficients. This691 group `G` in the form of a matrix with symbolic coefficients. This 687 692 function is useful for learning, teaching, and exploring elementary 688 group theory. Of course, G must be a group of low order. 689 693 group theory. Of course, `G` must be a group of low order. 694 695 EXAMPLES: 696 690 697 As the last line below illustrates, the ordering used here in the 691 first row is the same as in G.list(). 692 693 EXAMPLES:: 698 first row is the same as in ``G.list()``:: 694 699 695 700 sage: G = PermutationGroup(['(1,2,3)', '(2,3)']) 696 701 sage: G.cayley_table() … … 757 762 def exponent(self): 758 763 """ 759 764 Computes the exponent of the group. The exponent `e` of a 760 group `G` is the lcmof the orders of its elements, that765 group `G` is the LCM of the orders of its elements, that 761 766 is, `e` is the smallest integer such that `g^e=1` 762 767 for all `g \in G`. 763 768 … … 840 845 841 846 def _repr_(self): 842 847 r""" 843 Returns a string describing self.848 Returns a string describing ``self``. 844 849 845 EXAMPLES: We explicitly construct the alternating group on four 850 EXAMPLES: 851 852 We explicitly construct the alternating group on four 846 853 elements. Note that the ``AlternatingGroup`` class has 847 its own representation string. 848 849 :: 854 its own representation string:: 850 855 851 856 sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 852 857 Permutation Group with generators [(2,3,4), (1,2,3)] … … 859 864 860 865 def _latex_(self): 861 866 r""" 862 Method for describing selfin LaTeX. Encapsulates863 ``self.gens()`` in angle brackets to denote that self864 i ngenerated by these elements. Called by the867 Method for describing ``self`` in LaTeX. Encapsulates 868 ``self.gens()`` in angle brackets to denote that ``self`` 869 is generated by these elements. Called by the 865 870 ``latex()`` function. 866 871 867 EXAMPLES: We explicitly construct the alternating group on four868 elements. 869 870 ::872 EXAMPLES: 873 874 We explicitly construct the alternating group on four 875 elements:: 871 876 872 877 sage: A4 = PermutationGroup([[(1,2,3)],[(2,3,4)]]); A4 873 878 Permutation Group with generators [(2,3,4), (1,2,3)] … … 930 935 931 936 def id(self): 932 937 """ 933 (Same as self.group_id().) Return the ID code of this group, which938 (Same as ``self.group_id()``.) Return the ID code of this group, which 934 939 is a list of two integers. Requires "optional" database_gap-4.4.x 935 940 package. 936 941 … … 944 949 945 950 def center(self): 946 951 """ 947 Return the subgroup of elements ofthat commute with every element952 Return the subgroup of elements that commute with every element 948 953 of this group. 949 954 950 955 EXAMPLES:: … … 961 966 962 967 def direct_product(self,other,maps=True): 963 968 """ 964 Wraps GAP's DirectProduct, Embedding, and Projection.969 Wraps GAP's ``DirectProduct``, ``Embedding``, and ``Projection``. 965 970 966 Sage calls GAP's DirectProduct, which chooses an efficient971 Sage calls GAP's ``DirectProduct``, which chooses an efficient 967 972 representation for the direct product. The direct product of 968 973 permutation groups will be a permutation group again. For a direct 969 product D, the GAP operation Embedding(D,i) returns the 970 homomorphism embedding the i-th factor into D. The GAP operation 971 Projection(D,i) gives the projection of D onto the i-th factor. 972 974 product ``D``, the GAP operation ``Embedding(D,i)`` returns the 975 homomorphism embedding the i-th factor into ``D``. The GAP operation 976 ``Projection(D,i)`` gives the projection of ``D`` onto the i-th factor. 977 This method returns a 5-tuple: a permutation group and 4 morphisms. 978 973 979 INPUT: 974 980 975 981 976 982 - ``self, other`` - permutation groups 977 983 978 This method returns a 5-tuple - a permutation groups and 4979 morphisms.980 984 981 985 982 986 OUTPUT: … … 985 989 - ``D`` - a direct product of the inputs, returned as 986 990 a permutation group as well 987 991 988 - ``iota1`` - an embedding of self into D992 - ``iota1`` - an embedding of ``self`` into ``D`` 989 993 990 - ``iota2`` - an embedding of other into D994 - ``iota2`` - an embedding of ``other`` into ``D`` 991 995 992 - ``pr1`` - the projection of D onto self(giving a996 - ``pr1`` - the projection of ``D`` onto ``self`` (giving a 993 997 splitting 1 - other - D - self - 1) 994 998 995 - ``pr2`` - the projection of D onto other(giving a999 - ``pr2`` - the projection of ``D`` onto ``other`` (giving a 996 1000 splitting 1 - self - D - other - 1) 997 1001 998 1002 … … 1042 1046 1043 1047 def subgroup(self, gens): 1044 1048 """ 1045 Wraps the PermutationGroup_subgroup constructor. The argument gens1046 is a list of elements of self.1049 Wraps the ``PermutationGroup_subgroup`` constructor. The argument 1050 ``gens`` is a list of elements of ``self``. 1047 1051 1048 1052 EXAMPLES:: 1049 1053 … … 1083 1087 1084 1088 def cohomology(self, n, p = 0): 1085 1089 r""" 1086 Computes the group cohomology H_n(G, F), where F = Z if p=0 and F1087 = Z/pZ if p 0 is a prime. Wraps HAP's GroupHomology function,1088 written by Graham Ellis.1090 Computes the group cohomology `H^n(G, F)`, where `F = \mathbb{Z}` 1091 if `p=0` and `F = \mathbb{Z} / p \mathbb{Z}` if `p > 0` is a prime. 1092 Wraps HAP's ``GroupHomology`` function, written by Graham Ellis. 1089 1093 1090 1094 REQUIRES: GAP package HAP (in gap_packages-\*.spkg). 1091 1095 … … 1106 1110 ... 1107 1111 ValueError: p must be 0 or prime 1108 1112 1109 This computes `H^4(S_3, ZZ)`, `H^4(S_3,ZZ/2ZZ)`,1110 resp.1113 This computes `H^4(S_3, \mathbb{Z})` and 1114 `H^4(S_3, \mathbb{Z} / 2 \mathbb{Z})`, respectively. 1111 1115 1112 1116 AUTHORS: 1113 1117 … … 1137 1141 def cohomology_part(self, n, p = 0): 1138 1142 """ 1139 1143 Computes the p-part of the group cohomology `H^n(G, F)`, 1140 where `F = Z` if `p=0` and `F = Z/pZ` if1141 `p > 0` is a prime. Wraps HAP's Homology function, written1144 where `F = \mathbb{Z}` if `p=0` and `F = \mathbb{Z} / p \mathbb{Z}` if 1145 `p > 0` is a prime. Wraps HAP's Homology function, written 1142 1146 by Graham Ellis, applied to the `p`-Sylow subgroup of 1143 1147 `G`. 1144 1148 … … 1175 1179 def homology(self, n, p = 0): 1176 1180 r""" 1177 1181 Computes the group homology `H_n(G, F)`, where 1178 `F = Z` if `p=0` and `F = Z/pZ` if1179 `p > 0` is a prime. Wraps HAP's GroupHomologyfunction,1182 `F = \mathbb{Z}` if `p=0` and `F = \mathbb{Z} / p \mathbb{Z}` if 1183 `p > 0` is a prime. Wraps HAP's ``GroupHomology`` function, 1180 1184 written by Graham Ellis. 1181 1185 1182 1186 REQUIRES: GAP package HAP (in gap_packages-\*.spkg). … … 1185 1189 1186 1190 - David Joyner and Graham Ellis 1187 1191 1188 The example below computes `H_7(S_5,ZZ)`, 1189 `H_7(S_5,ZZ/2ZZ)`, `H_7(S_5,ZZ/3ZZ)`, and 1190 `H_7(S_5,ZZ/5ZZ)`, resp. To compute the `2`-part 1191 of `H_7(S_5,ZZ)`, use the ``homology_part`` 1192 The example below computes `H_7(S_5, \mathbb{Z})`, 1193 `H_7(S_5, \mathbb{Z} / 2 \mathbb{Z})`, 1194 `H_7(S_5, \mathbb{Z} / 3 \mathbb{Z})`, and 1195 `H_7(S_5, \mathbb{Z} / 5 \mathbb{Z})`, respectively. To compute the 1196 `2`-part of `H_7(S_5, \mathbb{Z})`, use the ``homology_part`` 1192 1197 function. 1193 1198 1194 1199 EXAMPLES:: … … 1227 1232 def homology_part(self, n, p = 0): 1228 1233 r""" 1229 1234 Computes the `p`-part of the group homology 1230 `H_n(G, F)`, where `F = Z` if `p=0` and1231 `F = Z/pZ` if `p >0` is a prime. Wraps HAP's1232 Homologyfunction, written by Graham Ellis, applied to the1235 `H_n(G, F)`, where `F = \mathbb{Z}` if `p=0` and 1236 `F = \mathbb{Z} / p \mathbb{Z}` if `p > 0` is a prime. Wraps HAP's 1237 ``Homology`` function, written by Graham Ellis, applied to the 1233 1238 `p`-Sylow subgroup of `G`. 1234 1239 1235 1240 REQUIRES: GAP package HAP (in gap_packages-\*.spkg). … … 1263 1268 r""" 1264 1269 Returns the matrix of values of the irreducible characters of a 1265 1270 permutation group `G` at the conjugacy classes of 1266 `G`. The columns represent the theconjugacy classes of1271 `G`. The columns represent the conjugacy classes of 1267 1272 `G` and the rows represent the different irreducible 1268 1273 characters in the ordering given by GAP. 1269 1274 … … 1320 1325 [(1, 1, 1, 1, 1, 1, 1), (5, 1, 2, -1, -1, 0, 0), (5, 1, -1, 2, -1, 0, 0), (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), (8, 0, -1, -1, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1), (9, 1, 0, 0, 1, -1, -1), (10, -2, 1, 1, 0, 0, 0)] 1321 1326 1322 1327 Suppose that you have a class function `f(g)` on 1323 `G` and you know the values `v_1, ..., v_n` on1328 `G` and you know the values `v_1, \dots, v_n` on 1324 1329 the conjugacy class elements in 1325 1330 ``conjugacy_classes_representatives(G)`` = 1326 1331 `[g_1, \ldots, g_n]`. Since the irreducible characters … … 1330 1335 a linear combination of these basis elements, 1331 1336 `f = c_1\rho_1 + \cdots + c_n\rho_n`. To find 1332 1337 the coefficients `c_i`, you simply solve the linear system 1333 ``character_table_values(G)``\*`[v_1, ..., v_n] = [c_1, ..., c_n]`, 1334 where `[v_1, ...,v_n]` = 1335 ``character_table_values(G)`` `^{-1}[c_1, ...,c_n]`. 1338 ``character_table_values(G)``\* [v_1, ..., v_n] = [c_1, ..., c_n], 1339 where [v_1, ..., v_n] = ``character_table_values(G)`` ^(-1)[c_1, ..., c_n]. 1336 1340 1337 1341 AUTHORS: 1338 1342 … … 1341 1345 .. note:: 1342 1346 1343 1347 The ordering of the columns of the character table of a group 1344 corresponds to the ordering of the list. However, in general there is1345 no way to canonically list (or index) the conjugacy classes of a group.1346 Therefore the ordering of the columns of the character table of1347 a group is somewhat random.1348 corresponds to the ordering of the list. However, in general 1349 there is no way to canonically list (or index) the conjugacy 1350 classes of a group. Therefore the ordering of the columns of the 1351 character table of a group is somewhat random. 1348 1352 """ 1349 1353 current_randstate().set_seed_gap() 1350 1354 G = self._gap_() … … 1365 1369 1366 1370 def irreducible_characters(self): 1367 1371 r""" 1368 Returns a list of the irreducible characters of self.1372 Returns a list of the irreducible characters of ``self``. 1369 1373 1370 1374 EXAMPLES:: 1371 1375 … … 1381 1385 1382 1386 def trivial_character(self): 1383 1387 r""" 1384 Returns the trivial character of self.1388 Returns the trivial character of ``self``. 1385 1389 1386 1390 EXAMPLES:: 1387 1391 … … 1393 1397 1394 1398 def character(self, values): 1395 1399 r""" 1396 Returns a group character of from values, where values is a list of 1397 the values of the character evaluated on the conjugacy classes. 1400 Returns a group character of from ``values``, where ``values`` is 1401 a list of the values of the character evaluated on the conjugacy 1402 classes. 1398 1403 1399 1404 EXAMPLES:: 1400 1405 … … 1408 1413 def conjugacy_classes_representatives(self): 1409 1414 """ 1410 1415 Returns a complete list of representatives of conjugacy classes in 1411 a permutation group G. The ordering is that given by GAP.1416 a permutation group `G`. The ordering is that given by GAP. 1412 1417 1413 1418 EXAMPLES:: 1414 1419 … … 1438 1443 def conjugacy_classes_subgroups(self): 1439 1444 """ 1440 1445 Returns a complete list of representatives of conjugacy classes of 1441 subgroups in a permutation group G. The ordering is that given by1446 subgroups in a permutation group `G`. The ordering is that given by 1442 1447 GAP. 1443 1448 1444 1449 EXAMPLES:: … … 1477 1482 1478 1483 def normalizer(self, g): 1479 1484 """ 1480 Returns the normalizer of g in self.1485 Returns the normalizer of ``g`` in ``self``. 1481 1486 1482 1487 EXAMPLES:: 1483 1488 … … 1497 1502 1498 1503 def centralizer(self, g): 1499 1504 """ 1500 Returns the centralizer of g in self.1505 Returns the centralizer of ``g`` in ``self``. 1501 1506 1502 1507 EXAMPLES:: 1503 1508 … … 1517 1522 1518 1523 def isomorphism_type_info_simple_group(self): 1519 1524 """ 1520 I sthe group is simple, then this returns the name of the group.1525 If the group is simple, then this returns the name of the group. 1521 1526 1522 1527 EXAMPLES:: 1523 1528 … … 1535 1540 1536 1541 def is_abelian(self): 1537 1542 """ 1538 Return Trueif this group is abelian.1543 Return ``True`` if this group is abelian. 1539 1544 1540 1545 EXAMPLES:: 1541 1546 … … 1550 1555 1551 1556 def is_commutative(self): 1552 1557 """ 1553 Return Trueif this group is commutative.1558 Return ``True`` if this group is commutative. 1554 1559 1555 1560 EXAMPLES:: 1556 1561 … … 1565 1570 1566 1571 def is_cyclic(self): 1567 1572 """ 1568 Return Trueif this group is cyclic.1573 Return ``True`` if this group is cyclic. 1569 1574 1570 1575 EXAMPLES:: 1571 1576 … … 1580 1585 1581 1586 def is_elementary_abelian(self): 1582 1587 """ 1583 Return Trueif this group is elementary abelian. An elementary1584 abelian group is a finite Abelian group, where every nontrivial1585 element has order p, where pis a prime.1588 Return ``True`` if this group is elementary abelian. An elementary 1589 abelian group is a finite abelian group, where every nontrivial 1590 element has order `p`, where `p` is a prime. 1586 1591 1587 1592 EXAMPLES:: 1588 1593 … … 1597 1602 1598 1603 def isomorphism_to(self,right): 1599 1604 """ 1600 Return an isomorphism self to right if the groups are isomorphic,1601 otherwise None.1605 Return an isomorphism from ``self`` to ``right`` if the groups 1606 are isomorphic, otherwise ``None``. 1602 1607 1603 1608 INPUT: 1604 1609 … … 1608 1613 - ``right`` - a permutation group 1609 1614 1610 1615 1611 OUTPUT: None or a morphism of permutation groups. 1616 OUTPUT: 1617 1618 - ``None`` or a morphism of permutation groups. 1612 1619 1613 1620 EXAMPLES:: 1614 1621 … … 1641 1648 1642 1649 def is_isomorphic(self, right): 1643 1650 """ 1644 Return Trueif the groups are isomorphic. If mode="verbose" then an1651 Return ``True`` if the groups are isomorphic. If mode="verbose" then an 1645 1652 isomorphism is printed. 1646 1653 1647 1654 INPUT: … … 1652 1659 - ``right`` - a permutation group 1653 1660 1654 1661 1655 OUTPUT: bool 1662 OUTPUT: 1663 1664 - boolean; ``True`` if ``self`` and ``right`` are isomorphic groups; 1665 ``False`` otherwise. 1656 1666 1657 1667 EXAMPLES:: 1658 1668 … … 1674 1684 1675 1685 def is_monomial(self): 1676 1686 """ 1677 Returns Trueif the group is monomial. A finite group is monomial1687 Returns ``True`` if the group is monomial. A finite group is monomial 1678 1688 if every irreducible complex character is induced from a linear 1679 1689 character of a subgroup. 1680 1690 … … 1688 1698 1689 1699 def is_nilpotent(self): 1690 1700 """ 1691 Return Trueif this group is nilpotent.1701 Return ``True`` if this group is nilpotent. 1692 1702 1693 1703 EXAMPLES:: 1694 1704 … … 1703 1713 1704 1714 def is_normal(self, other): 1705 1715 """ 1706 Return True if this group is a normal subgroup of other.1716 Return ``True`` if this group is a normal subgroup of ``other``. 1707 1717 1708 1718 EXAMPLES:: 1709 1719 … … 1720 1730 1721 1731 def is_perfect(self): 1722 1732 """ 1723 Return Trueif this group is perfect. A group is perfect if it1733 Return ``True`` if this group is perfect. A group is perfect if it 1724 1734 equals its derived subgroup. 1725 1735 1726 1736 EXAMPLES:: … … 1736 1746 1737 1747 def is_pgroup(self): 1738 1748 """ 1739 Returns True if the group is a p-group. A finite group is a p-group1740 if its order is of the form `p^n` for a prime integer p and1741 a nonnegative integer n.1749 Returns ``True`` if this group is a `p`-group. A finite group is 1750 a `p`-group if its order is of the form `p^n` for a prime integer 1751 `p` and a nonnegative integer `n`. 1742 1752 1743 1753 EXAMPLES:: 1744 1754 … … 1750 1760 1751 1761 def is_polycyclic(self): 1752 1762 r""" 1753 Return Trueif this group is polycyclic. A group is polycyclic if1754 it has a subnormal series with cyclic factors. (For finite groups 1763 Return ``True`` if this group is polycyclic. A group is polycyclic if 1764 it has a subnormal series with cyclic factors. (For finite groups, 1755 1765 this is the same as if the group is solvable - see 1756 ``is_solvable`` )].)1766 ``is_solvable``.) 1757 1767 1758 1768 EXAMPLES:: 1759 1769 … … 1768 1778 1769 1779 def is_simple(self): 1770 1780 """ 1771 Returns Trueif the group is simple. A group is simple if it has no1781 Returns ``True`` if the group is simple. A group is simple if it has no 1772 1782 proper normal subgroups. 1773 1783 1774 1784 EXAMPLES:: … … 1781 1791 1782 1792 def is_solvable(self): 1783 1793 """ 1784 Returns Trueif the group is solvable.1794 Returns ``True`` if the group is solvable. 1785 1795 1786 1796 EXAMPLES:: 1787 1797 … … 1793 1803 1794 1804 def is_subgroup(self,other): 1795 1805 """ 1796 Returns true if self is a subgroup of other.1806 Returns ``True`` if ``self`` is a subgroup of ``other``. 1797 1807 1798 1808 EXAMPLES:: 1799 1809 … … 1812 1822 1813 1823 def is_supersolvable(self): 1814 1824 """ 1815 Returns Trueif the group is supersolvable. A finite group is1825 Returns ``True`` if the group is supersolvable. A finite group is 1816 1826 supersolvable if it has a normal series with cyclic factors. 1817 1827 1818 1828 EXAMPLES:: … … 1825 1835 1826 1836 def is_transitive(self): 1827 1837 """ 1828 Return True if selfis a transitive group, i.e., if the action1838 Return ``True`` if ``self`` is a transitive group, i.e., if the action 1829 1839 of self on [1..n] is transitive. 1830 1840 1831 1841 EXAMPLES:: … … 1838 1848 False 1839 1849 1840 1850 Note that this differs from the definition in GAP, where 1841 IsTransitivereturns whether the group is transitive on the1851 ``IsTransitive`` returns whether the group is transitive on the 1842 1852 set of points moved by the group. 1843 1853 1844 1854 :: … … 1853 1863 1854 1864 def normalizes(self,other): 1855 1865 r""" 1856 Returns True if the group other is normalized by the self. Wraps1857 GAP's IsNormalfunction.1866 Returns ``True`` if the group ``other`` is normalized by ``self``. 1867 Wraps GAP's ``IsNormal`` function. 1858 1868 1859 A group G normalizes a group Uif and only if for every1869 A group `G` normalizes a group `U` if and only if for every 1860 1870 `g \in G` and `u \in U` the element `u^g` 1861 is a member of U. Note that U need not be a subgroup of G.1871 is a member of `U`. Note that `U` need not be a subgroup of `G`. 1862 1872 1863 1873 EXAMPLES:: 1864 1874 … … 1873 1883 sage: H.normalizes(G) 1874 1884 True 1875 1885 1876 In the last example, G and Hare disjoint, so each normalizes the1886 In the last example, `G` and `H` are disjoint, so each normalizes the 1877 1887 other. 1878 1888 """ 1879 1889 return self._gap_().IsNormal(other._gap_()).bool() … … 1885 1895 Return the composition series of this group as a list of 1886 1896 permutation groups. 1887 1897 1888 EXAMPLES: These computations use pseudo-random numbers, so we set 1898 EXAMPLES: 1899 1900 These computations use pseudo-random numbers, so we set 1889 1901 the seed for reproducible testing. 1890 1902 1891 1903 :: … … 1912 1924 Return the derived series of this group as a list of permutation 1913 1925 groups. 1914 1926 1915 EXAMPLES: These computations use pseudo-random numbers, so we set 1927 EXAMPLES: 1928 1929 These computations use pseudo-random numbers, so we set 1916 1930 the seed for reproducible testing. 1917 1931 1918 1932 :: … … 1935 1949 Return the lower central series of this group as a list of 1936 1950 permutation groups. 1937 1951 1938 EXAMPLES: These computations use pseudo-random numbers, so we set 1952 EXAMPLES: 1953 1954 These computations use pseudo-random numbers, so we set 1939 1955 the seed for reproducible testing. 1940 1956 1941 1957 :: … … 1955 1971 1956 1972 def molien_series(self): 1957 1973 r""" 1958 Returns the Molien series of a trans tive permutation group. The1974 Returns the Molien series of a transitive permutation group. The 1959 1975 function 1960 1976 1961 1977 .. math:: 1962 1978 1963 M(x) = (1/|G|)\sum_{g\in G} det(1-x*g)^(-1)1979 M(x) = (1/|G|)\sum_{g\in G} \det(1-x*g)^{-1} 1964 1980 1965 1981 1966 is sometimes called the "Molien series" of G. GAP's1982 is sometimes called the "Molien series" of `G`. GAP's 1967 1983 ``MolienSeries`` is associated to a character of a 1968 group G. How are these related? A group G, given as a permutation1969 group on n points, has a "natural" representation of dimension n,1970 given by permutation matrices. The Molien series of Gis the one1971 associated to that permutation representation of Gusing the above1984 group `G`. How are these related? A group `G`, given as a permutation 1985 group on `n` points, has a "natural" representation of dimension `n`, 1986 given by permutation matrices. The Molien series of `G` is the one 1987 associated to that permutation representation of `G` using the above 1972 1988 formula. Character values then count fixed points of the 1973 1989 corresponding permutations. 1974 1990 … … 1998 2014 Return the normal subgroups of this group as a (sorted in 1999 2015 increasing order) list of permutation groups. 2000 2016 2001 The normal subgroups of `H = PSL(2,7) xPSL(2,7)` are2017 The normal subgroups of `H = PSL(2,7) \cdot PSL(2,7)` are 2002 2018 `1`, two copies of `PSL(2,7)` and `H` 2003 itself, as the following example shows. EXAMPLES:: 2019 itself, as the following example shows. 2020 2021 EXAMPLES:: 2004 2022 2005 2023 sage: G = PSL(2,7) 2006 2024 sage: D = G.direct_product(G) … … 2022 2040 2023 2041 def poincare_series(self, p=2, n=10): 2024 2042 """ 2025 Returns the Poincare series of G mod p (p must be a prime), for n1 2026 large. In other words, if you input a finite group G, a prime p, 2027 and a positive integer n, it returns a quotient of polynomials 2028 f(x)=P(x)/Q(x) whose coefficient of `x^k` equals the rank 2029 of the vector space `H_k(G,ZZ/pZZ)`, for all k in the 2030 range `1\leq k \leq n`. 2043 Returns the Poincare series of `G \mod p` (`p \geq 2` must be a 2044 prime), for `n` large. In other words, if you input a finite 2045 group `G`, a prime `p`, and a positive integer `n`, it returns a 2046 quotient of polynomials `f(x) = P(x) / Q(x)` whose coefficient of 2047 `x^k` equals the rank of the vector space 2048 `H_k(G, \mathbb{Z} / p \mathbb{Z})`, for all `k` in the 2049 range `1 \leq k \leq n`. 2031 2050 2032 2051 REQUIRES: GAP package HAP (in gap_packages-\*.spkg). 2033 2052 … … 2061 2080 2062 2081 def sylow_subgroup(self, p): 2063 2082 """ 2064 Returns a Sylow p-subgroups of the finite group G, where pis a2065 prime. This is a p-subgroup of G whose index in G is coprime to p.2066 Wraps the GAP function SylowSubgroup.2083 Returns a Sylow `p`-subgroup of the finite group `G`, where `p` is a 2084 prime. This is a `p`-subgroup of `G` whose index in `G` is coprime to 2085 `p`. Wraps the GAP function ``SylowSubgroup``. 2067 2086 2068 2087 EXAMPLES:: 2069 2088 … … 2091 2110 Return the upper central series of this group as a list of 2092 2111 permutation groups. 2093 2112 2094 EXAMPLES: These computations use pseudo-random numbers, so we set 2113 EXAMPLES: 2114 2115 These computations use pseudo-random numbers, so we set 2095 2116 the seed for reproducible testing. 2096 2117 2097 2118 :: … … 2110 2131 2111 2132 class PermutationGroup_subgroup(PermutationGroup_generic): 2112 2133 """ 2113 Subgroup subclass of PermutationGroup_generic, so instance methods2134 Subgroup subclass of ``PermutationGroup_generic``, so instance methods 2114 2135 are inherited. 2115 2136 2116 2137 EXAMPLES:: … … 2133 2154 Initialization method for the 2134 2155 ``PermutationGroup_subgroup`` class. 2135 2156 2136 INPUTS: ambient - the ambient group from which to construct this 2137 subgroup gens - the generators of the subgroup from_group - True: 2138 subroup is generated from a Gap string representation of the 2139 generators check- True: checks if gens are indeed elements of the 2140 ambient group canonicalize - bool (default: True), if True sort 2141 generators and remove duplicates 2157 INPUTS: 2158 2159 - ``ambient`` - the ambient group from which to construct this 2160 subgroup 2161 2162 - ``gens`` - the generators of the subgroup 2163 2164 - ``from_group`` - ``True``: subgroup is generated from a Gap 2165 string representation of the generators (default: ``False``) 2166 2167 - ``check`` - ``True``: checks if ``gens`` are indeed elements of the 2168 ambient group 2169 2170 - ``canonicalize`` - boolean (default: ``True``); if ``True``, sort 2171 generators and remove duplicates 2142 2172 2143 EXAMPLES: An example involving the dihedral group on four elements. 2173 EXAMPLES: 2174 2175 An example involving the dihedral group on four elements. 2144 2176 `D_8` contains a cyclic subgroup or order four:: 2145 2177 2146 2178 sage: G = DihedralGroup(4) … … 2188 2220 2189 2221 def __cmp__(self, other): 2190 2222 r""" 2191 Compare self and other. If self and other are in a common ambient 2192 group, then self = other precisely if self is contained in other. 2223 Compare ``self`` and ``other``. If ``self`` and ``other`` are in 2224 a common ambient group, then self = other precisely if ``self`` is 2225 contained in ``other``. 2193 2226 2194 2227 EXAMPLES:: 2195 2228 … … 2220 2253 Returns a string representation / description of the permutation 2221 2254 subgroup. 2222 2255 2223 EXAMPLES: An example involving the dihedral group on four elements, 2256 EXAMPLES: 2257 2258 An example involving the dihedral group on four elements, 2224 2259 `D_8`:: 2225 2260 2226 2261 sage: G = DihedralGroup(4) … … 2237 2272 2238 2273 def _latex_(self): 2239 2274 r""" 2240 Return latexrepresentation of this group.2275 Return LaTeX representation of this group. 2241 2276 2242 EXAMPLES: An example involving the dihedral group on four elements, 2277 EXAMPLES: 2278 2279 An example involving the dihedral group on four elements, 2243 2280 `D_8`:: 2244 2281 2245 2282 sage: G = DihedralGroup(4) … … 2256 2293 2257 2294 def ambient_group(self): 2258 2295 """ 2259 Return the ambient group related to self.2296 Return the ambient group related to ``self``. 2260 2297 2261 EXAMPLES: An example involving the dihedral group on four elements, 2298 EXAMPLES: 2299 2300 An example involving the dihedral group on four elements, 2262 2301 `D_8`:: 2263 2302 2264 2303 sage: G = DihedralGroup(4) … … 2276 2315 """ 2277 2316 Return the generators for this subgroup. 2278 2317 2279 EXAMPLES: An example involving the dihedral group on four elements, 2318 EXAMPLES: 2319 2320 An example involving the dihedral group on four elements, 2280 2321 `D_8`:: 2281 2322 2282 2323 sage: G = DihedralGroup(4)
