next up previous contents
Next: Checking the correctness of Up: The LanHEP Handbook Previous: Lagrangian expressions   Contents


Omitting indices

Physicists usually do not write all possible indices in the Lagrangian terms. LanHEP also allows a user to omit indices. This feature can simplify the introduction of the expressions and makes them more readable. Compare two possible forms:

lterm E1^a*gamma^a^b^mu*A^mu*e1^b.
corresponding to $g_e \bar e_a(x) \gamma^\mu_{ab} e_b(x) A_\mu(x)$, and
lterm E1*gamma^mu*e1*A^mu.
corresponding to $g_e \bar e(x) \gamma^\mu e(x) A_\mu(x)$). Furthermore, while physicists usually write vector indices explicitly in the formulas, in LanHEP vector indices also can be omitted:
lterm -i*ee*E1*gamma*e1*A.
Generally speaking, when the user omits indices in the expressions, LanHEP faces two problems: which indices were omitted and how to contract indices.

Restoring the omitted indices

When the indexed object is declared the corresponding set of indices is assumed. Thus, if the quark q is declared as

spinor q:('some quark', color c3).
its first index is spinor and the second one belongs to the color c3 type. If both indices are omitted in some expression, LanHEP generates them in the correspondence to order (spinor, color c3). However, if only one index is written, for example in the form q^a, LanHEP has to recognize whether the index a is of color c3 or of spinor types.

To solve this problem LanHEP looks up the list of indices omitting order. By default this list is set to

[spinor, color c3, color c8, vector]

The algorithm to restore omitted indices is the following. First, LanHEP assumes that user has omitted indices which belong to the first type (and corresponding antitype) from this list. Continuing the consideration of our example with particle q one can see that since this particle is declared having one spinor index (the first type in the list) LanHEP checks whether the number of indices declared for this object without spinor index equals the number of indices written explicitly by user. In our example (when user has written q^a) this is true. In the following LanHEP concludes that the user omitted the spinor index and that explicitly written index is of color c3 type.

In other cases, when the supposition fails if the user has omitted indices of the first type in the list of indices omitting order, LanHEP goes to the second step. It assumes that user has omitted indices of first two types from this list. If this assumption also fails, LanHEP assumes that the user has omitted indices of first three types in the list and so on. At each step LanHEP subtracts the number of indices of these types assumed to be omitted from the full number of indices declared for the object, and checks whether this number of resting indices equals the number of explicitly written indices. If LanHEP fails when the list of indices omitting order is completed, error message is returned by the program.

Note that if the user would like to omit indices of some type, he must omit all indices of this type (and antitype) as well as the indices of all types which precede in the list of indices omitting order.

For example, if object Y is declared with one spinor, two vector and three color c8 indices, than

One can say that indices should be omitted in the direct correspondence with abrupting the list of indices omitting order from left to right.

One could change the list of indices omitting order types by the statement SetDefIndex. For example, for default setting it looks like

SetDefIndex(spinor, color c3, color c8, vector).
Each argument in the list is a type of index.

Contraction of restored indices

A dummy index can be contracted only with some another dummy index. LanHEP expands the expression and restores indices in each monomial. LanHEP reads objects in the monomial from the left to the right and checks whether the restored indices are present. If such index appears LanHEP seeks for the restored index of the appropriate type at the next objects. Note, that the program does not check whether the object with the first restored index has another restored index of the appropriate type. Thus, if F is declared as let-substitution for the strength tensor of electromagnetic field (with two vector indices) then expression F*F (as well as F**2) after processing dummy indices turns to the implied form F^mu^nu*F^mu^nu rather than F^mu^mu*F^nu^nu.

This algorithm makes the contractions to be sensitive to the order of objects in the monomial. Let us look again at the QED example. Expression E1*gamma*A*e1 (as well as A*e1*gamma*E1) leads to correct result where the vector index of photon is contracted with the same index of $\gamma$-matrix, spinor index of electron is contracted with antispinor index of $\gamma$-matrix and antispinor index of positron is contracted with spinor index of $\gamma$-matrix. However the expression E1*e1*A*gamma leads to the wrong form E1^a*e1^a*A^mu*gamma^b^c^mu, because the first antispinor index after the electron belongs to positron. Spinor indices of gamma stay free (non-contracted) since no more objects with appropriate indices (so, LanHEP will report an error since Lagrangian term is not a scalar).

Note, that in the vertex with two $\gamma$-matrices the situation is more ambiguous. Let's look at the term corresponding to the electron anomalous magnetic moment $\bar e(x) (\gamma^\mu\gamma^\nu-\gamma^\nu\gamma^\mu)e(x)F_{\mu\nu}$. The correct LanHEP expression is

e1*(gamma^mu*gamma^nu - gamma^nu*gamma^mu)*E1*F^mu^nu
Here vector indices can't be omitted, since it lead to the contraction of vector indices of $\gamma$-matrices. One can see also that the form
e1*E1*(gamma^mu*gamma^nu - gamma^nu*gamma^mu)*F^mu^nu
will correspond to the expression $\bar e(x) e(x) Sp(\gamma^\mu\gamma^\nu)F_{\mu\nu}$. Here LanHEP has got scalar Lorentz-invariant expression in the Lagrangian term, so it has no reason to report an error.

These examples mean that the user should clearly realize how the indices will be restored and contracted, or (s)he has to write all indices explicitly.


Another problem arises when the dummy indices stay free, this is the case for the let statement. LanHEP allows only two ways to avoid ambiguity in the order of indices types: either user specifies all the indices at the name of new symbol and free indices in the corresponding expression, or he should omit all free indices.

In the latter case the order of indices types is defined following the order of free dummy indices in the first monomial of the expression. For example if A1 and A2 are vectors and c1 and c2 are spinors, the statement

let d=A1*c1+c2*A2.
declares a new object d with two indices, the first is a vector index and the second is a spinor index according to their order in the monomial A1*c1. Of course, each monomial in the expression must have the same types of free indices.


The usage of arrays with dummy indices allows us to define matrices conveniently. For example, the declaration of $\tau$-matrices (defined in Section 3.5) can be written as

let tau1 = {{0,-1}, {-1,-0}}.
let tau2 = {{0,-i}, {-i,-0}}.
let tau3 = {{1,-0}, {-0,-1}}.
One can see that in such way of declaration a matrix is written "column by column".

The declaration of objects with three `explicit' indices can be done using the objects already defined. For example, when $\tau$-matrices are defined as before, it is easy to define the vector $\vec{\tau}\equiv(\tau_1, \tau_2, \tau_3)$ as

let tau = {tau1, tau2, tau3}.
The object tau has three indices, first pair selects the element of the matrix, while the matrix itself is selected by the third index, i.e. tau^i^j^a corresponds to $\tau^a_{ij}$.

On the other hand, the declaration of structure constants of a group is more complicated. Declaring such an object one should bear in mind that omitting indices implies that in a sequence of components the second index of an object is changed after the full cycle of the first index, the third index is changed after the full cycle of the second one, etc. For example, a declaration of the antisymmetrical tensor $\varepsilon^{abc}$ can read as

let eps = {{{0,0,0}, {0,0,-1}, {0,1,0}},
let eps = {{0,0,1}, {0,0,0}, {-1,0,0}},
let eps = {{0,-1,0}, {1,0,0}, {0,0,0}}}.
One can easily see that the components are listed here in the following order:
$\varepsilon^{111}, \varepsilon^{211}, \varepsilon^{311},
...epsilon^{321}, \varepsilon^{131},
\; ... \;\varepsilon^{233}, \varepsilon^{333}$.
The declaration of more complex objects such as $SU(3)$ structure constants can be made in the same way.

next up previous contents
Next: Checking the correctness of Up: The LanHEP Handbook Previous: Lagrangian expressions   Contents
Andrei Semenov 2008-02-16