I am trying to do some simple vector algebra/analysis, but am not sure how
to start getting useful results with SymPy.
Here an example:
from sympy.tensor.tensor import TensorIndexType, TensorHead
from sympy.tensor.toperators import PartialDerivative
from sympy import symbols
from sympy.tensor.tensor import TensorSymmetry
sym2 = TensorSymmetry.fully_symmetric(2)
L = TensorIndexType("L")
A = TensorHead("A", [L,L], sym2)
x = TensorHead("x", [L])
i, j, k = symbols("i j k")
PartialDerivative(A(-i,-j)*x(i)*x(j), x(j))
The result is
PartialDerivative(A(-L_0, -L_1)*x(L_0)*x(L_1), x(j))
Assuming A is constant, how can make SymPy to evaluate this to the
expression below?
2 * A(-j, -L_1)*x(L_0)
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/dc493fd9-8383-4703-bb14-16031e1f1acbn%40googlegroups.com.