maple clifford package
DOCX · 749.9 KB
Open DOCX file
Phil's notes dated 8.30.15 on whether Maple can do Clifford algebra. They cover finding and installing Rafal Ablamowicz's Cliff5 package in Maple V (libname and maple.ini troubleshooting), then testing wedge and geometric products against hand calculations in Cl(3), which agreed. They also work through what the bilinear form B means, with notes on Korman, Ablamowicz, Wikipedia and Wheeler.
AI-written summary; may contain errors.
Extracted text (machine-read; may contain errors)
The Maple Cliffordlib Package PhL 8.30.15
Question: Does Maple know how to do cliff things?
1. LOCATE AND INSTALL PACKAGE 1
2. PLAY WITH PACKAGE 5
3. Korman notes 8
4. Ablamowicz notes 9
5. Wiki notes on Algebra: K-algebra, subalgebra, ideal 11
6. Wheeler Notes 12
1. LOCATE AND INSTALL PACKAGE
It is not built in, but there is a package that works for Maple V located here:
http://math.tntech.edu/rafal/cliff5/index.html
Now I somewhere have notes for adding a library to Maple. As expected, I don't see such notes anywhere in my Maple folder. The notes are probably off in some folder where I actually did the job. I will now search all of Work for "Maple package". Nothing. Now search just on "package", get 355 hits. Let's try witzend on this. Try Maple AND package AND library. Get 35 hits. Try "Maple library". Nada.
But I now see that the above site has installation instructions! Here they are:
A. For Windows:
The following installation instructions should be general enough to allow for loading and installation of the package under any (hopefully) operating system. If you encounter any problems, please let me know.
• Make sure you run Maple V R. 5.1 dated November 5, 1998 [these packages should run under Maple V R. 5.0 but they have not been tested under this version of Maple. Note: This version won't run under Maple 6 or 7.].
• Download maple.ini file into the \LIB subdirectory in your Maple V directory.
[ I created my own file with the single line they way in there and then put it into the Maple lib folder]
[ I edit the line so it now reads: libname:="C:\Program Files\Maple V Release 5\Cliffordlib",libname: ]
• Create a directory where you will store CLIFFORD's library files and help pages. Default directory name used in maple.ini file is \Cliffordlib in the directory C:\Maplev51. Thus, to use the default names, create first a directory \Maplev51 on the C:\ drive and then a subdirectory \Cliffordlib in the directory C:\Maplev51.
[ I did what they said, my folder Cliffordlib is at top level within the Maple directory. ]
• If you want to install CLIFFORD in a different directory than C:\Maplev51\Cliffordlib, you may do so but you will need to change accordingly the single line in maple.ini. Use the current line shown above as an example. Make sure you type the path correctly and appropriately for your operating system.
[ did it ]
• Download file Cliffordlib.zip (just left click on the link and then save to your system) to C:\Maplev51\Cliffordliband unzip it there using, for example, on a Windows machine WinZip 8.1 (32-bit) for Windows Me/NT/2000/XP. If you don't have any unzipper, download file Cliffordlib.exe (again, just left click on the link and then save to your system) to C:\Maplev51\Cliffordlib and then "install" it, that is, run it to let it unzip automatically in the directory C:\Maplev51\Cliffordlib (make sure that you type the path C:\Maplev51\Cliffordlib into the window 'Unzip to folder:').
[ I have the three files in this new folder]
• If you have any problems with installation under Windows, please contact Dr. Rafal Ablamowicz at [email protected].
So I have to search the web afresh on this subject due to lost notes. There is no help in the little download of three files. Here are the three files I get
My current Maple lib directory has only these files
Where is my maple.ini file? I have no such file on drive C on Black.
One sit says to just put the new files in a folder somewhere, then make a maple.ini which points there and put this ini into the maple lib.
Idea: Let just copy the three new files to my Maple lib area and see what happens. But ouch, they have the same file names, so cannot do it that way!
So lets fire up Maple and see what happens. At least it starts up, but then not so good:
So the instructions were not got enough. How can I view the Maple variable libname? There is a discussion here
There is says you can view libname just by typing it, and I get
So I have a slashes problem here! I put this into my ini file
libname:="C:\Program Files\Maple V Release 5\Cliffordlib",libname:
thinking this was the windows standard. Let's try this instead
libname:="C:\\Program Files\\Maple V Release 5/Cliffordlib",libname:
where I just mimic the system syntax. Well, the libname seems OK, but it cannot find it
Let's try renaming all the little files replacing maple with Cliffordlib. So my little directory now has
Does this help? No, same problem. Try lower case everywhere. Still no go!
So that is not the problem.
OK, lets fire up Alta and see if I didn't add a package there! I see some dirac package files right in the lib directory, but with(dirac) does nothing, nor does readlib(dirac). Another difference is that Alta has stuff in the update folder, whereas block does not. The site above warns to get updated to Maple 5.1 November 5, 1998. Can I download an update? Both Alta and Black are Maple 5.0.
Well, I see no available Maple V updates on the web, nor at waterloo. I think I have to be happy with my version as is. What is on my Maple CD? The usual stuff, no separate update or SP items.
Now, when I look in side the files, I see Cliff5 sometimes. And then in his help thing I see this
So duh, let's try that:
Now we are cooking with gas! The files are back to simple maple names. Here is the ini file line which is right in the maple lib directory,
libname:="C:\\Program Files\\Maple V Release 5/Cliffordlib",libname:
and here is my little added folder
So I guess now I know how to add a package. Is the help on this working?
2. PLAY WITH PACKAGE
Note that this kind of stuff also works now
restart:with(Cliff5):with(Bigebra);
and you get that package too. The man pages are all good!
OK, here is a useful help item:
So e1e2 is written e1we2. Makes complete sense. Identify is Id. So here you see the basis for CA[R3]. Now how do you do a wedge product?
This is saying:
A = 1 + e3 ^ e2 - 3 ej ^ ei^e3
B = 2 + e1 ^ e2 ^ e3 + 3 ej ^ ei ^ e3
The claimed result is
A^B = 2 - 2e2^e3+ 3e3^ei^ej + e1^e2^ e3
They allow undetermined integers like i and j here, velly intellesting.
Let's try the geometric product I did by hand:
A = 2 + 3e1 + 4 e23 + 5 e123
B = 1 + 2e1 + 2 e13 + e123
and after much fiddling I found by hand that,
AB = 3 + 3e1 + 10e2 + 6e3 + 8e12 + 4 e13 + 17 e23 + 15 e123 .
Let's give it a whirl. But how do you do a geometric product in Cliff5. Here is one obscure way:
Their answer (if I did it right in Maple) is thus,
3 + 3e1 + 17 e2e3 + 15 e1e2e3 + 4e1e3 + 6 e3 + 8 e1e2 + 10e2
which I manually reorder to get
3 + 3e1 + 10e2 + 6 e3 + 8 e1e2 + 4e1e3 + 17 e2e3 + 15 e1e2e3
I put in red the terms that agree with my manual result. So we agree exactly!
Perhaps the K thing is the metric tensor?
The things like e1wee2 are called "the Grassman basis monomials" by Maple.
The name of the algebra is called Cl(V,B) where V is a read vector space and B is the "bilinear form" for that vector space. I am not sure what that means. Is it a scalar product?
V is set to dim = 9 by default, I guess just to give some headroom.
Clifford product in Cl(V,B) is given by the procedure Cliff5[cmul], while the wedge product is given by the procedure Cliff5[wedge].
Let's try one wedge product and then call it quits. I used the same multivectors as above
A = 2 + 3e1 + 4 e23 + 5 e123
B = 1 + 2e1 + 2 e13 + e123
and manually this is what I got
A^B = 2 + 7e1 + 4 e13 + 4 e23 + 15 e123 .
Here is the Maple version (same result by two syntaxes)
and I translate their result to
2 + 7 e1 + 4e1e3 + 4 e2e3 + 15 e1e2e3
= 2 + 7 e1 + 4e13 + 4 e23 + 15 e123
and they agree. So I got Maple to compute the two examples in my cliff review 1 doc, and things agree.
Question: What does Maple mean by saying B is "the bilinear form" ? I think this is just a 2-multilinear function. I thought Hitchin was going to help me on this since he uses a bilinear form and even calls it B, but I think that was a red herring. Can I find some general doc on the Maple package that is more than just the man pages?? Start again here
http://math.tntech.edu/rafal/cliff5/index.html
"Procedure 'cmul' and its infix form '&c' give the Clifford multiplication in the Clifford algebra of an arbitrary bilinear form B "
So what does this red phrase mean? I at least find this phrase in a Korman pdf, so take a look there.
3. Korman notes
OK, this is that idea of excluding xx stuff that I have never understood. What is a "free" algebra? Is the function g(a,b) here symmetric? It must be in order to obtain result (2) below
I tried on this elsewhere and could not grok this ideal. But let's continue anyway
So orthogonal must mean that g(v,w) = 0 where g is the "bilinear form".
Comment: Notice the word "metric" here. Korman is here assuming that the metric matrix gij is diagonal with the above diagonal elements. I show elsewhere how gij and g(x,y) are related.
This is in my language at least. But what happened to g? Are they saying g is diagonal? [yes] Well, our friend Korman is off and running with me lost in the dust.
4. Ablamowicz notes
Next, I am viewing a PDF of Ablamowicz which opens with
Pause to look at M&M page 317:
A bilinear form is a second degree poly in 2n variables x and y and there are several ways to write it
A(x,y) = xTA y // M&M use an over-twiddle to mark transpose instead of T.
= ΣijAijxiyj // = x A y in some worlds
Comment: If you break A into As + Aa in the usual manner, Aa makes no contribution to A(x,y), so you might as well assume that A is symmetric.
This thing is in fact linear in x and in y. so my earlier guess was pretty good. If we set x = y we get
A(x,x) = xTA x = ΣijAijxixj ≡ Q(x)
This thing is a quadratic form , obviously not linear in x. Obviously
Q(αx) = α2 Q(x)
Now one could define
2g(x,y) = Q(x-y) - Q(x) - Q(y) = ΣijAij(x-y)i(x-y)j - ΣijAijxixj - ΣijAijyiyj
= - ΣijAij[ xiyj + yixj]
as done in my new Ablamowicz paper. Why is this thing useful? It is a "bilinear form", that is true, and that is what I am looking for. It is symmetric. Claims one can always diagonalize g with a choice of basis.
He then blathers for a while, then we come to
This is a confusing statement. Maybe it means an algebra of the elements ei to which we simply add the condition that {ei,ej} = 2gij [ anticommutator notation] .
OK, now maybe this is something I can chew on. From above I have
2g(x,y) = - ΣijAij[ xiyj + yixj] x = Σixiei
2g(en,em) = - ΣijAij[ (en)i(em)j + (em)i(en)j] ≡ 2 gnm // wrong! See comment below.
But alas, this makes no sense in terms of vector notation, compared to (5) above [see comment below]. If I try installing unit vectors, then this says
2g(en,em) = - ΣijAij[ δniδmj +δnnδnj] = -(Anm+ Amn) = -2 Anm if A is symmetric
so he has lots me and I cannot go on. So A has had his two cents. The above stuff is parroted in the wiki site on Clifford.
Comments: In R3 one writes basis vectors ei with components (ei)j = δij . One does not talk about something like e1e2 because that makes no sense in the vector space R3. But the ei are also basis vectors in a different vector space which is Cl(2), say, whose basis elements are 1, e1, e2, e12. Now within this vector space, the combination e1e2 does make sense, and we have in fact that e1e2 = e12. So maybe it would be good to not bold ei when you think of it as a Clif, and bold it as ei when an element of R3. This is what confused me above. Some authors, however, like Ablamowicz above, choose to embolden all elements of Cl(2) as in (5) and (6) above , where 1 is the Cl(2) identity. So then you cannot tell just by looking at the symbol whether it is meant to be an element of Rn or Cl(n). You have to tell by the context. So in my confusion above, I mix these together and get a meaningless result!
5. Wiki notes on Algebra: K-algebra, subalgebra, ideal
Here is wiki on "Algebra over a Field":
So the objects x and y above are elements of vector space A. The scalars are elements of field K, so that is where the K comes in. As I know, R and C are fields, as are the Galois finite fields, so I guess any of these could be K (aka the Base Field). Now why is the above called "bilinear"? For a function that means
f(ax + by, ....) = af(x, ....) + bf(y, ....)
Let's try this for the above algebra:
(αx+βy)z = α xz + β yz
This what you would mean by "the operation is linear in the first vector". But this is really the same as saying the is "right distributive" since z is on the right. So if the operation is both left and right distributive, then I agree that is linear in both arguments, and that is where "bilinear" comes from.
There follows a possibly useful discussion of subalgebras and ideals.
In Galois, remember that a ring has and + and is a field except it may have no mult identity and may not have a mult inverse for all elements. A "ring with identity" has the g-1 possibly missing. I then talked there about an ideal within a ring. r•I = I•r = I. was the key idea, where r is anywhere in the ring.
Here the discussion is a little different. Galois doc does not even use the words algebra or module. So first, what is "an algebra"? Wiki says it is a "structure has an addition, multiplication, and a scalar multiplication ". Notice they are not calling it a "vector space" or a "set of elements".
An "algebra over a field" is a "vector space" equipped with a "bilinear product" xy. The vector space part means you can do vector addition and scalar multiplication, so the new feature is multiplication of vectors. The scalars are in the field. If the scalars were instead elements of a ring (where there may be scalars which have no inverses and there may be no identity scalar) , then you have a vector space over a ring, and that is what a module is. There is more to the module world, but I think that is the main idea. Note that "vector space" by default implies the related scalars are in a field.
An algebra over a field K (known as a K-algebra) may or may hot have the associative property under the operation. So perhaps (AB)C ≠ A(BC) where is the arbitrary op (I call * in Galois). The cross product is an example of this ≠. Unital = unitary means there is a multiplicative identity.
Suppose A is a K-algebra and we want to have L be a subalgebra. What does that require? For any pair x and y in L and c in K you must have xy and yx both in L, AND cx must be in L.
An ideal is a subalgebra with an extra requirement:
left-ideal: extra requirement is that zx is in L for any z in A (z on the left)
right-ideal: extra requirement is that xz is in L for any z in A (z on the right)
ideal: both the above
In Galois I write rI = Ir = I so this is the same idea. There r was an element of ring R, whereas here r would be an element of an algebra A, that clement called z above instead of r. Same idea!
Resume 9.1.15.
6. Wheeler Notes
Wheeler has some things to say. He works a lot with the basis vectors ei but then he brings up the subject of what happens if they are not orthogonal. He is only thinking R2 at this point. He says,
So this is the first author I have found who talks about "metric". To get the last line here, we have to back way up to an earlier section where he says,
What does 20 say? I will put indices down for the moment just to make typing easier.
x = Σi xiei would be an expansion of a vector x
The left side of (20) says (x12 + x22)I. So then (20) reads: (x12 + x22)I = x x = x2 which seems pretty reasonable as a thing to "posit". Now write out the RHS
x2 = (x1e1+ x2e2) (x1e1+ x2e2) = x12e12 + x22e22 + 2(e1e2+e2e1)
So then we have
(x12 + x22)1 = x12e12 + x22e22 + 2(e1e2+e2e1)
Write out more generally:
Σixi2 I = (Σixiei) (Σjxjej) = Σi [ Σj xieixjej]
Alternately,
Σixi2 I = (Σjxjej) (Σixiei) = Σj [ Σi xjejxiei] = Σi [ Σj xjejxiei]
Add these two equations to get
2 Σixi2 I = Σi[ Σj xixj ( eiej + ejei)]
For this to be true for any xi components, we would want to have
eiej + ejei = 2 δijI
and this is (21). Setting i = j gives ei2 = 1 and setting i ≠ j gives eiej = - ejei, as he goes on to say,
He goes on with very clear statements:
So what is he saying here? In an "algebra" you will consider lots of products of elements of the algebra. When you do such products, you will end up with products of the ei . But all these basis vector products boil down to only 4 possible forms as listed above. Thus, it must be that (23) is the most general form you can have for any element of the algebra. This I recognize as scalar + vector or Cl(2).
Now let's stop that thread and jump ahead to page 17 where we were above, and where he says (I repeat),
which compare to the earlier result // note he says g is symmetric!
M&M would refer to δijxixj as a quadratic form with A = 1
A(x,x) = xTA x = ΣijAijxixj ≡ Q(x)
and we are generalizing this from A = 1 to A = g. As noted above, you might as well assume g is symmetric. So g here is a "quadratic form" matrix and for me it is "similar to" a metric tensor, but we don't have ds = gijdxidxj, we have this for full vector components, not differential ones. So perhaps you could define A(x,x) = the norm ||x||2 and then || x - y||2 would be the "natural metric". Then
Q(x) = A(x,x) = ||x||2
d(x,y)2 = || x - y||2 = Q(x-y) = ΣijAij(xi-yi)(xj- yj) = A(x,x) + A(y,y) - 2 A(x,y)
= Q(x) + Q(y) - 2A(x,y)
where now we have defined a new object which is
A(x,y) = ΣijAijxiyj = "a bilinear form".
Here if A = As+ Aa you could have Aa playing a role, but it seems to me we already threw out Aa.
So if we do this, then you could say that A(x,y) is related to the metric d(x,y) . Note that
Q(x-y) = Q(x) + Q(y) - 2A(x,y)
or
2A(x,y) = Q(x) + Q(y) - Q(x-y)
Now recall from above the Ablam statement that
Conclusion: this "polar bilinear form of Q" g(x,y) is related to the natural "metric tensor" for the metric as defined above
d(x,y)2 = Q(x) + Q(y) - 2g(x,y)
where d(x,y) is the metric. So g(x,y) is not itself "the metric" , it is related to the natural metric d(x,y). I don't really see any metric tensors here.
So back to Wheeler again:
I think we just repeat the math we did earlier and we arrive at this point (adding two equations)
2 Σigijxixj I = Σi[ Σj xixj ( eiej + ejei)]
For this to be true for any xi components, we would want to have
eiej + ejei = 2 gijI
and now we no longer have simple alternation negation of eiej. So the suggestion is made to define a NEW object eij as follows:
I verify:
eij = eiej - gij
eji = ejei - gji = [ 2gij- eiej] - gji = - [eiej - gij] = - eij of g is symmetric!
He now writes
f = (1/2) εijeij = (1/2) [ e12 - e21] = e12 with this new eij
and he then continues:
Now he is just "working out" the multiplication table for this little CL(2) algebra. In the last item
f f = e12e12 = (e1e2- g12) (e1e2- g12) = e1e2e1e2 - g12 e1e2 - g12 e1e2 + g122
= e1e2e1e2 - 2 g12 e1e2 + g122
But now write
e2e1 = - e1e2 + 2g12
Then we get
ff = e1e2e1e2 - 2 g12 e1e2 + g122
= e1[- e1e2 + 2g12]e2 - 2 g12 e1e2 + g122
= - g11g22 + 2g12e1e2 - 2 g12 e1e2 + g122
= - g11g22 + g122 = - [g11g22 -g122] = - det(g) ≡ - g
He then goes on to write c and C as arbitrary elements of this Cl(2) and it is closed.
Wheeler then carries on where I don't care to follow right now. He is using the real tensor algebra notation with up and down indices, he talks about ε having weight 1 and g having weight 2 and all that stuff that is no mystery to me anymore. But right now I am just interested in his metric related matrix g. In his world it is just a 2x2 matrix. But what I have seem above is that this matrix defines a bilinear form in this manner [ recall isomorphism comment of an earlier author] .
g(x,y) = Σijgijxiyj
so one could say that Wheeler is talking about "Cl(2) of an arbitrary bilinear form g(x,y) "
I suspect that this generalizes to the following:
Cl(Rn; g) g = bilinear form
g(x,y) = Σijgijxiyj = bilinear form
but no one has said this so far. I would then expect some complicated definitions for eij and eijk and so on, with some very messy multiplication table. But the eij piece would probably be the same as above.
Comment: Suppose we were to write u = Σiuiei and v = Σkvkek. Then
uv+vu = (Σiuiei)(Σkvkek) + (Σkvkek)(Σiuiei)
= Σik uivk[eiek + ekei] = Σik uivk 2gik = 2 Σik gikuivk = 2 g(u,v)
Therefore we have
eiej + ejei = 2 gij uv + vu = 2 g(u,v) v2 = g(v,v)
Now what happens to wedge products if we use this general g(x,y) thing? Wheeler has no wedges until page 29 after doing rotation and Lorentz group connections.
Wheeler says that the wedge product should always have this definition,
For example, he wants
ε123 ≡ (1/6) [ e1 ^ e2 ^ e3] = (1/6) [ e1e2e3 + signed permutations ]
= (1/6) [ e1e2e3 - e2e1e3 + ...]
So his definition of the wedge product then has nothing directly to do with gij. However, the gij metric thing is injected into the theory in the expected way
so when you try to combine terms in the antisym wedge product, various gij things will appear. So he is really saying three things above:
1. The connection that eijk ≡ ei ^ ej ^ ek which we used earlier remains as it was.
2. The wedge product is defined as it has always been defined as the sum shown.
3. The connection eijk ≡ eiejek is now no longer true, so this is what is different.
He shows that this approach replicates his n = 2 Clifford algebra theory presented earlier.
For the n = 2 case he finds
so you see how e123 differs from e1e2e3. He then says for an arbitrary element in his CL(3),
Wheeler seems to be cutting new ground with his proposals. This paper is 2003, fairly recent. He ends up on page 31 with this sort of proposal for the lower Clifford algebras,
where he gives new names to things. We had f = e12 in the C2 case, and then fi and then fij as you build up to higher order. He then tries to carry out this plan explicitly for n = 2 then n = 3 then n = 4. He uses Mathematica by the way, starting on page 36. Here is an interesting fact:
Does Maple have something like this? I recall rolling my own once. Well in Maple you can do this
where we use the fancy call for a simple case.
So Wheeler goes on to show how he can use Mathematic to compute things for his clifford stuff.
Task: Let's now see if perhaps Maple's B matrix is the same as Wheeler's g matrix. What test can we do?
e1e2 = - e2e1 + 2g12
So I could try this
cmul(e1,e2) + cmul(e2,e1) which should be - 2 g12
Looks good! Maple does not assume symmetry for its version of the g matrix B.
Now what would Maple say about this:
e1 ^ e2 = (1/2) [e1e2- e2e1]
I would then predict that
e1e2- e2e1 = 2 e1 ^ e2
and here is what Maple says,
So in general, if you ask Maple to do some wedge product, it does not expand that in any way. It regards that as the sort of basis for things. For example,
It is whey you do geometric products that the B elements appear.
Now let's go back to the clifford Maple overview"
So now FINALLY I think I know that this paragraph is saying.
So here is how you make Maple do what you want for G = g = δij:
So this gets rid of Bij stuff and gives you results with the usual "orthogonal basis" that most of my pdf's use.
Now my Maple program is pretty simple:
and these agree with my two hand calculations as noted above. So I think I can make Maple compute things I want computed for the orthogonal basis stuff.