Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

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:

gschw :={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_Yschw := {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); gschw := {g{t t}=-c2 * (1-R0/r), g{r r}=(1-R0/r)**(-1), g{\theta \theta}=r2, g_{\phi \phi}=r2 * (sin(\theta))2}; complete(g_schw, $g^{\mu \nu}$); hharm := 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(hharm, $h{\rho \sigma}$);

in General questions by (260 points)

Please log in or register to answer this question.

...