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?

  • 2
    $\begingroup$ 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 $\endgroup$
    – xzczd
    Commented Jul 19, 2021 at 15:58
  • $\begingroup$ @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? $\endgroup$ Commented Jul 19, 2021 at 16:30
  • $\begingroup$ Yes. BTW you can find even more related posts in math.SE e.g. math.stackexchange.com/q/3742242/58219 $\endgroup$
    – xzczd
    Commented Jul 19, 2021 at 17:05
  • $\begingroup$ @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. $\endgroup$ Commented Jul 20, 2021 at 19:46
  • $\begingroup$ 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. ) $\endgroup$
    – xzczd
    Commented Jul 21, 2021 at 1:52

1 Answer 1


Maybe we need to use Grad to calculate the Gram matrix

 "Spherical" -> "Cartesian", {r, θ, ϕ}]
Transpose[Grad[%, {r, θ, ϕ}]] . 
  Grad[%, {r, θ, ϕ}] // Simplify

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.