Here we add some hair to make hacking easier, but somewhat obscuring the mathematical ideas. (Here is an earlier clunkier version which may yet have merit.)
To our Clifford packet we add
(define (G f) (apply (lambda (tr bar alpha sg zer zer? one + - * rls basis) (list (lambda (x) (cons (tr (car x)) (bar (cdr x)))) ; tr (lambda (x) (cons (bar (car x)) (- (tr (cdr x))))) ; bar (lambda (x) (cons (alpha (car x)) (- (alpha (cdr x))))) ; alpha, called conj earlier (lambda () (cons (sg) (sg))) ; sg (cons zer zer) ; zer (lambda (a) (and (zer? (car a)) (zer? (cdr a)))) ; zer? (cons one zer) ; one (lambda (a b) (cons (+ (car a)(car b))(+ (cdr a)(cdr b)))) ; + (lambda (a) (cons (-(car a))(-(cdr a)))) ; - (negation) (lambda (a b) (cons (+ (* (car a)(car b))(-(* (cdr a)(alpha (cdr b))))) ; * (+ (* (car a)(cdr b))(* (cdr a)(alpha (car b)))))) (lambda (x)(cons (rls x) zer)) ; rls (cons (cons zer one) (map (lambda (x) (cons x zer)) basis)) ; basis )) f)); Use definitions for Do and grc4 for a pseudo random number generator.
(define rr (let ((ig (grc4 "vjoe"))) (lambda ()(/ (ig 1)(+ 1 (ig 1)))))); As in the division algebras we boot the process with the reals: (substitute your favorite field here.)
(define reals (let ((i (lambda (x) x))) (list i i i rr 0 zero? 1 + - * i '()))); Now we build the 4th Clifford algebra C4 thus:
(define P (G (G (G (G reals))))); and unpack the tools from the result p:
(define tr (car P)) ; transpose (define bar (cadr P)) ; conjugate (bar) (define Ha (caddr P)) ; main involution (define p (cdddr P)) ; rest (define Cr (car p)) ; sample generator (define C0 (cadr p)) ; 0 (define C0? (caddr p)) ; 0 predicate (define q (cdddr p)) ; rest of tools (define C1 (car q)) ; multiplicative identity (define C+ (cadr q)) ; addition (define C- (lambda (x y) (C+ x ((caddr q) y)))) ; subtraction (define C* (cadddr q)) ; multiplication (define r (cddddr q)) ; rest of tools (define Hrls (car r)) ; returns Clifford number corresponding to real. (define basis (cadr r)) ; list of basis vectors of V as Clifford numbers. ; Define. (define (even a)(C* (Hrls 1/2)(C+ a (Ha a)))) ; even part of Clifford number (define (odd a)(C* (Hrls 1/2)(C- a (Ha a)))) ; odd part of Clifford number (define (rv) (let rv ((x basis)) (if (null? x) C0 (C+ (C* (Hrls (rr)) (car x)) (rv (cdr x)))))) ; a random vector generator (define g0 (car basis)) ; individual Clifford number basis elements for V in C. (define g1 (cadr basis)) (define g2 (caddr basis)) (define g3 (cadddr basis)); We now have four reflections in V4. g0, ... g3 span the copy of V4 within C4.
(let ((a (rv))) (equal? (Ha a)(C- C0 a))) ; => #t (let ((a (Cr))(b (Cr))) (list (C0? (C- (C* (tr a)(tr b))(tr (C* b a)))) (C0? (C- (C+ (tr a)(tr b))(tr (C+ a b)))) (C0? (C- (C* (Ha a)(Ha b))(Ha (C* a b)))) (C0? (C- (C+ (Ha a)(Ha b))(Ha (C+ a b)))) (C0? (C- (C* (bar a)(bar b))(bar (C* b a)))) (C0? (C- (C+ (bar a)(bar b))(bar (C+ a b)))))) ; => (#t #t #t #t #t #t)The expression above corroborates that Ha is an automorphism and that tr and bar are antiautomorphisms (note the reversed (C* b a)). See Clifford Algebras with Division!