Code

Some of my research has involved writing (and executing) computer code provided here.

Computing excluded minors for classes of matroids representable over partial fields

The following SageMath code was used in this paper (joint with Rudi Pendavingh). Some of this code is not written by me; in particular, thanks to Rudi Pendavingh for the Tutte Group code, and the DY() routine in the Delta-Y tools code is from the technical report "Computer-verification of the structure of some classes of fragile matroids". An overview of some of the functionality of the code:

  • Matroid tools: A MatroidIsomorphismClass class, a (potentially) faster version of get_nonisomorphic_matroids() (depending on the matroids under consideration), and routines to load Mayhew and Royle's catalog and look up the "catalog ID" for a matroid on at most 9 elements.
  • Delta-Y tools: ΔY/YΔ exchanges on triangles/triads (both for LinearMatroids and abstract Matroids), or the generalised version (a.k.a. segment-cosegment exchange), and find ΔY equivalence classes (optionally, dual-closed).
  • Circuit-hyperplane tools: get circuit-hyperplanes or free bases, relax a circuit-hyperplane, tighten a free basis.
  • Representation tools: check if a given matrix representation for a matroid is valid (or obtain a certificate that it is not), find all subdeterminants of a matrix.
  • Excluded-minor generation: generate matroids representable over a partial field up to a certain size, find all excluded minors up to a certain size, along with many options for optimisation (orderly algorithms, splicing, linear homomorphisms, etc. – more details are given in the paper). Requires Matroid tools.
  • Interesting matroids: definitions of some matroids of interest not found in sage.named_matroids. In particular, known excluded minors for dyadic, 2-regular, K2-representable, P4-representable, and golden-mean matroids appear here.
    Update October 2026: the matroids here have been introduced into SageMath (in matroids.catalog), since version 10.2. The version provided in the above link is a small update from the previous version (which is, essentially, currently in SageMath 10.8), with the following changes:
    • There was an error in the representation for UP14 (and the documentation stated its UPF is W, when it should be G).
    • We rename LP8, FF10, and FR12 to TP8pp, N1pp, and N2pp respectively (as these matroids can be obtained by relaxing the two disjoint circuit-hyperplanes of TP8, N1, and N2 respectively). Similarly, we remove some out-of-date references to SQ14 due to earlier similar changes where SQ14 was renamed to N3pp;
    • A comment that "N3pp is not P4-representable" is corrected; in fact, its universal partial field is P4; and
    • The 15-element matroids NA15 and NB15 are added; these matroids are excluded minors for P4-representable matroids with universal partial field PT, they can be obtained by extending N1pp by 5 elements and N2pp by 3 elements (respectively), and they belong to Delta-wye/duality equivalence classes of size 28 and 14 (respectively). Also renamed FA15 to NC15 (this matroid also is an excluded minor for P4-representability with universal partial field PT, can be obtained by a single-element extension of N3pp, and belongs to a Delta-wye/duality equivalence classes of size 6.
    • The 16-element matroid N4pp (a double-relaxation of N4, an excluded minor for dyadic matroids) is added; this matroid is an excluded minor for K2-representable matroids with universal partial field P4.
    • The 16-element matroid QP16 is added; this matroid is a non-self-dual excluded-minor for K2-representable matroids, having disjoint-circuit hyperplanes, with universal partial field W.
  • Tutte group: calculate the universal partial field of a matroid.

The excluded minors for GF(5)-representable matroids on ten elements

The above SageMath code was also used for this paper (see also the associated blog post). Here we additionally provide: