# An error during substitution command

Hi everyone!

I don't understand why in the following code, the substitute command can't act on g^{\mu \nu} in the gamma expression defined in the code.

{\alpha, \beta, \rho, \mu, \nu, \sigma, \lambda, \theta}::Indices(position=fixed, vectors).
\eta_{\mu \nu}::Metric.
\eta^{\mu \nu}::InverseMetric.
h^{\mu \nu}::Symmetric.
g^{\mu \nu}::Symmetric.
\eta^{\mu}_{\nu}::KroneckerDelta.
\partial_{#}::PartialDerivative.
{h^{\mu \nu}, h, g_{\mu \nu}, g^{\mu \nu}, \phi}::Depends(\partial).
\Gamma^{\alpha}_{\beta \rho}::Depends(\partial).
\Gamma^{\alpha}_{\beta \rho}::TableauSymmetry(shape={2}, indices={1,2}).
{k}::Weight(label=expan).
gamma:=\Gamma^{\alpha}_{\beta \rho} = \frac{1}{2} g^{\alpha \theta}[\partial_{\rho}{g_{\theta \beta}}
+\partial_{\beta}{g_{\theta \rho}}-\partial_{\theta}{g_{\beta \rho}}];
substitute(gamma, $g^{\mu \nu} -> \eta^{\mu \nu}-k h^{\mu \nu}$);

Look carefully at how you wrote the gamma expression. You write
g^{\alpha\theta}[\partial_{\rho}{...} ... ]
There is no space between the g^{\alpha\beta} and the bracket [. The result is that the stuff inside [...] is interpreted as an argument to g^{\alpha\beta}, not as a factor multiplying this tensor.
Insert a space in front of the [ and all is fine.