% Cadabra notebook version 1.0
\documentclass[11pt]{article}
\usepackage{geometry}
\usepackage[usenames]{color}
\usepackage[parfill]{parskip}
\usepackage{breqn}
\def\specialcolon{\mathrel{\mathop{:}}\hspace{-.5em}}
\renewcommand{\bar}[1]{\overline{#1}}
\begin{document}
% Begin TeX cell closed
{\Large\bfseries Superinvariance of super QED}

This notebook shows how to deal with spinors and gamma matrix algebra.
% End TeX cell
{\color[named]{Blue}\begin{verbatim}
{ a,b,c,d,e }::Indices(vector).
\bar{#}::DiracBar.
{ \partial{#}, \ppartial{#} }::PartialDerivative.
{ A_{a}, f_{a b} }::Depends(\partial, \ppartial).
{ \epsilon, \gamma_{#} }::Depends(\bar).
\lambda::Depends(\bar, \partial).
{ \lambda, \gamma_{#} }::NonCommuting.
{ \lambda, \epsilon }::Spinor(dimension=4, type=Majorana).
{ \epsilon, \lambda }::SortOrder.
{ \epsilon, \lambda }::AntiCommuting.
\lambda::SelfAntiCommuting.
\gamma_{#}::GammaMatrix(metric=\delta).
\delta{#}::Accent.
f_{a b}::AntiSymmetric.
\delta_{a b}::KroneckerDelta.
\end{verbatim}}
\begin{verbatim}
Assigning property Indices to a, b, c, d, e.
Assigning property DiracBar to \bar.
Assigning property PartialDerivative to \partial, \ppartial.
Assigning property Depends to A, f.
Assigning property Depends to \epsilon, \gamma.
Assigning property Depends to \lambda.
Assigning property NonCommuting to \lambda, \gamma.
Assigning property Spinor to \lambda, \epsilon.
Assigning property SortOrder to \epsilon, \lambda.
Assigning property AntiCommuting to \epsilon, \lambda.
Assigning property SelfAntiCommuting to \lambda.
Assigning property GammaMatrix to \gamma.
Assigning property Accent to \delta.
Assigning property AntiSymmetric to f.
Assigning property KroneckerDelta to \delta.
\end{verbatim}
{\color[named]{Blue}\begin{verbatim}
::PostDefaultRules(@@prodsort!(%), @@rename_dummies!(%), @@canonicalise!(%), @@collect_terms!(%) ).
\end{verbatim}}
\begin{verbatim}
Assigning property PostDefaultRules to .
\end{verbatim}
{\color[named]{Blue}\begin{verbatim}
susy:= { \delta{A_{a}}   = \bar{\epsilon} \gamma_{a} \lambda, 
         \delta{\lambda} = -(1/2) \gamma_{a b} \epsilon f_{a b} };
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
susy\specialcolon{}= \{\delta{A_{a}} = \bar{\epsilon} \gamma_{a} \lambda, \delta{\lambda} = (\frac{-1}{2})\, \gamma_{a b} \epsilon f_{a b}\};
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
S:= -(1/4) f_{a b} f_{a b} 
              - (1/2) \bar{\lambda} \gamma_{a} \partial_{a}{\lambda};
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}=  - \frac{1}{4}\, f_{a b} f_{a b} - \frac{1}{2}\, \bar{\lambda} \gamma_{a} \partial_{a}{\lambda};
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
@vary!(%)( f_{a b} -> \partial_{a}{\delta{A_{b}}} - \partial_{b}{\delta{A_{a}}},
           \lambda -> \delta{\lambda} );
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}=  - \frac{1}{2}\, ((\partial_{a}{\delta{A_{b}}} - \partial_{b}{\delta{A_{a}}}) f_{a b}) - \frac{1}{2}\, \bar{\delta{\lambda}} \gamma_{a} \partial_{a}{\lambda} - \frac{1}{2}\, \bar{\lambda} \gamma_{a} \partial_{a}{\delta{\lambda}};
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
@distribute!(%);
@substitute!(%)( @(susy) ): @prodrule!(%): @distribute!(%): @unwrap!(%);
@rewrite_diracbar!(%);
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}=  - \partial_{a}{\delta{A_{b}}} f_{a b} - \frac{1}{2}\, \bar{\delta{\lambda}} \gamma_{a} \partial_{a}{\lambda} - \frac{1}{2}\, \bar{\lambda} \gamma_{a} \partial_{a}{\delta{\lambda}};
\end{dmath*}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}= \bar{\epsilon} \gamma_{a} \partial_{b}{\lambda} f_{a b} + \frac{1}{4}\, \bar{\gamma_{a b} \epsilon} \gamma_{c} \partial_{c}{\lambda} f_{a b} + \frac{1}{4}\, \bar{\lambda} \gamma_{a} \gamma_{b c} \epsilon \partial_{a}{f_{b c}};
\end{dmath*}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}= \bar{\epsilon} \gamma_{a} \partial_{b}{\lambda} f_{a b} - \frac{1}{4}\, \bar{\epsilon} \gamma_{a b} \gamma_{c} \partial_{c}{\lambda} f_{a b} + \frac{1}{4}\, \bar{\lambda} \gamma_{a} \gamma_{b c} \epsilon \partial_{a}{f_{b c}};
\end{dmath*}
\begin{verbatim}
Warning: assuming Minkowski signature.
\end{verbatim}
{\color[named]{Blue}\begin{verbatim}
@substitute!(%)( \partial_{c}{f_{a b}} -> \ppartial_{c}{f_{a b}} ):
@pintegrate!(%){\ppartial}: 
@rename!(%){"\ppartial"}{"\partial"}:
@prodrule!(%): @unwrap!(%);
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}= \bar{\epsilon} \gamma_{a} \partial_{b}{\lambda} f_{a b} - \frac{1}{4}\, \bar{\epsilon} \gamma_{a b} \gamma_{c} \partial_{c}{\lambda} f_{a b} - \frac{1}{4}\, \partial_{a}{\bar{\lambda}} \gamma_{a} \gamma_{b c} \epsilon f_{b c};
\end{dmath*}
{\color[named]{Blue}\begin{verbatim}
@join!(%){expand}: @distribute!(%): @eliminate_kr!(%):
@substitute!(%)( \partial_{a}{\bar{\lambda}} -> \bar{\partial_{a}{\lambda}} );
@spinorsort!(%);
\end{verbatim}}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}= \frac{1}{2}\, \bar{\epsilon} \gamma_{a} \partial_{b}{\lambda} f_{a b} - \frac{1}{4}\, \bar{\epsilon} \gamma_{a b c} \partial_{a}{\lambda} f_{b c} - \frac{1}{4}\, \bar{\partial_{a}{\lambda}} \gamma_{a b c} \epsilon f_{b c} - \frac{1}{2}\, \bar{\partial_{a}{\lambda}} \gamma_{b} \epsilon f_{a b};
\end{dmath*}
\begin{dmath*}[compact, spread=2pt]
S\specialcolon{}= (\frac{-1}{2})\, \bar{\epsilon} \gamma_{a b c} \partial_{a}{\lambda} f_{b c};
\end{dmath*}
\end{document}
