First of all, thanks for the corrections in the code, I hadn't noticed.
So, the error persisted, but I think I managed to get around it. A few lines before, I made some statements for different calculations, I believe that is what caused the problem. When I put a reset() between them the problem goes away, or if I leave the first statement as a comment. I will leave the two statements here because I am not sure the source of the error, in case you know, I will be happy to know.
- First statement:
{\theta, \varphi}::Coordinate;
{a,b,c,d,e,f,g,h#}::Indices(values={\theta, \varphi}, position=independent);
\partial{#}::PartialDerivative;
- Second statement:
{r,t,\phi,\theta}::Coordinate;
{\mu,\nu,\rho,\sigma,\lambda,\kappa,\chi,\gamma,\alpha,\beta#}::Indices(values= {t,r,\phi,\theta}, position=independent);
\partial{#}::PartialDerivative;
g_{\mu\nu}::Metric;
g^{\mu\nu}::InverseMetric;