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

If I try to use collect_factors for an expression that contains exponents, it does not collect them into one exponent, for example:

collect_factors($\exp(-2\sigma-2\kappa) \exp(2\sigma) \exp(2\kappa)$);

these exponents can only be removed by map_sympy(ex, "simplify"), but it can't be used with zoom function, for example. same situation with product_rule.

in Bug reports by (1.1k points)

1 Answer

+1 vote

Use a substitution like

 substitute(ex, $\exp(A??) \exp(B??)-> exp(A??+B??)$)

Add the , repeat=True if necessary to make it repeat the process until the expression no longer changes.

by (76.4k points)
...