Ask Your Question

Revision history [back]

The best thing to do is to use the source. The group algebra of a group is implemented nicely in SAGE_ROOT/devel/sage/sage/categories/examples/, in a way which works well with inheritance and the category structure in Sage. See also the patches at, for a very similar implementation, but one which also implements coercion.

This implementation doesn't inherit from a generic algebra structure, but instead from CombinatorialFreeModule (an implementation of free modules which is well suited to incorporating algebraic structures), and then sets the category appropriately, which helps to automatically implement some structure.

The patches at (merged into prerelease versions of Sage 4.7.1) does something similar to implement the Steenrod algebra and its sub-Hopf algebras.