The braid programme was originally written in support of work done with Roger Fenn to calculate matrix representations of virtual braid groups. It has evolved to include tasks that relate to virtual knots, long knots, welded knots and knotoids but that do not involve a braid representation. However, in the absence of anything better, the name 'braid' has been retained for the programme.

The tools provided by the programme support the following:

- The Alexander and Burau polynomial invariants of a classical or virtual knot or link
- The Alexander-like polynomial invariant of a classical doodle [19]
- Various quaternionic polynomial invariants of a classical or virtual knot or link
- Various matrix-switch polynomial invariants of a classical or virtual knot or link
- Various Weyl algebra switch polynomial invariants of a classical or virtual knot or link
- Various finite-switch polynomial invariants (also known as rack polynomials) of a classical or virtual knot or link
- The fixed-point invariant of the braid representation of a knot or doodle
- Various commutative automorphism switch invariants of a classical or virtual knot or link
- Vogel's algorithm for determining a braid word from a classical or virtual knot or link diagram
- The HOMFLY polynomial for the closure of a classical braid
- The Kauffman bracket polynomial of a classical or virtual knot, link, knotoid or multi-knotoid
- The Jones polynomial of a classical or virtual knot, link, knotoid or multi-knotoid
- Turaev's extended bracket polynomial of a clasical or virtual knotoid or multi-knotoid
- The arrow polynomial of a classical or virtual knot, link, long knot, long virtual knot, knotoid or multi-knotoid
- Manturov's parity bracket polynomial of a classical or virtual knot or knotoid
- Kaestner and Kauffman's parity arrow polynomial for classical and virtual knots or knotoids
- Kauffman's Affine Index Polynomial for virtual knots or knotoids
- Sawollek's normalized Conway polynomial for a braid word
- The Dynnikov test for the trivial braid
- The Dowker(-Thistlethwaite) code for the braid
- The Gauss code, or the oriented or unoriented left preferred Gauss data for a labelled peer code, labelled immersion code or a braid word [14]
- The labelled immersion code for a braid word
- The labelled peer code for a braid word or a labelled immersion code
- The labelled peer code for the Gauss code of a classical link
- The labelled peer code for the r-parallel cable satellite of a knot's peer code

The source code is available, together with user documentation and some additional developers notes here: braid-23.0-src.tar.

When you unzip and extract the files from the source image archive braid-23.0-src.tar you will create a subdirectory called braid-23.0 containing subdirectories doc and prog and a README file with further details of the source distribution. The prog directory contains the source code in subdirectories called src and include, a sample input file and the programme help, and also a Makefile . The doc directory contains the user documentation in HTML format and some software developer's notes.

**User documentation**

Here is a link to the latest on-line version of the user documentation.

Some results from the early version of the programme are presented on the braid results page.

The braid programme is able to calculate quaternionic polynomial invariants as described in [1]. The source code used to search for the quaternionic switches used for these invariants is presented on the quaternionic switches page.

The first released version was 6.1.b1, supporting Burau and quaternion
matrix representation, Alexander polynomial, 0^{th} and 1^{st} ideal polynomials for
quaternionic representations, Dynnikov test and Dowker code calculation.

Version 7.0 (not released via the web) introduced calculation of Sawollek's normalized Conway polynomial.

Version 8.0 added the Vogel algorithm for evaluating braid words from Gauss codes, the ability to include programme options in input files, the writing of an output file in "input" format, and support of the alphabetical notation for classical braids.

Version 9.0 added the Gauss code and labelled immersion code calculations. It added the calculation of
Delta_{i}^{C} and Delta_{i}^{R} as further options to the quaternionic representations. Version 9 changed the meaning of
two programme options (see below), and aligned the terminology used for the Burau and Alexander representations to that in [1]. This meant that what had previously been referred to as the Burau representation was henceforth referred to as the Alexander representation and vice versa. The term Alexander polynomial was retained for Delta_1 of the Burau representation according to common practise.

The option changes introduced in version 9 are as follows:

option old meaning new meaning new option for old meaning c dowker code calculate Delta_1^C d i input as output imersion code I

Version 9.0 also extended the Vogel algorithm to handle labelled immersion code descriptions of virtual knots. This corrected an error that was found in the version 8.0 implementation of the Vogel algorithm.

Version 10 was a major update to the structure of the code, making it much more object oriented. This was partly motivated by the requirement to add support for matrix switch invariants but was also long overdue from a coding standpoint. Version 10 introduced use of the fundamental equation ([5]) to calculate C and D from A and B when evaluating switch matrices. This version also included support of a simple web interface to the programme.

Version 11 added support for Weyl algebra switches, calaulation mod p for all switches, control over the use of the variable t, and changed the default behaviour for calculating Delta_{1}. Previous versions only calculated Delta_{1} when Delta_{0} was zero, now Delta_{1} is always calculated, unless the user specifies otherwise. Version 11 was also supplied with a much more feature rich web interface that allowed access to most of the common command line options.

Version 11.1 tidied up the internal structure of the code and made several behind-the-scenes changes, but did not alter the functionality from Version 11.0.

Version 11.2 added an option for the programme to report explicitly whether polynomial invariant switch elements satisfy A=D and B=C. It also corrected an error in the HTML used for the web interface that caused a problem with some browsers.

Version 12.0 introduced support for long knots, termination of further calculation of E_{1} generators if a unit is encountered, and added various improvements to the web interface for the programme. It also corrected an error in the calculation of Delta_{1} for non-commutative switches when Delta_{0} was non-zero (see the bug tracker below).

In version 12.0, one of the source code header files was renamed from Quaternion.h to quaternion-scalar.h. This was done to avoid a conflict with another header file quaternion.h experienced in some operating systems, such as Windows and MAC OS X.

In version 12.0, the matrix representation produced from a labelled immersion code was changed so that the switch action at a real crossing was more natural, whilst not affecting the results.

In version 12.0, the option for mapping quaternionic matrix representations into M_{n}(R[t,t^{-1}]) was removed, since it proved to be of no theoretical value.

Version 12.1 was a maintenance release, see the bug tracker below.

Version 12.2 added automatic handling of the concatenation product for long knots via the `#` syntax in an input file.

Version 12.3 was a maintenance release: it corrected an error in processing an unusual input polynomial case (see the bug tracker below) and added some additional error checking on input strings.

Version 13.0 added support for the HOMFLY polynomial and introduced the Qbraid graphical front end to the programme. It also changed the CLI syntax if the programme is run from the command line.

Version 14.0 added support for the fixed-point invariant and finite-switch polynomial invariants.

Version 15.0 added the bracket polynomial for knotoids and extended the dowker code tool to accommodate labelled immersion codes as input.

Version 16.0 added support of labelled peer codes and the silent option for batch processing. The Vogel algorithm was updated to support labelled peer codes and had support for Gauss codes and labelled immersion codes removed. This reflected the cleaner structure of the January 2011 update to the Vogel algorithm.

Version 16.0 removed support for the (erroneous) Nicholson polynomial.

Version 16.1 and 16.2 (September 2011 and November 2012 respectively) added the flip-braid option and "flip" braid qualifier that renumbers the strands of a braid in the opposite order (equivalent to turning over a braid in R^3) before calculating fixed point invariants.

Version 17.0 (January 2013)added the Kauffman bracket and Jones Polynomial to the function bracket_polynomial, it also added support for Gauss codes when calculating these two polynomials, which entailed creating a modified form of the generic code data structure for Gauss codes to allow for the fact that Gauss codes describe only classical crossings and not virtual crossings. Version 17.0 also introduced support for the affine index polynomial invariant for virtual knots. A tool for converting labelled peer codes or immersion codes was added to allow testing of the affine index polynomial.

Version 18.0 (January 2015) introduced the fixed point invariant for virtual doodles and aligned the code for fixed-point invariants from [11] to [12].

Version 18.1: Added invert-braid, line-reflect-braid and plane-reflect-braid options and {invert, line-reflect, plane-reflect} braid qualifiers (March 2015)

Version 19.0 (March 2017) added satellite knot calculation for r-parallel cables of knots.

Version 19.1 (July 2017) modified write_gauss_code and read_gauss_code to handle doodle Gauss codes.

Version 20.0 (February 2018) added support for commutative automorphism switches.

Version 20.1 (April 2018) added Kamada double covering calculation for braids.

Version 21.0 (November 2019) added support for links and multi-knotoids in bracket_polynomial, added gauss code to peer code conversion for classical links.

Version 21.1 (April 2020) modified the bracket polynomial so that the kauffman-bracket and jones-polynomial options evaluated the normalized bracket polynomial and Jones polynomial for knotoids and multi-knotoids as well as knots and links. The knotoid-bracket option calculates Turaev's extended bracket polynomial for knotoids and multi-knotoids as before. Added TeX output format option for bracket polynomials

Version 22.0 (May 2020) added support for the arrow polynomial for classical and virtual knots, links, knotoids and multi-knotoids, added no-expand-bracket and no-normalize-bracket options, added support for "An Alexander type invariant for doodles", added mapped polynomials for improved arrow polynomial presentation and to prepare for the parity bracket polynomial, added support for knotoids to affine_index_polynomial, added support for knotoids to the Gauss code task, added the lpgd and ulpgd options to the Gauss code task, added the parity bracket polynomial and the parity arrow polynomial for classical or virtual knots or knotoids.

Version 23.0 (November 2021)) Updated the syntax for knot-type knotoids and long knots to be "K:" and "L:", extended the ability to convert Gauss codes of virtual knots and links
to labelled peer codes based on Jeremy Green's algorithm for drawing virtual knots from Gauss codes, added support for reading Gauss codes of the form
sequence{(O|U)

- The braid word algebra of assignment statements and braid statements did not work in version 6.1.b1, since they were confused with switch definitions in the code(!). This was corrected in version 8.0
- In version 8.0 the degrees of variables in quotient polynomials with two or more variables was calculated incorrectly. This bug caused the programme to hang in an infinite loop. It was corrected in version 9.0
- In version 8.0 the function that sets s=1 when evaluating Alexander polynomials was called without first checking that there were indeed variables present in the polynomial. This bug caused a segmentation fault, it was corrected in version 9.0.
- In version 8.0 the implementation of the Vogel algorithm for virtual braids was found to have a theoretical bug that invalidated the braid words produced in some cases. This was corrected in version 9.0.
- Version 10 added support for matrix switch representations but the R_module representation for immersion codes set an internal variable incorrectly that made the Delta_1 calculation cause a segmentation fault. This was corrected in version 11.1.
- In version 11.0 the bigint right-shift operator left redundant leading zeros in the bigint representation that caused the bigint division operator to generate a floating point exception. This was corrected in version 11.1.
- In version 11.0 the rational<bigint> scalar variant absolute value member function returned the value, not the absolute value(!). This was corrected in version 11.1.
- In version 11.0 the quaternion class abs() function returned it's argument unchanged so that the polynomial output operator worked properly, which meant that the abs function was mathematically incorrect (it should return the quaternion's modulus). Therefore in 11.1 the abs() function was removed for the quaternion class, since the modulus function is not required, and the polynomial output operator rewritten.
- In version 11.0 the inverse of the quantum Weyl algebra switch matrix was set incorrectly from a formula, rather than being calculated directly, therefore giving incorrect values for the polynomial invariants calculated with the switch. This was corrected in version 11.1.
- In version 11.0 the HTML used to generate part of the web interface was incorrect: although some browsers tollerated the error, later versions of Firefox do not. This was corrected in version 11.2.
- In version 11.0 the default behaviour was changed so that Delta
_{1}was calculated even when Delta_{0}was non-zero. However, in the non-commutative case Delta_{0}was not included as a generator of Delta_{1}which meant that when Delta_{0}was non-zero the value calculated for Delta_{1}was not always correct. This error was corrected in version 12.0. - Version 12.1 corrected a memory leak in the absolute function for scalars, abs(const scalar& c). It also corrected a memory leak in the function used to calculate R-module representations from labelled immersion codes.
- Reference [6] contains a typographic error in the description of a Weyl algebra over a truncated poynomial ring, interchanging the matrices u and v. The error was included in version 11.0 and corrected in version 12.1.
- Version 12.1 also corrected an error for the cases n >= 3 in the setting up of the matrix v for the Weyl algebra over the truncated polynomial ring .
- Version 12.1 corrected an error that displayed polynomial coefficients equal to -1 mod p incorrectly for the case p > 2.
- Version 12.2 corrected an error in the renumbering of a labelled immersion code for long knots when the point at infinity is moved by an even number of semi-arcs.
- Version 12.3 corrected an error in the polynomial input routine when the entire polynomial was enclosed in parentheses.
- Version 18.0 corrected the ambiguity in the code described in [12].

[1] A. Bartholomew and R. Fenn. Quaternionic Invariants of Virtual Knots and Links (J Knot Theory and Its Ramifications Vol. 17 No. 2 (2008) 231-251).

[2] A. Bartholomew. An Application of Vogel's Algorithm to Classical Links and Virtual Knots

[3] J. Sawollek. On Alexander-Conway Polynomials For Virtual Knots and Links

[4] P. Dehornoy. Braids and Self-Distributivity. Progress in Mathematics no 192 Birkha user,(2000)

[5] P. Budden and R. Fenn. The equation [B,(A-1)(A,B)]=0 and Virtual Knots and Links Fund. Math 184 (2004).19 29

[6] R. Fenn and V. Turaev. Weyl Algebras and Knots. J. Geometry and Physics 57 (2007) 1313-1324

[7] A. Bartholomew, R. Fenn, N. Kamada, S. Kamada, New Invariants of Long Virtual Knots, Kobe J. Math 27 (2010) 21-33

[8] L. H. Kauffman. Introduction to Virtual Knot Theory, arXiv:1101.0665v1

[9] V. Turaev. Knotoids, arXiv:1002.4133v4

[10] L. H. Kauffman. An Affine Index Polynomial Invariant of Virtual Knots, arXiv:1211.1601v1

[11] A. Bartholomew and R. Fenn. Biquandles and Welded Knot Invariants of Small Size (arXiv:1001.5127v1).

[12] A. Bartholomew and R. Fenn. Erratum: Biquandles of Small Size and some Invariants of Virtual and Welded Knots (J Knot Theory and Its Ramifications Vol. 26 No. 8 (2017)).

[13] A. Bartholomew, R. Fenn, N. Kamada, S. Kamada, Colorings and Doubled colorings of Virtual Doodles (arXiv:1809:04205).

[14] A. Bartholomew, R. Fenn, N. Kamada, S. Kamada, On Gauss codes of virtual doodles (Journal of Knot Theory and Its Ramifications Vol. 27, No. 11, 1843013 (2018), arXiv:1806.05885 ).

[15] H. A. Dye, L. H. Kauffman, Virtual Crossing Number and the Arrow Polynomial arXiv:0810.3858

[16] N. Gugumcu, L, H. Kauffman, New invariants of knotoids, European Journal of Combinatorics 65 (2017) 186–229

[17] L. H. Kauffman, An Extended Bracket Polynomial for Virtual Knots and Links, arXiv:0712.2546

[18] A. Kaestner, L, H, Kauffman, Parity, Skein Polynomials and Categorification, arXiv:1110.4911v1

[19] B. Cisneros, M. Flores, J. Juyumaya, C.Roque-Márquez, An Alexander type invariant for doodles, arXiv:2005.06290v1

[20] V. O. Manturov. Parity in knot theory. (Russian) Mat. Sb. 201 (2010), no. 5, 65–110; translation in Sb. Math. 201 (2010), no. 5-6, 693733.

[21] A. Kaestner, L. H. Kauffman, Parity, Skein Polynomials and Categorification, arXiv:1110.4911