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

Hello

At first, thank you for inventing this very good tools

i wondering is there other way to split index

if i use split_index command to split index m to \mu and 5,

i get

A^{m} B_{m} = A^{\mu} B_{\mu} + A^{5} A_{5} 

but

i want this to be

A^{m} B_{m} = A^{\mu} B_{\mu} - A^{5} A_{5}

Is there any good way?

Thank you

in General questions by

2 Answers

+1 vote

In Cadabra the Einstein index summation convention always means just a plain sum, without sign factors. Did you really mean those indices to one upper, one lower? Or does this sign come from a suppressed metric?

by (85.9k points)
+1 vote

With the version of Cadabra currently on github (2.3.1.5) you can write a small function which examines every term in the expression, counts the number of '5' indices, and flips the sign if there is an odd number of pairs. Starting from

{m,n,p}::Indices(space);
{\mu,\nu}::Indices(subspace, parent=space);
ex:=A^{m n} B_{m n};
split_index(ex, $m, \mu, 5$, repeat=True);

which produces AμνBμν+Aμ5Bμ5+A5μB5μ+A55B55, you can define

def flip5(ex):
   for node in ex:
      for term in node.terms():
         cnt=0
         for index in term.indices():
             if index.name=="1" and index.multiplier==5:
                 cnt+=1
         term.multiplier *= (-1)**(cnt//2)
   return ex

and then do

flip5(ex);

to get AμνBμνAμ5Bμ5A5μB5μ+A55B55

by (85.9k points)
...