def M22(r, s, a1, a2, i, j, c, mu): if abs(r[0]) + abs(r[1]) + abs(r[2]) > 1e-10: return c * 0.5 * sum([ levi(i, k, l) * D_R(r, s, k, l, j) for k in xrange(3) for l in xrange(3) if k != l and i != k and i != l ]) else: return kronmatrix[i][j] / (8 * pi * mu * a1**3)
def M23(r, s, a1, a2, i, j, k, c, mu): if abs(r[0]) + abs(r[1]) + abs(r[2]) > 1e-10: return c * -0.5 * sum([ levi(i, l, m) * (D_K(r, s, l, m, j, k) + (a2**2 / 6.) * DLap_K(r, s, l, m, j, k)) for l in xrange(3) for m in xrange(3) if l != m and i != l and i != m ]) else: return 0
def L6(d, i, j, k): return sum([ levi(i, k, l) * d[l] * d[j] for l in xrange(3) if l != i and l != k ]) + sum( [levi(j, k, l) * d[l] * d[i] for l in xrange(3) if l != k and l != j])
def L3(d, i, j): if i == j: return 0 else: return sum( [levi(i, j, k) * d[k] for k in xrange(3) if k != i and k != j])
def R(r, ss, i, j): return -0.5 * sum([ levi(j, k, l) * D_J(r, ss, k, i, l) for k in xrange(3) for l in xrange(3) if k != l and j != k and j != l ])
def D_R(r, ss, l, i, j): return -0.5 * sum([ levi(j, m, n) * DD_J(r, ss, l, m, i, n) for m in xrange(3) for n in xrange(3) if m != n and m != j and n != j ])