Hi,
I am trying to understand if xAct&friends could fit my needs. In particular, I often have to work with components, so xCoba is the package I am studying.
Yet, despite having looked at the latest xCoba documentation and some of the questions posted in this forum, I could not figure out how to archive a very
simple task. For concreteness let's consider a Euclidean R^3 space. I can start with Spherical coordinates (r,theta,phi) and the metric of this manifold would
be diag(1,r^2,r^2 sin(theta)^2). Now, I can define a new set of coordinates, for example, the Cartesian coordinates. So I define the coordinate (x,y,z) and I
have a transformation law to express (x,y,z) as functions of (r,theta,phi). My goal is to find the transformed metric (which should be diag(1,1,1)).
My (unsuccessful) attempt modeled on the shape of what I find in the documentation is the following:
Needs["xAct`xCoba`"]
DefManifold[M, 3, IndexRange[a, c]]
DefChart[sph, M, {1, 2, 3}, {r[], \[Theta][], \[Phi][]}]
bc = {{r[] Sin[\[Theta][]] Cos[\[Phi][]], 0, 0 }, {0,
r[] Sin[\[Theta][]] Sin[\[Phi][]], 0}, {0, 0,
r[] Cos[\[Theta][]]}}
DefBasis[cart, TangentM, {1, 2, 3},
BasisChange -> CTensor[bc, {-cart, sph}], BasisColor -> Red]
met = CTensor[{{1, 0, 0}, {0, r[]^2, 0}, {0, 0,
r[]^2 Sin[\[Theta][]]^2}}, {-sph, -sph}]
ToCTensor[met, {-cart, -cart}]
Honestly, I don't know what I am doing. In particular, I don't understand why I have both charts and basis involved.
Could anyone give me some directions?
Thank you,
Gabriele