(1) -> (1) -> Value = # (1) -> )co grassmann Compiling FriCAS source code from file /home/fauser/fricas/grassmann.spad using old system compiler. GRAS abbreviates domain GrassmannAlgebra processing macro definition PI ==> PositiveInteger processing macro definition NNI ==> NonNegativeInteger processing macro definition SINT ==> SingleInteger processing macro definition T$ ==> -- the constructor category processing macro definition Impl ==> -- the constructor capsule ------------------------------------------------------------------------ initializing NRLIB GRAS for GrassmannAlgebra compiling into NRLIB GRAS processing macro definition New ==> (elt Rep new)(dim,elt(K,Zero)) compiling exported characteristic : () -> NonNegativeInteger Time: 0.15 SEC. ... ; /home/fauser/fricas/GRAS.NRLIB/GRAS.fasl written ; compilation finished in 0:00:01.233 ------------------------------------------------------------------------ GrassmannAlgebra is now explicitly exposed in frame frame1 GrassmannAlgebra will be automatically loaded when needed from /home/fauser/fricas/GRAS.NRLIB/GRAS (1) -> GR:=GrassmannAlgebra(4, Fraction(Integer), matrix [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (1) GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1] ]) $$ GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) \leqno(1) $$ Type: Domain (3) -> e12:=monomial(1,[1,2])$GR (3) e e 1 2 $$ {e \sb {1}} \ {e \sb {2}} \leqno(3) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (4) -> e3:=monomial(1,[3])$GR (4) e 3 $$ e \sb {3} \leqno(4) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (5) -> e12 /\ e3 (5) e e e 1 2 3 $$ {e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \leqno(5) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (6) -> e3/\e12 (6) e e e 1 2 3 $$ {e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \leqno(6) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (7) -> e1:=monomial(1,[1])$GR (7) e 1 $$ e \sb {1} \leqno(7) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (8) -> e1/\e3 (8) e e 1 3 $$ {e \sb {1}} \ {e \sb {3}} \leqno(8) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (9) -> e3/\e1 (9) - e e 1 3 $$ -{{e \sb {1}} \ {e \sb {3}}} \leqno(9) $$ Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (10) -> lc(e1,e3) (10) 0 $$ 0 \leqno(10) $$ ## ## BF: It seems that the interpreter cannot handle the construction of ## the matrix and the definition of the type in a single stroke ## Type: GrassmannAlgebra(4,Fraction(Integer),[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]) (17) -> GR:=GrassmannAlgebra(4,Expression(Fraction(Integer)),matrix [[b(i,j) for j in 1..4] for i in 1..4]) There are no library operations named b Use HyperDoc Browse or issue )what op b to learn if there is any operation containing " b " in its name. Cannot find a definition or applicable library operation named b with argument type(s) PositiveInteger PositiveInteger Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. FriCAS will attempt to step through and interpret the code. There are no library operations named b Use HyperDoc Browse or issue )what op b to learn if there is any operation containing " b " in its name. Cannot find a definition or applicable library operation named b with argument type(s) PositiveInteger PositiveInteger Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. ## ## BF: so we need to define a matrix B first ## (13) -> B:=matrix [[b[i,j] for j in 1..4] for i in 1..4] +b b b b + | 1,1 1,2 1,3 1,4| | | |b b b b | | 2,1 2,2 2,3 2,4| (13) | | |b b b b | | 3,1 3,2 3,3 3,4| | | |b b b b | + 4,1 4,2 4,3 4,4+ $$ \left[ \begin{array}{cccc} {b \sb {1, \: 1}} & {b \sb {1, \: 2}} & {b \sb {1, \: 3}} & {b \sb {1, \: 4}} \\ {b \sb {2, \: 1}} & {b \sb {2, \: 2}} & {b \sb {2, \: 3}} & {b \sb {2, \: 4}} \\ {b \sb {3, \: 1}} & {b \sb {3, \: 2}} & {b \sb {3, \: 3}} & {b \sb {3, \: 4}} \\ {b \sb {4, \: 1}} & {b \sb {4, \: 2}} & {b \sb {4, \: 3}} & {b \sb {4, \: 4}} \end{array} \right] \leqno(13) $$ ## ## BF: Now we can define the type, however the printout of this type is pretty ## ugly using the '*02b' type of symbol, later output seems to be OK, see ## below ## Type: Matrix(Polynomial(Integer)) (18) -> GR:=GrassmannAlgebra(4,Fraction Polynomial(Integer),B) (18) GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1 ,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2) ,*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) $$ GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) \leqno(18) $$ Type: Domain (20) -> e(2)$GR (20) e 2 $$ e \sb {2} \leqno(20) $$ Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (21) -> e(1)$GR (21) e 1 $$ e \sb {1} \leqno(21) $$ ## ## BF: The volume element seems to be OK, it has to have grades 4,2,0 and ## the permutations and signs of the involved indices look good either ## Note: ## -- the grade 0 part contains the full contraction wrt B ## -- the grade 2 part contains all contractions of e1/\e2/\e3/\e4 (=e1234) ## with b(i,j) including the sign to 'move' the corresponding indices ## to the front B_{1,2}(e1234) = b(1,2)e3/\e4 ## and B_{1,3}(e1234) = B_{1,2}(-e1324) = -b(1,3)e2we4 ## ect Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (22) -> )expose GrassmannAlgebra GrassmannAlgebra is already explicitly exposed in frame frame1 (25) -> (e(1)*e(2)*e(3)*e(4))$GR (25) b b - b b + b b + b e e - b e e + b e e + b e e 1,2 3,4 1,3 2,4 1,4 2,3 3,4 1 2 2,4 1 3 1,4 2 3 2,3 1 4 + - b e e + b e e + e e e e 1,3 2 4 1,2 3 4 1 2 3 4 $$ {{b \sb {1, \: 2}} \ {b \sb {3, \: 4}}} -{{b \sb {1, \: 3}} \ {b \sb {2, \: 4}}}+{{b \sb {1, \: 4}} \ {b \sb {2, \: 3}}}+{{b \sb {3, \: 4}} \ {e \sb {1}} \ {e \sb {2}}} -{{b \sb {2, \: 4}} \ {e \sb {1}} \ {e \sb {3}}}+{{b \sb {1, \: 4}} \ {e \sb {2}} \ {e \sb {3}}}+{{b \sb {2, \: 3}} \ {e \sb {1}} \ {e \sb {4}}} -{{b \sb {1, \: 3}} \ {e \sb {2}} \ {e \sb {4}}}+{{b \sb {1, \: 2}} \ {e \sb {3}} \ {e \sb {4}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \ {e \sb {4}}} \leqno(25) $$ ## ## BF: The left contraction has the following grading: ## lc (n,m) -> max(m-n,0) (n,m integers defining the grade of ## homogenous input ## ## In the example we would like to see ## lc(e2, e123+b(12)e3-b(13)e2+b(23)e1) : grades 1,3+1 -> 2+0 ## the rsult looks OK Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (31) -> lc(e(2),e(1)*e(2)*e(3))$GR (31) (b + b )b - b b + b e e - b e e + b e e 2,1 1,2 2,3 1,3 2,2 2,3 1 2 2,2 1 3 2,1 2 3 $$ {{\left( {b \sb {2, \: 1}}+{b \sb {1, \: 2}} \right)} \ {b \sb {2, \: 3}}} -{{b \sb {1, \: 3}} \ {b \sb {2, \: 2}}}+{{b \sb {2, \: 3}} \ {e \sb {1}} \ {e \sb {2}}} -{{b \sb {2, \: 2}} \ {e \sb {1}} \ {e \sb {3}}}+{{b \sb {2, \: 1}} \ {e \sb {2}} \ {e \sb {3}}} \leqno(31) $$ ## ## similar calculation for the right contraction Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (32) -> rc(e(1)*e(2)*e(3),e(2))$GR (32) b b + b b - b b + b e e - b e e + b e e 1,2 3,2 1,2 2,3 1,3 2,2 3,2 1 2 2,2 1 3 1,2 2 3 $$ {{b \sb {1, \: 2}} \ {b \sb {3, \: 2}}}+{{b \sb {1, \: 2}} \ {b \sb {2, \: 3}}} -{{b \sb {1, \: 3}} \ {b \sb {2, \: 2}}}+{{b \sb {3, \: 2}} \ {e \sb {1}} \ {e \sb {2}}} -{{b \sb {2, \: 2}} \ {e \sb {1}} \ {e \sb {3}}}+{{b \sb {1, \: 2}} \ {e \sb {2}} \ {e \sb {3}}} \leqno(32) $$ ## ## BF: 'Volume' element, this has to have grades 4+2+0 ## Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (35) -> (e(1)*e(2)*e(3)*e(4))$GR (35) b b - b b + b b + b e e - b e e + b e e + b e e 1,2 3,4 1,3 2,4 1,4 2,3 3,4 1 2 2,4 1 3 1,4 2 3 2,3 1 4 + - b e e + b e e + e e e e 1,3 2 4 1,2 3 4 1 2 3 4 $$ {{b \sb {1, \: 2}} \ {b \sb {3, \: 4}}} -{{b \sb {1, \: 3}} \ {b \sb {2, \: 4}}}+{{b \sb {1, \: 4}} \ {b \sb {2, \: 3}}}+{{b \sb {3, \: 4}} \ {e \sb {1}} \ {e \sb {2}}} -{{b \sb {2, \: 4}} \ {e \sb {1}} \ {e \sb {3}}}+{{b \sb {1, \: 4}} \ {e \sb {2}} \ {e \sb {3}}}+{{b \sb {2, \: 3}} \ {e \sb {1}} \ {e \sb {4}}} -{{b \sb {1, \: 3}} \ {e \sb {2}} \ {e \sb {4}}}+{{b \sb {1, \: 2}} \ {e \sb {3}} \ {e \sb {4}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \ {e \sb {4}}} \leqno(35) $$ ## ## BF: Now some problems with precedence. If we use * and /\ (I really don't ## like the inline version of wedge here). It seems that all products are ## evaluated left associative, which is mathematically totally unexpected ## Look at: ## e(2)*e(3)= b(2,3)+e23 (eij = ei/\ej) ## e(2)*(e34) = b(2,3)e4- b(2,4)e3 + e234 ## e1/\(e(2)*(e(34))) = b(2,3)e14-b(2,4)e13 + e1234 ## compared to ## (e12*e3) = b(2,3)e1-b(1,3)e2 + e123 ## (e12*e3)/\e4 = b(2,3)e14 -b(1,3)e24 +e1234 ## FriCAS gives: Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (40) -> (e(1)/\e(2)*e(3)/\e(4))$GR (40) b e e - b e e + e e e e 2,3 1 4 1,3 2 4 1 2 3 4 $$ {{b \sb {2, \: 3}} \ {e \sb {1}} \ {e \sb {4}}} -{{b \sb {1, \: 3}} \ {e \sb {2}} \ {e \sb {4}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \ {e \sb {4}}} \leqno(40) $$ ## ## BF: In my eyes the wedge should bind more that the * or the wedge should not ## have an inline form at all, to avoide the above confusion, which will ## drive any user crazy... ## ## ## BF: similar problem in the next computation ## Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (42) -> (e(1)*e(2)*(e(3)/\e(4))-lc(e(1),e(2)*(e(3)/\e(4))))$GR (42) - b e e + b e e + e e e e 2,4 1 3 2,3 1 4 1 2 3 4 $$ -{{b \sb {2, \: 4}} \ {e \sb {1}} \ {e \sb {3}}}+{{b \sb {2, \: 3}} \ {e \sb {1}} \ {e \sb {4}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}} \ {e \sb {4}}} \leqno(42) $$ Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (43) -> (e(1)*(e(2)/\e(3)))$GR (43) - b e + b e + e e e 1,3 2 1,2 3 1 2 3 $$ -{{b \sb {1, \: 3}} \ {e \sb {2}}}+{{b \sb {1, \: 2}} \ {e \sb {3}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}}} \leqno(43) $$ Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (44) -> (e(1)*e(2)/\e(3))$GR (44) b e + e e e 1,2 3 1 2 3 $$ {{b \sb {1, \: 2}} \ {e \sb {3}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}}} \leqno(44) $$ Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (45) -> ((e(1)*e(2))/\e(3))$GR (45) b e + e e e 1,2 3 1 2 3 $$ {{b \sb {1, \: 2}} \ {e \sb {3}}}+{{e \sb {1}} \ {e \sb {2}} \ {e \sb {3}}} \leqno(45) $$ Type: GrassmannAlgebra(4,Fraction(Polynomial(Integer)),[[*02b(1,1),*02b(1,2),*02b(1,3),*02b(1,4)],[*02b(2,1),*02b(2,2),*02b(2,3),*02b(2,4)],[*02b(3,1),*02b(3,2),*02b(3,3),*02b(3,4)],[*02b(4,1),*02b(4,2),*02b(4,3),*02b(4,4)]]) (46) -> ## ## so to get sensible output one must type in lots of parentheses, most users ## will not make this or do it the wrong way. Providing only a prefix version ## wedge will prevent such a misguided usage.. ##