You probably do not need this notebook. The normal way to use Cadabra in Jupyter is either the Cadabra2 kernel, or an ordinary Python notebook with the Cadabra extension loaded through %load_ext cadabra2_jupyter. Both let you write standard Cadabra notation, just like in Cadabra's own notebook interface; see Cadabra in Jupyter for details.
This notebook is only relevant if you can use neither the kernel nor the extension, and instead rely on accessing Cadabra's expression and property objects directly, through the cadabra2 Python module, from plain Python code. It shows the absolute basics. The first thing to do is to import the cadabra2 module. To save typing, we will import everything into the global namespace.
from cadabra2 import *
from IPython.display import display, Math, Latex
Expressions are declared by typing them as standard LaTeX, and feeding that into the Ex object. The result is a standard Python object.
ex=Ex(r"A_{m n} B^{m n}")
Without the Cadabra kernel or extension, expressions are not typeset automatically. You can get the nicely typeset form of an expression through IPython's display functions:
display(Math(str(ex)))
Properties get assigned to symbols or patterns by using their Cadabra name,
Symmetric(Ex(r"A_{m n}"))
AntiSymmetric(Ex(r"B_{m n}"))
Cadabra algorithms are ordinary python functions. They always act on the expression that you pass it, and modify it in-place. Here's an example: the contraction of an antisymmetric and a symmetric tensor is zero:
display(Math(str(canonicalise(ex))))
Let's do another example, with substitution. Note how indices get relabelled automatically.
Indices(Ex(r"{m,n,p,q,r,s,t}"))
ex=Ex(r"A_{m n} B^{m p} C_{p q}")
display(Math(str(substitute(ex, Ex(r"A_{m n} -> D_{m q} D^{q}_{n}")))))
For anything beyond this, the Cadabra kernel or the Cadabra extension (see Cadabra in Jupyter) is a much more convenient way to work. Questions can be sent to info@cadabra.science.