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

Hi! I am new to Cadabra and faced the following issue with contraction of indices.

Define a metric in dimension N as follows

g_{i j}::Metric;
g^{i j}::InverseMetric;

Now, if I run

_:= g_{i}^{i}:

the output is (as expected) N

On the other hand, if I set up an equation, it appears not to work.

_:= N = g_{i}^{i}:

In this case, the output is


and the contraction is not simplified on the right hand side of the equation.

Any help will be appreciated!

asked in General questions by (320 points)

1 Answer

+2 votes
Best answer

That's a bug, thanks for reporting it. Try

_:= N = g_{i}^{i} + 1

It's the edge-case of a single term with a single factor on the rhs which is not handled correctly. Will fix.

answered by (62.3k points)
selected by

Now fixed on github.