Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

r""" 

Implementing a new parent: a (draft of) tutorial 

 

 

The easiest approach for implementing a new parent is to start from a 

close example in sage.categories.examples. Here, we will get through 

the process of implementing a new finite semigroup, taking as starting 

point the provided example:: 

 

sage: S = FiniteSemigroups().example() 

sage: S 

An example of a finite semigroup: the left regular band generated by ('a', 'b', 'c', 'd') 

 

You may lookup the implementation of this example with:: 

 

sage: S?? # not tested 

 

Or by browsing the source code of 

:class:`sage.categories.examples.finite_semigroups.LeftRegularBand`. 

 

Copy-paste this code into, say, a cell of the notebook, and replace 

every occurrence of ``FiniteSemigroups().example(...)`` in the 

documentation by ``LeftRegularBand``. This will be equivalent to:: 

 

sage: from sage.categories.examples.finite_semigroups import LeftRegularBand 

 

Now, try:: 

 

sage: S = LeftRegularBand(); S 

An example of a finite semigroup: the left regular band generated by ('a', 'b', 'c', 'd') 

 

and play around with the examples in the documentation of ``S`` and of 

:class:`FiniteSemigroups`. 

 

Rename the class to ``ShiftSemigroup``, and modify the product to 

implement the semigroup generated by the given alphabet such that `au 

= u` for any `u` of length `3`. 

 

Use ``TestSuite`` to test the newly implemented semigroup; draw its 

Cayley graph. 

 

Add another option to the constructor to generalize the construction 

to any u of length `k`. 

 

Lookup the Sloane for the sequence of the sizes of those semigroups. 

 

 

Now implement the commutative monoid of subsets of `\{1,\dots,n\}` 

endowed with union as product. What is its category? What are the 

extra functionalities available there? Implement iteration and 

cardinality. 

 

TODO: the tutorial should explain there how to reuse the enumerated 

set of subsets, and endow it with more structure. 

 

"""