Skip to content

Commit 14c4ef3

Browse files
committed
last review changes
1 parent c9f9f68 commit 14c4ef3

File tree

3 files changed

+33
-42
lines changed

3 files changed

+33
-42
lines changed

src/doc/en/reference/references/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,8 +1382,8 @@ REFERENCES:
13821382
[`<https://hal.inria.fr/hal-01182890>`_].
13831383
13841384
.. [CS1999a] \D. Cohen and A. Suciu. *Characteristic varieties of arrangements*.
1385-
Math. Proc. Cambridge Philos. Soc.127 (1999), no.1, 33–-53.
1386-
:doi:`10.1017/S0305004199003576`.
1385+
Math. Proc. Cambridge Philos. Soc.127 (1999), no.1, 33–-53.
1386+
:doi:`10.1017/S0305004199003576`.
13871387
13881388
.. [CCLSV2005] \M. Chudnovsky, G. Cornuejols, X. Liu, P. Seymour, K. Vuskovic.
13891389
*Recognizing berge graphs*.

src/sage/groups/finitely_presented.py

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ class GroupMorphismWithGensImages(SetMorphism):
165165
Defn: x0 |--> ()
166166
x1 |--> ()
167167
x2 |--> ()
168-
169168
"""
170169

171170
def _repr_defn(self):
@@ -476,7 +475,6 @@ class RewritingSystem():
476475
477476
- Miguel Angel Marco Buzunariz (2013-12-16)
478477
"""
479-
480478
def __init__(self, G):
481479
"""
482480
Initialize ``self``.
@@ -1355,14 +1353,13 @@ def abelian_invariants(self):
13551353
invariants = self.gap().AbelianInvariants()
13561354
return tuple(i.sage() for i in invariants)
13571355

1358-
13591356
def abelianization_map(self):
13601357
r"""
13611358
Return the abelianization map of ``self``.
13621359
13631360
OUTPUT:
13641361
1365-
The abelianization map of ``self`` as a homomorphism of finitely presented groups.
1362+
The abelianization map of ``self`` as a homomorphism of finitely presented groups.
13661363
13671364
EXAMPLES::
13681365
@@ -1373,11 +1370,11 @@ def abelianization_map(self):
13731370
Group morphism:
13741371
From: Finitely presented group < g0, g1, g2, g3 | g1^2, g2*g1*g2^-1*g1^-1, g1*g3^-2, g0^4 >
13751372
To: Finitely presented group < f2, f3, f4 | f2^-1*f3^-1*f2*f3, f2^-1*f4^-1*f2*f4, f3^-1*f4^-1*f3*f4, f2^4, f3^4 >
1376-
sage: g=FreeGroup(0)/[]
1373+
sage: g = FreeGroup(0) / []
13771374
sage: g.abelianization_map()
13781375
Group endomorphism of Finitely presented group < | >
13791376
"""
1380-
if len(self.generators()) == 0:
1377+
if not self.generators():
13811378
return self.hom(codomain=self, im_gens=[])
13821379
hom_ab_libgap = libgap(self).MaximalAbelianQuotient()
13831380
ab_libgap = hom_ab_libgap.Range()
@@ -1408,12 +1405,9 @@ def abelianization_to_algebra(self, ring=QQ):
14081405
14091406
- ``ab`` -- the abelianization of ``self`` as a finitely presented group
14101407
with a minimal number `n` of generators.
1411-
14121408
- ``R`` -- a Laurent polynomial ring with `n` variables with base ring ``ring``.
1413-
14141409
- ``ideal`` -- a list of generators of an ideal ``I`` in ``R`` such that ``R/I``
14151410
is the group algebra of the abelianization over ``ring``
1416-
14171411
- ``image`` -- a list with the images of the generators of ``self`` in ``R/I``
14181412
14191413
EXAMPLES::
@@ -1427,11 +1421,11 @@ def abelianization_to_algebra(self, ring=QQ):
14271421
f3^-1*f4^-1*f3*f4, f2^4, f3^4 >,
14281422
Multivariate Laurent Polynomial Ring in f2, f3, f4 over Rational Field,
14291423
[f2^4 - 1, f3^4 - 1], [f2^-1*f3^-2, f3^-2, f4, f3])
1430-
sage: g=FreeGroup(0)/[]
1424+
sage: g=FreeGroup(0) / []
14311425
sage: g.abelianization_to_algebra()
14321426
(Finitely presented group < | >, Rational Field, [], [])
14331427
"""
1434-
if len(self.generators()) == 0:
1428+
if not self.generators():
14351429
return self, ring, [], []
14361430
hom_ab = self.abelianization_map()
14371431
ab = hom_ab.codomain()
@@ -1657,37 +1651,34 @@ def abelian_alexander_matrix(self, ring=QQ, abelianized=None, simplified=True):
16571651
OUTPUT:
16581652
16591653
- ``A`` -- a matrix with coefficients in ``R``
1660-
1661-
- ``R`` -- a ring of Laurent polynomials over ``ring``
1662-
1663-
- ``ideal`` -- an list of generators of an ideal ``I`` of ``R`` such that ``R/I`` is
1654+
- ``ideal`` -- an list of generators of an ideal ``I`` of ``R = A.base_ring()`` such that ``R/I`` is
16641655
the group algebra of the abelianization of ``self``
16651656
16661657
EXAMPLES::
16671658
16681659
sage: G.<a,b,c> = FreeGroup()
16691660
sage: H = G.quotient([a*b/a/b, a*c/a/c, c*b/c/b])
1670-
sage: A, R, ideal = H.abelian_alexander_matrix()
1661+
sage: A, ideal = H.abelian_alexander_matrix()
16711662
sage: A
16721663
[-f2 + 1 f1 - 1 0]
16731664
[-f3 + 1 0 f1 - 1]
16741665
[ 0 f3 - 1 -f2 + 1]
1675-
sage: R
1666+
sage: A.base_ring()
16761667
Multivariate Laurent Polynomial Ring in f1, f2, f3 over Rational Field
16771668
sage: ideal
16781669
[]
16791670
sage: abel = H.abelianization_to_algebra()
1680-
sage: (A, R, ideal) == H.abelian_alexander_matrix(abelianized=abel)
1671+
sage: (A, ideal) == H.abelian_alexander_matrix(abelianized=abel)
16811672
True
1682-
sage: G=FreeGroup(3)/[(2,1,1), (1,2,2,3,3)]
1683-
sage: A, R, ideal = G.abelian_alexander_matrix(simplified=True); A
1673+
sage: G = FreeGroup(3)/[(2, 1, 1), (1, 2, 2, 3, 3)]
1674+
sage: A, ideal = G.abelian_alexander_matrix(simplified=True); A
16841675
[-f3^2 - f3^4 - f3^6 f3^3 + f3^6]
1685-
sage: g=FreeGroup(1)/[]
1676+
sage: g = FreeGroup(1) / []
16861677
sage: g.abelian_alexander_matrix()
1687-
([], Integer Ring, [])
1688-
sage: g=FreeGroup(0)/[]
1678+
([], [])
1679+
sage: g = FreeGroup(0) / []
16891680
sage: g.abelian_alexander_matrix()
1690-
([], Integer Ring, [])
1681+
([], [])
16911682
"""
16921683
if abelianized is None:
16931684
ab, R, ideal, images = self.abelianization_to_algebra(ring=ring)
@@ -1696,9 +1687,8 @@ def abelian_alexander_matrix(self, ring=QQ, abelianized=None, simplified=True):
16961687
A = self.alexander_matrix(im_gens=images)
16971688
if simplified:
16981689
n, m = A.dimensions()
1699-
R = A.base_ring()
1700-
if 0 in (n, m):
1701-
return A, R, ideal
1690+
if n == 0 or m == 0:
1691+
return A, ideal
17021692
simpli = True
17031693
while simpli:
17041694
i = 0
@@ -1721,9 +1711,9 @@ def abelian_alexander_matrix(self, ring=QQ, abelianized=None, simplified=True):
17211711
i += 1
17221712
j = 0
17231713
simpli = unidad
1724-
return A, R, ideal
1714+
return A, ideal
17251715

1726-
def char_var(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False):
1716+
def characteristic_varieties(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False):
17271717
r"""
17281718
Return the characteristic varieties of the group ``self``.
17291719
@@ -1736,7 +1726,7 @@ def char_var(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False)
17361726
17371727
V_k(G) = \{\xi\in\mathbb{T}\mid \dim H^1(G;\xi)\geq k\}.
17381728
1739-
These varieties are defined by ideals in `\Lambda`
1729+
These varieties are defined by ideals in `\Lambda`.
17401730
17411731
INPUT:
17421732
@@ -1757,7 +1747,7 @@ def char_var(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False)
17571747
17581748
sage: L = [2*(i, j) + 2* (-i, -j) for i, j in ((1, 2), (2, 3), (3, 1))]
17591749
sage: G = FreeGroup(3) / L
1760-
sage: G.char_var(groebner=True)
1750+
sage: G.characteristic_varieties(groebner=True)
17611751
[[(f1 - 1, f2 - 1, f3 - 1),
17621752
(f1 + 1, f2 - 1, f3 - 1),
17631753
(f1 - 1, f2 - 1, f3 + 1),
@@ -1770,25 +1760,25 @@ def char_var(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False)
17701760
(f2*f3 + 1, f1 - f2),
17711761
(f2*f3 + 1, f1 - f3),
17721762
(f1*f3 + 1, f2 - f3)]]
1773-
sage: A, R, I = G.abelian_alexander_matrix()
1774-
sage: G.char_var(groebner=True) == G.char_var(groebner=True, matrix_ideal=(A, I))
1763+
sage: A, I = G.abelian_alexander_matrix()
1764+
sage: G.characteristic_varieties(groebner=True) == G.characteristic_varieties(groebner=True, matrix_ideal=(A, I))
17751765
True
17761766
sage: G = FreeGroup(2)/[2*(1,2,-1,-2)]
1777-
sage: G.char_var()
1767+
sage: G.characteristic_varieties()
17781768
[Ideal (-2*f2 + 2, 2*f1 - 2) of Multivariate Laurent Polynomial Ring in f1, f2 over Rational Field]
1779-
sage: G.char_var(ring=ZZ)
1769+
sage: G.characteristic_varieties(ring=ZZ)
17801770
[Ideal (-2*f2 + 2, 2*f1 - 2) of Multivariate Laurent Polynomial Ring in f1, f2 over Integer Ring]
17811771
sage: G = FreeGroup(2)/[(1,2,1,-2,-1,-2)]
1782-
sage: G.char_var()
1772+
sage: G.characteristic_varieties()
17831773
[Ideal (1 - f2 + f2^2, -1 + f2 - f2^2) of Univariate Laurent Polynomial Ring in f2 over Rational Field]
1784-
sage: G.char_var(groebner=True)
1774+
sage: G.characteristic_varieties(groebner=True)
17851775
[[1 - f2 + f2^2]]
17861776
"""
17871777
if matrix_ideal is None:
1788-
A, R, ideal = self.abelian_alexander_matrix(ring=ring, abelianized=abelianized, simplified=True)
1778+
A, ideal = self.abelian_alexander_matrix(ring=ring, abelianized=abelianized, simplified=True)
17891779
else:
17901780
A, ideal = matrix_ideal
1791-
R = A.base_ring()
1781+
R = A.base_ring()
17921782
res = []
17931783
S = R.polynomial_ring()
17941784
ideal = [S(elt) for elt in ideal]
@@ -1806,7 +1796,7 @@ def char_var(self, ring=QQ, matrix_ideal=None, abelianized=None, groebner=False)
18061796
res1.append([R(0)])
18071797
else:
18081798
fct = [q[0] for q in R(p).factor()]
1809-
if len(fct) > 0:
1799+
if fct:
18101800
res1.append(fct)
18111801
return res1
18121802
res1 = []

src/sage/rings/polynomial/laurent_polynomial_mpair.pyx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
15311531
is a monomial.
15321532
15331533
EXAMPLES::
1534+
15341535
sage: R.<x, y> = LaurentPolynomialRing(QQ)
15351536
sage: f = y / x + x^2 / y + 3 * x^4 * y^-2
15361537
sage: f.polynomial_construction()

0 commit comments

Comments
 (0)