5.4. IndexRule and IndexRuleDelayed

The function IndexRule relates to Rule exactly in the same way that IndexSet relates to Set. It just introduces Module constructs. The symbol |→ has been introduced. It is input as \[RightTeeArrow], but this input sequence doesn't work with the style used in this notebook (I don't know why).

IndexRule                Construct rule for an indexed expression, at definition time
IndexRuleDelayed        Construct rule for an indexed expression, at evaluation time

Rule  functions for indexed expressions.

Here we have again the problem of repeated indices b:

In[395]:=

{w[a], w[b]}/.w[a_] →T[a, b] v[-b]

Validate :: repeated : Found indices with the same name b .

Throw :: nocatch : Uncaught Throw[Null] returned to top level. More…

Out[395]=

Hold[Throw[Null]]

Using IndexRule the problem disappears:

In[396]:=

{w[a], w[b]}/.IndexRule[w[a_], T[a, b] v[-b]]

Out[396]=

{T_  ^ab v_b^ , T_  ^ba v_a^ }

In[397]:=

{w[a], w[b]}/.w[a_] |→T[a, b] v[-b]

Out[397]=

{T_  ^ab v_b^ , T_  ^ba v_a^ }


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!