Behrend's trace formula

Behrend's trace formula

In algebraic geometry, Behrend's trace formula is a generalization of the Grothendieck–Lefschetz trace formula to a smooth algebraic stack over a finite field, conjectured in 1993 [1] and proven in 2003 [2] by Kai Behrend. Unlike the classical one, the formula counts points in the "stacky way"; it takes into account the presence of nontrivial automorphisms.
The desire for the formula comes from the fact that it applies to the moduli stack of principal bundles on a curve over a finite field (in some instances indirectly, via the Harder–Narasimhan stratification, as the moduli stack is not of finite type.[3][4]) See the moduli stack of principal bundles and references therein for the precise formulation in this case.
Deligne found an example[5] that shows the formula may be interpreted as a sort of the Selberg trace formula.
Formulation
Here, it is crucial that the cohomology of a stack is with respect to the smooth topology (not etale).
When X is a variety, the smooth cohomology is the same as etale one and, via the Poincaré duality, this is equivalent to Grothendieck's trace formula. (But the proof of Behrend's trace formula relies on Grothendieck's formula, so this does not subsume Grothendieck's.)
Simple example
Note that