My Science and Math Stuff


Here are some Mathematica notebooks and other such documents that should be useful in various mathematical and scientific calculations.

Mathematica is a computer-algebra software package that is produced by Wolfram Research, but the algorithms I've implemented in it can be ported to other computer-algebra software and programming languages if desired.

All of this software and all of the web content here that is my work is under the MIT License. I make the qualification "that is my work" because some of the pages here have inlined images from other sources, and they may be under difference licenses.

-- Loren Petrich, lpetrich at various online venues

Semisimple Lie Algebras

These mathematical structures are important in physics for expressing the internal symmetries of space-time and elementary particles and the like. I wrote this package because it was hard to find anything online certain things that I was looking for. More specifically, decomposing product representations into irreducible ones and calculating branching rules: what representations of subalgebras does a representation of an algebra produce? It has applications like getting Standard-Model particle multiplets from Grand-Unified-Theory particle multiplets.

Contains code in Mathematica, Python, and C++; all three versions are feature-parallel except for Mathematica's graphics code. (zip archive)

Rotations, Polyhedra, Point, and Space Groups

A collection of Mathematica notebooks for doing 2D, 3D, and 4D rotations and reflections, 2D and 3D point and space groups, graphical demos of several of these groups, semiregular polyhedra with lookalike faces (Catalan solids and related axial ones) and lookalike vertices (Archimedean solids and related axial ones), and similar stuff.

Mathematica code:

Computational Geometry

Convex hull, Delaunay triangulation/tessellation, Voronoi diagram. This archive contains code that implements convex hulls and Delaunay triangulations using several algorithms: quickhull, incremental, gift wrapping, divide and conquer, and more. These are implemented for both N-D spaces and N-D spheres. Voronoi diagrams only implemented for the 2D plane and 3D sphere.

Mathematica and Python code:

The Cayley-Dickson construction

Abstract-algebra code for making complex numbers, quaternions, octonions, sedenions, and higher 2^n-ions out of real numbers. I've included functions to verify various properties, so you can see properties drop as one goes higher and higher.

Inspired by John Baez's The Octonions

Mathematica code:

Distance-Matrix Cluster Analysis and Phylogeny Software

Code that uses distance matrices to do cluster analysis and to find phylogenies. Though Mathematica has some nice clustering algorithms, it has no support for using distance matrices directly, as far as I can tell. Although distance matrices would not make any sense for some algorithms, like K-means, they can nevertheless be used in K-medoids.

I have also implemented code for finding phylogenies from distance matrices. This is useful in evolutionary biology.

Mathematica code:

To my home page