  We develop an efficient algorithmic approach for approximate counting and
sampling in the low-temperature regime of a broad class of statistical physics
models on finite subsets of the lattice $\mathbb Z^d$ and on the torus
$(\mathbb Z/n \mathbb Z)^d$. Our approach is based on combining contour
representations from Pirogov-Sinai theory with Barvinok's approach to
approximate counting using truncated Taylor series. Some consequences of our
main results include an FPTAS for approximating the partition function of the
hard-core model at sufficiently high fugacity on subsets of $\mathbb Z^d$ with
appropriate boundary conditions and an efficient sampling algorithm for the
ferromagnetic Potts model on the discrete torus $(\mathbb Z/n \mathbb Z)^d$ at
sufficiently low temperature.
