  We study the phase transition of KMS states for the C*-algebras of
$ax+b$-semigroups of algebraic integers in which the multiplicative part is
restricted to a congruence monoid, as in recent work of Bruce generalizing
earlier work of Cuntz, Deninger, and Laca. Here we realize the extremal
low-temperature KMS states as generalized Gibbs states by constructing concrete
representations induced from extremal traces of certain group C*-algebras. We
use these representations to compute the Murray--von Neumann type of extremal
KMS states and we determine explicit partition functions for the type I factor
states. The collection of partition functions that arise this way is an
invariant under $\mathbb{R}$-equivariant isomorphism of C*-dynamical systems,
which produces further invariants through the analysis of the topological
structure of the KMS state space. As an application we characterize several
features of the underlying number field and congruence monoid in terms of these
invariants. In most cases our systems have infinitely many type I factor KMS
states and at least one type II factor KMS state at the same inverse
temperature and there are infinitely many partition functions. In order to deal
with this multiplicity, we establish, in the context of general C*-dynamical
systems, a precise way to associate partition functions to extremal KMS states
that are of type I, and we then show that for our systems these partition
functions depend only on connected components in the KMS simplex. The
discussion of partition functions of general C*-dynamical systems may be of
interest by itself and is likely to have applications in other contexts, so we
include it in a self-contained initial section that is partly expository and is
independent of the number-theoretic background and of the technical results
about congruence monoids.
