  We consider finite quantum systems defined by a mixed set of commutation and
anti-commutation relations between components of the Hamiltonian operator.
These relations are represented by an anti-commutativity graph which contains a
necessary and sufficient information for computing the full quantum partition
function. We derive a second-order differential equation for an extended
partition function $z[\beta, \beta', J]$ which describes a transformation from
a ``parent'' partition function $z[0, \beta', J]$ (or anti-commutativity graph)
to a ``child'' partition function $z[\beta, 0, J]$ (or anti-commutativity
graph). The procedure can be iterated and then one forms a pseudo-forest of
duality transformations between quantum systems, i.e. a directed graph in which
every vertex (or quantum system) has at most one incoming edge (from its parent
system). The pseudo-forest has a single tree connected to a constant partition
function, many pseudo-trees connected to self-dual systems and all other
pseudo-trees connected to closed cycles of transformations between mutually
dual systems. We also show how the differential equation for the extended
partition function can be used to study disordered systems.
