GrassmannCalculus`
Transform (★) |
|
| | ||||
|
| | ||||
Details and Options
Examples
(2)
Basic Examples
(1)
In[1]:=
<<GrassmannCalculus`
Set the default GrassmannPlane.
In[2]:=
SetActiveAssociation
"Grassmann Plane"
PublicGrassmannAtlas |
Following are some examples of simple transformations. First using a rule.
In[3]:=
x+yTransform[%,yxy]
e
x
e
y
Out[3]=
x+y
e
x
e
y
Out[3]=
x+xy
e
x
e
y
Using a definition:
In[4]:=
f1z_?
:=x+yTransform[%,f1]
ScalarSymbolQ |
2
z
e
x
e
y
Out[4]=
x+y
e
x
e
y
Out[4]=
2
x
e
x
2
y
e
y
Using both:
In[5]:=
x+yTransform[%,yxy,f1]
e
x
e
y
Out[5]=
x+y
e
x
e
y
Out[5]=
2
x
e
x
2
x
2
y
e
y
The following uses a Grade assertion.
In[6]:=
(⋀)⊖zTransform%,
,z∈
e
x
e
y
ToMetricElements |
★Λ
1
Out[6]=
e
x
e
y
Out[6]=
e
y
e
x
e
x
e
y
The following uses rules for the scalar products and the Grade assertion. But since inside is represented as , the rules will not match inside and we must put them outside the .
Transform
z
z
1
Transform
Transform
In[7]:=
zRules={⊖z12,⊖z13};(⋀)⊖zTransform%,
,zRules,z∈%/.zRules
e
x
e
y
e
x
e
y
ToMetricElements |
★Λ
1
Out[7]=
e
x
e
y
Out[7]=
e
y
e
x
e
x
e
y
Out[7]=
-+
e
x
3
e
y
2
Or first convert the internal expression so the rules will match.
In[8]:=
zRules={⊖z12,⊖z13};(⋀)⊖zTransform%,
,z,zRules,z∈
e
x
e
y
e
x
e
y
ToMetricElements |
z
1
★Λ
1
Out[8]=
e
x
e
y
Out[8]=
-+
e
x
3
e
y
2
It might sometimes be useful to define specialized routines with assertions using Transform. The following simplifies more general expressions as above.
In[9]:=
myTransform[vectors_List,scalarRules:{(_Rule|_RuleDelayed)..}][expr_]:=Transformexpr,
[#]&,
[#]&,Thread&/@vectorsvectors,scalarRules,vectors∈
SimplifyExteriorProducts |
ToMetricElements |
#
1
★Λ
1
Then given a set of scalar product rules and an expression, we have:
In[10]:=
pqRules={p⊖12,p⊖13,q⋀2,q⊖3};Sin[x](x)⋀(y)⊖p+Cos[y]⋀⊖q%//myTransform[{p,q},pqRules]
e
x
e
y
e
x
e
y
e
x
e
y
e
x
e
y
Out[10]=
Cos[y]⋀⊖q+Sin[x](x)⋀(y)⊖p
e
x
e
y
e
x
e
y
Out[10]=
-3Cos[y]+(q⊖)Cos[y]-xySin[x]+xySin[x]
e
x
e
y
e
x
1
3
e
x
1
2
e
y
In[11]:=
Clear[f1,zRules,pqRules,myTransform]
Extended Examples
(1)
|
|
""


