  A quantum Monte Carlo algorithm for the transverse Ising model with arbitrary
short- or long-range interactions is presented. The algorithm is based on
sampling the diagonal matrix elements of the power series expansion of the
density matrix (stochastic series expansion), and avoids the interaction
summations necessary in conventional methods. In the case of long-range
interactions, the scaling of the computation time with the system size N is
therefore reduced from N^2 to Nln(N). The method is tested on a one-dimensional
ferromagnet in a transverse field, with interactions decaying as 1/r^2.
