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

In fact, there are two questions. First, for example,

{a,b,c,d}::Indices(vector).
tr{#}::Trace.
A::ImplicitIndex(A_{a b}).
B::ImplicitIndex(B_{a b}).
ex:=tr(c A B) tr(A B);
untrace(_);
explicit_indices(_);

A,B are not ImplicitIndex, is it a bug? Second, I rewrite the above code using

{a,b,c,d}::Indices(vector).
tr{#}::Trace.
{A,B}::ImplicitIndex.
ex:=tr(c A B) tr(A B);
untrace(_);
A::ImplicitIndex(A_{a b}).
B::ImplicitIndex(B_{a b}).
explicit_indices(_);

but it doesn't work. The error report is

{RuntimeError: Double index pair a inside a single factor found.

At:
  <string>(9): <module>

Is this another bug?

in General questions by (2.0k points)

1 Answer

+1 vote
 
Best answer

The first problem arises because you did not tell tr over which indices it traces. If you have ImplicitIndex objects inside the trace which have an explicit form listed, then you also need to specify the indices on which tr acts, otherwise it takes those objects out. Perhaps the default is not entirely logical, apologies. So this is easily fixed by using

tr{#}::Trace(indices=vector).

instead.

The second problem was a bug, thanks for reporting it. It is now fixed on github with version 2.3.5.4.

by (80.3k points)
selected ago by

Thanks for your labor. By the way, the question https://cadabra.science/qa/1868/only-one-window-can-be-opened is still unsolved, and I have tried all methods I can consider, including reinstalling the Ubuntu system. Can you give me some further suggestions?

...