A computer algebra system written in pure Python http://sympy.org/ . To get started to with contributing https://github.com/sympy/sympy/wiki/Introduction-to-contributing
./bin/test
do not work on ubuntu. So is the solution here simply cloning a wsl version of the sympy repo and keeping its functioning separate from windows?
Hi all -- I'm looking at how to differentiate expressions involving IndexedBase objects. When I run the following code:
import sympy
n = sympy.symbols('n', integer=True)
M = sympy.IndexedBase('M', shape=(n, n))
x = sympy.IndexedBase('x', shape=n)
i = sympy.Idx('i', n)
j = sympy.Idx('j', n)
k = sympy.Idx('k', n)
energy = 0.5 * M[i, j] * x[i] * x[j]
print(sympy.simplify(energy.diff(x[k])))
I get an expression involving lots of Kronecker deltas. I feel it should be possible to simplify these out but I don't know how. Thoughts?
0.5 * (M[k, j] * x[j] + M[i, k] * x[i])
at the very least