Hi there,
*ISSUE 1:*I had a discussion with Kalevi Suominen about two operations I introduced in my PR: https://github.com/sympy/sympy/pull/10511 Tensor product acts on two N-dim arrays *A[m1, m2, ... ]* and *B[n1, n2, ... ]* to give *A[m1, m2, ... ]*B[n1, n2, ... ]* (that is an N-dim array of rank the sum of the two original ranks). Tensor contraction sums the indices given by the specified positions: *A[m1, ... , mk, ... , mp , ... ] *===> *Sum(A[m1, ... , i , ... , i , ... ], i)*The point to decide is wheter *tensorproduct( ) *and *tensorcontraction( )* should be class methods or functions in the module namespace. My point for the public namespace functions is that those operations shall also act on scalars. Scalars can be thought of as zero-dimensional N-dim arrays. Every SymPy Expr is a scalar (maybe with some minor exceptions). A function in public namespace can be called as *tensorproduct(a, b)* even if *a* is a scalar (say a Symbol or number), while *a.tensorproduct(b)* would fail because only N-dim arrays would be associated the method. On the other hand, for type stability reasons one could wish to represent scalars still as array objects, just with no shape defined. They would have all tensorial methods defined. I don't like this idea because it looks more natural to just pick a SymPy object an multiply it by an array. Type stability could be the pro of this point. Read the discussion for details. Wolfram Mathematica does it my way: https://reference.wolfram.com/language/ref/TensorProduct.html?q=TensorProduct https://reference.wolfram.com/language/ref/TensorContract.html?q=TensorContract (though it may be argued that Mathematica language has no syntax like* a.method(b)* ) What do you think? Anyone supporting my API choice? Can we solve this issue quickly before the release process for version 1.0 starts? *ISSUE 2:*In Wolfram Mathematica it is possible to derive an object by an array of symbols: https://reference.wolfram.com/language/ref/D.html?q=D In their documentation: D <https://reference.wolfram.com/language/ref/D.html>[f,{{x1,x2,…}}] for a scalar f gives the vector derivative . Basically, if *f* is an N-dim array (scalar, vector, matrix or higher rank), it raises the array rank by one by deriving elementwise *f* by each {x1, x2, ... }. What about introducing this to SymPy? I could quickly write this routine for the newly created N-dim array module. If these two issues are solved, it will get much more easy to use SymPy to deal with modern physics, such as General Relativity. I counted at least 5 PR in the last two years by minor contributors trying to introduce some sort of tensorial stuff applied to relativity. -- 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 post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/b9d5e371-f858-413e-b466-4a1bcc810732%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
