Update Hopf algebra example
parent
40719f260b
commit
993a53c918
|
@ -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 .
|
||||
|
|
Loading…
Reference in New Issue