Skip to content

Commit a535a53

Browse files
presentation-examples: add braid_group
1 parent 357e481 commit a535a53

5 files changed

Lines changed: 50 additions & 7 deletions

File tree

docs/source/data-structures/presentations/examples.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ semigroup or monoid they define.
2828

2929
abacus_jones_monoid
3030
alternating_group
31+
braid_group
3132
brauer_monoid
3233
chinese_monoid
3334
cyclic_inverse_monoid

docs/source/libsemigroups.bib

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
%% This BibTeX bibliography file was created using BibDesk.
2-
%% https://bibdesk.sourceforge.io/
3-
4-
%% Created for James Mitchell at 2024-02-01 14:50:47 +0000
5-
6-
7-
%% Saved with string encoding Unicode (UTF-8)
1+
@inbook{Birman2005aa,
2+
title = {Braids},
3+
ISBN = {9780444514523},
4+
url = {http://dx.doi.org/10.1016/B978-044451452-3/50003-4},
5+
DOI = {10.1016/b978-044451452-3/50003-4},
6+
booktitle = {Handbook of Knot Theory},
7+
publisher = {Elsevier},
8+
author = {Birman, Joan S. and Brendle, Tara E.},
9+
year = {2005},
10+
pages = {19–103}
11+
}
812

913
@misc{Aicardi2025aa,
1014
title={Framization and Deframization},

src/libsemigroups_pybind11/presentation/examples.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
presentation_examples_abacus_jones_monoid_AJP25 as _abacus_jones_monoid_AJP25,
2020
presentation_examples_alternating_group as _alternating_group,
2121
presentation_examples_alternating_group_Moo97 as _alternating_group_Moo97,
22+
presentation_examples_braid_group as _braid_group,
2223
presentation_examples_brauer_monoid as _brauer_monoid,
2324
presentation_examples_brauer_monoid_KM07 as _brauer_monoid_KM07,
2425
presentation_examples_chinese_monoid as _chinese_monoid,
@@ -108,6 +109,7 @@
108109
alternating_group = _wrap_cxx_free_fn(_alternating_group)
109110
alternating_group_Moo97 = _wrap_cxx_free_fn(_alternating_group_Moo97)
110111
brauer_monoid = _wrap_cxx_free_fn(_brauer_monoid)
112+
braid_group = _wrap_cxx_free_fn(_braid_group)
111113
brauer_monoid_KM07 = _wrap_cxx_free_fn(_brauer_monoid_KM07)
112114
chinese_monoid = _wrap_cxx_free_fn(_chinese_monoid)
113115
chinese_monoid_CEKNH01 = _wrap_cxx_free_fn(_chinese_monoid_CEKNH01)

src/presentation-examples.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,26 @@ defines a monoid of size :math:`C_n\ d ^n` where :math:`C_n` is the
19451945
:rtype: Presentation
19461946
19471947
:raises LibsemigroupsError: if ``n < 3`` or if ``d = 0``.
1948+
)pbdoc");
1949+
1950+
m.def("presentation_examples_braid_group",
1951+
&presentation::examples::braid_group,
1952+
py::arg("n"),
1953+
R"pbdoc(
1954+
:sig=(n: int) -> Presentation:
1955+
1956+
A presentation for the Braid group.
1957+
1958+
This function returns a monoid presentation defining the Braid group with
1959+
:math:`n - 1` generators, as described in Equation (2) of :any:`Birman2005aa`.
1960+
1961+
:param n: the degree, or equivalently the number of generators plus 1.
1962+
:type n: int
1963+
1964+
:returns: The specified presentation.
1965+
:rtype: Presentation
1966+
1967+
:raises LibsemigroupsError: if ``n < 3``.
19481968
)pbdoc");
19491969
} // init_presentation_examples
19501970

tests/test_presentation_examples.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
congruence_kind,
2020
LibsemigroupsError,
2121
ReportGuard,
22+
POSITIVE_INFINITY,
2223
)
2324

2425
from libsemigroups_pybind11.presentation import examples
@@ -413,3 +414,18 @@ def test_abacus_jones():
413414
tc = ToddCoxeter(congruence_kind.twosided, p)
414415
assert tc.number_of_classes() == 40
415416
assert tc.number_of_classes() == 5 * 2**3
417+
418+
419+
def test_braid_group():
420+
ReportGuard(False)
421+
with pytest.raises(LibsemigroupsError):
422+
examples.braid_group(0)
423+
with pytest.raises(LibsemigroupsError):
424+
examples.braid_group(1)
425+
with pytest.raises(LibsemigroupsError):
426+
examples.braid_group(2)
427+
428+
p = examples.braid_group(3)
429+
assert len(p.alphabet()) == 4
430+
tc = ToddCoxeter(congruence_kind.twosided, p)
431+
assert tc.number_of_classes() == POSITIVE_INFINITY

0 commit comments

Comments
 (0)