Sample programs

The programs here are written in C++, using the CWEBx system of software documentation. Links are provided to the tangled (directly compilable) sources and the generated documentation in PDF format, so to use and inspect the programs it is not necessary to install the CWEBx system.

Combing lattice paths to obtain tilings of the Aztec diamond

This program will apply the algorithm described in the paper "A bijection proving the Aztec diamond theorem by combing lattice paths", either on a random array of bits to generate a random path family, or exhaustively on all possible such data of a given order; it also runs the reverse algorithm checking that it recovers the initial data. It can produce PostScript data depicting the path family produced, and optionally several intermediate stages, and the corresponding Aztec diamond tiling. The program is a command line program taking its arguments from the command line. Assuming the executable program is named aztec, the calling syntax is
where ORDER is the order of the Aztec diamond to consider (a nonnegative number; the path family will contain one more path than this). The final argument FILE is a base for the name of the PostScript file to be produced; the program will automatically add "" to it. If no FILE argument is given but PostScript output is requested, it will be written to the standard output. The default is to output one randomly generated path family of the given order, but this can be modified by options. The possible options are

A bijection between partitions of n and strict partitions of 2n whose diagram is black/white balanced

This is a small Python program that computes the bijections described in these MathOverflow and Math.StackExchange answers. They are between partitions of n on one hand and on the other hand strict partitions of 2n with empty 2-core, where the latter means that the diagram when coloured in a checkerboard fashion has as many black as white squares, or equivalently that the odd parts of the partition (which are even in number) occupy as many odd as even positions. This is my very first Python program, so it might contain things that are frowned upon by the Python community.

The forward direction is computed by double_strict using edge sequences, and also by to_double using the more direct approach of the StackExchange answer (the two functions should produce the same results). Similarly the reverse direction (which is actually the one described in the answers) is computed by undouble using edge sequences, and also more directly by by to_plain.

Valid HTML 4.01!