Get the diagonal of the array.
See also numpy.ndarray.diagonal().
numpy.ndarray.diagonal()
treams.SMatrix.cumsum
treams.SMatrix.flatten