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

Hi, and thanks as always for cdb.

I think I may be missing something, but I can't figure what it might be. Please consider the following two pieces of code; they only differ in that the first uses canonicalise while the second uses meld. However the second gives 0 as the result and I don't see why.

First segment of code:

\partial{#}::PartialDerivative.
{\mu,\nu,μ,ν}::Indices(spacetime,position=fixed).
f::Depends(\partial{#}).
\delta_{\alpha}^{\mu}::KroneckerDelta.
{\alpha,\beta,α,β}::Indices(flat,position=fixed).
e_{\alpha}^{\mu}::Depends(\partial{#}).

{u^{\mu},v^{\mu}, \partial_{\nu}{Q??}, \partial_{\nu}{f}, \partial_{\mu\nu}{f}, e_{\nu}, f, (1/f)}::SortOrder.

ex := \partial_{μ}(e_{β}^{ν}) \partial_{ν}(f) e_{α}^{μ} +
        \partial_{μ ν}(f) e_{α}^{μ} e_{β}^{ν}
        -\partial_{μ}(e_{α}^{ν}) \partial_{ν}(f) e_{β}^{μ}
        -\partial_{μ ν}(f) e_{α}^{ν} e_{β}^{μ}.
ex;
canonicalise(ex);

Second segment of code:

\partial{#}::PartialDerivative.
{\mu,\nu,μ,ν}::Indices(spacetime,position=fixed).
f::Depends(\partial{#}).
\delta_{\alpha}^{\mu}::KroneckerDelta.
{\alpha,\beta,α,β}::Indices(flat,position=fixed).
e_{\alpha}^{\mu}::Depends(\partial{#}).

{u^{\mu},v^{\mu}, \partial_{\nu}{Q??}, \partial_{\nu}{f}, \partial_{\mu\nu}{f}, e_{\nu}, f, (1/f)}::SortOrder.

ex := \partial_{μ}(e_{β}^{ν}) \partial_{ν}(f) e_{α}^{μ} +
        \partial_{μ ν}(f) e_{α}^{μ} e_{β}^{ν}
        -\partial_{μ}(e_{α}^{ν}) \partial_{ν}(f) e_{β}^{μ}
        -\partial_{μ ν}(f) e_{α}^{ν} e_{β}^{μ}.
ex;
meld(ex);

Thank you

GPN

in Bug reports by (2.0k points)
edited by

1 Answer

0 votes

Hi GNP. I was playing with your code (thank you for sharing it!), and I noticed that the problem is not with the meld algorithm, but with the previoussort_product.

If you comment the sort_product the result of both codes is the same (and nontrivial).

Cheers, Dox.

by (15.0k points)

Hi @doxdrum

Thank you for pointing that out! I believe my code was unclear.

I have now corrected it above (edited the original question) so it is more focused. I believe the difference between canonicalise and meld still exists.

Many thanks if you can confirm that the difference between canonicalise and meld is also seen on your side. Or maybe I am wrong?

GPN

...