For l2 in range(l1), so that this (at least) halves the calculations
required, as the matrix is symmetric.