Skip to content

Instantly share code, notes, and snippets.


James Mitchell james-d-mitchell

View GitHub Profile
james-d-mitchell /
Last active Aug 9, 2021
An implementation of the Todd-Coxeter Algorithm for Semigroups and Monoids in python3
#!/usr/bin/env python3
class ToddCoxeter:
def __init__(self):
self.nodes = [0]
self.edges = None
self.kappa = []
self.next_node = 1
self.R = []
james-d-mitchell /
Created Oct 18, 2019
Installation script for libsemigroups
set -e
git clone
cd libsemigroups/extern
curl -L -O
tar -xzf && rm -f
curl -L -O
tar -xzf && rm -f && mv HPCombi && cd ..
View homogeneous-rees-mat.g
# In GAP 4.9.1 or higher, with the Semigroups package 3.0.16 or higher
# A function for finding all the subsemigroups of a semigroup
# (this will only work for extremely small semigroups, due it being a quick implementation, and due to the inherent complexity)
Subsemigroups := function(S)
local foo, M, N;
foo := function(M)
return Unique(Concatenation(List(M, MaximalSubsemigroups)));
View gaplint.vim
"File: gaplint.vim
"Description: Syntax checking plugin for syntastic.vim
"License: This program is free software. It comes without any warranty,
" to the extent permitted by applicable law. You can redistribute
" it and/or modify it under the terms of the Do What The Fuck You
" Want To Public License, Version 2, as published by Sam Hocevar.
" See for more details.
james-d-mitchell / gist:a5912d15aedf8eddc0aadb52989bbf53
Created May 8, 2017
GAP code for computing the number of monogenic transformation semigroups of a given degree
View gist:a5912d15aedf8eddc0aadb52989bbf53
# Sieve of Eratosthenes based on code from
MyPrimes := function(n)
local A, limit, j, i;
A := BlistList([1 .. n], [2 .. n]);
limit := Int(Sqrt(Float(n)));
for i in [1 .. limit] do
if A[i] then