  We derive explicit closed-form matrix representations of Hamiltonians drawn
from tensored algebras, such as quantum spin Hamiltonians. These formulas
enable us to soft-code generic Hamiltonian systems and to systematize the input
data for uniformly structured as well as for un-structured Hamiltonians. The
result is an optimal computer code that can be used as a black box that takes
in certain input files and returns spectral information about the Hamiltonian.
The code is tested on Kitaev's toric code deployed on triangulated surfaces of
genus 0 and 1. The input file corresponding to the minimal triangulation of
genus 2 is also supplied.
