SamplePublisher`GrassmannCalculus`
GCMapLevelParts |
|
| | ||||
Details and Options
Examples
(1)
Basic Examples
(1)
In[1]:=
<<GrassmannCalcuus`
The following applies f to the second and forth part of a sum. If the level parts are parts of the entire expression the topposition is omitted.
In[2]:=
a+b+c+d+e//
[f,{{2,4,5}}]
GCMapLevelParts |
Out[2]=
a+c+f[b+d+e]
In the following the level parts are in the first part of a Power expression.
In[3]:=
1/(a+b+c+d+e)%//
[f,{1,{2,4}}]
GCMapLevelParts |
Out[3]=
1
a+b+c+d+e
Out[3]=
1
a+c+e+f[b+d]
In the following we might only want to operate on the first two terms because any of the Trig or Simplify commands will also involve the third term if we apply them to the entire expression.
In[4]:=
2
Sin[x]
2
Cos[x]
2
Tan[2x]
GCMapLevelParts |
Out[4]=
2
Cos[x]
2
Sin[x]
2
Tan[2x]
Out[4]=
1+2
2
Tan[2x]
We can also apply to products .
In[5]:=
abcde%//
[&,{{1,5}}]
GCMapLevelParts |
2
#
Out[5]=
abcde
Out[5]=
2
a
2
e
In[6]:=
abcde%//
[(#1+&)[First[#],Last[#]]&,{{1,5}}]
GCMapLevelParts |
2
#2
Out[6]=
abcde
Out[6]=
bcd(a+)
2
e
And lists:
In[7]:=
{a,b,c,d,e}%//
[f@@#&,{{1,5}}]
GCMapLevelParts |
Out[7]=
{a,b,c,d,e}
Out[7]=
{f[a,e],b,c,d}
|
|
""

