Update Hopf algebra example

darcs
slava 2006-07-10 04:50:51 +00:00
parent 40719f260b
commit 993a53c918
1 changed files with 15 additions and 3 deletions

View File

@ -7,11 +7,21 @@ IN: hopf
! An element is represented as a hashtable mapping basis
! elements to scalars.
! A generator is a pair of arrays, odd/even generators.
! A basis element is a pair of arrays, odd/even generators.
! Example:
! Define degrees using deg=
SYMBOLS: a b c ;
! Add elements using h+
! Multiply elements using /\
! The co-unit is co1
! Print elements using h.
! Define the differential using d=
! Differentiate using d
: SYMBOLS:
string-mode on
@ -60,6 +70,8 @@ H{ } clone degrees set
{ [ t ] [ number>string " + " swap append ] }
} cond ;
: co1 ( vec -- n ) { { } { } } swap hash [ 0 ] unless* ;
: h. ( vec -- )
dup hash-empty? [
drop 0 .