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

Is there a way to label an object in Cadabra?

Suppose I wanted to define some tensor $T^{a b c}_{e f}$, gives it some properties (e.g. make some indices antisymmetric or something, give it some rules...). Could I then use multiple copies, each having a different label?

Or in the very simple case, could I do something like define a momentum vector which has one vector index and one label, so I can have e.g. $p_1 \cdot p_2$ and similar?


in General questions by (200 points)
edited by

1 Answer

+2 votes
Best answer

From (which I have just pushed to github) you can use the auto-declare syntax for this, using the # character after the name. So e.g.

T#^{a b c}_{e f}::TableauSymmetry(shape={1,1}, indices={3,4});
ex:=T1^{a b c}_{e f} T2^{e f g}_{h i} + T1^{a b c}_{e f} T2^{f e g}_{h i};

to produce zero.

by (66.3k points)
selected by