description:
algebra(sp, ket, sp)
a minimalistic implementation of algebra over kets
examples:
algebra(|a>, |+>, |b>)
|a> + |b>
algebra(3|a>, |*>, 5|b>)
15|a*b>
algebra(|a> + |b>, |^>, |3>)
|a*a*a> + 3|a*a*b> + 3|a*b*b> + |b*b*b>
see also:
non-Abelian-algebra, arithmetic, display-algebra