Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Coding in Quaternions and Matrices

  1. Feb 24, 2007 #1
    I am currently doing some research in Clifford Algebra. My topic is to find explicit representation of its basis through matrices with entries in clifford algebra itself. At this moment I am trying to write code in mathematica to do KroneckerProduct and Quaternion multiplication. Now I have encounter a coding problem about mathematica.
    In the package of << Algebra`Quaternions`, quaternion multiplication is defined with ** instead of *, where in matrix multiplication product of entries are defined with *. Thus when I use quaternion entries in my matrix multiplication, its matrix product will give me, say, Quaternion[0,1,0,0]Quaternion[0,0,1,0] instead of Quaternion[0,0,0,1]
    where Quaternion[a,b,c,d] = a + b i + c j + d k.
    Does any one have any idea to override this function.

    Thank you.
     
  2. jcsd
  3. Feb 25, 2007 #2
    I have rewritten my problem due to my horrible english. PLease forgive me.



    I am currently doing some research in Clifford Algebra. My topic is to find explicit representation of its basis through matrices with entries in clifford algebra itself. At this moment I am trying to write code in mathematica to do KroneckerProduct and Quaternion multiplication. Now I have encounter a coding problem about mathematica.
    In the package of << Algebra`Quaternions`, quaternion multiplication is defined with ** (non-commutative multiplicative operator) instead of *, where matrix multiplication assumes communtivity of elements. Of course this is not the case when I use non-commutative ring on my matrices.

    for examples
    When I do {{0,Quaternion[0,0,1,0]},{Quaternion[0,0,1,0],0}} * {{0,-Quaternion[0,1,0,0]},{Quaternion[0,1,0,0],0}}, it will give me {{0, 0, Quaternion[0, 0, 1, 0] Quaternion[0, 1, 0, 0], 0}, {0, 0, 0, Quaternion[0, -1, 0, 0] Quaternion[0, 0, 1, 0]},{Quaternion[0, 0, 1,0] Quaternion[0, 1, 0, 0], 0, 0, 0}, {0, Quaternion[0, -1, 0, 0] Quaternion[0, 0, 1, 0], 0, 0}}

    My main problem is that when I try to define the following operation Quaternion[a_, b_, c_, d_]Quaternion[e_, f_, g_, h_] := Quaternion[a, b, c, d] ** Quaternion[e, f, g, h]. It automatically assumes commutativity, i.e Quaternion[0,1,0,0]Quaternion[0,0,1,0] = Quaternion[0,0,1,0]Quaternion[0,1,0,0]. But we know they should anticommute instead.

    Does any one have any idea to override this function.

    Thank you.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Coding in Quaternions and Matrices
  1. Quaternion confusion (Replies: 3)

  2. Averaging Quaternions (Replies: 15)

Loading...