A method is presented for efficient calculation of the electrostatic p
otential due to the nuclei and the continuous electronic charge distri
bution in a crystal or a large molecule. Accuracy is under the control
of a single tolerance parameter. The computational cost for the calcu
lation of the static potential on the entire grid and for static energ
y evaluation scales asymptotically as O(N) with a favorable prefactor.