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

Hi! When I try to work with expressions like (-X)^{1/2} or any other fractional degree the expand_power and collect_powers commands cause a kernel crash, for example:

collect_factors($(-X)**{-5/2} X$);

I know that without defining the X sign beforehand, I can't shorten this expression, but kernel crush is too much. That's why I have another question for this bugreport, is it possible to define the sign of X in advance to work with such expressions correctly?

in Bug reports by (1.4k points)

1 Answer

+2 votes

It's not the fractional power, it's the '-1' inside the square root (any factor except '+1' leads to the same problem). This indeed should have returned unevaluated, I'm not sure why I left the hard assert in the code which makes it bail out, other than to indicate to myself that this code was unfinished. I have filed an issue so we do not lose track of this again, https://github.com/kpeeters/cadabra2/issues/290.

The sympy bridge can help with this,

simplify($(-X)**{-5/2} X$);

returns what you want.

by (80.3k points)

It gave me back the same expression, but at least the kernel didn't crush. I hope this issue is resolved quickly.

...