GrassmannCalculus`
CongruenceSimplify |
|
| | ||||
Details and Options
Examples
(1)
Basic Examples
(1)
In[1]:=
<<GrassmannCalculus`
In[2]:=
SetBookVectorAssociation |
Here are two 3-vectors in 4-space.
In[3]:=
v1={1,-2,3,-4}.
[3]v2={2,0,1,1}.
[3]
GradeBasis |
GradeBasis |
Out[3]=
e
1
e
2
e
3
e
1
e
2
e
4
e
1
e
3
e
4
e
2
e
3
e
4
Out[3]=
2⋀⋀+⋀⋀+⋀⋀
e
1
e
2
e
3
e
1
e
3
e
4
e
2
e
3
e
4
If we find their intersection using we get a in the answer. obtains the same result without the .
ToCommonFactor
CongruenceFactor
CongruenceSimplify
CongruenceFactor
In[4]:=
v1⋁v2//
v1⋁v2//★
ToCommonFactor |
Out[4]=
★c(4⋀-5⋀-2⋀+9⋀-2⋀+7⋀)
e
1
e
2
e
1
e
3
e
1
e
4
e
2
e
3
e
2
e
4
e
3
e
4
Out[4]=
4⋀-5⋀-2⋀+9⋀-2⋀+7⋀
e
1
e
2
e
1
e
3
e
1
e
4
e
2
e
3
e
2
e
4
e
3
e
4
CongruenceSimplify
CongruenceFactor
Here is a geometric expression representing a conic section through five points in the plane. can be used to expand the expression into a sum of 3-elements.
CongruenceSimplify
Before applying CongruenceSimplify we must declare the extra vector symbols representing the points.
In[5]:=
★A;
;DeclareExtraVectorSymbols[{P,,,,}];
★ |
2
O
,P
1
P
2
R
1
R
2
In[6]:=
CongruenceSimplify |
P
1
R
2
P
2
R
1
R
1
P
1
R
2
P
2
Out[6]=
〈O⋀P⋀〉〈P⋀⋀〉〈⋀⋀〉O⋀⋀-〈O⋀P⋀〉〈P⋀⋀〉〈⋀⋀〉O⋀⋀+〈O⋀P⋀〉〈P⋀⋀〉〈⋀⋀〉O⋀⋀-〈O⋀P⋀〉〈O⋀P⋀〉〈⋀⋀〉⋀⋀
P
1
P
2
R
2
P
2
R
1
R
2
P
1
R
1
P
2
P
1
R
1
P
2
R
1
R
2
P
1
R
2
P
1
P
2
R
2
P
1
P
2
R
1
R
1
R
2
P
1
P
2
P
2
R
1
R
2
P
1
R
1
R
2
CongruenceSimplify
In[7]:=
★A;
;DeclareExtraVectorSymbols[{P,,,}];
★ |
2
P
0
P
1
P
2
In[8]:=
CongruenceSimplify |
P
2
L
2
2
P
0
L
1
2
P
1
Out[8]=
-P⋀⋀+P⋀⋀P⋀⋀-P⋀⋀P⋀⋀
L
2
2
P
2
L
1
2
L
1
2
P
2
L
2
2
P
0
P
1
L
2
2
P
0
L
1
2
P
1
P
2
CongruenceSimplify
In[9]:=
★ |
2
★ |
e
1
e
2
P
0
★ |
e
1
e
2
P
1
★ |
e
1
e
2
P
2
★ |
e
1
e
2
L
1
★ |
e
1
★ |
e
2
L
2
★ |
e
1
★ |
e
2
Using the alias ★ for CongruenceSimplify, the expression above gives:
In[10]:=
ℰ
1
P
2
L
2
P
0
L
1
P
1
Out[10]=
(-(-+ψ)(((-ξ)+(-)ψ)+((-+)ξ+(-+ψ))+(((-)ξ+(-ψ))+(--+ξ+ψ)))+(-ξ+ψ)((((-)ξ+(-ψ))+(--+ξ+ψ))+(((-ξ)+(-)ψ)+(--+ξ+ψ)))+(-+ξ)((((-ξ)+(-)ψ)+(--+ξ+ψ))-(((-ξ)+(-)ψ)+((-+)ξ+(-+ψ)))))★⋀⋀
e
1
e
2
We can divide out the basis n-element and collect the coefficients of ξ and ψ using .
ExpandAndCollect
In[11]:=
ExpandAndCollect |
ℰ
1
★ |
e
1
e
2
Out[11]=
-+-++-+-+-+(-+--++-++---+--++-+)ξ+(-++--+-++-)+(--+-++-+--++--++-+-)ψ+(-+++---+--+++-+-+--+)ξψ+(--++-+--+)0
2
ξ
2
ψ
|
""

