On the rapid computation of matrix elements