  Given a linear category over a finite field such that the moduli space of its
objects is a smooth Artin stack (and some additional conditions) we give
formulas for an exponential sum over the set of absolutely indecomposable
objects and a stacky sum over the set of all objects of the category,
respectively, in terms of the geometry of the cotangent bundle on the moduli
stack. The first formula was inspired by the work of Hausel, Letellier, and
Rodriguez-Villegas. It provides a new approach for counting absolutely
indecomposable quiver representations, vector bundles with parabolic structure
on a projective curve, and irreducible etale local systems (via a result of
Deligne). Our second formula resembles formulas appearing in the theory of
Donaldson-Thomas invariants.
