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

I have a triple index error because Cadabra replaces an index with another already used. Is this an error in my source or, if not, how to bypass this malfunction? Here is an example notebook:

{i,j,k,l,n#}::Indices.
{i,j,k,l,n#}::Integer(1..3).
\delta{#}::KroneckerDelta.
\epsilon^{i j k}::EpsilonTensor(delta=\delta);
{ A^{i}, B^{i}, C^{i} }::Depends(\commutator{#});
{ A^{i}, B^{i}, C^{i} }::Commuting;

def post_process(ex):
   unwrap(ex)
   eliminate_kronecker(ex)
   canonicalise(ex)
   rename_dummies(ex)
   collect_terms(ex)

commut_rules:={ \commutator{A^{i}}{A^{j}} -> \epsilon^{i j k} A^{k},
            \commutator{A^{i}}{B^{j}} -> \epsilon^{i j k} B^{k},
            \commutator{B^{i}}{B^{j}} -> -\epsilon^{i j k} A^{k},
            B^{i}F^{i} -> 0         };

defC:={  C^{i}->\epsilon^{ i j k} A^j B^{k}/(A^nA^n) };

commAC:=\commutator{A^{i}}{C^{j};

substitute(_,defC);

And I get a Triple index error.

I am using Version 2.4.0 on Ubuntu

Thank you! Jorge

in Bug reports by (180 points)

4 Answers

0 votes

Hi Jorge,

I can confirm the behaviour you are reporting.

I noticed two things:

  • In the expression defC you are using the index n, which is not defined as index (to my understanding n# stands for n1,n2, ...). However , adding n to the list of indices didn't solve the problem, because after evaluating defC the n index is substituted by k whish is in use!
  • The code runs properly if I change the index n to l in the definition of defC .

Hope this could help you to carry on your calculations.

Cheers.

by (9.7k points)
+1 vote

Commenting out the rename_dummies line in the post_process also seems to resolve the issue.

by (610 points)
+1 vote

I think the issue is a problem with the index classification routines not reading 'through' the \pow{...}{...} operator correctly, but I haven't had the time yet to dig further. I would write the division by the norm A^n A^n using a separate symbol (e.g. N) so you can avoid that there is a dummy index in (...)**(-1).

I'll post when I know more.

by (70.9k points)
+1 vote

This is now fixed in 2.4.3.3, which is currently the head of the github master branch.

by (70.9k points)

[It works for me now for the example, Thank you very much! Thanks also for doxdrum and jsem! Jorge] But:

Sorry I have still some bizarre errors : For this notebook

{i,j,k,l}::Indices. {i,j,k,l,n#}::Integer(1..3); \delta{#}::KroneckerDelta; { A^{i}, A2}::Depends(\commutator{#}); { A^{i}, A2 }::Commuting;

def post_process(ex): unwrap(ex) eliminate_kronecker(ex) canonicalise(ex) rename_dummies(ex) collect_terms(ex)

defA2:={A2-> A^{l}A^{l}};

A2→A^iA^i

exp:=A^kA^k \delta^{i j} /A2;

A^{k} A^{k} \delta^{i j} (A2)**(-1)

substitute(exp,defA2);

A^{i} A^{i} (A^{i} A^{i})**(-1)

The \delta dissappeared!

Thanks Jorge

...