def yield_pair_gradients(self, index1, index2):
d_2 = <NUM_LIT:1>/self.distances[index1, index2]**<NUM_LIT:2><EOL>if self.charges is not None:<EOL><INDENT>c1 = self.charges[index1]<EOL>c2 = self.charges[index2]<EOL>yield -c1*c2*d_2, np.zeros(<NUM_LIT:3>)<EOL><DEDENT>if self.dipoles is not None:<EOL><INDENT>d_4 = d_2**<NUM_LIT:2><EOL>d_6 = d_2**<NUM_LIT:3><EOL>delta = self.deltas[index1, index2]<EOL>p1 = self.dipoles[index1]<EOL>p2 = self.dipoles[index2]<EOL>yield -<NUM_LIT:3>*d_4*np.dot(p1, p2), np.zeros(<NUM_LIT:3>)<EOL>yield <NUM_LIT:15>*d_6, p1*np.dot(p2, delta) + p2*np.dot(p1, delta)<EOL>if self.charges is not None:<EOL><INDENT>yield -<NUM_LIT:3>*c1*d_4, p2<EOL>yield -<NUM_LIT:3>*c2*d_4, -p1<EOL><DEDENT><DEDENT>
Yields pairs ((s'(r_ij), grad_i v(bar{r}_ij))