For a quiver with potential, we can associate a vanishing cycle to each representation
space. If there is a nice torus action on the potential, the vanishing cycles can be
expressed in terms of truncated Jacobian algebras. We study how these
vanishing cycles change under the mutation of Derksen, Weyman and Zelevinsky.
The wall-crossing formula leads to a categorification of quantum cluster
algebras under some assumption. This is a special case of A. Efimov’s result,
but our approach is more concrete and down-to-earth. We also obtain a
counting formula relating the representation Grassmannians under sink-source
reflections.