Hi,

I'm trying to figure out how to use Cadabra for the following:

I defined a set of coordinate variables (e.g. {t,r,\theta,\phi}) and an explicit metric replacement statement, e.g. Schwarzschild metric:

g

schw :={g{t t}=-(1-R/r). g_{r r}=(1-R/r)**(-1), g_{\theta \theta}=...}

complete(g_schw, $g^{\mu \nu}$);

I have a formula for transformation from said coordinates into harmonic coordinates (Y0,Y1,Y2,Y3)

(or Kruskal coordinates (T,X,\theta,\phi), or whatever...)

I want to calculate the metric in the new coordinates, say h_{m n} (0<=m,n<=3).

The best I have so far (code below) is

1) make substitution rules for Y0(t,r,\theta,\phi)...Y3(t,r,\theta,\phi)

2) use the substitute and evaluate method to evaluate the inverse metric

h^{m n} = g^{\mu \nu} * partial*{mu}{Y^{m}} * partial*{nu}{Y^{n}}

However

* Cadabra constructs the new expression for the tensor with the indices values of [t,r,\theta,\phi] instead of [0,1,2,3]

* I can't use complete to calculate h_{m n} from h^{m n}. The complete method doesn't work.

```
{t,r,\theta,\phi}::Coordinate
{\mu,\nu,\rho,\sigma,\kappa,\xi,\zeta}::Indices(position=fixed,values=[t,r,\theta,\phi]);
{g_{\mu \nu},h_{\mu \nu}}::Metric;
{g^{\mu \nu},h^{\mu \nu}::InverseMetric;
{g_{\mu}^{\nu},h_{\mu}^{\nu}}::KroneckerDelta;
\partial{#}::PartialDerivative.
x_Y_schw := {X^{t}=t, X^{r}=r, X^{\theta}=\theta, X^{\phi}=\phi, Y^{t}=c t, Y^{r}=(r-R0/2) sin(\theta) cos(\phi), Y^{\theta}=(r-R0/2) sin(\theta) sin(\phi), Y^{\phi}=(r-R0/2) cos(\theta)};
{Y^{#}}::Depends(r,t,\theta,\phi);
evaluate($\partial_{\mu}{Y^{\nu}}$, x_Y_schw);
g_schw := {g_{t t}=-c**2 * (1-R0/r), g_{r r}=(1-R0/r)**(-1), g_{\theta \theta}=r**2, g_{\phi \phi}=r**2 * (sin(\theta))**2};
complete(g_schw, $g^{\mu \nu}$);
h_harm := h^{\rho \sigma} -> \partial_{\mu}{Y^{\rho}} \partial_{\nu}{Y^{\sigma}} g^{\mu \nu};
evaluate(h_harm, g_schw + x_Y_schw,rhsonly=True);
complete(h_harm, $h_{\rho \sigma}$);
```