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

Hi everyone!

I am here to ask another question. I hope it not be a silly one! In the following code:

https://db.tt/CLZmnHR4

I can't figure out why the productrule() after the substitute(_, gamma) doesn't work. Also the eliminate_metric in the final of the code doesn't work too!

Regards!

in General questions by (1.1k points)
edited by

1 Answer

+1 vote
 
Best answer

In general, please try to boil down your problem to something that can be displayed here, because dropbox files tend to have a short lifetime.

product_rule only works when you have a derivative acting on a product. It does not work when you have a derivative acting on a sum of products. In those cases, you first need to distribute the derivative over the terms in the product.

Thanks for spotting the second issue. eliminate_metric should by default act at an arbitrary level in the expression, but has deep=False as default argument, and hence does not go into the individual terms of the sum which forms your expression. You can work around this bug for the time being by using

eliminate_metric(_, deep=True);
by (82.5k points)
selected by

Obrigado! In fact, I wanted to use distribute before applying product _rule but I received an error saying the expression is too long. So I tried to kill the constant terms before. I would like to use this opportunity to give you my feedback about the graphical interface of Cadabra2. I think probably already you know but it is the minimum that I can to help its development. I think the graphical interface of Cadabra1 is more efficient than 2. I can distribute very long expression in 1 without receive any error but the same process throw an error in 2. Also it's more stable. In Cadsbra2 I have to close/open the interface after each 3-4 evaluations even after restarting the kernel. Another point is about the velocity. In a same machine, the Cadabra1 is 4-5 times more speedy than 2. I don't know it's related to the core of the program or the interface. I have tested both versions in two core-i5 machines, one having pure UBUNTU and the other one has LUBUNTU running inside a virtual machine.

Regards

If you have concrete comparison notebooks for 1 and 2 please send them to me by email. Long expressions display is certainly still not quite where I want to have it. Speed-wise, the algorithms are more or less unchanged from 1, but there are more cleanup routines acting behind the scenes now which can use some tuning, and there may be cases where there is an excessive number of round trips from Python to C++ and back.

In any case, if you have notebooks that show where you think 2 could be improved, please share some of them with me, and I'll have a closer look.

Still I don't have a concrete comparison between the two versions but I try to prepare it as soon as possible.

...