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

Hi!

I often use the following function with a converge loop to simplify expressions:

def tidy (expr):
   converge(expr):
       distribute(expr)
       product_rule(expr)
       sort_product(expr)
       collect_factors(expr)
   return expr

But after today's update of cadabra to the latest version, this loop became infinite. Not for all expressions, but, for example, for this one

{a,b,c,d,f,g,m,n,k,q,r,s,t,u,v,w,x,y,z,m#}::Indices(subspace, position=independent, parent=full);
\partial{#}::PartialDerivative.


expr := ((\phi)**(-2) + A_{a} h^{a b} A_{b}) (\partial_{n}((\phi)**2 A_{m}) + \partial_{m}((\phi)**2 A_{n}));

Also, the problem only occurs if I use this function from a external file

import functions as fun

so, if I use

fun.tidy(expr)

Loop is infinite.

in Bug reports by (1.7k points)

1 Answer

0 votes

I cannot reproduce this. Which "today's update" are you talking about? I did not make any new release. What is the version and build number? (start the command-line cadabra2 and look at the first line of output).

by (82.5k points)

Yes, sorry, I meant I did the update today and the version is the most recent. My cadabra version: 2.5.4, Python: 3.11.9, and I use Ubuntu 24.04.1

I also noticed that identical expressions are no longer automatically summarized, I have to use collect_terms() additionally where it was not required before. But I couldn't find a minimal example yet.

Built from source or from a binary package? Please start the command line cadabra2 and tell me the first line with the build version/hash.

Build from source, first line is

Cadabra 2.5.4 (build 3178.837bb63622 dated 2024-09-10)

Sorry, I didn't get notification of your reply for some reason

...