File: index_rename.tex

package info (click to toggle)
cadabra2 2.4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,732 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (20 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
\cdbalgorithm{index\_rename}{}

Replace index names. This should preferably be avoided, but can
incidentally come in useful to relabel a large set of numbered indices
in one go, as the following example shows.
\begin{screen}{1,2}
{m#,n#}::Indices(spacetime).
A_{m1 m2 m3} B_{m4 m2};
@index_rename!(%){m}{n}{true};
A_{n1 m2 n3} B_{n4 m2};
\end{screen}
The {\tt true} argument to the algorithm indicates that numbered
indices starting with the given index name should be relabelled too.

Generically, it is a better practise to avoid renaming indices
altogether, and try to set up calculations such that they do not
depend on the names of indices.

\cdbseealgo{substitute}