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

Hi, i'm quite new on this so forgive if obvious or cautioned against in the documentation... but i get some funny stuff with canonicalise

{a, b, c, d, e, f, g}::Indices(position=independent)
F_{a b}::AntiSymmetric; 
{\cal F}_{a b}::AntiSymmetric; 

example1:= F_{a b} F_{c d} - F_{a c} F_{b d} ;
canonicalise(_);

Here canonicalise correctly does nothing and returns F_{a b} F_{c d} - F_{a c} F_{b d}.

However

example2:= {\cal F}_{a b} {\cal F}_{c d} - {\cal F}_{a c} {\cal F}_{b d} ;
canonicalise(_);

returns for me 2 {\cal F}_{a b} {\cal F}_{c d}.

Clearly avoiding the usage of the {\cal F} is the work around but even so.

Cheers D

in Bug reports by (130 points)

A comment about LaTeX, the correct use of calligraphic font should be \mathcal{F}

1 Answer

+1 vote

Cadabra has considerable flexibility in defining symbols, but {\cal F} goes a bit too far. What happens here is that this expression gets interpreted as the product of \cal and F, and then this gets indices added to it. Then all hell breaks loose... Granted, some kind of error message would probably have helped you here.

The easiest way around this is to do

calF_{a b}::AntiSymmetric;
calF_{a b}::LaTeXForm("{\cal F}").

and then

example2:= calF_{a b} calF_{c d} - calF_{a c} calF_{b d} ;

This will display the way you want because of the LaTeXForm property, and saves some typing as well.

by (82.6k points)
...