First, I believe the unit tensor is a diagonal tensor with diagonal elements of 1, regardless of whether it is in Cartesian coordinates or cylindrical coordinates.
Then, I wanted to verify this using Mathematica.
I transformed the unit tensor, Icar
, from Cartesian coordinates to cylindrical coordinates to obtain Icyl
.
However, I noticed that some components of Icyl
are unexpectedly equal to 4.
Where did I make a mistake? It has been bothering me all day. Thank you.
Clear["Global`*"] // Quiet;
cyl = {r, \[Theta], z};
car = CoordinateTransform["Cylindrical" -> "Cartesian", cyl];
dcardcyl = Grad[car, cyl, "Cylindrical"];
Icar = IdentityMatrix[3];
Icyl = TensorContract[
dcardcyl\[TensorProduct]dcardcyl\[TensorProduct]Icar, {{1, 5}, {3,
6}}];
Icyl // Simplify