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

Edit detail for CaleyDickson revision 7 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/17 18:47:35 GMT-7
Note: cleanup

changed:
-CaleyDickson(C:CommutativeRing,gen:Symbol,gamma:C):Exports == Implementation where
-  CC ==> ComplexCategory
-  Exports ==> CC(C) with
-    if C has Field then Field
-  Implementation ==> add
CaleyDickson(C:CommutativeRing,gen:Symbol,gamma:C):ComplexCategory(C)
  == add

removed:
-

changed:
-    -- The following and many other funtctions are inherited from ComplexCategory
    -- Many other funtctions are inherited from ComplexCategory

removed:
-    --coerce(x:C):% == per pair(x,0)
-    --basis():Vector % == vector [1,imaginary()]
-    --(x:% - y:%):% == per(rep x - rep y)
-    --imaginary():% == complex(0,1)
-    --retract(x:%):C ==
-    --   imag x ~=0 => error "not retractable"
-    --   real x
-    --coerce(x:Integer):% == per pair(x::R::C,0)
-

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, ...

spad
)abbrev domain CALEY CaleyDickson
CaleyDickson(C:CommutativeRing,gen:Symbol,gamma:C):ComplexCategory(C)
  == add
    Rep == DirectProduct(2,C)
    rep(x:%):Rep == x pretend Rep
    per(x:Rep):% == x pretend %
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
0:% == complex(0,0) zero?(x:%):Boolean == zero? rep(x) 1:% == per pair(1,0) one?(x:%):Boolean == one? real x and zero? imag x
if C has conjugate:C->C then -- In general we need conjugate (x:% * y:%):% == --print(x::OutputForm * y::OutputForm) 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)
if C has Field then inv(x:%):% == per(inv(real(conjugate x * x))$C * rep 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()]
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 hconcat(outr, outi) -- -- 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
spad
   Compiling FriCAS source code from file 
      /var/zope2/var/LatexWiki/7769095362333751115-25px001.spad using 
      old system compiler.
   CALEY abbreviates domain CaleyDickson 
------------------------------------------------------------------------
   initializing NRLIB CALEY for CaleyDickson 
   compiling into NRLIB CALEY 
****** Domain: C already in scope
   compiling local rep : $ -> DirectProduct(2,C)
      CALEY;rep is replaced by x 
Time: 0.37 SEC.
compiling local per : DirectProduct(2,C) -> $ CALEY;per is replaced by x Time: 0.01 SEC.
compiling local pair : (C,C) -> DirectProduct(2,C) Time: 0.01 SEC.
compiling exported complex : (C,C) -> $ Time: 0 SEC.
compiling exported real : $ -> C Time: 0 SEC.
compiling exported imag : $ -> C Time: 0 SEC.
compiling exported Zero : () -> $ Time: 0 SEC.
compiling exported zero? : $ -> Boolean Time: 0 SEC.
compiling exported One : () -> $ Time: 0 SEC.
compiling exported one? : $ -> Boolean Time: 0 SEC.
augmenting C: (SIGNATURE C conjugate (C C)) compiling exported * : ($,$) -> $ Time: 0.01 SEC.
compiling exported conjugate : $ -> $ Time: 0 SEC.
compiling exported * : ($,$) -> $ Time: 0 SEC.
compiling exported conjugate : $ -> $ Time: 0 SEC.
****** Domain: C already in scope augmenting C: (Field) compiling exported inv : $ -> $ Time: 0 SEC.
compiling exported / : ($,$) -> $ Time: 0 SEC.
augmenting C: (SIGNATURE C rank ((PositiveInteger))) compiling exported rank : () -> PositiveInteger Time: 0 SEC.
compiling exported rank : () -> PositiveInteger CALEY;rank;Pi;18 is replaced by 2 Time: 0 SEC.
augmenting C: (SIGNATURE C basis ((Vector C))) compiling exported basis : () -> Vector $ Time: 0.05 SEC.
compiling exported basis : () -> Vector $ Time: 0 SEC.
compiling exported coerce : $ -> OutputForm augmenting C: (SIGNATURE C imaginary (C)) Time: 0.06 SEC.
compiling exported + : ($,$) -> $ Time: 0 SEC.
compiling exported = : ($,$) -> Boolean Time: 0 SEC.
****** Domain: C already in scope augmenting C: (EuclideanDomain) ****** Domain: C already in scope augmenting C: (PolynomialFactorizationExplicit) ****** Domain: C already in scope augmenting C: (RadicalCategory) ****** Domain: C already in scope augmenting C: (TranscendentalFunctionCategory) ****** Domain: C already in scope augmenting C: (RealNumberSystem) ****** Domain: C already in scope augmenting C: (TranscendentalFunctionCategory) ****** Domain: C already in scope augmenting C: (Comparable) ****** Domain: C already in scope augmenting C: (ConvertibleTo (InputForm)) ****** Domain: C already in scope augmenting C: (ConvertibleTo (Pattern (Float))) ****** Domain: C already in scope augmenting C: (ConvertibleTo (Pattern (Integer))) ****** Domain: C already in scope augmenting C: (DifferentialRing) ****** Domain: C already in scope augmenting C: (Eltable C C) ****** Domain: C already in scope augmenting C: (EuclideanDomain) ****** Domain: C already in scope augmenting C: (Evalable C) ****** Domain: C already in scope augmenting C: (Field) ****** Domain: C already in scope augmenting C: (Finite) ****** Domain: C already in scope augmenting C: (FiniteFieldCategory) ****** Domain: C already in scope augmenting C: (InnerEvalable (Symbol) C) ****** Domain: C already in scope augmenting C: (IntegerNumberSystem) ****** Domain: C already in scope augmenting C: (IntegralDomain) ****** Domain: C already in scope augmenting C: (LinearlyExplicitRingOver (Integer)) ****** Domain: C already in scope augmenting C: (PartialDifferentialRing (Symbol)) ****** Domain: C already in scope augmenting C: (PatternMatchable (Float)) ****** Domain: C already in scope augmenting C: (PatternMatchable (Integer)) ****** Domain: C already in scope augmenting C: (RealConstant) ****** Domain: C already in scope augmenting C: (RealNumberSystem) ****** Domain: C already in scope augmenting C: (RetractableTo (Fraction (Integer))) ****** Domain: C already in scope augmenting C: (RetractableTo (Integer)) ****** Domain: C already in scope augmenting C: (TranscendentalFunctionCategory) (time taken in buildFunctor: 2420)
;;; *** |CaleyDickson| REDEFINED
;;; *** |CaleyDickson| REDEFINED Time: 2.50 SEC.
Cumulative Statistics for Constructor CaleyDickson Time: 3.01 seconds
finalizing NRLIB CALEY Processing CaleyDickson for Browser database: --->-->CaleyDickson(): Missing Description ; compiling file "/var/zope2/var/LatexWiki/CALEY.NRLIB/CALEY.lsp" (written 17 APR 2011 06:47:24 PM):
; /var/zope2/var/LatexWiki/CALEY.NRLIB/CALEY.fasl written ; compilation finished in 0:00:00.746 ------------------------------------------------------------------------ CaleyDickson is now explicitly exposed in frame initial CaleyDickson will be automatically loaded when needed from /var/zope2/var/LatexWiki/CALEY.NRLIB/CALEY
>> System error: The bounding indices 163 and 162 are bad for a sequence of length 162. See also: The ANSI Standard, Glossary entry for "bounding index designator" The ANSI Standard, writeup for Issue SUBSEQ-OUT-OF-BOUNDS:IS-AN-ERROR

Test

axiom
)set output tex on
 
axiom
)set output algebra off

Complex Numbers

axiom
C := CaleyDickson(FRAC INT,'i,1)

\label{eq1}\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Integer}\ }) , i , 1)(1)
Type: Type
axiom
rank()$C

\label{eq2}2(2)
Type: PositiveInteger?
axiom
gens1 := entries basis()$C

\label{eq3}\left[ 1, \: i \right](3)
Type: List(CaleyDickson?(Fraction(Integer),i,1))
axiom
matrix [[gens1.i * gens1.j for j in 1..#gens1] for i in 1..#gens1]

\label{eq4}\left[ 
\begin{array}{cc}
1 & i 
\
i & - 1 
(4)
Type: Matrix(CaleyDickson?(Fraction(Integer),i,1))
axiom
--
-- compare
--
gens2:=map(x+-> complex(x.1,x.2),
           1$SquareMatrix(2,FRAC INT)::List List FRAC INT)

\label{eq5}\left[ 1, \: i \right](5)
Type: List(Complex(Fraction(Integer)))
axiom
matrix [[gens2.i * gens2.j for j in 1..#gens2] for i in 1..#gens2]

\label{eq6}\left[ 
\begin{array}{cc}
1 & i 
\
i & - 1 
(6)
Type: Matrix(Complex(Fraction(Integer)))

Quaternions

axiom
Q := CaleyDickson(C,'j,1)

\label{eq7}\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Integer}\ }) , i , 1) , j , 1)(7)
Type: Type
axiom
rank()$Q

\label{eq8}4(8)
Type: PositiveInteger?
axiom
gens3 :=entries basis()$Q

\label{eq9}\left[ 1, \: i , \: j , \:{ij}\right](9)
Type: List(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1))
axiom
matrix [[gens3.i * gens3.j for j in 1..#gens3] for i in 1..#gens3]

\label{eq10}\left[ 
\begin{array}{cccc}
1 & i & j &{ij}
\
i & - 1 &{ij}& - j 
\
j & -{ij}& - 1 & i 
\
{ij}& j & - i & - 1 
(10)
Type: Matrix(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1))
axiom
--
-- compare
--
gens4:=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: List(Quaternion(Fraction(Integer)))
axiom
matrix [[gens4.i * gens4.j for j in 1..#gens4] for i in 1..#gens4]

\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(Integer)))

Octonions

axiom
O:=CaleyDickson(Q,'k,1)

\label{eq13}\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Integer}\ }) , i , 1) , j , 1) , k , 1)(13)
Type: Type
axiom
rank()$O

\label{eq14}8(14)
Type: PositiveInteger?
axiom
gens5 := entries basis()$O

\label{eq15}\left[ 1, \: i , \: j , \:{ij}, \: k , \:{ik}, \:{jk}, \:{{ij}k}\right](15)
Type: List(CaleyDickson?(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1),k,1))
axiom
matrix [[gens5.i * gens5.j for j in 1..#gens5] for i in 1..#gens5]

\label{eq16}\left[ 
\begin{array}{cccccccc}
1 & i & j &{ij}& k &{ik}&{jk}&{{ij}k}
\
i & - 1 &{ij}& - j &{ik}& - k &{-{ij}k}&{jk}
\
j & -{ij}& - 1 & i &{jk}&{{ij}k}& - k &{- ik}
\
{ij}& j & - i & - 1 &{{ij}k}& -{jk}&{ik}& - k 
\
k &{- ik}& -{jk}&{-{ij}k}& - 1 & i & j &{ij}
\
{ik}& k &{-{ij}k}&{jk}& - i & - 1 & -{ij}& j 
\
{jk}&{{ij}k}& k &{- ik}& - j &{ij}& - 1 & - i 
\
{{ij}k}& -{jk}&{ik}& k & -{ij}& - j & i & - 1 
(16)
Type: Matrix(CaleyDickson?(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1),k,1))
axiom
--
-- compare
--
gens6:=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{eq17}\left[ 1, \: i , \: j , \: k , \: E , \: I , \: J , \: K \right](17)
Type: List(Octonion(Fraction(Integer)))
axiom
matrix [[gens6.i * gens6.j for j in 1..#gens6] for i in 1..#gens6]

\label{eq18}\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 
(18)
Type: Matrix(Octonion(Fraction(Integer)))

Sedenions

axiom
S:=CaleyDickson(O,'l,1)

\label{eq19}\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{CaleyDickson}\ } (\hbox{\axiomType{Fraction}\ } (\hbox{\axiomType{Integer}\ }) , i , 1) , j , 1) , k , 1) , l , 1)(19)
Type: Type
axiom
rank()$S

\label{eq20}16(20)
Type: PositiveInteger?
axiom
gens7 := entries basis()$S

\label{eq21}\left[ 1, \: i , \: j , \:{ij}, \: k , \:{ik}, \:{jk}, \:{{ij}k}, \: l , \:{il}, \:{jl}, \:{{ij}l}, \:{kl}, \:{{ik}l}, \:{{jk}l}, \:{{{ij}k}l}\right](21)
Type: List(CaleyDickson?(CaleyDickson?(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1),k,1),l,1))
axiom
matrix [[gens7.i * gens7.j for j in 1..#gens7] for i in 1..#gens7]

\label{eq22}\left[ 
\begin{array}{cccccccccccccccc}
1 & i & j &{ij}& k &{ik}&{jk}&{{ij}k}& l &{il}&{jl}&{{ij}l}&{kl}&{{ik}l}&{{jk}l}&{{{ij}k}l}
\
i & - 1 &{ij}& - j &{ik}& - k &{-{ij}k}&{jk}&{il}& - l &{-{ij}l}&{jl}&{{- ik}l}&{kl}&{{{ij}k}l}&{-{jk}l}
\
j & -{ij}& - 1 & i &{jk}&{{ij}k}& - k &{- ik}&{jl}&{{ij}l}& - l &{- il}&{-{jk}l}&{{-{ij}k}l}&{kl}&{{ik}l}
\
{ij}& j & - i & - 1 &{{ij}k}& -{jk}&{ik}& - k &{{ij}l}&{- jl}&{il}& - l &{{-{ij}k}l}&{{jk}l}&{{- ik}l}&{kl}
\
k &{- ik}& -{jk}&{-{ij}k}& - 1 & i & j &{ij}&{kl}&{{ik}l}&{{jk}l}&{{{ij}k}l}& - l &{- il}&{- jl}&{-{ij}l}
\
{ik}& k &{-{ij}k}&{jk}& - i & - 1 & -{ij}& j &{{ik}l}& -{kl}&{{{ij}k}l}&{-{jk}l}&{il}& - l &{{ij}l}&{- jl}
\
{jk}&{{ij}k}& k &{- ik}& - j &{ij}& - 1 & - i &{{jk}l}&{{-{ij}k}l}& -{kl}&{{ik}l}&{jl}&{-{ij}l}& - l &{il}
\
{{ij}k}& -{jk}&{ik}& k & -{ij}& - j & i & - 1 &{{{ij}k}l}&{{jk}l}&{{- ik}l}& -{kl}&{{ij}l}&{jl}&{- il}& - l 
\
l &{- il}&{- jl}&{-{ij}l}& -{kl}&{{- ik}l}&{-{jk}l}&{{-{ij}k}l}& - 1 & i & j &{ij}& k &{ik}&{jk}&{{ij}k}
\
{il}& l &{-{ij}l}&{jl}&{{- ik}l}&{kl}&{{{ij}k}l}&{-{jk}l}& - i & - 1 & -{ij}& j &{- ik}& k &{{ij}k}& -{jk}
\
{jl}&{{ij}l}& l &{- il}&{-{jk}l}&{{-{ij}k}l}&{kl}&{{ik}l}& - j &{ij}& - 1 & - i & -{jk}&{-{ij}k}& k &{ik}
\
{{ij}l}&{- jl}&{il}& l &{{-{ij}k}l}&{{jk}l}&{{- ik}l}&{kl}& -{ij}& - j & i & - 1 &{-{ij}k}&{jk}&{- ik}& k 
\
{kl}&{{ik}l}&{{jk}l}&{{{ij}k}l}& l &{- il}&{- jl}&{-{ij}l}& - k &{ik}&{jk}&{{ij}k}& - 1 & - i & - j & -{ij}
\
{{ik}l}& -{kl}&{{{ij}k}l}&{-{jk}l}&{il}& l &{{ij}l}&{- jl}&{- ik}& - k &{{ij}k}& -{jk}& i & - 1 &{ij}& - j 
\
{{jk}l}&{{-{ij}k}l}& -{kl}&{{ik}l}&{jl}&{-{ij}l}& l &{il}& -{jk}&{-{ij}k}& - k &{ik}& j & -{ij}& - 1 & i 
\
{{{ij}k}l}&{{jk}l}&{{- ik}l}& -{kl}&{{ij}l}&{jl}&{- il}& l &{-{ij}k}&{jk}&{- ik}& - k &{ij}& j & - i & - 1 
(22)
Type: Matrix(CaleyDickson?(CaleyDickson?(CaleyDickson?(CaleyDickson?(Fraction(Integer),i,1),j,1),k,1),l,1))