Skip to content

Instantly share code, notes, and snippets.

View james-d-mitchell's full-sized avatar

James Mitchell james-d-mitchell

View GitHub Profile
@james-d-mitchell
james-d-mitchell / vim
Created December 26, 2023 15:45
gaplint neovim ale setup file
"============================================================================
"File: gaplint.vim
"Description: Syntax checking plugin for ale.vim
"Maintainer: jenkyfunds@pm.me
"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 http://sam.zoy.org/wtfpl/COPYING for more details.
"
@james-d-mitchell
james-d-mitchell / jurina.ipynb
Created November 16, 2022 11:00
jurina.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@james-d-mitchell
james-d-mitchell / tropical-one-relation-monoids.ipynb
Created October 1, 2022 13:36
TROPICAL ONE-RELATION MONOIDS
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@james-d-mitchell
james-d-mitchell / todd_coxeter.py
Last active January 27, 2024 03:21
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
james-d-mitchell / install-libsemigroups.sh
Created October 18, 2019 10:07
Installation script for libsemigroups
#!/bin/bash
set -e
git clone https://github.com/libsemigroups/libsemigroups
cd libsemigroups/extern
curl -L -O https://github.com/fmtlib/fmt/releases/download/5.3.0/fmt-5.3.0.zip
tar -xzf fmt-5.3.0.zip && rm -f fmt-5.3.0.zip
curl -L -O https://github.com/hivert/HPCombi/archive/v0.0.3.zip
tar -xzf v0.0.3.zip && rm -f v0.0.3.zip && mv v0.0.3.zip HPCombi && cd ..
# In GAP 4.9.1 or higher, with the Semigroups package 3.0.16 or higher
LoadPackage("semigroups");
# 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)));
"============================================================================
"File: gaplint.vim
"Description: Syntax checking plugin for syntastic.vim
"Maintainer: jdm3@st-andrews.ac.uk
"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 http://sam.zoy.org/wtfpl/COPYING for more details.
"
@james-d-mitchell
james-d-mitchell / gist:a5912d15aedf8eddc0aadb52989bbf53
Created May 8, 2017 16:24
GAP code for computing the number of monogenic transformation semigroups of a given degree
# Sieve of Eratosthenes based on code from
# https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes#Pseudocode
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