Maple Physics Package Question: Trouble contracting indices

  • #1
retnev
2
4
TL;DR Summary
Maple Physics metrics contraction indices
I have been using Maple for a decade, but only recently started using the Physics Package.
I unfortunately ran into trouble to contract indices ( Maple calls it SumOverRepeatedIndices ).
Below I give an example that will execute if you paste it into a Maple worksheet.
A metric is defined. A contraction involving the metric is then further defined.
Result is the contraction command fails to contract and I cannot find a solution to this in the Maple help files.

with(Physics):
Coordinates(X = (rho, z, phi, t));
ds := 1*dt^2 - 2*drho^2 - 3*dz^2 - 4*dphi^2;
Setup(metric = ds);
g_[~mu, ~nu]*Diff(Phi(rho, z), nu, mu);
SumOverRepeatedIndices(%, nu);
Instructions to replicate the problem
1) Paste the code above into a maple worksheet with a Maple version that supports the Physics package.
2) Execute the worksheet.
3) Observe that the last command "ContractOverIndices fails, as e.g. the nu index should be Summed out for the four coordinates (rho, z, phi, t).

Any idea what I do wrong that prevents Maple from contracting the index nu ?
Result
No contraction over tensors take place using e.g. nu as coordinate to contract.
So what is the reason that Maple refuses to contract over indices in the example shown?
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
I solved the problem myself.
In case anyone else needs to deal with this issue, the solution is to convert the inert differential operator Diff to diff using the Maple function value(%).
Apparently indices cannot contract over the inert differential operator, which is silly.
Inert clearly should not include indices which is a design flaw in Maple as it will force you to execute differentials during symbolic calculations. Pretty unacceptable.
Therefore, to solve the problem, you always have to issue the instruction value(%); before you call SumOverRepeatedIndices, making the entire symbolic nature of calculations much weaker.
I saw the same problem that was asked on the Mapleprimes site which belongs to Maplesoft and they could not answer or resolve this issue about their own software.

Anyway, it is solved and it is best to leave this post up as this problem will creep up sporadically and this will be the only solution how to do it in Maple.
 
Last edited:
  • Informative
  • Like
Likes berkeman and DrClaude

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Replies
2
Views
2K
  • Advanced Physics Homework Help
Replies
30
Views
5K
  • Special and General Relativity
Replies
19
Views
3K
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
11
Views
2K
  • Special and General Relativity
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
7K
  • Special and General Relativity
Replies
1
Views
1K
Back
Top