Maple Physics Package Question: Trouble contracting indices

Click For Summary
SUMMARY

The discussion centers on a user experiencing issues with the Maple Physics Package, specifically with the function SumOverRepeatedIndices failing to contract indices. The user provides a code example that demonstrates the problem and identifies the solution: converting the inert differential operator Diff to diff using the Maple function value(%). This workaround is necessary because Maple does not allow contraction over inert operators, which the user criticizes as a design flaw. The solution is crucial for maintaining the symbolic integrity of calculations in Maple.

PREREQUISITES
  • Familiarity with Maple 2023 and its Physics Package
  • Understanding of tensor notation and index contraction
  • Basic knowledge of differential operators in symbolic computation
  • Experience with Maple syntax and command execution
NEXT STEPS
  • Research the function value(%); in Maple for handling inert operators
  • Explore advanced tensor operations in the Maple Physics Package
  • Learn about the limitations of symbolic computation in Maple
  • Investigate user experiences and solutions on Mapleprimes for similar issues
USEFUL FOR

This discussion is beneficial for physicists, mathematicians, and engineers using Maple for symbolic calculations, particularly those working with the Physics Package and tensor analysis.

retnev
Messages
2
Reaction score
4
TL;DR
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
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   Reactions: berkeman and DrClaude

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
7K
  • · Replies 30 ·
2
Replies
30
Views
7K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 19 ·
Replies
19
Views
6K
  • · Replies 11 ·
Replies
11
Views
4K
  • · Replies 22 ·
Replies
22
Views
3K
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K