passagemath-groups 10.5.47__cp313-cp313-macosx_14_0_arm64.whl → 10.6.3__cp313-cp313-macosx_14_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-groups might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: passagemath-groups
3
- Version: 10.5.47
3
+ Version: 10.6.3
4
4
  Summary: passagemath: Groups and Invariant Theory
5
5
  Author-email: The Sage Developers <sage-support@googlegroups.com>
6
6
  Maintainer: Matthias Köppe, passagemath contributors
@@ -8,7 +8,7 @@ License-Expression: GPL-2.0-or-later
8
8
  Project-URL: release notes, https://github.com/passagemath/passagemath/releases
9
9
  Project-URL: repo (upstream), https://github.com/sagemath/sage
10
10
  Project-URL: repo, https://github.com/passagemath/passagemath
11
- Project-URL: documentation, https://doc.sagemath.org
11
+ Project-URL: documentation, https://passagemath.org/docs/latest
12
12
  Project-URL: homepage (upstream), https://www.sagemath.org
13
13
  Project-URL: discourse, https://passagemath.discourse.group
14
14
  Project-URL: tracker (upstream), https://github.com/sagemath/sage/issues
@@ -17,20 +17,20 @@ Classifier: Development Status :: 6 - Mature
17
17
  Classifier: Intended Audience :: Education
18
18
  Classifier: Intended Audience :: Science/Research
19
19
  Classifier: Operating System :: POSIX
20
+ Classifier: Operating System :: POSIX :: Linux
20
21
  Classifier: Operating System :: MacOS :: MacOS X
21
22
  Classifier: Programming Language :: Python :: 3 :: Only
22
- Classifier: Programming Language :: Python :: 3.9
23
23
  Classifier: Programming Language :: Python :: 3.10
24
24
  Classifier: Programming Language :: Python :: 3.11
25
25
  Classifier: Programming Language :: Python :: 3.12
26
26
  Classifier: Programming Language :: Python :: 3.13
27
27
  Classifier: Programming Language :: Python :: Implementation :: CPython
28
28
  Classifier: Topic :: Scientific/Engineering :: Mathematics
29
- Requires-Python: <3.14,>=3.9
29
+ Requires-Python: <3.14,>=3.10
30
30
  Description-Content-Type: text/x-rst
31
- Requires-Dist: passagemath-categories~=10.5.47.0
32
- Requires-Dist: passagemath-gap~=10.5.47.0
33
- Requires-Dist: passagemath-modules~=10.5.47.0
31
+ Requires-Dist: passagemath-categories~=10.6.3.0
32
+ Requires-Dist: passagemath-gap~=10.6.3.0
33
+ Requires-Dist: passagemath-modules~=10.6.3.0
34
34
  Provides-Extra: test
35
35
  Requires-Dist: passagemath-repl; extra == "test"
36
36
  Provides-Extra: coxeter3
@@ -61,24 +61,25 @@ It is a fork of `SageMath <https://www.sagemath.org/>`__, which has been
61
61
  developed 2005-2025 under the motto “Creating a Viable Open Source
62
62
  Alternative to Magma, Maple, Mathematica, and MATLAB”.
63
63
 
64
- The passagemath fork was created in October 2024 with the following
65
- goals:
64
+ The passagemath fork uses the motto "Creating a Free Passage Between the
65
+ Scientific Python Ecosystem and Mathematical Software Communities."
66
+ It was created in October 2024 with the following goals:
66
67
 
67
- - providing modularized installation with pip, thus completing a `major
68
- project started in 2020 in the Sage
69
- codebase <https://github.com/sagemath/sage/issues/29705>`__,
68
+ - providing modularized installation with pip,
70
69
  - establishing first-class membership in the scientific Python
71
70
  ecosystem,
72
71
  - giving `clear attribution of upstream
73
72
  projects <https://groups.google.com/g/sage-devel/c/6HO1HEtL1Fs/m/G002rPGpAAAJ>`__,
74
73
  - providing independently usable Python interfaces to upstream
75
74
  libraries,
76
- - providing `platform portability and integration testing
75
+ - offering `platform portability and integration testing
77
76
  services <https://github.com/passagemath/passagemath/issues/704>`__
78
77
  to upstream projects,
79
78
  - inviting collaborations with upstream projects,
80
79
  - `building a professional, respectful, inclusive
81
80
  community <https://groups.google.com/g/sage-devel/c/xBzaINHWwUQ>`__,
81
+ - `empowering Sage users to participate in the scientific Python ecosystem
82
+ <https://github.com/passagemath/passagemath/issues/248>`__ by publishing packages,
82
83
  - developing a port to `Pyodide <https://pyodide.org/en/stable/>`__ for
83
84
  serverless deployment with Javascript,
84
85
  - developing a native Windows port.
@@ -86,24 +87,29 @@ goals:
86
87
  `Full documentation <https://doc.sagemath.org/html/en/index.html>`__ is
87
88
  available online.
88
89
 
89
- passagemath attempts to support all major Linux distributions and recent versions of
90
- macOS. Use on Windows currently requires the use of Windows Subsystem for Linux or
91
- virtualization.
90
+ passagemath attempts to support and provides binary wheels suitable for
91
+ all major Linux distributions and recent versions of macOS.
92
92
 
93
- Complete sets of binary wheels are provided on PyPI for Python versions 3.9.x-3.12.x.
94
- Python 3.13.x is also supported, but some third-party packages are still missing wheels,
95
- so compilation from source is triggered for those.
93
+ For the Linux aarch64 (ARM) platform, some third-party packages are still missing
94
+ wheels; see the `instructions for building them from source <https://github.com/passagemath/passagemath?tab=readme-ov-file#full-installation-of-passagemath-from-binary-wheels-on-pypi>`__.
95
+
96
+ Binary wheels for native Windows (x86_64) are are available for a subset of
97
+ the passagemath distributions. Use of the full functionality of passagemath
98
+ on Windows currently requires the use of Windows Subsystem for Linux (WSL)
99
+ or virtualization.
100
+
101
+ The supported Python versions in the passagemath 10.6.x series are 3.10.x-3.13.x.
96
102
 
97
103
 
98
104
  About this pip-installable distribution package
99
105
  -----------------------------------------------
100
106
 
101
- This pip-installable package `passagemath-groups` a distribution of a part of the Sage Library. It provides a small subset of the modules of the Sage library ("sagelib", `passagemath-standard`) for computations with groups.
107
+ This pip-installable package ``passagemath-groups`` a distribution of a part of the Sage Library. It provides a small subset of the modules of the Sage library ("sagelib", ``passagemath-standard``) for computations with groups.
102
108
 
103
109
 
104
110
  What is included
105
111
  ----------------
106
112
 
107
- * `Groups <https://doc.sagemath.org/html/en/reference/groups/index.html>`_
113
+ * `Groups <https://passagemath.org/docs/latest/html/en/reference/groups/index.html>`_
108
114
 
109
115
  * see https://github.com/passagemath/passagemath/blob/main/pkgs/sagemath-groups/MANIFEST.in
@@ -1,25 +1,25 @@
1
- passagemath_groups-10.5.47.dist-info/RECORD,,
2
- passagemath_groups-10.5.47.dist-info/WHEEL,sha256=ZQJAUvKl3_G657Vy_VrVH7Krx2Keg1PVu64bdERsotU,136
3
- passagemath_groups-10.5.47.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
4
- passagemath_groups-10.5.47.dist-info/METADATA,sha256=z4RAaCT16Cgqw4PodjD2k1PlvyYD25pzRpSsG62z0jo,4884
1
+ passagemath_groups-10.6.3.dist-info/RECORD,,
2
+ passagemath_groups-10.6.3.dist-info/WHEEL,sha256=ZQJAUvKl3_G657Vy_VrVH7Krx2Keg1PVu64bdERsotU,136
3
+ passagemath_groups-10.6.3.dist-info/top_level.txt,sha256=Kmzulf9WsphADFQuqgvdy5mvTLDj_V2zkFHU2s3UXos,6
4
+ passagemath_groups-10.6.3.dist-info/METADATA,sha256=RvTRT8natAcuhMW0id2BZTQtI9JqLl2VNc4WvviRIFQ,5382
5
5
  passagemath_groups.dylibs/libreadline.8.3.dylib,sha256=ufLMSAeOXYmbUdvwkvSj9DIEmVNQOMkXoWmYQgObGjc,316096
6
- passagemath_groups.dylibs/libgap.9.dylib,sha256=7ZyYtNTXRF_rr4nb3zKns2TS_jhwPYMp9pqYg8h-vfs,2475408
6
+ passagemath_groups.dylibs/libgap.9.dylib,sha256=y9vvUuy8ly5WvQDhlQrDtAa5msLvCCL7ElAelonlgmk,2475408
7
7
  passagemath_groups.dylibs/libgmp.10.dylib,sha256=VOGM_HerjozBJCK3LuahuI9rYziM1R-CNDmv8CKisxw,464688
8
- sage/all__sagemath_groups.py,sha256=r79v2kKSV7vqPKchrDfS9MOANmHgfIB1uvFiby6HVPk,505
8
+ sage/all__sagemath_groups.py,sha256=JOSY5oJmS67eaWpSs14SBcD7be6NMKH05esJQj8sNOI,525
9
9
  sage/groups/finitely_presented.py,sha256=hLccjNjrj880fFeiLu9W7Z7Xz1HewuyJTVKNWrUsVMI,70042
10
10
  sage/groups/fqf_orthogonal.py,sha256=8cx71JJorwsFoSPzVLBg1rI_dA9dfGeWDqA6GAuqRh8,20181
11
- sage/groups/free_group.py,sha256=Jp7zjjWcb4fwx5tXTW0km5C4MIA34IVptT4Q7Y153yM,29463
11
+ sage/groups/free_group.py,sha256=iMxfq5y8gA91i7XdpCmlL2N-5s2h_oYYohITmhMpVXo,29468
12
12
  sage/groups/all__sagemath_groups.py,sha256=g4HxEDA-YDJcTYHqA5pGLBIy7gpzg-BEVb2Jn7mTJD8,1147
13
- sage/groups/artin.py,sha256=lnpgpA6m7fuAvlcIEjIRlr7IXCrKq9aKLTlkfrV3vlw,41036
13
+ sage/groups/artin.py,sha256=Mm9gAYlUfq7kA8z44A2jTgdGaaDPM_TgGeXuj1nZf50,41096
14
14
  sage/groups/finitely_presented_named.py,sha256=dKB2M78fw5W7RTHCGy-VB_X9co9UbFcQQYSdBr945Rc,20597
15
15
  sage/groups/all.py,sha256=ia6P1nJW_QxBEPMNKdT6ZE8v7J0z8qlMbX2uD3lBJU8,229
16
16
  sage/groups/raag.py,sha256=WbkPRhwCopLc2PtJ_Zcy_QASzsHcsp84_fM1x_dUcWw,28842
17
17
  sage/groups/cubic_braid.py,sha256=LEStrE9YiJAb5acsybhoQhth5fh-wbtn7uLjYyLoO1o,86974
18
18
  sage/groups/group_semidirect_product.py,sha256=7XqgwRR8i-KAWQdRXE8uoNbYDG-mDTqFw2uyqhDGCwY,17910
19
19
  sage/groups/cactus_group.py,sha256=O0FTBvGw8y3nRSR1aGPn5FdEv3jILG7QK_g_lZYdLPc,32895
20
- sage/groups/braid.py,sha256=8QUyWn3-gJyl_68F0w1NAJADjJSCVFq9MniA7ssRDXA,139338
20
+ sage/groups/braid.py,sha256=BGOPYX4UtA-s1TKDOGvGcB1dqBrwY85GZaLU-rOLzsA,139760
21
21
  sage/groups/finitely_presented_catalog.py,sha256=Ylc_cx0Sv6eKH9J-n4xotqWK0Hc4pNrwZ3iRPe-gh1s,1251
22
- sage/groups/group_exp.py,sha256=QYVMwfLD1WYTOBjLp0wvKvElyGStDlSagpToYX-Ot4s,11157
22
+ sage/groups/group_exp.py,sha256=KjhnaTnqnNKvBmYZJEbUge2-RydGSkued1JFXSLzeoo,11190
23
23
  sage/groups/kernel_subgroup.py,sha256=hZVsh5UYfq6MPxekXwlRuQyPuHq0Fk6SlNnN-5Yja6A,7706
24
24
  sage/groups/lie_gps/catalog.py,sha256=O5ub0bmV3z8tvJEFjxhgjIz4Zff8rJksOe5VQp0py0o,363
25
25
  sage/groups/lie_gps/all.py,sha256=-vXQHOTG46Zum7Q6k0kcJO43yJo09AIX-El8fzXA7eI,45
@@ -31,8 +31,8 @@ sage/groups/abelian_gps/all.py,sha256=yQQEiBWy_vtucLyFb_q1OIqgiC_DIE9KUzNWpdGTa4
31
31
  sage/groups/semimonomial_transformations/semimonomial_transformation.pyx,sha256=9j9eS_uZYdCUQrTJDs4VhpO_7SeSzXdnzh0cACFNtkk,11298
32
32
  sage/groups/semimonomial_transformations/all.py,sha256=-vXQHOTG46Zum7Q6k0kcJO43yJo09AIX-El8fzXA7eI,45
33
33
  sage/groups/semimonomial_transformations/semimonomial_transformation_group.py,sha256=QflEYRK_oDUf8axx4kwcUR4aMOQNmE_faY1lzOdrAvQ,18312
34
- sage/groups/semimonomial_transformations/semimonomial_transformation.cpython-313-darwin.so,sha256=0SquVQXHewpec6Q__ZspH4t19BbO4nrA-EyA4nusBak,152752
34
+ sage/groups/semimonomial_transformations/semimonomial_transformation.cpython-313-darwin.so,sha256=koG0rEn2Punk8pMl5qTeMVxRG67mCUASkPihzcwnI4c,152736
35
35
  sage/groups/semimonomial_transformations/semimonomial_transformation.pxd,sha256=wivg7LyXn_ZMrADRUmabPEYNitTRZCvs2htLN3E0v9g,297
36
36
  sage/geometry/all__sagemath_groups.py,sha256=-vXQHOTG46Zum7Q6k0kcJO43yJo09AIX-El8fzXA7eI,45
37
- sage/geometry/palp_normal_form.pyx,sha256=dElNMIah-kQ7xxwSh4ZW5_Fgo9685Md79dGbqcs8seQ,17502
38
- sage/geometry/palp_normal_form.cpython-313-darwin.so,sha256=aRdSG3xZPS4nm7rrSfKRmhGgZ30yI_9D9xmsuOZyGOA,239616
37
+ sage/geometry/palp_normal_form.pyx,sha256=HfDpZHxffoxG2pxTrXO0ucRlEDZcrtzHBoZ0CoHm5lI,17498
38
+ sage/geometry/palp_normal_form.cpython-313-darwin.so,sha256=ZlbOliYVyR_3yGedn4ENOM81B4co3ntQR3KAwle5N9A,239536
Binary file
@@ -1,4 +1,5 @@
1
1
  # sage_setup: distribution = sagemath-groups
2
+ # delvewheel: patch
2
3
  r"""
3
4
  Top level of the distribution package sagemath-groups
4
5
 
@@ -198,7 +198,7 @@ def _palp_PM_max(Matrix_integer_dense PM, check=False):
198
198
  else:
199
199
  S[i] = i + 1
200
200
 
201
- cdef int l, np, cf, ccf, n_s_bar, d1, v0, vc, vj
201
+ cdef int l, cf, ccf, n_s_bar, d1, v0, vc, vj
202
202
  cdef list l_r
203
203
 
204
204
  # We determine the other rows of PM_max in turn by use of perms and
sage/groups/artin.py CHANGED
@@ -171,7 +171,7 @@ class ArtinGroupElement(FinitelyPresentedGroupElement):
171
171
  W = self.parent().coxeter_group()
172
172
  s = W.simple_reflections()
173
173
  In = W.index_set()
174
- return W.prod(s[In[abs(i)-1]] for i in self.Tietze())
174
+ return W.prod(s[In[abs(i) - 1]] for i in self.Tietze())
175
175
 
176
176
  def burau_matrix(self, var='t'):
177
177
  r"""
@@ -624,10 +624,10 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
624
624
  return super().__classcall__(cls, coxeter_data, names)
625
625
  if coxeter_data.coxeter_type().cartan_type().type() == 'A':
626
626
  from sage.groups.braid import BraidGroup
627
- return BraidGroup(coxeter_data.rank()+1, names)
627
+ return BraidGroup(coxeter_data.rank() + 1, names)
628
628
  return FiniteTypeArtinGroup(coxeter_data, names)
629
629
 
630
- def __init__(self, coxeter_matrix, names):
630
+ def __init__(self, coxeter_matrix, names) -> None:
631
631
  """
632
632
  Initialize ``self``.
633
633
 
@@ -646,7 +646,7 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
646
646
  I = coxeter_matrix.index_set()
647
647
  gens = free_group.gens()
648
648
  for ii, i in enumerate(I):
649
- for jj, j in enumerate(I[ii + 1:], start=ii+1):
649
+ for jj, j in enumerate(I[ii + 1:], start=ii + 1):
650
650
  m = coxeter_matrix[i, j]
651
651
  if m == Infinity: # no relation
652
652
  continue
@@ -657,7 +657,7 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
657
657
  rels.append(elt)
658
658
  FinitelyPresentedGroup.__init__(self, free_group, tuple(rels))
659
659
 
660
- def _repr_(self):
660
+ def _repr_(self) -> str:
661
661
  """
662
662
  Return a string representation of ``self``.
663
663
 
@@ -792,7 +792,7 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
792
792
  return self.element_class(self, x)
793
793
 
794
794
  @cached_method
795
- def an_element(self):
795
+ def _an_element_(self):
796
796
  """
797
797
  Return an element of ``self``.
798
798
 
@@ -804,7 +804,7 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
804
804
  """
805
805
  return self.gen(0)
806
806
 
807
- def some_elements(self):
807
+ def some_elements(self) -> list:
808
808
  """
809
809
  Return a list of some elements of ``self``.
810
810
 
@@ -972,7 +972,8 @@ class ArtinGroup(UniqueRepresentation, FinitelyPresentedGroup):
972
972
  elif x == 1:
973
973
  return 1 + q**2
974
974
  else:
975
- return q * (E(2*x) + ~E(2*x))
975
+ E2x = E(2 * x)
976
+ return q * (E2x + ~E2x)
976
977
  elif isinstance(base_ring, sage.rings.abc.NumberField_quadratic):
977
978
  from sage.rings.universal_cyclotomic_field import UniversalCyclotomicField
978
979
  E = UniversalCyclotomicField().gen
sage/groups/braid.py CHANGED
@@ -5,7 +5,8 @@ Braid groups
5
5
  Braid groups are implemented as a particular case of finitely presented groups,
6
6
  but with a lot of specific methods for braids.
7
7
 
8
- A braid group can be created by giving the number of strands, and the name of the generators::
8
+ A braid group can be created by giving the number of strands, and the name
9
+ of the generators::
9
10
 
10
11
  sage: BraidGroup(3)
11
12
  Braid group on 3 strands
@@ -16,8 +17,8 @@ A braid group can be created by giving the number of strands, and the name of th
16
17
  sage: BraidGroup(3,'a,b').gens()
17
18
  (a, b)
18
19
 
19
- The elements can be created by operating with the generators, or by passing a list
20
- with the indices of the letters to the group::
20
+ The elements can be created by operating with the generators, or by passing
21
+ a list with the indices of the letters to the group::
21
22
 
22
23
  sage: B.<s0,s1,s2> = BraidGroup(4)
23
24
  sage: s0*s1*s0
@@ -82,7 +83,8 @@ from sage.groups.finitely_presented import (
82
83
  GroupMorphismWithGensImages,
83
84
  )
84
85
  from sage.groups.free_group import FreeGroup, is_FreeGroup
85
- from sage.groups.perm_gps.permgroup_named import SymmetricGroup, SymmetricGroupElement
86
+ from sage.groups.perm_gps.permgroup_named import (SymmetricGroup,
87
+ SymmetricGroupElement)
86
88
  from sage.libs.gap.libgap import libgap
87
89
  from sage.matrix.constructor import identity_matrix, matrix
88
90
  from sage.misc.cachefunc import cached_method
@@ -97,10 +99,11 @@ from sage.structure.element import Expression
97
99
  from sage.structure.richcmp import rich_to_bool, richcmp
98
100
 
99
101
  lazy_import('sage.libs.braiding',
100
- ['leftnormalform', 'rightnormalform', 'centralizer', 'supersummitset', 'greatestcommondivisor',
102
+ ['leftnormalform', 'rightnormalform', 'centralizer',
103
+ 'supersummitset', 'greatestcommondivisor',
101
104
  'leastcommonmultiple', 'conjugatingbraid', 'ultrasummitset',
102
105
  'thurston_type', 'rigidity', 'sliding_circuits', 'send_to_sss',
103
- 'send_to_uss', 'send_to_sc', 'trajectory', 'cyclic_slidings' ],
106
+ 'send_to_uss', 'send_to_sc', 'trajectory', 'cyclic_slidings'],
104
107
  feature=sage__libs__braiding())
105
108
  lazy_import('sage.knots.knot', 'Knot')
106
109
 
@@ -503,7 +506,8 @@ class Braid(FiniteTypeArtinGroupElement):
503
506
  """
504
507
  return self.coxeter_group_element(W)
505
508
 
506
- def plot(self, color='rainbow', orientation='bottom-top', gap=0.05, aspect_ratio=1, axes=False, **kwds):
509
+ def plot(self, color='rainbow', orientation='bottom-top', gap=0.05,
510
+ aspect_ratio=1, axes=False, **kwds):
507
511
  """
508
512
  Plot the braid.
509
513
 
@@ -637,7 +641,7 @@ class Braid(FiniteTypeArtinGroupElement):
637
641
 
638
642
  def plot3d(self, color='rainbow'):
639
643
  """
640
- Plots the braid in 3d.
644
+ Plot the braid in 3d.
641
645
 
642
646
  The following option is available:
643
647
 
@@ -835,6 +839,7 @@ class Braid(FiniteTypeArtinGroupElement):
835
839
  r"""
836
840
  Return the representation matrix of ``self`` according to the R-matrix
837
841
  representation being attached to the quantum superalgebra `\mathfrak{sl}_q(2|1)`.
842
+
838
843
  See [MW2012]_, section 3 and references given there.
839
844
 
840
845
  INPUT:
@@ -867,15 +872,16 @@ class Braid(FiniteTypeArtinGroupElement):
867
872
  M = rep[0][0].parent().one()
868
873
  for i in self.Tietze():
869
874
  if i > 0:
870
- M = M*rep[i-1][0]
875
+ M = M * rep[i-1][0]
871
876
  if i < 0:
872
- M = M*rep[-i-1][1]
877
+ M = M * rep[-i-1][1]
873
878
  return M
874
879
 
875
880
  @cached_method
876
881
  def links_gould_polynomial(self, varnames=None, use_symbolics=False):
877
882
  r"""
878
883
  Return the Links-Gould polynomial of the closure of ``self``.
884
+
879
885
  See [MW2012]_, section 3 and references given there.
880
886
 
881
887
  INPUT:
@@ -913,12 +919,13 @@ class Braid(FiniteTypeArtinGroupElement):
913
919
  mu = rep[ln - 1] # quantum trace factor
914
920
  M = mu * self.links_gould_matrix(symbolics=use_symbolics)
915
921
  d1, d2 = M.dimensions()
916
- e = d1//4
922
+ e = d1 // 4
917
923
  B = M.base_ring()
918
924
  R = LaurentPolynomialRing(ZZ, varnames)
919
925
 
920
926
  # partial quantum trace according to I. Marin section 2.5
921
- part_trace = matrix(B, 4, 4, lambda i, j: sum(M[e * i + k, e * j + k] for k in range(e)))
927
+ part_trace = matrix(B, 4, 4, lambda i, j: sum(M[e * i + k, e * j + k]
928
+ for k in range(e)))
922
929
  ptemp = part_trace[0, 0] # part_trace == psymb*M.parent().one()
923
930
  if use_symbolics:
924
931
  v1, v2 = R.variable_names()
@@ -929,13 +936,13 @@ class Braid(FiniteTypeArtinGroupElement):
929
936
  else:
930
937
  ltemp = ptemp.lift().constant_coefficient()
931
938
  # Since the result of the calculation is known to be a Laurent polynomial
932
- # in t0 and t1 all exponents of ltemp must be divisable by 2
939
+ # in t0 and t1 all exponents of ltemp must be divisible by 2
933
940
  L = ltemp.parent()
934
941
  lred = L({(k[0]/2, k[1]/2): v for k, v in ltemp.monomial_coefficients().items()})
935
942
  t0, t1 = R.gens()
936
943
  return lred(t0, t1)
937
944
 
938
- def tropical_coordinates(self):
945
+ def tropical_coordinates(self) -> list:
939
946
  r"""
940
947
  Return the tropical coordinates of ``self`` in the braid group `B_n`.
941
948
 
@@ -979,7 +986,7 @@ class Braid(FiniteTypeArtinGroupElement):
979
986
 
980
987
  from sage.rings.semirings.tropical_semiring import TropicalSemiring
981
988
  T = TropicalSemiring(ZZ)
982
- return [T(_) for _ in coord]
989
+ return [T(c) for c in coord]
983
990
 
984
991
  def markov_trace(self, variab=None, normalized=True):
985
992
  r"""
@@ -1649,7 +1656,7 @@ class Braid(FiniteTypeArtinGroupElement):
1649
1656
  B = self.parent()
1650
1657
  return tuple([B(b) for b in rnf[:-1]] + [B.delta()**rnf[-1][0]])
1651
1658
 
1652
- def centralizer(self):
1659
+ def centralizer(self) -> list:
1653
1660
  """
1654
1661
  Return a list of generators of the centralizer of the braid.
1655
1662
 
@@ -1665,7 +1672,7 @@ class Braid(FiniteTypeArtinGroupElement):
1665
1672
  B = self.parent()
1666
1673
  return [B._element_from_libbraiding(b) for b in c]
1667
1674
 
1668
- def super_summit_set(self):
1675
+ def super_summit_set(self) -> list:
1669
1676
  """
1670
1677
  Return a list with the super summit set of the braid.
1671
1678
 
@@ -1787,10 +1794,9 @@ class Braid(FiniteTypeArtinGroupElement):
1787
1794
  cb = conjugatingbraid(self, other)
1788
1795
  if not cb:
1789
1796
  return None
1790
- else:
1791
- B = self.parent()
1792
- cb[0][0] %= 2
1793
- return B._element_from_libbraiding(cb)
1797
+ B = self.parent()
1798
+ cb[0][0] %= 2
1799
+ return B._element_from_libbraiding(cb)
1794
1800
 
1795
1801
  def is_conjugated(self, other) -> bool:
1796
1802
  """
@@ -1909,7 +1915,7 @@ class Braid(FiniteTypeArtinGroupElement):
1909
1915
  n2 = len(b2.Tietze())
1910
1916
  return b2 if n2 <= n0 else b0
1911
1917
 
1912
- def ultra_summit_set(self):
1918
+ def ultra_summit_set(self) -> list:
1913
1919
  """
1914
1920
  Return a list with the orbits of the ultra summit set of ``self``.
1915
1921
 
@@ -1939,7 +1945,7 @@ class Braid(FiniteTypeArtinGroupElement):
1939
1945
  B = self.parent()
1940
1946
  return [[B._element_from_libbraiding(i) for i in s] for s in uss]
1941
1947
 
1942
- def thurston_type(self):
1948
+ def thurston_type(self) -> str:
1943
1949
  """
1944
1950
  Return the thurston_type of ``self``.
1945
1951
 
@@ -2029,7 +2035,7 @@ class Braid(FiniteTypeArtinGroupElement):
2029
2035
  """
2030
2036
  return Integer(rigidity(self))
2031
2037
 
2032
- def sliding_circuits(self):
2038
+ def sliding_circuits(self) -> list:
2033
2039
  """
2034
2040
  Return the sliding circuits of the braid.
2035
2041
 
@@ -2332,7 +2338,7 @@ class Braid(FiniteTypeArtinGroupElement):
2332
2338
  B = self.parent()
2333
2339
  return tuple([B._element_from_libbraiding(b) for b in to_uss])
2334
2340
 
2335
- def sliding_circuits_element(self):
2341
+ def sliding_circuits_element(self) -> tuple:
2336
2342
  r"""
2337
2343
  Return an element of the braid's sliding circuits, and the conjugating
2338
2344
  braid.
@@ -2348,7 +2354,7 @@ class Braid(FiniteTypeArtinGroupElement):
2348
2354
  B = self.parent()
2349
2355
  return tuple([B._element_from_libbraiding(b) for b in to_sc])
2350
2356
 
2351
- def trajectory(self):
2357
+ def trajectory(self) -> list:
2352
2358
  r"""
2353
2359
  Return the braid's trajectory.
2354
2360
 
@@ -2366,7 +2372,7 @@ class Braid(FiniteTypeArtinGroupElement):
2366
2372
  B = self.parent()
2367
2373
  return [B._element_from_libbraiding(b) for b in traj]
2368
2374
 
2369
- def cyclic_slidings(self):
2375
+ def cyclic_slidings(self) -> list:
2370
2376
  r"""
2371
2377
  Return the braid's cyclic slidings.
2372
2378
 
@@ -2551,6 +2557,7 @@ class RightQuantumWord:
2551
2557
  def tuple_to_word(q_tuple):
2552
2558
  return M.prod(self._gens[i]**exp
2553
2559
  for i, exp in enumerate(q_tuple))
2560
+
2554
2561
  ret = {tuple_to_word(q_tuple): q_factor
2555
2562
  for q_tuple, q_factor in self.tuples.items() if q_factor}
2556
2563
  return self._algebra._from_dict(ret, remove_zeros=False)
@@ -2614,7 +2621,7 @@ class RightQuantumWord:
2614
2621
  return sum(q_factor * eps_monom(q_tuple)
2615
2622
  for q_tuple, q_factor in self.tuples.items())
2616
2623
 
2617
- def __repr__(self):
2624
+ def __repr__(self) -> str:
2618
2625
  r"""
2619
2626
  String representation of ``self``.
2620
2627
 
@@ -2644,14 +2651,14 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2644
2651
  sage: B1
2645
2652
  Braid group on 5 strands
2646
2653
  sage: B2 = BraidGroup(3)
2647
- sage: B1==B2
2654
+ sage: B1 == B2
2648
2655
  False
2649
2656
  sage: B2 is BraidGroup(3)
2650
2657
  True
2651
2658
  """
2652
2659
  Element = Braid
2653
2660
 
2654
- def __init__(self, names):
2661
+ def __init__(self, names) -> None:
2655
2662
  """
2656
2663
  Python constructor.
2657
2664
 
@@ -2726,7 +2733,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2726
2733
  # For caching hermitian form of unitary Burau representation
2727
2734
  self._hermitian_form = None
2728
2735
 
2729
- def __reduce__(self):
2736
+ def __reduce__(self) -> tuple:
2730
2737
  """
2731
2738
  TESTS::
2732
2739
 
@@ -2739,7 +2746,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2739
2746
  """
2740
2747
  return (BraidGroup_class, (self.variable_names(), ))
2741
2748
 
2742
- def _repr_(self):
2749
+ def _repr_(self) -> str:
2743
2750
  """
2744
2751
  Return a string representation.
2745
2752
 
@@ -2816,7 +2823,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2816
2823
  x = self._standard_lift_Tietze(x)
2817
2824
  return self.element_class(self, x)
2818
2825
 
2819
- def an_element(self):
2826
+ def _an_element_(self):
2820
2827
  """
2821
2828
  Return an element of the braid group.
2822
2829
 
@@ -2830,7 +2837,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2830
2837
  """
2831
2838
  return self.gen(0)
2832
2839
 
2833
- def some_elements(self):
2840
+ def some_elements(self) -> list:
2834
2841
  """
2835
2842
  Return a list of some elements of the braid group.
2836
2843
 
@@ -2847,7 +2854,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2847
2854
  elements_list.append(elements_list[-1]**self.strands())
2848
2855
  return elements_list
2849
2856
 
2850
- def _standard_lift_Tietze(self, p):
2857
+ def _standard_lift_Tietze(self, p) -> tuple:
2851
2858
  """
2852
2859
  Helper for :meth:`_standard_lift_Tietze`.
2853
2860
 
@@ -2875,8 +2882,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2875
2882
  (1, 2, 3, 4, 1, 2)
2876
2883
  """
2877
2884
  G = SymmetricGroup(self.strands())
2878
- pl = G(p)
2879
- return tuple(pl.reduced_word())
2885
+ return tuple(G(p).reduced_word())
2880
2886
 
2881
2887
  @cached_method
2882
2888
  def _links_gould_representation(self, symbolics=False):
@@ -2922,8 +2928,9 @@ class BraidGroup_class(FiniteTypeArtinGroup):
2922
2928
  else:
2923
2929
  from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
2924
2930
  LR = LaurentPolynomialRing(ZZ, 's0r, s1r')
2931
+ s0r, s1r = LR.gens()
2925
2932
  PR = PolynomialRing(LR, 'Yr')
2926
- s0r, s1r, Yr = PR.gens_dict_recursive().values()
2933
+ Yr = PR.gen()
2927
2934
  pqr = Yr**2 + (s0r**2 - 1) * (s1r**2 - 1)
2928
2935
  BR = PR.quotient_ring(pqr)
2929
2936
  s0 = BR(s0r)
@@ -3488,9 +3495,10 @@ class BraidGroup_class(FiniteTypeArtinGroup):
3488
3495
  r"""
3489
3496
  Return the mirror involution of ``self``.
3490
3497
 
3491
- This automorphism maps a braid to another one by replacing each generator
3492
- in its word by the inverse. In general this is different from the inverse
3493
- of the braid since the order of the generators in the word is not reversed.
3498
+ This automorphism maps a braid to another one by replacing
3499
+ each generator in its word by the inverse. In general this is
3500
+ different from the inverse of the braid since the order of the
3501
+ generators in the word is not reversed.
3494
3502
 
3495
3503
  EXAMPLES::
3496
3504
 
@@ -3554,7 +3562,7 @@ class BraidGroup_class(FiniteTypeArtinGroup):
3554
3562
  h2 = G.hom(codomain=self, im_gens=[self(a) for a in L2], check=False)
3555
3563
  return (G, h1, h2)
3556
3564
 
3557
- def epimorphisms(self, H):
3565
+ def epimorphisms(self, H) -> list:
3558
3566
  r"""
3559
3567
  Return the epimorphisms from ``self`` to ``H``, up to automorphism of `H` passing
3560
3568
  through the :meth:`two generator presentation
@@ -3587,12 +3595,18 @@ class BraidGroup_class(FiniteTypeArtinGroup):
3587
3595
  Gg = libgap(G)
3588
3596
  Hg = libgap(H)
3589
3597
  gquotients = Gg.GQuotients(Hg)
3590
- hom1g = libgap.GroupHomomorphismByImagesNC(G0g, Gg, [libgap(hom1(u)) for u in self.gens()])
3598
+ hom1g = libgap.GroupHomomorphismByImagesNC(G0g, Gg,
3599
+ [libgap(hom1(u))
3600
+ for u in self.gens()])
3591
3601
  g0quotients = [hom1g * h for h in gquotients]
3592
3602
  res = []
3603
+
3593
3604
  # the following closure is needed to attach a specific value of quo to
3594
3605
  # each function in the different morphisms
3595
- fmap = lambda tup: (lambda a: H(prod(tup[abs(i)-1]**sign(i) for i in a.Tietze())))
3606
+ def fmap(tup):
3607
+ return (lambda a: H(prod(tup[abs(i) - 1]**sign(i)
3608
+ for i in a.Tietze())))
3609
+
3596
3610
  for quo in g0quotients:
3597
3611
  tup = tuple(H(quo.ImageElm(i.gap()).sage()) for i in self.gens())
3598
3612
  fhom = GroupMorphismWithGensImages(HomSpace, fmap(tup))
@@ -3720,7 +3734,8 @@ class MappingClassGroupAction(Action):
3720
3734
 
3721
3735
  sage: A = B.mapping_class_action(F)
3722
3736
  sage: A
3723
- Right action by Braid group on 4 strands on Free Group on generators {x0, x1, x2, x3}
3737
+ Right action by Braid group on 4 strands on Free Group
3738
+ on generators {x0, x1, x2, x3}
3724
3739
  sage: A(x0, s1)
3725
3740
  x0
3726
3741
  sage: A(x1, s1)
@@ -3728,14 +3743,15 @@ class MappingClassGroupAction(Action):
3728
3743
  sage: A(x1^-1, s1)
3729
3744
  x1*x2^-1*x1^-1
3730
3745
  """
3731
- def __init__(self, G, M):
3746
+ def __init__(self, G, M) -> None:
3732
3747
  """
3733
3748
  TESTS::
3734
3749
 
3735
3750
  sage: B = BraidGroup(3)
3736
3751
  sage: G = FreeGroup('a, b, c')
3737
3752
  sage: B.mapping_class_action(G) # indirect doctest
3738
- Right action by Braid group on 3 strands on Free Group on generators {a, b, c}
3753
+ Right action by Braid group on 3 strands on Free Group
3754
+ on generators {a, b, c}
3739
3755
  """
3740
3756
  import operator
3741
3757
  Action.__init__(self, G, M, False, operator.mul)
sage/groups/free_group.py CHANGED
@@ -458,8 +458,9 @@ class FreeGroupElement(ElementLibGAP):
458
458
  R = ring
459
459
  symb = list(im_gens)
460
460
  symb += reversed([a**(-1) for a in im_gens])
461
- i = gen.Tietze()[0] # So ``gen`` is the `i`-th
462
- # generator of the free group.
461
+ i = gen.Tietze()[0]
462
+ # so gen is the i-th generator of the free group
463
+
463
464
  a = R.zero()
464
465
  coef = R.one()
465
466
  while l:
@@ -507,7 +508,7 @@ class FreeGroupElement(ElementLibGAP):
507
508
  for i in range(k):
508
509
  exponent = exponent_syllable(g, i+1).sage()
509
510
  generator = gen(generator_syllable(g, i+1).sage() - 1)
510
- result.append( (generator, exponent) )
511
+ result.append((generator, exponent))
511
512
  return tuple(result)
512
513
 
513
514
  def __call__(self, *values):
@@ -937,6 +938,7 @@ class FreeGroup_class(CachedRepresentation, Group, ParentLibGAP):
937
938
  Finitely presented group < a, b, c, d | a*b*a^-1 >
938
939
  """
939
940
  from sage.groups.finitely_presented import FinitelyPresentedGroup
940
- return FinitelyPresentedGroup(self, tuple(map(self, relations) ), **kwds)
941
+ return FinitelyPresentedGroup(self,
942
+ tuple(map(self, relations)), **kwds)
941
943
 
942
944
  __truediv__ = quotient
sage/groups/group_exp.py CHANGED
@@ -6,15 +6,15 @@ AUTHORS:
6
6
 
7
7
  - Mark Shimozono (2013): initial version
8
8
  """
9
- #*****************************************************************************
9
+ # ***************************************************************************
10
10
  # Copyright (C) 2013 <mshimo at math.vt.edu>
11
11
  #
12
12
  # This program is free software: you can redistribute it and/or modify
13
13
  # it under the terms of the GNU General Public License as published by
14
14
  # the Free Software Foundation, either version 2 of the License, or
15
15
  # (at your option) any later version.
16
- # http://www.gnu.org/licenses/
17
- #*****************************************************************************
16
+ # https://www.gnu.org/licenses/
17
+ # ***************************************************************************
18
18
 
19
19
  from sage.categories.commutative_additive_groups import CommutativeAdditiveGroups
20
20
  from sage.categories.functor import Functor
@@ -169,7 +169,10 @@ class GroupExp(Functor):
169
169
  """
170
170
  new_domain = self._apply_functor(f.domain())
171
171
  new_codomain = self._apply_functor(f.codomain())
172
- new_f = lambda a: new_codomain(f(a.value))
172
+
173
+ def new_f(a):
174
+ return new_codomain(f(a.value))
175
+
173
176
  return SetMorphism(Hom(new_domain, new_codomain, Groups()), new_f)
174
177
 
175
178
 
@@ -255,7 +258,7 @@ class GroupExp_Class(UniqueRepresentation, Parent):
255
258
  sage: GroupExp()(QQ)
256
259
  Multiplicative form of Rational Field
257
260
  """
258
- def __init__(self, G):
261
+ def __init__(self, G) -> None:
259
262
  r"""
260
263
 
261
264
  EXAMPLES::
@@ -268,7 +271,7 @@ class GroupExp_Class(UniqueRepresentation, Parent):
268
271
  self._G = G
269
272
  Parent.__init__(self, category=Groups())
270
273
 
271
- def _repr_(self):
274
+ def _repr_(self) -> str:
272
275
  r"""
273
276
  Return a string describing the multiplicative form of a commutative additive group.
274
277
 
@@ -308,7 +311,7 @@ class GroupExp_Class(UniqueRepresentation, Parent):
308
311
  """
309
312
  return GroupExpElement(self, self._G.zero())
310
313
 
311
- def an_element(self):
314
+ def _an_element_(self):
312
315
  r"""
313
316
  Return an element of the multiplicative group.
314
317