  Let X be a Calabi-Yau 3-fold over C. The Donaldson-Thomas invariants of X are
integers DT^a(t) which count stable sheaves with Chern character a on X, with
respect to a Gieseker stability condition t. They are defined only for Chern
characters a for which there are no strictly semistable sheaves on X. They have
the good property that they are unchanged under deformations of X. Their
behaviour under change of stability condition t was not understood until now.
  This book defines and studies a generalization of Donaldson-Thomas
invariants. Our new invariants \bar{DT}^a(t) are rational numbers, defined for
all Chern characters a, and are equal to DT^a(t) if there are no strictly
semistable sheaves in class a. They are deformation-invariant, and have a known
transformation law under change of stability condition.
  To prove all this we study the local structure of the moduli stack M of
coherent sheaves on X. We show that an atlas for M may be written locally as
Crit(f) for f a holomorphic function on a complex manifold, and use this to
deduce identities on the Behrend function of M.
  We compute our invariants in examples, and make a conjecture about their
integrality properties. We extend the theory to abelian categories of
representations of a quiver with relations coming from a superpotential, and
connect our ideas with Szendroi's "noncommutative Donaldson-Thomas invariants"
and work by Reineke and others.
  This book is surveyed in the paper arXiv:0910.0105.
