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

Hi,

I am currently practicing Cadabra 2 and would like to ask a simple (and maybe stupid) question. I wrote down the following code:

{t,x,y,z}::Coordinate;
{\mu,\nu,\rho,\sigma}::Indices(values={t,x,y,z},vectors);
\partial{#}::PartialDerivative;
f::Depends(t,x,y,z,\partial);
ex:= \partial_{\mu}{1+f};

Then I want to evaluate ex to get \partial{\mu}{f}. How can I do that? I tried some commands but nothing did work well. Or, is there any idea to automatically get 0 when we write down \partial{\mi}{some constant} in the definition or when \partial_{\mu}{const} is evaluated on the way of calculations?

in General questions by (700 points)

2 Answers

+1 vote

There is a bug with \partial_{\mu}{1} not simplifying to 0, will probably be fixed in the next few days. In principle, just doing distribute(_) should have done the job.

by (82.5k points)
+1 vote

This was fixed a while ago; if you do

{t,x,y,z}::Coordinate;
{\mu,\nu,\rho,\sigma}::Indices(values={t,x,y,z},vectors);
\partial{#}::PartialDerivative;
f::Depends(t,x,y,z,\partial{#});
ex:= \partial_{\mu}{1+f};
distribute(_);

it now does what you expected, giving

\partial_{\mu}{f}
by (82.5k points)

Thanks, Kasper!

...