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

For example,

{a,b}::Indices(vector).
\delta{#}::Accent.
ex:=\delta{A^{a b}+B^{a b}}

Result is not right.

in Bug reports by (2.2k points)
edited by

1 Answer

0 votes

Hi Eureka.

Firstly, let me point that a semi-colon is missing at the en d of the third line. So, the correct code should be

{a,b}::Indices(vector).
\delta{#}::Accent.
ex := \delta{A^{a b}+B^{a b}};

Then, let me clarify that (to my understanding) accents are a way to differentiate symbols, i.e. it has no further properties. Why is this important? Perhaps your expression should be written as

ex := \delta{A}^{a b} + \delta{B}^{a b};

If you are expect your accent to have linearity property, give assign the property of Derivative, i.e.

\delta{#}::Derivative.

If you use the Derivative property instead of the Accent, you could apply the distribute algorithm in your original expression

{a,b}::Indices(vector).
\delta{#}::Derivative.
ex:=\delta{A^{a b}+B^{a b}};
distribute(ex);

Cheers, Dox.

by (15.0k points)

Just a small comment to that: if you just want your accent to have that linear property so it behaves as in the above example using distribute, then it is better to use the Distributable property. So

{a,b}::Indices(vector).
\delta{#}::Distributable.
ex:=\delta{A^{a b}+B^{a b}};
distribute(ex);

The Derivative property leads to other behaviour of the accented symbols which you may or may not want, while Distributable just means that the accent is handled as above in distribute.

Hi K. Excellent clarification! I didn't know the Distributable property. Thank you.

Thanks @kasper & @doxrum, this is what I want. I also didn't know the Distributable property, maybe a complete manual for Cadabra2 is necessary.

Writing good documentation is the hardest part of writing software.... I didn't even realise that Distributable lacked a manual page. Will add.

Fully understand, but the new reference guide is still expected to be finished soon. Some of my friends have temporarily not used this software mainly because the manual is incomplete. Cadabra2 is undoubtedly great, if there could be a detailed manual, it would be even greater.

That's what I said. I only have limited time, and writing good/complete documentation gobbles up loads of that time. Anyone is free to contribute with pull requests.

In any case, the manual page for Distributable already existed, it was just not linked into the web and the book. Now fixed.

...