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

I have some really horrendous expressions calculated by evaluate. The map_sympy does not do the job .of simplifications when "simplify" is used. I saw that map_mma() can be used, but everytime I use yields an error that it is not defined (Even though I declared to use the Mathematica Kernel). I really need to know if it is possible to use it

in General questions by (230 points)

1 Answer

+1 vote

This should work:

 ex:=\sin(x)**2+\cos(x)**2;
 map_mma(ex, "Simplify");

and produce "1".

If it does not, something has gone wrong when building Cadabra with Mathematica support. It is possible that your version of Mathematica is too new and was not picked up when you ran cmake -DENABLE_MATHEMATICA=ON ... Try pulling from github; I have just pushed a change which includes an updated FindMathematica.cmake script.

If that still does not work, send me the output of that cmake run by email and I'll have a look.

by (76.2k points)

I just pulled from github and the code

ex:=\sin(x)2+\cos(x)2; map_mma(ex, "Simplify");

Yields NameError: name 'map_mma' is not defined

Then you did not build Cadabra with -DENABLE_MATHEMATICA=ON added to the cmake options, or Mathematica could not be found on your system.

I did it again with cmake -DENABLE_MATHEMATICA=ON .. instead of just cmake .., (I was following the tutorial o github). Now it's working! Thank you!

Is it possible to use map_mma to calculates limits and and integrals, like map_sympy?

I need to check limits in a for loop. Sympy is taking way too long.

Not at present unfortunately, the map_mma function is very rudimentary and does not allow for function arguments.

...