login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for CaleyDickson revision 12 of 18

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Editor: Bill Page
Time: 2011/04/19 08:40:40 GMT-7
Note: faster Rep

changed:
-    Rep == DirectProduct(2,C)
    Rep == Record(re:C, im:C)

changed:
-    pair(x:C,y:C):Rep == directProduct vector [x,y]
-    complex(x:C,y:C):% == per pair(x,y)
-    real(x:%):C == rep(x).1
-    imag(x:%):C == rep(x).2
    complex(x:C,y:C):% == per [x,y]
    real(x:%):C == rep(x).re
    imag(x:%):C == rep(x).im
    --mul(x:C,y:%):% == complex(x * real y, x * imag y)
    mul(x:C,y:%):% == per [x * rep(y).re, x * rep(y).im]

    -- Many funtctions are inherited from ComplexCategory
    --
    -- To Do:
    -- 1) Check which functions are still correct for higher-order algebras!

changed:
-    zero?(x:%):Boolean == zero? rep(x)
-    1:% == per pair(1,0)
-    one?(x:%):Boolean  == one? real x and zero? imag x
    --zero?(x:%):Boolean == zero? real x and zero? imag x
    zero?(x:%):Boolean == x = 0
    1:% == complex(1,0)
    --one?(x:%):Boolean  == one? real x and zero? imag x
    one?(x:%):Boolean == x = 1

changed:
-      inv(x:%):% == per(inv norm x * rep conjugate x)
      inv(x:%):% == mul(inv norm x, conjugate x)

removed:
-    --
-    -- Many other funtctions are inherited from ComplexCategory
-    --
-    -- To Do:
-    -- 1) Check which other functions are still correct for higher-order algebras!
-    --
-    -- re-defined these only to save function calls
-    (x:% + y:%):% == per(rep x + rep y)
-    (x:% = y:%):Boolean == rep x = rep y

Ref:

http://en.wikipedia.org/wiki/Cayley%E2%80%93Dickson_construction

"The Cayley–Dickson construction, named after Arthur Cayley and Leonard Eugene Dickson, produces a sequence of algebras over the field of real numbers, each with twice the dimension of the previous one. The algebras produced by this process are known as Cayley–Dickson algebras; since they extend the complex numbers, ... "

complex numbers, quaternions, octonions, sedenions, ...

http://en.wikipedia.org/wiki/Hypercomplex_number

spad
)abbrev domain CALEY CaleyDickson
CaleyDickson(C:CommutativeRing,gen:Symbol,gamma:C):ComplexCategory(C) with
    hyper:List % -> %
      ++ convert a list of scalars to a hyper-comnplex number
    scalars: % -> List %
      ++ convert a hyper-complex number to a list of scalars
  == add
    Rep == Record(re:C, im:C)
    rep(x:%):Rep == x pretend Rep
    per(x:Rep):% == x pretend %
complex(x:C,y:C):% == per [x,y] real(x:%):C == rep(x).re imag(x:%):C == rep(x).im --mul(x:C,y:%):% == complex(x * real y, x * imag y) mul(x:C,y:%):% == per [x * rep(y).re, x * rep(y).im]
-- Many funtctions are inherited from ComplexCategory -- -- To Do: -- 1) Check which functions are still correct for higher-order algebras!
0:% == complex(0,0) --zero?(x:%):Boolean == zero? real x and zero? imag x zero?(x:%):Boolean == x = 0 1:% == complex(1,0) --one?(x:%):Boolean == one? real x and zero? imag x one?(x:%):Boolean == x = 1
if C has conjugate:C->C then -- In general we need conjugate (x:% * y:%):% == complex(real x * real y - gamma*conjugate imag y * imag x, imag y * real x + imag x * conjugate real y) conjugate(x:%):% == complex(conjugate(real x), -imag x) else -- If not complex then conjugate is identity (x:% * y:%):% == complex(real x * real y - gamma*imag y * imag x, imag y * real x + imag x * real y) conjugate(x:%):% == complex(real x, -imag x)
-- correct order norm(x:%):C == retract(conjugate(x)*x)
if C has Field then inv(x:%):% == mul(inv norm x, conjugate x) (x:% / y:%):% == x * inv(y)
if C has rank:()->PositiveInteger then rank():PositiveInteger == 2*rank()$C else rank():PositiveInteger == 2
if C has basis:()->Vector C then basis():Vector % == concat([complex(i,0) for i in entries basis()$C], [complex(0,i) for i in entries basis()$C]) else basis():Vector % == [1,imaginary()]
if C has scalars: C -> List C then scalars(x:%):List % == map(coerce,concat(scalars real x, scalars imag x))$ListFunctions2(C,%) else scalars(x:%):List % == [ coerce real x, coerce imag x ]
if C has hyper:List C -> C then hyper(x:List %):% == h:Integer := divide(#x,2).quotient complex(hyper([retract(x.i)@C for i in 1..h]),hyper([retract(x.i)@C for i in h+1..#x])) else hyper(x:List %):% == complex(retract x.1,retract x.2)
coerce(x:%):OutputForm == outr:=real(x)::OutputForm imag x = 0 => return outr outi := hconcat(imag(x)::OutputForm, gen::OutputForm) if imag x = 1 then outi := gen::OutputForm if imag x = -1 then outi := -(gen::OutputForm) if C has imaginary:()->C then if imag x = -imaginary()$C then outi := -hconcat(imaginary()$C::OutputForm,gen::OutputForm) real x = 0 => return outi return outr + outi
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/6953324592202451318-25px001.spad
      using old system compiler.
   CALEY abbreviates domain CaleyDickson 
------------------------------------------------------------------------
   initializing NRLIB CALEY for CaleyDickson 
   compiling into NRLIB CALEY 
****** Domain: C already in scope
************* USER ERROR **********
available signatures for Rep: 
    NONE
NEED Rep: () -> ?
****** comp fails at level 1 with expression: ******
((DEF (|Rep|) (NIL) (NIL) (|Record| (|:| |re| C) (|:| |im| C))))
****** level 1  ******
$x:= (DEF (Rep) (NIL) (NIL) (Record (: re C) (: im C)))
$m:= $EmptyMode
$f:=
((((|$Information| #) (~= #) (= #) (|coerce| #) ...)))
>> Apparent user error: unspecified error

Test

axiom
R := FRAC POLY Integer

\label{eq1}\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Polynomial}\ } (\hbox{\axiomType{Integer}\ }))(1)
Type: Type

Complex Numbers

axiom
C := CaleyDickson(R,'i,1)
CaleyDickson is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? rank()$C
The function rank is not implemented in NIL . Ce:ILIST(C,0) := construct entries basis()$C
The function basis is not implemented in NIL . matrix [[Ce.i * Ce.j for j in 0..#Ce-1] for i in 0..#Ce-1]
Ce is declared as being in IndexedList(NIL,0) but has not been given a value. -- -- compare -- Cg:ILIST(Complex R,0) := construct map(x+-> complex(x.1,x.2), 1$SquareMatrix(2,FRAC INT)::List List FRAC INT)

\label{eq2}\left[ 1, \: i \right](2)
Type: IndexedList?(Complex(Fraction(Polynomial(Integer))),0)
axiom
matrix [[Cg.i * Cg.j for j in 0..#Cg-1] for i in 0..#Cg-1]

\label{eq3}\left[ 
\begin{array}{cc}
1 & i 
\
i & - 1 
(3)
Type: Matrix(Complex(Fraction(Polynomial(Integer))))
axiom
-- normed?
c1:C := hyper [subscript('c1,[i]) for i in 1..2]

\label{eq4}hyper_{{c 1_{1}}, \:{c 1_{2}}}(4)
Type: Symbol
axiom
c2:C := hyper [subscript('c2,[i]) for i in 1..2]

\label{eq5}hyper_{{c 2_{1}}, \:{c 2_{2}}}(5)
Type: Symbol
axiom
c3:C := hyper [subscript('c3,[i]) for i in 1..8]

\label{eq6}hyper_{{c 3_{1}}, \:{c 3_{2}}, \:{c 3_{3}}, \:{c 3_{4}}, \:{c 3_{5}}, \:{c 3_{6}}, \:{c 3_{7}}, \:{c 3_{8}}}(6)
Type: Symbol
axiom
-- Normed?
test(norm(c1*c2)=norm(c1)*norm(c2))
There are 7 exposed and 3 unexposed library operations named norm having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op norm to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named norm with argument type(s) Polynomial(Integer)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. -- Commutative? test( c1 * c2 = c2 * c1 )

\label{eq7} \mbox{\rm true} (7)
Type: Boolean
axiom
-- Associative?
test((c1 * c2) * c3 = c1 * (c2 * c3))

\label{eq8} \mbox{\rm true} (8)
Type: Boolean
axiom
-- inverse
c1inv := inv c1

\label{eq9}1 \over{hyper_{{c 1_{1}}, \:{c 1_{2}}}}(9)
Type: Fraction(Polynomial(Integer))
axiom
test(c1 * c1inv = 1)

\label{eq10} \mbox{\rm true} (10)
Type: Boolean

Quaternions

axiom
Q := CaleyDickson(C,'j,1)
CaleyDickson is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? rank()$Q
The function rank is not implemented in NIL . Qe:ILIST(Q,0) := construct entries basis()$Q
The function basis is not implemented in NIL . matrix [[Qe.i * Qe.j for j in 0..#Qe-1] for i in 0..#Qe-1]
Qe is declared as being in IndexedList(NIL,0) but has not been given a value. -- -- compare -- Qg:ILIST(Quaternion R,0) := construct map(x+-> quatern(x.1,x.2,x.3,x.4), 1$SquareMatrix(4,FRAC INT)::List List FRAC INT)

\label{eq11}\left[ 1, \: i , \: j , \: k \right](11)
Type: IndexedList?(Quaternion(Fraction(Polynomial(Integer))),0)
axiom
matrix [[Qg.i * Qg.j for j in 0..#Qg-1] for i in 0..#Qg-1]

\label{eq12}\left[ 
\begin{array}{cccc}
1 & i & j & k 
\
i & - 1 & k & - j 
\
j & - k & - 1 & i 
\
k & j & - i & - 1 
(12)
Type: Matrix(Quaternion(Fraction(Polynomial(Integer))))
axiom
q1:Q := hyper [subscript('q1,[i]) for i in 1..4]

\label{eq13}hyper_{{q 1_{1}}, \:{q 1_{2}}, \:{q 1_{3}}, \:{q 1_{4}}}(13)
Type: Symbol
axiom
q2:Q := hyper [subscript('q2,[i]) for i in 1..4]

\label{eq14}hyper_{{q 2_{1}}, \:{q 2_{2}}, \:{q 2_{3}}, \:{q 2_{4}}}(14)
Type: Symbol
axiom
q3:Q := hyper [subscript('q3,[i]) for i in 1..8]

\label{eq15}hyper_{{q 3_{1}}, \:{q 3_{2}}, \:{q 3_{3}}, \:{q 3_{4}}, \:{q 3_{5}}, \:{q 3_{6}}, \:{q 3_{7}}, \:{q 3_{8}}}(15)
Type: Symbol
axiom
-- Normed?
test( norm(q1*q2) = norm(q1)*norm(q2))
There are 7 exposed and 3 unexposed library operations named norm having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op norm to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named norm with argument type(s) Polynomial(Integer)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. -- Commutative? test( q1 * q2 = q2 * q1 )

\label{eq16} \mbox{\rm true} (16)
Type: Boolean
axiom
-- Associative?
test((q1 * q2) * q3 = q1 * (q2 * q3))

\label{eq17} \mbox{\rm true} (17)
Type: Boolean
axiom
-- inverse
q1inv := inv q1

\label{eq18}1 \over{hyper_{{q 1_{1}}, \:{q 1_{2}}, \:{q 1_{3}}, \:{q 1_{4}}}}(18)
Type: Fraction(Polynomial(Integer))
axiom
test(q1 * q1inv = 1)

\label{eq19} \mbox{\rm true} (19)
Type: Boolean

Octonions

Ref: http://en.wikipedia.org/wiki/Octonion

axiom
O:=CaleyDickson(Q,'k,1)
CaleyDickson is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? rank()$O
The function rank is not implemented in NIL . Oe:ILIST(O,0) := construct entries basis()$O
The function basis is not implemented in NIL . matrix [[Oe.i * Oe.j for j in 0..#Oe-1] for i in 0..#Oe-1]
Oe is declared as being in IndexedList(NIL,0) but has not been given a value. -- -- compare -- Og:ILIST(Octonion R,0):=map(x+-> octon(x.1,x.2,x.3,x.4,x.5,x.6,x.7,x.8), 1$SquareMatrix(8,FRAC INT)::List List FRAC INT)

\label{eq20}\left[ 1, \: i , \: j , \: k , \: E , \: I , \: J , \: K \right](20)
Type: IndexedList?(Octonion(Fraction(Polynomial(Integer))),0)
axiom
matrix [[Og.i * Og.j for j in 0..#Og-1] for i in 0..#Og-1]

\label{eq21}\left[ 
\begin{array}{cccccccc}
1 & i & j & k & E & I & J & K 
\
i & - 1 & k & - j & I & - E & - K & J 
\
j & - k & - 1 & i & J & K & - E & - I 
\
k & j & - i & - 1 & K & - J & I & - E 
\
E & - I & - J & - K & - 1 & i & j & k 
\
I & E & - K & J & - i & - 1 & - k & j 
\
J & K & E & - I & - j & k & - 1 & - i 
\
K & - J & I & E & - k & - j & i & - 1 
(21)
Type: Matrix(Octonion(Fraction(Polynomial(Integer))))
axiom
o1:O := hyper [subscript('o1,[i]) for i in 1..8]

\label{eq22}hyper_{{o 1_{1}}, \:{o 1_{2}}, \:{o 1_{3}}, \:{o 1_{4}}, \:{o 1_{5}}, \:{o 1_{6}}, \:{o 1_{7}}, \:{o 1_{8}}}(22)
Type: Symbol
axiom
o2:O := hyper [subscript('o2,[i]) for i in 1..8]

\label{eq23}hyper_{{o 2_{1}}, \:{o 2_{2}}, \:{o 2_{3}}, \:{o 2_{4}}, \:{o 2_{5}}, \:{o 2_{6}}, \:{o 2_{7}}, \:{o 2_{8}}}(23)
Type: Symbol
axiom
o3:O := hyper [subscript('o3,[i]) for i in 1..8]

\label{eq24}hyper_{{o 3_{1}}, \:{o 3_{2}}, \:{o 3_{3}}, \:{o 3_{4}}, \:{o 3_{5}}, \:{o 3_{6}}, \:{o 3_{7}}, \:{o 3_{8}}}(24)
Type: Symbol
axiom
-- normed?
test(norm(o1*o2)=norm(o1)*norm(o2))
There are 7 exposed and 3 unexposed library operations named norm having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op norm to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named norm with argument type(s) Polynomial(Integer)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. -- Commutative? test( o1 * o2 = o2 * o1 )

\label{eq25} \mbox{\rm true} (25)
Type: Boolean
axiom
-- Associative?
test((o1 * o2) * o3 = o1 * (o2 * o3))

\label{eq26} \mbox{\rm true} (26)
Type: Boolean
axiom
-- Alternative?
test((o1 * o2) * o1 = o1 * (o2 * o1))

\label{eq27} \mbox{\rm true} (27)
Type: Boolean

Split-Octonions

Ref: http://en.wikipedia.org/wiki/Split-octonion

Note: Our table below is not identical the one shown in the reference where a different convention is used to define multiplication.

axiom
sO:=CaleyDickson(Q,'ℓ,-1)
CaleyDickson is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? rank()$sO
The function rank is not implemented in NIL . sOe:ILIST(sO,0) := construct entries basis()$sO
The function basis is not implemented in NIL . matrix [[sOe.i * sOe.j for j in 0..#sOe-1] for i in 0..#sOe-1]
sOe is declared as being in IndexedList(NIL,0) but has not been given a value. so1:sO := hyper [subscript('so1,[i]) for i in 1..8]

\label{eq28}hyper_{{so 1_{1}}, \:{so 1_{2}}, \:{so 1_{3}}, \:{so 1_{4}}, \:{so 1_{5}}, \:{so 1_{6}}, \:{so 1_{7}}, \:{so 1_{8}}}(28)
Type: Symbol
axiom
so2:sO := hyper [subscript('so2,[i]) for i in 1..8]

\label{eq29}hyper_{{so 2_{1}}, \:{so 2_{2}}, \:{so 2_{3}}, \:{so 2_{4}}, \:{so 2_{5}}, \:{so 2_{6}}, \:{so 2_{7}}, \:{so 2_{8}}}(29)
Type: Symbol
axiom
so3:sO := hyper [subscript('so3,[i]) for i in 1..8]

\label{eq30}hyper_{{so 3_{1}}, \:{so 3_{2}}, \:{so 3_{3}}, \:{so 3_{4}}, \:{so 3_{5}}, \:{so 3_{6}}, \:{so 3_{7}}, \:{so 3_{8}}}(30)
Type: Symbol
axiom
-- Normed?
test(norm(so1*so2)=norm(so1)*norm(so2))
There are 7 exposed and 3 unexposed library operations named norm having 1 argument(s) but none was determined to be applicable. Use HyperDoc Browse, or issue )display op norm to learn more about the available operations. Perhaps package-calling the operation or using coercions on the arguments will allow you to apply the operation.
Cannot find a definition or applicable library operation named norm with argument type(s) Polynomial(Integer)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. -- Commutative? test( so1 * so2 = so2 * so1 )

\label{eq31} \mbox{\rm true} (31)
Type: Boolean
axiom
-- Associative?
test((so1 * so2) * so3 = so1 * (so2 * so3))

\label{eq32} \mbox{\rm true} (32)
Type: Boolean
axiom
-- Alternative?
test((so1 * so2) * so1 = so1 * (so2 * so1))

\label{eq33} \mbox{\rm true} (33)
Type: Boolean
axiom
-- inverse
so1inv := inv so1;
Type: Fraction(Polynomial(Integer))
axiom
test(so1 * so1inv = 1)

\label{eq34} \mbox{\rm true} (34)
Type: Boolean

Sedenions

Ref: http://en.wikipedia.org/wiki/Sedenion

axiom
S:=CaleyDickson(O,'l,1)
CaleyDickson is an unknown constructor and so is unavailable. Did you mean to use -> but type something different instead? rank()$S
The function rank is not implemented in NIL . Se:ILIST(S,0) := construct entries basis()$S
The function basis is not implemented in NIL . matrix [[Se.i * Se.j for j in 0..#Se-1] for i in 0..#Se-1]
Se is declared as being in IndexedList(NIL,0) but has not been given a value. s1:S := hyper [subscript('s1,[i]) for i in 1..16]
>> Error detected within library code: Can have at most 9 scripts of each kind

Power Associative?

Algebra with associative powers

Ref: http://eom.springer.de/a/a011410.htm

axiom
test( s1^2 * s1 = s1 * s1^2 )

\label{eq35} \mbox{\rm true} (35)
Type: Boolean
axiom
test( (s1^2 * s1) * s1 = s1^2 * s1^2 )

\label{eq36} \mbox{\rm true} (36)
Type: Boolean

Conversions

axiom
test(s1=hyper scalars s1)
There are no library operations named scalars Use HyperDoc Browse or issue )what op scalars to learn if there is any operation containing " scalars " in its name.
Cannot find a definition or applicable library operation named scalars with argument type(s) Variable(s1)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need. scalars(s1)::List Symbol
There are no library operations named scalars Use HyperDoc Browse or issue )what op scalars to learn if there is any operation containing " scalars " in its name.
Cannot find a definition or applicable library operation named scalars with argument type(s) Variable(s1)
Perhaps you should use "@" to indicate the required return type, or "$" to specify which version of the function you need.