def levi_civita_tensor(dim): """ Parameters ---------- dim Returns ------- """ epsilon = np.zeros((dim, ) * dim) for index_tup in permutations(range(dim), dim): epsilon[index_tup] = perm_parity(list(index_tup)) return epsilon
def test_perm_parity_correctness_on_odd_sequences(seq): assert perm_parity(seq) == -1