it can be generalized to arbitrary lattices in arbitrary dimensions