Hypercomplex Algebra Toolkit (HAT) Code
A Matlab code toolkit for arbitrary hypercomplex algebras
Brought to you by:
sangwine
---------------------------------- Hypercomplex Algebra Toolkit (HAT) ---------------------------------- - classes for user-defined - hypercomplex algebras in MATLAB. Copyright © 2025 Stephen J. Sangwine and Eckhard Hitzer https://github.com/sangwine/Hypercomplex-Algebra-Toolkit Licensed under the GNU General Public License version 3. See the file : LICENSE for further details. This toolkit, as its name suggests, is designed to provide hypercomplex algebra computations (in MATLAB), in a general manner, such that a skilled user can use it to create a computational tool for an arbitrary algebra, by defining the multiplication table of the algebra in terms of structure constants (in some algebras this means no more than signs of [-1, 0, +1] but in more general cases these constants can be linear combinations of basis elements scaled by signed numeric values). Several example algebras are implemented to provide a model from which support for further algebras may be added. The toolkit is based on MATLAB's object-oriented features, so that many MATLAB operations, including the colon notation, array indexing, etc., are inherited from MATLAB (i.e. they do not need to be implemented within the toolkit). This reduced the amount of custom code which had to be written. Furthermore, two root classes provide general hypercomplex number operations, including multiplication, addition, equality comparison, and more, so that an algebra-specific class does not have to implement these operations (unless the default implementation requires overloading for some reason, to provide an algebra-specific algorithm). Previous toolboxes provided inspiration for this work, including the QTFM, LQSTFM, and Clifford toolboxes, all of which are available on Sourceforge. There is a major difference in implementation, which is that the earlier toolboxes implement a hypercomplex number as a structure with ordinary MATLAB arrays as coefficients. In the HAT toolkit, each hypercomplex number is stored as an object, and arrays of hypercomplex numbers are represented as arrays of objects (leaving MATLAB to handle indexing). While this makes for more compact code, it may not result in high computational efficiency. This remains to be investigated, as we're not concerned right now with efficiency or code optimisation. The toolkit has been designed to support symbolic computation as well as numeric, but at present this is limited to some hooks that provide for this in the future. As with earlier toolboxes, the symbolic features require the MATLAB Symbolic Toolbox. This is not required if only numeric computations are performed. Installation ============ At present this toolkit is not packaged as a MATLAB toolbox, although we may do this in future. Currently the toolkit consists of a collection of files in a flat directory/folder called HAT. Just put this directory/folder somewhere (we suggest *not* with MATLAB's toolboxes), and set your MATLAB path to include it (or run with the current folder set to .../HAT). The simplest way to install the toolkit is to use git clone to make a copy of the Sourceforge repository, and then subsequently use git pull to update the local copy. Details on how to set this up are provided on Sourceforge, and within MATLAB (which has support for git in recent versions). An alternative is to download a snapshot from Sourceforge, which will make a ZIP file and download it to your local machine. Updating then requires a new snapshot and replacement of the previous code by the new (slightly more complex than using git pull). There is no version number other than the git versioning. Documentation ============= To follow. At present the only documentation is the source code and this README, but there are test code files which provide examples of what the toolkit can do with the example algebras currently implemented. To run it, run the script Test_all.m, or the individual files *_Test.m for each algebra. Steve Sangwine and Eckhard Hitzer November 2025