Skip to content

Commit d11e5c4

Browse files
committed
using new libbraiding
1 parent 8d5627b commit d11e5c4

File tree

4 files changed

+24
-40
lines changed

4 files changed

+24
-40
lines changed

src/sage/geometry/hyperplane_arrangement/ordered_arrangement.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ def projective_fundamental_group(self):
394394
< x0, x1, x2, x3, x4 | x4^-1*x3^-1*x2^-1*x3*x4*x0*x2*x0^-1,
395395
x4^-1*x2^-1*x4*x2, x4^-1*x1^-1*x0^-1*x1*x4*x0,
396396
x4^-1*x1^-1*x0^-1*x4*x0*x1,
397-
x4^-1*x1^-1*x3*x0*x1*x3^-1*x2^-1*x4*x0^-1*x2,
398397
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2,
399398
x3^-1*x1^-1*x3*x1 >
400399
sage: G3.abelian_invariants()
@@ -406,9 +405,7 @@ def projective_fundamental_group(self):
406405
< x0, x1, x2, x3, x4 | x4^-1*x3^-1*x2^-1*x3*x4*x0*x2*x0^-1,
407406
x4^-1*x2^-1*x4*x2, x4^-1*x1^-1*x0^-1*x1*x4*x0,
408407
x4^-1*x1^-1*x0^-1*x4*x0*x1,
409-
x4^-1*x1^-1*x3*x0*x1*x3^-1*x2^-1*x4*x0^-1*x2,
410-
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2,
411-
x3^-1*x1^-1*x3*x1 >
408+
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2, x3^-1*x1^-1*x3*x1 >
412409
sage: G4.abelian_invariants()
413410
(0, 0, 0, 0, 0)
414411

src/sage/schemes/curves/plane_curve_arrangement.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ def fundamental_group(self, simplified=True, vertical=True,
513513
{0: [x1, x2], 1: [x0], 2: [x3], 3: [x3^-1*x2^-1*x1^-1*x0^-1]}
514514
sage: A.fundamental_group(vertical=False)
515515
Finitely presented group
516-
< x0, x1, x2 | x2^-1*x1^-1*x2*x1, x1*x0*x1^-1*x0^-1, (x0*x2)^2*(x0^-1*x2^-1)^2 >
516+
< x0, x1, x2 | x2*x1^-1*x2^-1*x1, x1*x0*x1^-1*x0^-1, (x0*x2)^2*(x0^-1*x2^-1)^2 >
517517
sage: A.meridians(vertical=False)
518518
{0: [x2, x0*x2*x0^-1], 1: [x1], 2: [x0], 3: [x0*x2^-1*x0^-1*x2^-1*x1^-1*x0^-1]}
519519
sage: G = A.fundamental_group(simplified=False, vertical=False)
@@ -834,7 +834,7 @@ def fundamental_group(self, simplified=True):
834834
sage: A.fundamental_group().sorted_presentation()
835835
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1*x0 >
836836
sage: A.meridians()
837-
{0: [x1], 1: [x0], 2: [x1^-1*x0^-1*x1^-1]}
837+
{0: [x1], 1: [x0], 2: [x0^-1*x1^-2]}
838838
sage: G = A.fundamental_group(simplified=False)
839839
sage: G.sorted_presentation()
840840
Finitely presented group
@@ -945,7 +945,7 @@ def meridians(self, simplified=True):
945945
sage: A.fundamental_group().sorted_presentation()
946946
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1*x0 >
947947
sage: A.meridians()
948-
{0: [x1], 1: [x0], 2: [x1^-1*x0^-1*x1^-1]}
948+
{0: [x1], 1: [x0], 2: [x0^-1*x1^-2]}
949949
sage: A = H(y^2 + x*z, z, x)
950950
sage: A.fundamental_group()
951951
Finitely presented group < x0, x1 | (x1*x0)^2*(x1^-1*x0^-1)^2 >

src/sage/schemes/curves/projective_curve.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1775,8 +1775,9 @@ def fundamental_group(self):
17751775
sage: C = P.curve(x^2*z - y^3)
17761776
sage: C.fundamental_group() # needs sirocco
17771777
Finitely presented group < x0 | x0^3 >
1778-
sage: P.curve(z*(x^2*z - y^3)).fundamental_group() # needs sirocco
1779-
Finitely presented group < x0, x1 | x1*x0*x1*x0^-1*x1^-1*x0^-1 >
1778+
sage: g = P.curve(z*(x^2*z - y^3)).fundamental_group() # needs sirocco
1779+
sage: g.sorted_presentation() # needs sirocco
1780+
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1^-1*x0*x1*x0 >
17801781
17811782
In the case of number fields, they need to have an embedding
17821783
into the algebraic field::

src/sage/schemes/curves/zariski_vankampen.py

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import itertools
4545

4646
from copy import copy
47-
from datetime import datetime
4847
from itertools import combinations
4948

5049
from sage.combinat.permutation import Permutation
@@ -1417,7 +1416,7 @@ def conjugate_positive_form(braid):
14171416
14181417
A list of `r` lists. Each such list is another list with two elements, a
14191418
positive braid `\alpha_i` and a list of permutation braids
1420-
`\gamma_{1}^{i},\dots,\gamma_{r}^{n_i}` such that if
1419+
`\gamma_{1}^{i},\dots,\gamma_{n_i}^{i}` such that if
14211420
`\gamma_i=\prod_{j=1}^{n_i} \gamma_j^i` then the braids
14221421
`\tau_i=\gamma_i\alpha_i\gamma_i^{-1}` pairwise commute
14231422
and `\alpha=\prod_{i=1}^{r} \tau_i`.
@@ -1428,11 +1427,11 @@ def conjugate_positive_form(braid):
14281427
sage: B = BraidGroup(4)
14291428
sage: t = B((1, 3, 2, -3, 1, 1))
14301429
sage: conjugate_positive_form(t)
1431-
[[(s1*s0)^2, [s2]]]
1430+
[[(s0*s1)^2, [s0*s2*s1*s0]]]
14321431
sage: B = BraidGroup(5)
14331432
sage: t = B((1, 2, 3, 4, -1, -2, 3, 3, 2, -4))
14341433
sage: L = conjugate_positive_form(t); L
1435-
[[s1^2, [s3*s2]], [s1*s2, [s0]]]
1434+
[[s0^2, [s0*s1*s2*s1*s3*s2*s1*s0]], [s3*s2, [s0*s1*s2*s1*s3*s2*s1*s0]]]
14361435
sage: s = B.one()
14371436
sage: for a, l in L:
14381437
....: b = prod(l)
@@ -1452,9 +1451,7 @@ def conjugate_positive_form(braid):
14521451
braid1 = prod(A1, B.delta() ** ex)
14531452
sg0 = B.one()
14541453
else:
1455-
A = braid.super_summit_set()
1456-
braid1 = A[0]
1457-
sg0 = braid.conjugating_braid(braid1)
1454+
braid1, sg0 = braid.super_summit_set_element()
14581455
if ex > 0:
14591456
blocks = [list(braid1.Tietze())]
14601457
else:
@@ -1467,30 +1464,18 @@ def conjugate_positive_form(braid):
14671464
if block:
14681465
blocks.append(block)
14691466
shorts = []
1470-
oneblock = len(blocks) == 1
14711467
for a in blocks:
14721468
if sg0 == B.one():
14731469
res0 = [B(a), []]
14741470
else:
1475-
if not oneblock:
1476-
A = B(a).super_summit_set()
1471+
bra = sg0 * B(a) / sg0
1472+
br1, sg = bra.super_summit_set_element()
14771473
res = None
1478-
t0 = datetime.now()
1479-
for j, tau in enumerate(A):
1480-
if j == 1:
1481-
sg = sg0
1482-
else:
1483-
sg = (sg0 * B(a) / sg0).conjugating_braid(tau)
1484-
A1 = rightnormalform(sg)
1485-
par = A1[-1][0] % 2
1486-
A1 = [B(a) for a in A1[:-1]]
1487-
b = prod(A1, B.one())
1488-
b1 = len(b.Tietze()) / (len(A1) + 1)
1489-
if res is None or b1 < res[3]:
1490-
res = [tau, A1, par, b1]
1491-
if (datetime.now() - t0).total_seconds() > 60:
1492-
break
1493-
if res[2] == 1:
1474+
A1 = rightnormalform(sg)
1475+
par = A1[-1][0] % 2
1476+
A1 = [B(a0) for a0 in A1[:-1]]
1477+
res = [br1, A1, par]
1478+
if res[2]:
14941479
r0 = res[0].Tietze()
14951480
res[0] = B([i.sign() * (d - abs(i)) for i in r0])
14961481
res0 = res[:2]
@@ -1619,9 +1604,10 @@ def fundamental_group_from_braid_mon(bm, degree=None,
16191604
sage: bm = [s1*s2*s0*s1*s0^-1*s1^-1*s0^-1,
16201605
....: s0*s1^2*s0*s2*s1*(s0^-1*s1^-1)^2*s0^-1,
16211606
....: (s0*s1)^2]
1622-
sage: g = fundamental_group_from_braid_mon(bm, projective=True); g # needs sirocco
1607+
sage: g = fundamental_group_from_braid_mon(bm, projective=True) # needs sirocco
1608+
sage: g.sorted_presentation() # needs sirocco
16231609
Finitely presented group
1624-
< x1, x3 | x3^2*x1^2, x1^-1*x3^-1*x1*x3^-1*x1^-1*x3^-1 >
1610+
< x0, x1 | x1^-2*x0^-2, x1^-1*(x0^-1*x1)^2*x0 >
16251611
sage: print(g.order(), g.abelian_invariants()) # needs sirocco
16261612
12 (4,)
16271613
sage: B2 = BraidGroup(2)
@@ -1720,8 +1706,8 @@ def fundamental_group(f, simplified=True, projective=False, puiseux=True):
17201706
sage: from sage.schemes.curves.zariski_vankampen import fundamental_group, braid_monodromy
17211707
sage: R.<x, y> = QQ[]
17221708
sage: f = x^2 + y^3
1723-
sage: fundamental_group(f)
1724-
Finitely presented group < x0, x1 | x0*x1^-1*x0^-1*x1^-1*x0*x1 >
1709+
sage: fundamental_group(f).sorted_presentation()
1710+
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1^-1*x0*x1*x0 >
17251711
sage: fundamental_group(f, simplified=False, puiseux=False).sorted_presentation()
17261712
Finitely presented group < x0, x1, x2 | x2^-1*x1^-1*x0*x1,
17271713
x2^-1*x0*x1*x0^-1,
@@ -1882,7 +1868,7 @@ def fundamental_group_arrangement(flist, simplified=True, projective=False,
18821868
sage: G.sorted_presentation()
18831869
Finitely presented group
18841870
< x0, x1, x2, x3 | x3^-1*x2^-1*x3*x2, x3^-1*x1^-1*x0^-1*x1*x3*x0,
1885-
x3^-1*x1^-1*x3*x0*x1*x0^-1, x2^-1*x0^-1*x2*x0 >
1871+
x3^-1*x1^-1*x0^-1*x3*x0*x1, x2^-1*x0^-1*x2*x0 >
18861872
sage: dic
18871873
{0: [x1], 1: [x3], 2: [x2], 3: [x0], 4: [x3^-1*x2^-1*x1^-1*x0^-1]}
18881874
sage: fundamental_group_arrangement(L, vertical=True)

0 commit comments

Comments
 (0)