I was starting to set up a curved axisymmetric metric using the Physics package and came across an error message that I could not resolve. I was actually writing the metric in the form given after output line (5) in the code attcahed below. This returned the error message:
Error, (in Physics:-Setup) invalid subscript selector
Then I started fiddling and discovered that somehow braces and order of coefficients are making a difference in the metric. I have written the flat space metric in three different ways after output line (2). The difference is only in the coefficient of the last $d\phi^2$ term. For some reason, $r^2 (sin(\theta))^2$ is shown as $r (sin(\theta))^4$ in output line (3). Removing the brackets around $sin(theta)$ or writing $r^2$ after it is resolving the problem. Is this in someway related to the whole square operation? Can you please help me understand why this is happening?
The original error message I was getting went away after I similarly changed the order of coefficients in the second term of the curved metric to get output (6). Here again, there was a whole square operation!