def test_epsilon_delta_rule(self): e1 = LeviCivitaTensor(3, True) e2 = LeviCivitaTensor(3, False) d = KroneckerDelta(3) d2 = d.tensor_product(d) d1 = d2.transpose((0, 1)) diagram = TensorDiagram((e1, e2.transpose())) assert diagram.calculate() == d1 - d2
def test_kronecker_delta(self): d = KroneckerDelta(4, 3) assert d.array.shape == (4, ) * 6 assert d.array[0, 1, 2, 0, 1, 2] == 1 assert d.array[0, 2, 1, 0, 1, 2] == -1