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

There seems to be a bug in Cadabra v1.x. (I've checked in 1.42 and 1.46). The \sqrt function seems to drop numerical prefactors in the displayed expression (and in the .cnb file) when no other objects multiply it.

Consider: The first expression returns \sqrt{x} but the second returns 7 y \sqrt{x}.

7 \sqrt{x};
7 y \sqrt{x};

This seems to be partly a bug in how the expression is displayed. The first expression above is rendered as "\sqrt{x}" in the .cnb file but in expressions it seems to be treated correctly as 7 \sqrt{x}, so that, for example, "7 \sqrt{x} - 6 \sqrt{x}" displays "\sqrt{x}" (after collecting terms) but "7 \sqrt{x} - 7 \sqrt{x}" returns zero.

in Bug reports by (1.0k points)

1 Answer

0 votes

Thanks. This works fine in 2.x, indeed seems to be a display problem. I can't tell you if and when I have time to fix this for 1.x. Perhaps time to upgrade?

by (82.5k points)

Probably right about the time to upgrade. Right now I'm finishing a few very large projects involving really intricate Cadabra 1.4x code. I'm very familiar with its idiosyncrasies, and I'm a little afraid of learning Cadabra 2.x. I think for future projects! :-D

...