Lattice sum of electric field gradients in tetragonal crystals