# TransformedField on Tensor

I was trying to use the TransformedField function to Transform the Metric Tensor $$ds^2 = dx^2 + dy^2 + dz^2$$ into Spherical coordinates. So i use:

TransformedField["Cartesian" -> "Spherical", IdentityMatrix[3], {x, y, z} -> {r, \[Theta], \[Phi]}]


Where i expect to get $$\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & r^2 & 0 \\ 0 & 0 & r^2 \sin ^2(\theta ) \\ \end{array} \right)$$

But instead i obtain this: $$\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \\ \end{array} \right)$$ Which is not what i expected from the Transformation of a Tensor. I am pretty sure i am doing something wrong here or something that is not supposed to be done like that but i can't quite put my finger on it. The Documentation doesn't Realy Mention how it Transforms Tensors just that it does. Can somebody enlighten me?

• TransformedField transtorms in orthonormal bases, which is not the convention of differential geometry. There exist several related posts in this site e.g. mathematica.stackexchange.com/a/192851/1871 Commented Jul 19, 2021 at 15:58
• @xzczd ah ok i didnt think about this posibility. So basically the difference is that in Diff Geo which is used in GR we dont use Orthonomal Bases for the Transformation Matrices? Commented Jul 19, 2021 at 16:30
• Yes. BTW you can find even more related posts in math.SE e.g. math.stackexchange.com/q/3742242/58219 Commented Jul 19, 2021 at 17:05
• @xzczd thanks that is realy interesting, tho i do get a bit confused as to why the unit vectors in the duals space are derivatives. Commented Jul 20, 2021 at 19:46
• Do you mean you're confused by the $\frac{\partial}{\partial x^i}$ denoting basis vectors? If so, it's because this notation is convenient, the calculation rule of the basis vectors is the same as that of partial derivative. (You may want to read The Poor Man’s Introduction to Tensors. ) Commented Jul 21, 2021 at 1:52

Maybe we need to use Grad to calculate the Gram matrix
CoordinateTransform[

{{1, 0, 0}, {0, r^2, 0}, {0, 0, r^2 Sin[θ]^2}}