  Existing computer algebra packages do not fully support quantum mechanics
calculations in Dirac's notation. I present the foundation for building such
support: a mathematical system for the symbolic manipulation of expressions
used in the invariant formalism of quantum mechanics. I first describe the
essential mathematical features of the Hilbert-space invariant formalism. This
is followed by a formal characterisation of all possible algebraic expressions
in this formalism. This characterisation is provided in the form of a set of
terms. Rewrite rules over this set of terms are then developed that correspond
to allowed manipulations of the algebraic expressions. This approach is
contrasted with current attempts to build invariant quantum mechanics
calculations into computer algebra systems.
