{ "cells" : [ { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "\\section*{Indices, dummy indices and automatic index renaming}\n\nIn Cadabra, all objects which occur as subscripts or superscripts\nare considered to be ``indices''. The names of indices are understood\nto be irrelevant when they occur in a pair, and automatic relabelling\nwill take place whenever necessary in order to avoid index clashes. \n\nCadabra knows about the differences between free and dummy indices. It \nchecks the input for consistency and displays a warning when the\nindex structure does not make sense. Thus, the input" } ], "source" : "\\section*{Indices, dummy indices and automatic index renaming}\n\nIn Cadabra, all objects which occur as subscripts or superscripts\nare considered to be ``indices''. The names of indices are understood\nto be irrelevant when they occur in a pair, and automatic relabelling\nwill take place whenever necessary in order to avoid index clashes. \n\nCadabra knows about the differences between free and dummy indices. It \nchecks the input for consistency and displays a warning when the\nindex structure does not make sense. Thus, the input" }, { "cell_origin" : "client", "cell_type" : "input", "source" : "ex:= A_{m n} + B_{m} = 0;" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "will results in an error message." } ], "hidden" : true, "source" : "will results in an error message." }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "The location of indices is, by default, not considered to be\nrelevant. That is, you can write" } ], "hidden" : true, "source" : "The location of indices is, by default, not considered to be\nrelevant. That is, you can write" }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "source" : "\\begin{dmath*}{}\\text{Attached property Indices(position=free) to~}\\left[m,~\\discretionary{}{}{} n\\right].\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "A_{m} + A^{m}" } ], "source" : "\\begin{dmath*}{}A_{m}+A^{m}\\end{dmath*}" } ], "source" : "{m, n}::Indices(name=\"free\");\nex:=A_{m} + A^{m};" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "as input and these are considered to be consistent expressions. You can collect such terms\nby using \\algo{lower_free_indices} or \\algo{raise_free_indices}," } ], "hidden" : true, "source" : "as input and these are considered to be consistent expressions. You can collect such terms\nby using \\algo{lower_free_indices} or \\algo{raise_free_indices}," }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "2A_{m}" } ], "source" : "\\begin{dmath*}{}2A_{m}\\end{dmath*}" } ], "source" : "lower_free_indices(ex);" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "If,\nhowever, the position of an index means something (like in general\nrelativity, where index lowering and raising implies contraction with\na metric), then you can declare index positions to be ``fixed''. This\nis done using" } ], "hidden" : true, "source" : "If,\nhowever, the position of an index means something (like in general\nrelativity, where index lowering and raising implies contraction with\na metric), then you can declare index positions to be ``fixed''. This\nis done using" }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "source" : "\\begin{dmath*}{}\\text{Attached property Indices(position=fixed) to~}\\left[a,~\\discretionary{}{}{} b,~\\discretionary{}{}{} c,~\\discretionary{}{}{} d,~\\discretionary{}{}{} e,~\\discretionary{}{}{} f\\right].\\end{dmath*}" } ], "source" : "{a,b,c,d,e,f}::Indices(name=\"fixed\", position=fixed);" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "Cadabra will raise or lower indices on such expressions to a canonical form when the\n\\algo{canonicalise} algorithm is used," } ], "hidden" : true, "source" : "Cadabra will raise or lower indices on such expressions to a canonical form when the\n\\algo{canonicalise} algorithm is used," }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "G_{a b} F^{a b} + G^{a b} F_{a b}" } ], "source" : "\\begin{dmath*}{}G_{a b} F^{a b}+G^{a b} F_{a b}\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "2G^{a b} F_{a b}" } ], "source" : "\\begin{dmath*}{}2G^{a b} F_{a b}\\end{dmath*}" } ], "source" : "ex:= G_{a b} F^{a b} + G^{a b} F_{a b};\ncanonicalise(_);" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "If upper and lower indices should remain untouched at all times, there is a third index position type,\ncalled `independent'," } ], "hidden" : true, "source" : "If upper and lower indices should remain untouched at all times, there is a third index position type,\ncalled `independent'," }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "source" : "\\begin{dmath*}{}\\text{Attached property Indices(position=independent) to~}\\left[q,~\\discretionary{}{}{} r,~\\discretionary{}{}{} s\\right].\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "G_{q r} F^{q r} + G^{q r} F_{q r}" } ], "source" : "\\begin{dmath*}{}G_{q r} F^{q r}+G^{q r} F_{q r}\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "G_{q r} F^{q r} + G^{q r} F_{q r}" } ], "source" : "\\begin{dmath*}{}G_{q r} F^{q r}+G^{q r} F_{q r}\\end{dmath*}" } ], "source" : "{q,r,s}::Indices(name=\"independent\", position=independent);\nex:= G_{q r} F^{q r} + G^{q r} F_{q r};\ncanonicalise(_);" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "As the last line shows, the index positions have remained unchanged." } ], "hidden" : true, "source" : "As the last line shows, the index positions have remained unchanged." }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "When substituting an expression into another one, dummy indices will\nautomatically be relabelled when necessary. To see this in action,\nconsider the following example:" } ], "hidden" : true, "source" : "When substituting an expression into another one, dummy indices will\nautomatically be relabelled when necessary. To see this in action,\nconsider the following example:" }, { "cell_origin" : "client", "cell_type" : "input", "cells" : [ { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "G_{a b} Q" } ], "source" : "\\begin{dmath*}{}G_{a b} Q\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "Q → F_{a b} F^{a b}" } ], "source" : "\\begin{dmath*}{}Q \\rightarrow F_{a b} F^{a b}\\end{dmath*}" }, { "cell_origin" : "server", "cell_type" : "latex_view", "cells" : [ { "cell_origin" : "server", "cell_type" : "input_form", "source" : "G_{a b} F_{c d} F^{c d}" } ], "source" : "\\begin{dmath*}{}G_{a b} F_{c d} F^{c d}\\end{dmath*}" } ], "source" : "ex:= G_{a b} Q;\nrl:= Q-> F_{a b} F^{a b};\nsubstitute(ex, rl);" }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "The $a$ and $b$ indices have automatically been relabelled to $c$ and $d$\nin order to avoid a conflict with the free indices on the $G_{a b}$ object." } ], "hidden" : true, "source" : "The $a$ and $b$ indices have automatically been relabelled to $c$ and $d$\nin order to avoid a conflict with the free indices on the $G_{a b}$ object." }, { "cell_origin" : "client", "cell_type" : "latex", "cells" : [ { "cell_origin" : "client", "cell_type" : "latex_view", "source" : "You may have noticed that when you write \\verb|T_{a b}| the `\\verb|a b|' in the subscript is\nnot interpreted as a product, but rather as two different indices to the tensor~$T$. " } ], "hidden" : true, "source" : "You may have noticed that when you write \\verb|T_{a b}| the `\\verb|a b|' in the subscript is\nnot interpreted as a product, but rather as two different indices to the tensor~$T$. " }, { "cell_origin" : "client", "cell_type" : "input", "source" : "" } ], "description" : "Cadabra JSON notebook format", "version" : 1 }