I'm trying to derive Maxwell equations in general curved space. I run into a very specific issue that's not related to this example but I couldn't find a simpler example to illustrate the issue. Here's my attempt:
{ \alpha, \beta, \mu, \nu, \lambda, \kappa, \rho, \sigma, \sigma# }::Indices(spacetime, position=independent).
\partial{#}::PartialDerivative.
{\nabla{#}, \delta{#}}::Derivative.
g_{ \mu \nu }::Metric.
g^{ \mu \nu }::InverseMetric.
g_{ \mu \nu }::Symmetric.
g^{ \mu \nu }::Symmetric.
g{#}::Depends(\nabla{#}, \partial{#}).
\Gamma^{\mu?}_{\nu? \rho?}::TableauSymmetry(shape={2}, indices={1,2}).
A{#}::Depends(\nabla{#}, \partial{#}).
ex:= L = - \sqrt{(- g)} (\frac{1}{4} g^{\mu \alpha} g^{\nu \beta} (\nabla_{\alpha}{A_{\beta}} - \nabla_{\beta}{A_{\alpha}})(\nabla_{\mu}{A_{\nu}} - \nabla_{\nu}{A_{\mu}}));
varyex:= \delta{L}.
substitute(varyex, ex);
distribute(varyex, repeat=True)
product_rule(varyex, repeat=True)
distribute(varyex, repeat=True)
substitute(varyex, $\delta{ \nabla_{\mu}{ A_{\nu} } } -> \nabla_{\mu}{ \delta{ A }_{\nu} } - \delta{\Gamma}^{\rho}_{\mu \nu} A_{\rho}$, repeat=True);
distribute(varyex, repeat=True)
canonicalise(varyex, repeat=True);
zoom(_, $Q?? \delta{\Gamma}^{\rho}_{\mu \nu}$);
You see at the end that there are four terms that should visibly cancel between each other. But I'm not sure what I should be doing to cancel them out. canonicalise
doesn't seem to do the job. I tried using factor_out
to pull out some pieces to see if the rest of it cancels. But nothing has worked yet.
Any suggestions?