Albert


Albert is an extremely useful and efficient C program for computations in relatively free nonassociative algebras. It was written around 1990 by David Pokrass Jacobs with help of few others.

Albert version 3.0 was released at 1994 and since then, according to my understanding, there was no active Albert development. Albert version 4.0 was released at September 2008 with the sole change to be able to compile it with the modern gcc.

Albert computes over a prime field of characteristic up to 251 and is an interactive program. I have slightly modified it in the following ways:
  • allowed to compute over prime fields of large characteristics (up to 263 - 1);
  • improved interface: using GNU readline; to facilitate non-interactive processing, exposed it through a C++ library;
  • fixed few minor glitches here and there.
All the core Albert algorithms and data structures were not modified.

The library interface is rather limited and does not provide all Albert functionality, as my primary concern was to perform computations of dimensions of certain operads described in the paper The alternative operad is not Koszul. Note also that the library is not thread-safe. The following code snippet was used in computations of dimension of the alternative operad in degree 6 modulo different primes (supplied on the standard input) and may serve as an example of the Albert C++ library usage:

#include <stdlib.h>
#include <iostream>
#include "albert.h"

int main()
{
  Dalbert_node* dot_albert;
  if (albert_init (3000, (char*)"/home/pasha/prj/albert/.albert", &dot_albert, 0) != 1)
	{
	  std::cerr << "albert_init() failed" << std::endl;
	  exit (-1);
	}
  // left alternative
  if (albert_add_identity ("(xx)y-x(xy)") == 0)
	{
	  std::cerr << "albert_add_identity() failed" << std::endl;
	  exit (-1);
	}
  // right alternative
  if (albert_add_identity ("(xy)y-x(yy)") == 0)
	{
	  std::cerr << "albert_add_identity() failed" << std::endl;
	  exit (-1);
	}
  albert_set_generators (6);
  albert_set_sparse (0);

  long long p;
  while (! std::cin.eof())
	{
	  std::cin >> p >> std::ws;
	  if (albert_set_field (p, 1) != 1)
		{
		  std::cerr << "albert_set_field() failed" << std::endl;
		  exit (-1);
		}
	  if (albert_build (0) != 1)
		{
		  std::cerr << "albert_build() failed" << std::endl;
		}
	}

  albert_free (dot_albert);
  exit (0);
}

Alternatively, the same effect may be achieved by feeding commands to the albert binary from the standard input:
i (xx)y-x(xy)
i (xy)y-x(yy)
g abcdef
f <1st prime>
build
f <2nd prime>
build
...
f <last prime>
build
quit
The following files are taken from the above-mentioned site and provided for archival and reference purposes:
  • 3.0: Albert 3.0, minimally modified by me to compile with the modern gcc (before Albert 4.0 was released)
  • 4.0
The following are the modified Albert versions, dubbed 4.0M:
  • 4.0M3, released September 9, 2010: using GNU readline; fixed some memory leaks.
  • 4.0M2, released August 2, 2010: fixed a bug preventing immediate printing of the results after completing each degree.
  • 4.0M1, released March 22, 2010: fixed a bug in displaying degrees of generators; do not set upper limit for multiplication table.
  • 4.0M, released March 10, 2009.
Here is the user guide for version 3.0, largely valid for 4.0M versions: To build albert binary, type make. To build albert static library, type make libalbert.a. This should work on any unix system with gcc. Here are MacOSX binaries of the version 4.0M1, compiled on Darwin 9.8.0 with gcc 4.0.1:
Things I am planning to do:
  • Possibility to use optionally Givaro library instead of built-in modular arithmetics.
  • Support for characteristic zero.
  • Play with various g++ optimization flags.
  • Eliminate all memory leaks (valgrind).

Should you have comments or questions about this modified version of Albert, do not hesitate to contact me.


created Mar 10 2009
last modified Wed Jul 6 21:54:59 EEST 2011