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

It seems to me that unwrap (in Cadabra 2) fails to recognize properly the dependency of an additive combination of dependent quantities. Here's the simplest case,


{ A, B, C, D }::Depends(\partial{#}).

ex1 := \partial_{\alpha}{ A (B + r C) }.

ex2 := \partial_{\alpha}{ (A + r B) (C + r D) }.


In the first case it treats $(B + r C)$ as a constant. In the second case it produces unrecognizable result. There's no syntax error and the result is wrong which, I suppose, is a problem.

Of course, if one distributes first and then unwraps, the result comes out right. The reason why I need to do the other way around is another problem, which I ask as a separate question.

asked in Bug reports by (290 points)

1 Answer

+1 vote

Well spotted. This was a silly mistake for the default properties of the \sum node. I have now pushed a fix to github, please try again.

answered by (57.2k points)

Sorry, I'm not very good at using github. I'm using Ubuntu. Will it be OK if I just install it again? Thanks.

If you build from github again, just install on top of the existing version.

I haven't yet had time to make new .deb packages.

I failed to build. Here're the outputs...

/Downloads/cadabra-master$ ./configure --prefix=/usr

checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking CFLAGS for maximum warnings... -Wall
checking for lie... yes
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking pcre.h usability... yes
checking pcre.h presence... yes
checking for pcre.h... yes
checking gmpxx.h usability... yes
checking gmpxx.h presence... yes
checking for gmpxx.h... yes
checking pcrecpp.h usability... yes
checking pcrecpp.h presence... yes
checking for pcrecpp.h... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for sigc... yes
checking for modglue... yes
checking for ptywrap... yes
checking system type... Unix
Checking whether to use -fnested-functions with g++... no
checking whether to build the GUI... yes
checking for sigc... yes
checking for gtk... yes
checking for pango... yes
checking for GTKMM... yes
checking for GLIBMM... yes
checking for pangomm... yes
checking for dvipng... yes
checking for latex... yes
checking for breqn package... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/modules/Makefile
config.status: creating tests/Makefile
config.status: creating gui/Makefile
config.status: creating doc/Makefile
config.status: creating src/config.h
config.status: src/config.h is unchanged

/Downloads/cadabra-master$ make

( cd src && make );
make[1]: Entering directory '/home/partha/Downloads/cadabra-master/src'
g++ -g -O2 -Wall --std=c++11 -I. -I../src pkg-config modglue --cflags -D"RELEASE=\"1.45\"" -D"DATETIME=\"date | sed -e 's/ / /'\"" -DHOSTNAME=\"hostname\" -c -o display.o display.cc
In file included from manipulator.hh:26:0,
from display.cc:22:
algorithm.hh:25:27: fatal error: modglue/pipe.hh: No such file or directory
compilation terminated.
Makefile:30: recipe for target 'display.o' failed
make[1]: *** [display.o] Error 1
make[1]: Leaving directory '/home/partha/Downloads/cadabra-master/src'
Makefile:21: recipe for target 'program' failed
make: *** [program] Error 2

You downloaded Cadabra version 1. Try version 2 from


Sorry for the confusion. unwrap is working fine now. Many thanks!