Skip to content

Commit

Permalink
Update tensors.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Li-Xiang-Ideal authored Nov 16, 2023
1 parent 60b9ee7 commit 2da36b4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions mathics/builtin/tensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
from mathics.core.atoms import Integer, String
from mathics.core.attributes import A_FLAT, A_ONE_IDENTITY, A_PROTECTED
from mathics.core.builtin import BinaryOperator, Builtin
from mathics.core.convert.python import from_python
from mathics.core.evaluation import Evaluation
from mathics.core.expression import Expression
from mathics.core.list import ListExpression
from mathics.core.symbols import Atom, Symbol, SymbolFalse, SymbolTrue
from mathics.core.systemsymbols import SymbolRule, SymbolSparseArray
from mathics.eval.parts import get_part
from sympy.combinatorics import Permutation
from sympy.utilities.iterables import permutations


def get_default_distance(p):
Expand Down Expand Up @@ -519,11 +523,6 @@ class LeviCivitaTensor(Builtin):
def eval(self, d, type, evaluation: Evaluation):
"LeviCivitaTensor[d_Integer, type_]"

from mathics.core.systemsymbols import SymbolSparseArray, SymbolRule
from mathics.core.convert.python import from_python
from sympy.utilities.iterables import permutations
from sympy.combinatorics import Permutation

if isinstance(d, Integer) and type == SymbolSparseArray:
d = d.get_int_value()
perms = list(permutations([i for i in range(1, d + 1)]))
Expand Down

0 comments on commit 2da36b4

Please sign in to comment.