Skip to content

Commit

Permalink
sagemathgh-39301: Using a new functions in libbraiding in zariski_van…
Browse files Browse the repository at this point in the history
…kampen

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

The file `zariski_vankampen` used some `libbraiding` functions in order
to compute the relations of the  group obtained applying Zariski-van
Kampen method. The use of the `super_summit_set` allowed to end
computations which did not finish with a straightforward approach. But,
when one works with large braid groups, the mehtod `super_summit_set`
can be very long, and running along its output is even longer. The new
`libbraiding` version includes the method `super_summit_set_element`
which simplifies and fasten the computations. The main changes are in
method `conjugate_positive_form`

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [X] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#39301
Reported by: Enrique Manuel Artal Bartolo
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed Jan 10, 2025
2 parents 63f8189 + b481917 commit 3954fe3
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 49 deletions.
4 changes: 2 additions & 2 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tarball=configure-VERSION.tar.gz
sha1=852d0d200a6a73aa5ddb9e00874cbe4a61c211e9
sha256=c4b089d90850dfdf15b905f66e4f6a0d961b96eb0663d8603beaff1a9efb2cbe
sha1=1eddcd428863dd3f9a9b59ac701e63d9b718748d
sha256=bb763394dfaa0ba132b9e8055eaca3d3fb0cae9135403582eff41491d40248e5
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a2ba1f943f88775218c385efe55509c4548d1b44
0cb2721d2a823ab7042811c7fca5752c54248e67
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ def projective_fundamental_group(self):
< x0, x1, x2, x3, x4 | x4^-1*x3^-1*x2^-1*x3*x4*x0*x2*x0^-1,
x4^-1*x2^-1*x4*x2, x4^-1*x1^-1*x0^-1*x1*x4*x0,
x4^-1*x1^-1*x0^-1*x4*x0*x1,
x4^-1*x1^-1*x3*x0*x1*x3^-1*x2^-1*x4*x0^-1*x2,
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2,
x3^-1*x1^-1*x3*x1 >
sage: G3.abelian_invariants()
Expand All @@ -406,9 +405,7 @@ def projective_fundamental_group(self):
< x0, x1, x2, x3, x4 | x4^-1*x3^-1*x2^-1*x3*x4*x0*x2*x0^-1,
x4^-1*x2^-1*x4*x2, x4^-1*x1^-1*x0^-1*x1*x4*x0,
x4^-1*x1^-1*x0^-1*x4*x0*x1,
x4^-1*x1^-1*x3*x0*x1*x3^-1*x2^-1*x4*x0^-1*x2,
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2,
x3^-1*x1^-1*x3*x1 >
x3^-1*x2^-1*x1^-1*x0^-1*x3*x0*x1*x2, x3^-1*x1^-1*x3*x1 >
sage: G4.abelian_invariants()
(0, 0, 0, 0, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/sage/schemes/curves/plane_curve_arrangement.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def fundamental_group(self, simplified=True, vertical=True,
{0: [x1, x2], 1: [x0], 2: [x3], 3: [x3^-1*x2^-1*x1^-1*x0^-1]}
sage: A.fundamental_group(vertical=False)
Finitely presented group
< x0, x1, x2 | x2^-1*x1^-1*x2*x1, x1*x0*x1^-1*x0^-1, (x0*x2)^2*(x0^-1*x2^-1)^2 >
< x0, x1, x2 | x2*x1^-1*x2^-1*x1, x1*x0*x1^-1*x0^-1, (x0*x2)^2*(x0^-1*x2^-1)^2 >
sage: A.meridians(vertical=False)
{0: [x2, x0*x2*x0^-1], 1: [x1], 2: [x0], 3: [x0*x2^-1*x0^-1*x2^-1*x1^-1*x0^-1]}
sage: G = A.fundamental_group(simplified=False, vertical=False)
Expand Down Expand Up @@ -834,7 +834,7 @@ def fundamental_group(self, simplified=True):
sage: A.fundamental_group().sorted_presentation()
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1*x0 >
sage: A.meridians()
{0: [x1], 1: [x0], 2: [x1^-1*x0^-1*x1^-1]}
{0: [x1], 1: [x0], 2: [x0^-1*x1^-2]}
sage: G = A.fundamental_group(simplified=False)
sage: G.sorted_presentation()
Finitely presented group
Expand Down Expand Up @@ -945,7 +945,7 @@ def meridians(self, simplified=True):
sage: A.fundamental_group().sorted_presentation()
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1*x0 >
sage: A.meridians()
{0: [x1], 1: [x0], 2: [x1^-1*x0^-1*x1^-1]}
{0: [x1], 1: [x0], 2: [x0^-1*x1^-2]}
sage: A = H(y^2 + x*z, z, x)
sage: A.fundamental_group()
Finitely presented group < x0, x1 | (x1*x0)^2*(x1^-1*x0^-1)^2 >
Expand Down
5 changes: 3 additions & 2 deletions src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,8 +1775,9 @@ def fundamental_group(self):
sage: C = P.curve(x^2*z - y^3)
sage: C.fundamental_group() # needs sirocco
Finitely presented group < x0 | x0^3 >
sage: P.curve(z*(x^2*z - y^3)).fundamental_group() # needs sirocco
Finitely presented group < x0, x1 | x1*x0*x1*x0^-1*x1^-1*x0^-1 >
sage: g = P.curve(z*(x^2*z - y^3)).fundamental_group() # needs sirocco
sage: g.sorted_presentation() # needs sirocco
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1^-1*x0*x1*x0 >
In the case of number fields, they need to have an embedding
into the algebraic field::
Expand Down
80 changes: 43 additions & 37 deletions src/sage/schemes/curves/zariski_vankampen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ def conjugate_positive_form(braid):
A list of `r` lists. Each such list is another list with two elements, a
positive braid `\alpha_i` and a list of permutation braids
`\gamma_{1}^{i},\dots,\gamma_{r}^{n_i}` such that if
`\gamma_{1}^{i},\dots,\gamma_{n_i}^{i}` such that if
`\gamma_i=\prod_{j=1}^{n_i} \gamma_j^i` then the braids
`\tau_i=\gamma_i\alpha_i\gamma_i^{-1}` pairwise commute
and `\alpha=\prod_{i=1}^{r} \tau_i`.
Expand All @@ -1426,51 +1426,56 @@ def conjugate_positive_form(braid):
sage: from sage.schemes.curves.zariski_vankampen import conjugate_positive_form
sage: B = BraidGroup(4)
sage: t = B((1, 3, 2, -3, 1, 1))
sage: conjugate_positive_form(t)
[[(s1*s0)^2, [s2]]]
sage: cpf = conjugate_positive_form(t); cpf
[[(s0*s1)^2, [s0*s2*s1*s0]]]
sage: t == prod(prod(b) * a / prod(b) for a, b in cpf)
True
sage: B = BraidGroup(5)
sage: t = B((1, 2, 3, 4, -1, -2, 3, 3, 2, -4))
sage: L = conjugate_positive_form(t); L
[[s1^2, [s3*s2]], [s1*s2, [s0]]]
sage: s = B.one()
sage: for a, l in L:
....: b = prod(l)
....: s *= b * a / b
sage: s == t
[[s0^2, [s0*s1*s2*s1*s3*s2*s1*s0]], [s3*s2, [s0*s1*s2*s1*s3*s2*s1*s0]]]
sage: t == prod(prod(b) * a / prod(b) for a, b in L)
True
sage: s1 = B.gen(1)^3
sage: conjugate_positive_form(s1)
[[s1^3, []]]
"""
B = braid.parent()
d = B.strands()
braid1 = braid.super_summit_set()[0]
L1 = braid1.Tietze()
sg0 = braid.conjugating_braid(braid1)
gns = set(L1)
cuts = [j for j in range(d + 1) if j not in gns]
blocks = []
for i in range(len(cuts) - 1):
block = [j for j in L1 if cuts[i] < j < cuts[i + 1]]
if block:
blocks.append(block)
rnf = rightnormalform(braid)
ex = rnf[-1][0]
if ex >= 0:
A1 = [B(a) for a in rnf[:-1]]
braid1 = prod(A1, B.delta() ** ex)
sg0 = B.one()
else:
braid1, sg0 = braid.super_summit_set_element()
if ex > 0:
blocks = [list(braid1.Tietze())]
else:
L1 = braid1.Tietze()
gns = set(L1)
cuts = [j for j in range(d + 1) if j not in gns]
blocks = []
for i in range(len(cuts) - 1):
block = [j for j in L1 if cuts[i] < j < cuts[i + 1]]
if block:
blocks.append(block)
shorts = []
for a in blocks:
A = B(a).super_summit_set()
res = None
for tau in A:
sg = (sg0 * B(a) / sg0).conjugating_braid(tau)
if sg0 == B.one():
res0 = [B(a), []]
else:
bra = sg0 * B(a) / sg0
br1, sg = bra.super_summit_set_element()
A1 = rightnormalform(sg)
par = A1[-1][0] % 2
A1 = [B(a) for a in A1[:-1]]
b = prod(A1, B.one())
b1 = len(b.Tietze()) / (len(A1) + 1)
if res is None or b1 < res[3]:
res = [tau, A1, par, b1]
if res[2] == 1:
r0 = res[0].Tietze()
res[0] = B([i.sign() * (d - abs(i)) for i in r0])
res0 = res[:2]
A1 = [B(a0) for a0 in A1[:-1]]
res = [br1, A1, par]
if res[2]:
r0 = res[0].Tietze()
res[0] = B([d - i for i in r0])
res0 = res[:2]
shorts.append(res0)
return shorts

Expand Down Expand Up @@ -1596,9 +1601,10 @@ def fundamental_group_from_braid_mon(bm, degree=None,
sage: bm = [s1*s2*s0*s1*s0^-1*s1^-1*s0^-1,
....: s0*s1^2*s0*s2*s1*(s0^-1*s1^-1)^2*s0^-1,
....: (s0*s1)^2]
sage: g = fundamental_group_from_braid_mon(bm, projective=True); g # needs sirocco
sage: g = fundamental_group_from_braid_mon(bm, projective=True) # needs sirocco
sage: g.sorted_presentation() # needs sirocco
Finitely presented group
< x1, x3 | x3^2*x1^2, x1^-1*x3^-1*x1*x3^-1*x1^-1*x3^-1 >
< x0, x1 | x1^-2*x0^-2, x1^-1*(x0^-1*x1)^2*x0 >
sage: print(g.order(), g.abelian_invariants()) # needs sirocco
12 (4,)
sage: B2 = BraidGroup(2)
Expand Down Expand Up @@ -1697,8 +1703,8 @@ def fundamental_group(f, simplified=True, projective=False, puiseux=True):
sage: from sage.schemes.curves.zariski_vankampen import fundamental_group, braid_monodromy
sage: R.<x, y> = QQ[]
sage: f = x^2 + y^3
sage: fundamental_group(f)
Finitely presented group < x0, x1 | x0*x1^-1*x0^-1*x1^-1*x0*x1 >
sage: fundamental_group(f).sorted_presentation()
Finitely presented group < x0, x1 | x1^-1*x0^-1*x1^-1*x0*x1*x0 >
sage: fundamental_group(f, simplified=False, puiseux=False).sorted_presentation()
Finitely presented group < x0, x1, x2 | x2^-1*x1^-1*x0*x1,
x2^-1*x0*x1*x0^-1,
Expand Down Expand Up @@ -1859,7 +1865,7 @@ def fundamental_group_arrangement(flist, simplified=True, projective=False,
sage: G.sorted_presentation()
Finitely presented group
< x0, x1, x2, x3 | x3^-1*x2^-1*x3*x2, x3^-1*x1^-1*x0^-1*x1*x3*x0,
x3^-1*x1^-1*x3*x0*x1*x0^-1, x2^-1*x0^-1*x2*x0 >
x3^-1*x1^-1*x0^-1*x3*x0*x1, x2^-1*x0^-1*x2*x0 >
sage: dic
{0: [x1], 1: [x3], 2: [x2], 3: [x0], 4: [x3^-1*x2^-1*x1^-1*x0^-1]}
sage: fundamental_group_arrangement(L, vertical=True)
Expand Down

0 comments on commit 3954fe3

Please sign in to comment.