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:

corresponding to , andlterm E1^a*gamma^a^b^mu*A^mu*e1^b.

corresponding to ). Furthermore, while physicists usually write vector indices explicitly in the formulas, in LanHEP vector indices also can be omitted:lterm E1*gamma^mu*e1*A^mu.

Generally speaking, when the user omits indices in the expressions, LanHEP faces two problems: which indices were omitted and how to contract indices.lterm -i*ee*E1*gamma*e1*A.

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

its first index is spinor and the second one belongs to thespinor q:('some quark', color c3).

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

- the form
`Y^a^b^c^d^e^f`means that the user wrote all the indices explicitly; - the form
`Y^a^b^c^d^e`means that the user omitted`spinor`index and wrote`vector`and`color c8`ones; - the form
`Y^a^b`means that the user omitted`spinor`and`color c8`indices and wrote only two`vector`ones; - the form
`Y`means that the user omitted all indices; - all other forms, involving different number of written indices, are incorrect.

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

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

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

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 -matrix, spinor index of electron is contracted with
antispinor index of -matrix and antispinor index of
positron is contracted with spinor index of -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 -matrices the situation is more ambiguous. Let's look at the term corresponding to the electron anomalous magnetic moment . The correct LanHEP expression is

Here vector indices can't be omitted, since it lead to the contraction of vector indices of -matrices. One can see also that the forme1*(gamma^mu*gamma^nu - gamma^nu*gamma^mu)*E1*F^mu^nu

will correspond to the expression . Here LanHEP has got scalar Lorentz-invariant expression in the Lagrangian term, so it has no reason to report an error.e1*E1*(gamma^mu*gamma^nu - gamma^nu*gamma^mu)*F^mu^nu

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

declares a new objectlet d=A1*c1+c2*A2.

Arrays

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

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

let tau2 = {{0,-i}, {-i,-0}}.

let tau3 = {{1,-0}, {-0,-1}}.

The declaration of objects with three `explicit' indices can be done using the objects already defined. For example, when -matrices are defined as before, it is easy to define the vector as

The objectlet tau = {tau1, tau2, tau3}.

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 can read as

One can easily see that the components are listed here in the following order: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}}}.

.The declaration of more complex objects such as structure constants can be made in the same way.