Skip to content

Commit 099e010

Browse files
rebuilding site Sun 18 Jan 2026 16:30:15 GMT
1 parent 7725eca commit 099e010

157 files changed

Lines changed: 2049 additions & 1709 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_images/to-table.svg

Lines changed: 1379 additions & 1157 deletions
Loading

_sources/changelog-v1.rst.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
Changelog - version 1
99
=====================
1010

11+
v1.3.0 (released 18/01/2026)
12+
----------------------------
13+
14+
* Update to libsemigroups v3.4.0 and add features introduced there by
15+
@james-d-mitchell in
16+
https://github.com/libsemigroups/libsemigroups_pybind11/pull/380
17+
1118
v1.2.0 (released 16/12/2025)
1219
----------------------------
1320

_sources/data-structures/presentations/to-inverse-present.rst.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ using the :any:`to` function.
2222
Various uses
2323
------------
2424

25-
Recall that the signature for the :any:`to` function is ``to(*args, Return)``.
26-
In what follows, we explain how different values of *args* and *Return* may be
25+
Recall that the signature for the :any:`to` function is ``to(*args, rtype)``.
26+
In what follows, we explain how different values of *args* and *rtype* may be
2727
used to construct :any:`InversePresentation` objects. The following options are
2828
possible:
2929

@@ -41,7 +41,7 @@ the following values for *args*:
4141

4242
- **p** (:any:`Presentation`) -- the :any:`Presentation` to convert.
4343

44-
Additionally, specify the following for *Return*:
44+
Additionally, specify the following for *rtype*:
4545

4646
- ``(InversePresentation,)`` for constructing an :any:`InversePresentation`
4747
over words of the same type as those in *p*.
@@ -92,22 +92,22 @@ specify the following values for *args*:
9292
- **ip** (:any:`InversePresentation`) -- the :any:`InversePresentation` to
9393
convert.
9494

95-
Additionally, specify one of the following for *Return*:
95+
Additionally, specify one of the following for *rtype*:
9696

9797
- ``(InversePresentation, str)`` for constructing an
9898
- :any:`InversePresentation` over words of type ``str``.
9999
- ``(InversePresentation, list[int])`` for constructing an
100100
:any:`InversePresentation` over words of type ``list[int]``.
101101

102102
This function behaves in one of two ways, depending on type of words in *p*, and
103-
the type of words specified in *Return*:
103+
the type of words specified in *rtype*:
104104

105-
1. When the type of words in *ip* and type of words specified in *Return*
105+
1. When the type of words in *ip* and type of words specified in *rtype*
106106
are not the same, this function returns an :any:`InversePresentation`
107107
equivalent to the input :any:`InversePresentation` *ip* but with words a
108108
different type (for example, can be used to convert from ``str`` to
109109
``list[int]``).
110-
2. When the type of words in *ip* and type of words specified in *Return*
110+
2. When the type of words in *ip* and type of words specified in *rtype*
111111
are the same, this function just returns its argument *ip*, and is
112112
included solely for the purpose of simplifying certain client code, where
113113
objects of type :any:`InversePresentation` must be converted from one
@@ -120,7 +120,7 @@ of type ``list[int]``, then the conversion from one type to another is
120120
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.
121121

122122
This function throws a :any:`LibsemigroupsError` if the type of words in *ip* is
123-
not the same as that specified in *Return* and
123+
not the same as that specified in *rtype* and
124124
``p.throw_if_bad_alphabet_rules_or_inverses()`` throws.
125125

126126
.. seealso::
@@ -164,7 +164,7 @@ using a custom letter conversion function, specify the following values for
164164
- **f** (``Callable[[str | int], int | str]``) -- the function used to
165165
convert between the different types of letters.
166166

167-
Additionally, specify one of the following for *Return*:
167+
Additionally, specify one of the following for *rtype*:
168168

169169
- ``(InversePresentation, str)`` for constructing an
170170
:any:`InversePresentation` over words of type ``str``.
@@ -180,7 +180,7 @@ to the other.
180180
This function throws a :any:`LibsemigroupsError` if
181181
``ip.throw_if_bad_alphabet_rules_or_inverses()`` throws, or if the function
182182
specified by *f* does not map letters of the type used in *ip* to letters of the
183-
type of word specified in *Return*.
183+
type of word specified in *rtype*.
184184

185185
.. seealso::
186186

_sources/data-structures/presentations/to-present.rst.txt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ This page contains documentation relating to converting
2222
Various uses
2323
------------
2424

25-
Recall that the signature for the :any:`to` function is ``to(*args, Return)``.
26-
In what follows, we explain how different values of *args* and *Return* may be
25+
Recall that the signature for the :any:`to` function is ``to(*args, rtype)``.
26+
In what follows, we explain how different values of *args* and *rtype* may be
2727
used to construct :any:`Presentation` objects. The following options are
2828
possible:
2929

@@ -46,21 +46,21 @@ following values for *args*:
4646

4747
- **p** (:any:`Presentation`) -- the :any:`Presentation` to convert.
4848

49-
Additionally, specify one of the following for *Return*:
49+
Additionally, specify one of the following for *rtype*:
5050

5151
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
5252
of type ``str``.
5353
- ``(Presentation, list[int])`` for constructing a :any:`Presentation` over
5454
words of type ``list[int]``.
5555

5656
This function behaves in one of two ways, depending on type of words in *p*, and
57-
the type of words specified in *Return*:
57+
the type of words specified in *rtype*:
5858

59-
1. When the type of words in *p* and type of words specified in *Return* are
59+
1. When the type of words in *p* and type of words specified in *rtype* are
6060
not the same, this function returns a :any:`Presentation` equivalent to
6161
the input :any:`Presentation` *p* but with words a different type (for
6262
example, can be used to convert from ``str`` to ``list[int]``).
63-
2. When the type of words in *p* and type of words specified in *Return* are
63+
2. When the type of words in *p* and type of words specified in *rtype* are
6464
the same, this function just returns its argument *p*, and is included
6565
solely for the purpose of simplifying certain client code, where
6666
presentations must be converted from one type to another sometimes, but
@@ -73,7 +73,7 @@ of type ``list[int]``, then the conversion from one type to another is
7373
:math:`a_i \mapsto` ``human_readable_letter(a_i)``.
7474

7575
This function throws a :any:`LibsemigroupsError` if the type of words in *p* is
76-
not the same as that specified in *Return*, and
76+
not the same as that specified in *rtype*, and
7777
``p.throw_if_bad_alphabet_or_rules()`` throws.
7878

7979
.. seealso::
@@ -115,7 +115,7 @@ letter conversion function, specify the following values for *args*:
115115
- **f** (``Callable[[str | int], int | str]``) -- the function used to
116116
convert between the different types of letters.
117117

118-
Additionally, specify one of the following for *Return*:
118+
Additionally, specify one of the following for *rtype*:
119119

120120
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
121121
of type ``str``.
@@ -131,7 +131,7 @@ other.
131131
This function throws a :any:`LibsemigroupsError` if
132132
``p.throw_if_bad_alphabet_or_rules()`` throws, or if the function specified by
133133
*f* does not map letters of the type used in *p* to letters of the type of word
134-
specified in *Return*.
134+
specified in *rtype*.
135135

136136
.. seealso::
137137

@@ -169,7 +169,7 @@ following values for *args*:
169169
- **kb** (:any:`KnuthBendix`) -- the :any:`KnuthBendix` from which to obtain
170170
the rules.
171171

172-
Additionally, specify one of the following for *Return*:
172+
Additionally, specify one of the following for *rtype*:
173173

174174
- ``(Presentation,)`` for constructing a :any:`Presentation` over words of
175175
the same type as that in *kb*.
@@ -211,7 +211,7 @@ enumerates *kb*) prior to calling this function.
211211
>>> kb.run()
212212
>>> p2 = to(kb, rtype=(Presentation,))
213213
>>> for p in [p1, p2]:
214-
... # Returns whether any changes have been made
214+
... # rtypes whether any changes have been made
215215
... presentation.sort_each_rule(p)
216216
... presentation.sort_rules(p)
217217
True
@@ -230,7 +230,7 @@ following values for *args*:
230230
- **fp** (:any:`FroidurePin`) -- the :any:`FroidurePin` from which to obtain
231231
the rules.
232232

233-
Additionally, specify the following for *Return*:
233+
Additionally, specify the following for *rtype*:
234234

235235
- ``(Presentation, str)`` for constructing a :any:`Presentation` over words
236236
of type ``str``.
@@ -282,7 +282,7 @@ following values for *args*:
282282
- **k** (:any:`Kambites`) -- the :any:`Kambites` from which to obtain
283283
the presentation.
284284

285-
Additionally, specify one of the following for *Return*:
285+
Additionally, specify one of the following for *rtype*:
286286

287287
- ``(Presentation,)`` for constructing a :any:`Presentation` over words of
288288
the same type as that in *k*.
@@ -342,7 +342,7 @@ following values for *args*:
342342
- **tc** (:any:`ToddCoxeter`) -- the :any:`ToddCoxeter` from which to obtain
343343
the presentation.
344344

345-
Additionally, specify one of the following for *Return*:
345+
Additionally, specify one of the following for *rtype*:
346346

347347
- ``(Presentation,)`` for constructing a :any:`Presentation` over words of
348348
the same type as that in *tc*.
@@ -402,7 +402,7 @@ following values for *args*:
402402
- **c** (:any:`Congruence`) -- the :any:`Congruence` from which to obtain
403403
the presentation.
404404

405-
Additionally, specify one of the following for *Return*:
405+
Additionally, specify one of the following for *rtype*:
406406

407407
- ``(Presentation,)`` for constructing a :any:`Presentation` over words of
408408
the same type as that in *c*.
@@ -463,7 +463,7 @@ following values for *args*:
463463
- **s** (:any:`Stephen`) -- the :any:`Stephen` from which to obtain
464464
the presentation.
465465

466-
Additionally, specify one of the following for *Return*:
466+
Additionally, specify one of the following for *rtype*:
467467

468468
- ``(Presentation,)`` for constructing a :any:`Presentation` over words of
469469
the same type as that in *s*.

_sources/data-structures/to-function.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
.. currentmodule:: libsemigroups_pybind11
99

10+
.. |br| raw:: html
11+
12+
<br />
13+
1014
The ``to`` function
1115
===================
1216

@@ -26,6 +30,7 @@ A summary of the possible conversions available in ``libsemigroups_pybind11`` of
2630
:align: center
2731
:alt: A table containing the possible conversions of libsemigroups_pybind11 types.
2832

33+
|br|
2934
A tick indicates that this conversion is implemented, and a cross that it is not
3035
yet implemented.
3136

_sources/install.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ To build ``libsemigroups_pybind11`` from a release archive:
101101
102102
::
103103

104-
$ curl -L -O https://github.com/libsemigroups/libsemigroups_pybind11/releases/latest/download/libsemigroups_pybind11-1.2.0.tar.gz
105-
$ tar -xf libsemigroups_pybind11-1.2.0.tar.gz
106-
$ rm -f libsemigroups_pybind11-1.2.0.tar.gz
107-
$ cd libsemigroups_pybind11-1.2.0
104+
$ curl -L -O https://github.com/libsemigroups/libsemigroups_pybind11/releases/latest/download/libsemigroups_pybind11-1.3.0.tar.gz
105+
$ tar -xf libsemigroups_pybind11-1.3.0.tar.gz
106+
$ rm -f libsemigroups_pybind11-1.3.0.tar.gz
107+
$ cd libsemigroups_pybind11-1.3.0
108108
$ pip install .
109109

110110
Building the documentation

_sources/main-algorithms/congruence/to-cong.rst.txt

Lines changed: 50 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ This page contains documentation relating to converting
2222
Various uses
2323
------------
2424

25-
Recall that the signature for the :any:`to` function is ``to(*args, Return)``.
26-
In what follows, we explain how different values of *args* and *Return* may be
25+
Recall that the signature for the :any:`to` function is ``to(*args, rtype)``.
26+
In what follows, we explain how different values of *args* and *rtype* may be
2727
used to construct :any:`Congruence` objects. The following options are possible:
2828

2929
- :ref:`froidure-pin-to-congruence`.
30+
- :ref:`word-graph-to-congruence`.
3031

3132
.. _froidure-pin-to-congruence:
3233

@@ -37,12 +38,12 @@ To construct a :any:`Congruence` from a :any:`FroidurePin`, specify all of the
3738
following values for *args*:
3839

3940
- **knd** (:any:`congruence_kind`) -- the kind of the congruence being
40-
construed;
41+
constructed;
4142
- **fpb** (:any:`FroidurePin`) -- the :any:`FroidurePin` instance to be
4243
converted; and
4344
- **wg** (:any:`WordGraph`) -- the left or right Cayley graph of *fpb*.
4445

45-
Additionally, specify one of the following tuples for *Return*:
46+
Additionally, specify one of the following tuples for *rtype*:
4647

4748
- ``(Congruence, str)`` for constructing a :any:`Congruence` on words of
4849
type ``str``; or
@@ -87,3 +88,48 @@ This will throw a :any:`LibsemigroupsError` if *wg* is not the
8788
>>> cong.run()
8889
>>> S.size() == cong.number_of_classes()
8990
True
91+
92+
.. _word-graph-to-congruence:
93+
94+
Converting a :any:`WordGraph` to a :any:`Congruence`
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
To construct a :any:`Congruence` from a :any:`WordGraph`, specify all of the
98+
following values for *args*:
99+
100+
- **knd** (:any:`congruence_kind`) -- the kind of the congruence being
101+
constructed;
102+
- **wg** (:any:`WordGraph`) -- the word graph.
103+
104+
Additionally, specify one of the following tuples for *rtype*:
105+
106+
- ``(Congruence, str)`` for constructing a :any:`Congruence` on words of
107+
type ``str``; or
108+
- ``(Congruence, list[int])`` for constructing a :any:`Congruence` on words
109+
of type ``list[int]``.
110+
111+
This function converts the :any:`WordGraph` object *wg* into a
112+
:any:`Congruence` object. This returned :any:`Congruence` object represents the
113+
trivial congruence over the word graph *wg*.
114+
115+
.. doctest:: Python
116+
117+
>>> from libsemigroups_pybind11 import (
118+
... congruence_kind,
119+
... Congruence,
120+
... WordGraph,
121+
... to,
122+
... )
123+
124+
>>> wg = WordGraph(7, [[1, 2], [1, 3], [4, 2], [5, 3], [4, 6], [5, 3], [4, 6]])
125+
>>> cong = to(congruence_kind.twosided, wg, rtype=(Congruence, list[int]))
126+
>>> cong.add_generating_pair([0], [1])
127+
<1-sided Congruence over <semigroup presentation with 2 letters, 0 rules, and length 0> with 1 gen. pair, 1 runners>
128+
>>> cong.number_of_classes()
129+
1
130+
131+
>>> cong = to(congruence_kind.twosided, wg, rtype=(Congruence, str))
132+
>>> cong.add_generating_pair("a", "b")
133+
<1-sided Congruence over <semigroup presentation with 2 letters, 0 rules, and length 0> with 1 gen. pair, 1 runners>
134+
>>> cong.number_of_classes()
135+
1

_sources/main-algorithms/froidure-pin/to-froidure-pin.rst.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ This page contains documentation relating to converting
2222
Various uses
2323
------------
2424

25-
Recall that the signature for the :any:`to` function is ``to(*args, Return)``.
26-
In what follows, we explain how different values of *args* and *Return* may be
25+
Recall that the signature for the :any:`to` function is ``to(*args, rtype)``.
26+
In what follows, we explain how different values of *args* and *rtype* may be
2727
used to construct :any:`FroidurePin` objects. The following options are
2828
possible:
2929

@@ -44,7 +44,7 @@ following values for *args*:
4444
- **cong** (:any:`Congruence`) -- the :any:`Congruence` object being
4545
converted.
4646

47-
Additionally, specify the following for *Return*:
47+
Additionally, specify the following for *rtype*:
4848

4949
- ``(FroidurePin,)`` for constructing a :any:`FroidurePin`.
5050

@@ -88,7 +88,7 @@ values for *args*:
8888

8989
- **k** (:any:`Kambites`) -- the :any:`Kambites` object being converted.
9090

91-
Additionally, specify the following for *Return*:
91+
Additionally, specify the following for *rtype*:
9292

9393
- ``(FroidurePin,)`` for constructing a :any:`FroidurePin`.
9494

@@ -138,7 +138,7 @@ following values for *args*:
138138
- **kb** (:any:`KnuthBendix`) -- the :any:`KnuthBendix` object being
139139
converted.
140140

141-
Additionally, specify the following for *Return*:
141+
Additionally, specify the following for *rtype*:
142142

143143
- ``(FroidurePin,)`` for constructing a :any:`FroidurePin`.
144144

@@ -182,7 +182,7 @@ following values for *args*:
182182
- **tc** (:any:`ToddCoxeter`) -- the :any:`ToddCoxeter` object being
183183
converted.
184184

185-
Additionally, specify the following for *Return*:
185+
Additionally, specify the following for *rtype*:
186186

187187
- ``(FroidurePin,)`` for constructing a :any:`FroidurePin`.
188188

@@ -235,7 +235,7 @@ or
235235
- **last** (:any:`int`) -- the value of :math:`b` in the following
236236
discussion.
237237

238-
Additionally, specify the following for *Return*:
238+
Additionally, specify the following for *rtype*:
239239

240240
- ``(FroidurePin,)`` for constructing a :any:`FroidurePin`.
241241

0 commit comments

Comments
 (0)