# Defining the Rarita-Schwinger action: Action outputs 0

Hello,

I'm completely new to Cadabra and just installed this on my Mac OS laptop. As a first step in familiarising myself with the syntax, I tried to modify the first tutorial of varying the action for the Maxwell gauge field by that of the Rarita-Schwinger action for the gravitino. However, when I define the action, the output is zero, and I don't know what I did wrong. Here is my code:

#Rarita-Scwhinger Action
def post_process(ex):
sort_product(ex)
eliminate_kronecker(x)
canoincalise(ex)
collect_terms(ex)

{\mu,\nu,\rho}::Indices(position=free).
x::Coordinate.

\Gamma_{#}::GammaMatrix(metric=\eta);
\Gamma^{#}::GammaMatrix(metric=\eta);
\eta_{\mu\nu}::Metric;
\partial{#}::Derivative;

\psi_{\mu}::Spinor;
\bar\psi_{\mu}::DiracBar;
\psi_{\mu}::Depends(x).
\bar\psi_{\mu}::Depends(x).

S:=\int{\bar\psi_{\mu}\Gamma^{\mu\nu\rho}\partial_{\nu}\psi_{\rho}}{x};


At this stage I guess the output should just be the action itself since no manipulation has been performed. Yet the output is zero.
Any help is appreciated. Thanks.

It's mostly an issue with not putting brackets at the right places. While Cadabra uses TeX notation, you sometimes have to be a little more explicit than strictly necessary in TeX, in order to avoid ambiguity. So you have to write e.g.

\bar{\psi_{\mu}}


so that it is clear to Cadabra that the \psi_{\mu} is an 'argument' of \bar. Ditto for \partial, which you need to write as

\partial_{\nu}{ \psi_{\rho} }


so that the \psi_{\rho} explicitly becomes an 'argument' of \partial. In your example, the \partial_{\nu}\psi_{\rho} was interpreted as a derivative acting on nothing, multiplied with \psi_{\rho}, giving nothing.

Here's a tidied-up version which works:

#Rarita-Scwhinger Action
def post_process(ex):
sort_product(ex)
eliminate_kronecker(ex)
canonicalise(ex)
collect_terms(ex)

{\mu,\nu,\rho}::Indices(position=independent);
x::Coordinate;

\Gamma{#}::GammaMatrix(metric=\eta);
\eta_{\mu\nu}::Metric;
\partial{#}::Derivative;

\psi_{\mu}::Spinor;
\bar{#}::DiracBar;
\psi_{\mu}::Depends(x);

S:=\int{\bar{\psi_{\mu}} \Gamma^{\mu\nu\rho} \partial_{\nu}{\psi_{\rho}} }{x};


I have fixed a few typos and also changed the index type to 'independent' to prevent Cadabra from raising/lowering index pairs (usually better for susy computations, as you can then keep all indices on the Gamma's upstairs and more easily convert them using vielbeine).

Thank you for taking the time to answer my question. I've used your fixed-up code to define the action, and it works fine.

However, I'm encountering a problem with the variation itself. Since \bar{#}::DiracBar is defined as such, when I try to vary $S$ with respect to

$\delta{\psi_{\mu}}$,

the bar is automatically over the whole of $\delta{\psi_{\mu}}$,

i.e. $\bar{\delta{\psi_{\mu}}}$

S:=\int{\bar{\psi{\mu}} \Gamma^{\mu\nu\rho} \partial{\nu}{\psi{\rho}} }{x};
vary(S, $\psi {\mu}-> \delta{\psi_{\mu}}$);

Is it possible to have 2 separate variations: one with respect to

$\bar{\psi_{\mu}}$,

and one with respect to $\psi_{\mu}$?
Thank you !

If you want to do these variations separately, you need to use a different object for $\bar{\psi}_{\mu}$, and not declare \bar{#} as accent. So e.g.

\bpsi{#}::LaTeXForm("\bar{\psi}").
{\psi_{\mu}, \bpsi_{\mu} }::Spinor;


(the first line is to make the output look nice). You can then write a variation rule for \bpsi_{\mu} separately.

The alternative is to keep the story as you wrote originally, but expand the Dirac bar after you have done the variation. See the expand_diracbar algorithm for details https://cadabra.science/manual/expand_diracbar.html.

(I have removed the question in which you asked the above; please keep related things in one thread on the forum. I read everything, but sometimes do not immediately have time to respond).
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7981271147727966, "perplexity": 1413.5046581338295}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514573832.23/warc/CC-MAIN-20190920050858-20190920072858-00029.warc.gz"}