Spinors Extras Package SymbolTutorials »|See Also »

ReplaceSpinor

ReplaceSpinor[expr, x→r]
returns expr with massless or massive spinors x replaced by r, r can be linear combination of massless or massive spinors.
ReplaceSpinor[expr, x{b, a}]
replaces B spinor x with b and A spinor x with a, a and b can be linear combinations of massless or massive spinors.
ReplaceSpinor[expr, patt→r ]
returns expr with all massless or massive spinors that match pattern patt replaced by r.
ReplaceSpinor[expr, patt→{b, a} ]
returns expr with all massless or massive B spinors that match pattern patt replaced by b and all A spinors that match patt with a.
ReplaceSpinor[expr, patt⧴replacement ]
returns expr with all massless or massive spinors that match pattern patt replaced by replacement . patt can have named patterns inside and replacement can use variables matched by those named patterns.
ReplaceSpinor[expr, patt⧴{replacementB , replacementA } ]
replaces B spinors with replacementB and A spinors with replacementA . replacementB and replacementA can use variables matched by named patterns in patt.
ReplaceSpinor[expr, {x{b, a}, patt⧴replacement , ...}]
returns expr with replacement using all given rules.
ReplaceSpinor[expr, {{x1→r1, ...}, {x2→{b2, a2}, ...}, ...}]
returns a List, each element of this list is a result of replacement using subsequent list of rules.
  • ReplaceSpinor behaves similar to built-in ReplaceAll function but replaces only expressions that are found in places where they can be interpreted as objects that scale as square root of four-vector.
Occurrences of replaced label that represent object that scales as square root of four-vector are replaced:
Occurrences of replaced label that don't scale as square root of four-vector are not replaced:
B and A spinors can be replaced by different labels:
Labels representing massive objects can be used, but only occurrences representing objects scaling as square root of four-vector will be replaced:
Occurrences of replaced label that represent object that scales as square root of four-vector are replaced:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
Out[3]=
 
Occurrences of replaced label that don't scale as square root of four-vector are not replaced:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Out[2]=
 
B and A spinors can be replaced by different labels:
In[1]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
Out[3]=
 
Labels representing massive objects can be used, but only occurrences representing objects scaling as square root of four-vector will be replaced:
In[1]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]=
Out[3]=
Out[3]=
Rule with patterns can be used:
RuleDelayed with named patterns can be used:
Change u spinors to v spinors and vice versa:
Change reference vector of all massive B spinors to q:
List of rules can be used:
List of lists of rules can be used, ReplaceSpinor will return list or results:
Any expression can be replaced by any other expression only requirement is that expression is inside symbol in which it can be interpreted as object scaling as square root of four-vector: