  We present a numerical method to evaluate partition functions and associated
correlation functions of inhomogeneous 2--D classical spin systems and 1--D
quantum spin systems. The method is scalable and has a controlled error. We
illustrate the algorithm by calculating the finite--temperature properties of
bosonic particles in 1--D optical lattices, as realized in current experiments.
