Skip to content

Commit

Permalink
Trac #33858: Further parallelization for fundamental group of curves.
Browse files Browse the repository at this point in the history
The computation of the fundamental group of algebraic plane curves is
done by computing the braid monodromy (which already takes advantage of
parallelization), and then computing the action of the braids over the
free group.

This second step can take non negligible time in some cases. With this
simple change, it is computed in parallel too, which can save some time.

URL: https://trac.sagemath.org/33858
Reported by: mmarco
Ticket author(s): Miguel Marco
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager committed May 22, 2022
2 parents a357cf7 + 8953d53 commit 7de9262
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sage/schemes/curves/zariski_vankampen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,11 @@ def fundamental_group(f, simplified=True, projective=False):
bm = braid_monodromy(f)
n = bm[0].parent().strands()
F = FreeGroup(n)
R = [x*b/x for x in F.gens() for b in bm]
@parallel
def relation(x,b):
return x*b/x
relations = list(relation([(x,b) for x in F.gens() for b in bm]))
R = [r[1] for r in relations]
if projective:
R.append(prod(F.gens()))
G = F/R
Expand Down

0 comments on commit 7de9262

Please sign in to comment.