We present an adaptive fast multipole method for solving the Poisson equati
on in two dimensions. The algorithm is direct, assumes that the source dist
ribution is discretized using an adaptive quad-tree, and allows for Dirichl
et, Neumann, periodic, and free-space conditions to be imposed on the bound
ary of a square. The amount of work per grid point is comparable to that of
classical fast solvers, even for highly nonuniform grids.