Axiom/FriCAS - CliffordAlgebra - User Guide

First start up the Axiom or FriCAS Program (if you have not yet installed see this page), then if the CliffordAlgebra code is not yet provided with the built in library you will need to compile (very easy as you can see below), or if it has been compiled in a previous session, use the library command:

)compile CliffordAlgebra
or
)library CLIF

martin@suse111:~> ./fricas
Checking for foreign routines
AXIOM="/usr/share/fricas/usr/local/lib/fricas/target/x86_64-unknown-linux"
spad-lib="/usr/share/fricas/usr/local/lib/fricas/target/x86_64-unknown-linux/lib/libspad.so"
foreign routines found                                                                      
openServer result 0                                                                         
                 FriCAS (AXIOM fork) Computer Algebra System                                
                            Version: FriCAS 1.0.8                                           
              Timestamp: Saturday October 24, 2009 at 02:03:04                              
-----------------------------------------------------------------------------               
   Issue )copyright to view copyright notices.                                              
   Issue )summary for a summary of useful system commands.                                  
   Issue )quit to leave FriCAS and return to shell.                                         
-----------------------------------------------------------------------------               
                                                                                            
(1) ->                                                                                      
(1) -> )library CLIF                                                                        
   CliffordAlgebra is now explicitly exposed in frame frame1                               
   CliffordAlgebra will be automatically loaded when needed from                           
      /home/martin/CLIF.NRLIB/CLIF 

We then need to instantiate an instance of CliffordAlgebra, the constructor takes 3 parameters:

parameter type meaning
1st PositiveInteger dimension of the underling vector algebra
2nd Type type over which this is defined
3rd SquareMatrix of dimension defined by 1st parameter bilinear form

In the following example we will define a 3 dimensional Euclidean space so the bilinear form is the identity matrix:

(1) -> Eu := CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])                

   (1)  CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
                                                                 Type: Domain

Entering Multivectors

We can then create some elements in the algebra (I will call the general element in this algebra a 'multivector' to be consistent with most of the literature). First we can create some basis vectors using e(PI):

(2) -> e1:Eu := e(1)                                                         

   (2)  e
         1
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(3) -> e2:Eu := e(2)                                                         

   (3)  e
         2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])

There are many options for creating higher grade basis,

(4) -> e12:Eu := e(1) /\ e(2)

   (4)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(5) -> e12:Eu := ee[1,2]

   (5)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(6) -> e12:Eu := eFromBinaryMap(3)

   (6)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(7) -> e12:Eu := monomial(1,[1,2])

   (7)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(8) -> p:Eu := ePseudoscalar()

   (8)  e e e
         1 2 3
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])

We can create vectors from a linear sum of its bases and similarly we can create a bivector from a sum of bases with grade 2:

(9) -> v:Eu := 2*e(1) + 3*e(2) + 4*e(3)

   (9)  2e  + 3e  + 4e
          1     2     3
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(10) -> m:Eu := 2*ee[1,2] + 3*ee[1,3] + 4*ee[2,3]

   (10)  2e e  + 3e e  + 4e e
          1 2     1 3     2 3
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])

If we want a more complicated multivector, then it may be easier to specify it in one, by using the multivector function. Note that the indices are specified in binary order, that is multivector[scalar,e1,e2,e12,e3,e13,e23,e123...] so we only need specify the multipliers for these:

(11) -> m:Eu := multivector[0,0,0,2,0,3,4,0]

   (11)  2e e  + 3e e  + 4e e
          1 2     1 3     2 3
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])

Algebraic Operations

We can then do some operations such as:

operator meaning
/\ exterior
\/ regression
* Clifford
lc left contraction
rc right contraction

examples:

(12) -> e1 /\ e2                                                              

   (12)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(13) -> e1 /\ e1                                                              
                                                                                                    
   (13)  0                                                                                           
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])                       
(14) -> e1 \/ e2                                                                                     
                                                                                                    
   (14)  0                                                                                           
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])                       
(15) -> e1 \/ e1                                                                                     
                                                                                                    
   (15)  0                                                                                           
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])                       
(16) -> lc(e1,e2)                                                                                    
                                                                                                    
   (16)  0                                                                                           
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])                       
(17) -> lc(e1,e1)                                                                                    
                                                                                                    
   (17)  1
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(18) -> rc(e1,e2)

   (18)  0
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(19) -> rc(e1,e1)

   (19)  1
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])

Functions

Here are some functions available for the algebra :

coefficient(%,List NNI) extracts the scalar coefficient of a given basis which is specified by a list of indices.
~(%) Clifford dual
gradeInvolution(%) invert (multiply by -1) vector and modify other grades accordingly
reverse(%) reverse order of basis vectors in each blade
conj(%) equivalent to applying both gradeInvolution and reverse
grade(%) returns an integer representing the maximum grade of the non-zero blades in this multivector. 0 for scalar, 1 for vector and so on.

examples:

(20) -> c:Eu := coefficient(p,[1,2])

   (20)  0
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(21) -> c:Eu := coefficient(p,[1,2,3])

   (21)  1
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(22) -> ~e12

   (22)  - 1
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(23) -> gradeInvolution(e12)

   (23)  e e
         1 2
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(24) -> gradeInvolution(p)

   (24)  - e e e
           1 2 3
        Type: CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]])
(25) -> grade(p)

   (25)  3
                                                        Type: PositiveInteger

Tables

We can produce tables (Cayley table) of the built-in operations, unary and binary functions by using 'toTable'. The result is a matrix showing all combinations of the basis for each operand:

(26) -> toTable(lc)$Eu

         +1  e   e   e e   e   e e   e e   e e e +
         |    1   2   1 2   3   1 3   2 3   1 2 3|
         |                                       |
         |0  1   0    e    0    e     0     e e  |
         |             2         3           2 3 |
         |                                       |
         |0  0   1   - e   0    0     e    - e e |
         |              1              3      1 3|
         |                                       |
         |0  0   0   - 1   0    0     0     - e  |
   (26)  |                                     3 |
         |                                       |
         |0  0   0    0    1   - e   - e    e e  |
         |                        1     2    1 2 |
         |                                       |
         |0  0   0    0    0   - 1    0      e   |
         |                                    2  |
         |                                       |
         |0  0   0    0    0    0    - 1    - e  |
         |                                     1 |
         |                                       |
         +0  0   0    0    0    0     0     - 1  +
Type: Matrix(CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]]))
(27) -> toTable(*)$Eu

         +  1       e        e       e e      e       e e      e e    e e e +
         |           1        2       1 2      3       1 3      2 3    1 2 3|
         |                                                                  |
         |  e       1       e e       e      e e       e      e e e    e e  |
         |   1               1 2       2      1 3       3      1 2 3    2 3 |
         |                                                                  |
         |  e     - e e      1       - e     e e    - e e e     e     - e e |
         |   2       1 2                1     2 3      1 2 3     3       1 3|
         |                                                                  |
         | e e     - e       e       - 1    e e e    - e e     e e     - e  |
         |  1 2       2       1              1 2 3      2 3     1 3       3 |
   (27)  |                                                                  |
         |  e     - e e    - e e    e e e     1       - e      - e     e e  |
         |   3       1 3      2 3    1 2 3               1        2     1 2 |
         |                                                                  |
         | e e     - e    - e e e    e e      e       - 1     - e e     e   |
         |  1 3       3      1 2 3    2 3      1                 1 2     2  |
         |                                                                  |
         | e e    e e e     - e     - e e     e       e e      - 1     - e  |
         |  2 3    1 2 3       3       1 3     2       1 2                1 |
         |                                                                  |
         |e e e    e e     - e e     - e     e e       e       - e     - 1  |
         + 1 2 3    2 3       1 3       3     1 2       2         1         +
Type: Matrix(CliffordAlgebra(3,Fraction(Integer),[[1,0,0],[0,1,0],[0,0,1]]))


metadata block
see also:
Correspondence about this page

Book Shop - Further reading.

Where I can, I have put links to Amazon for books that are relevant to the subject, click on the appropriate country flag to get more details of the book or to buy it from them.

flag flag flag flag flag flag Geometric Algebra for Physicists - This is intended for physicists so it soon gets onto relativity, spacetime, electrodynamcs, quantum theory, etc. However the introduction to Geometric Algebra and classical mechanics is useful.
flag flag flag flag flag flag Geometric Algebra for Computer Science: An Object-oriented Approach to Geometry. This book stresses the Geometry in Geometric Algebra, although it is still very mathematically orientated. Programmers using this book will need to have a lot of mathematical knowledge. Its good to have a Geometric Algebra book aimed at computer scientists rather than physicists. There is more information about this book here.

 

This site may have errors. Don't use for critical systems.

Copyright (c) 1998-2017 Martin John Baker - All rights reserved - privacy policy.