-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
clifford2.dem
82 lines (65 loc) · 1.86 KB
/
clifford2.dem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* Copyright (C) 2015 Dimiter Prodanov
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* Clfford 1.0 demo based on atensor demo by Viktor T. Toth
*/
if get('clifford,'version)=false then load("clifford");
("Clifford implements Clifford algebra for Maxima.")$
("Let us begin with the complex algebra")$
clifford(e,0,1,0);
("complex multiplication table")$
mtable2();
("split-complex algebra")$
clifford(e,1,0,0);
("split-complex multiplication table")$
mtable2();
("dual number algebra")$
clifford(e,0,0,1);
("dual number full multiplication table")$
mtable2();
("Quaternion algebra")$
clifford(e,0,2,0);
("here are all elements of the algebra")$
elements();
("quaternion multiplication table")$
mtable2();
("anticommutativity")$
e[2].e[1];
e[1].e[2].e[1].e[2];
("simplification of products")$
e[1].e[2].e[1].e[2], dotsimpc;
e[2].e[1].e[1].e[2];
e[2].e[1].e[1].e[2], dotsimpc;
("simplification of inversions")$
1/e[2] ;
1/e[2], dotinvsimp;
1/(e[1].e[2]);
1/(e[1].e[2]), dotinvsimp;
("full simplification")$
1/(1+e[1]);
1/(1+e[1]), cliffsimpall;
("scalar product")$
e[1]*e[2];
(1+e[1])*(1+e[1]),expand;
("outer product")$
e[1] & e[2];
(1+e[1])&(1+e[1]),expand;
("computation of Quaternion inverses")$
block(
declare([a,b,c,d],scalar),
cc:cc:a+b*e[1]+c*e[2]+d*e[1].e[2],
dd:cinv(cc)
);
("checking the result")$
dd.cc, expand, ratsimp;
%,cliffsimpall;
/* End of demo -- comment line needed by MAXIMA to resume demo menu */