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

I have an elementary question. I would like to do this:

ex := A B;
asym(_, $A,B$);
Rule := {
x -> @(ex)
};

but without introducing ex as an intermediate. So something like:

Rule := {
x -> @asym($A B$, $A,B$)
};

I'm sure there must be a way to do it in Cadabra 2 but I cannot figure it out... Probably some python knowledge is needed!

asked in General questions by (310 points)

1 Answer

+1 vote

Not possible at the moment. The @ operator which pulls a Python expression into a maths expression does not do any evaluation. It would be nice to be able to write

Rule := {
    x -> @{ anything python that produces an Ex }
};

but at the moment that does not exist.

answered by (54.1k points)

Thanks for the answer! I was driving myself nuts trying to figure out how to do it... ;-)

...