Example #1
0
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
Example #2
0
def test_perm_parity_correctness_on_odd_sequences(seq):
    assert perm_parity(seq) == -1