Efficient evaluation of partition functions of inhomogeneous many-body spin systems.