]> gitweb.factorcode.org Git - factor.git/blob - extra/koszul/koszul-tests.factor
01fba499956bcfdef8672f1691bc695f1cf060b2
[factor.git] / extra / koszul / koszul-tests.factor
1 USING: koszul tools.test kernel sequences assocs namespaces
2 symbols ;
3 IN: koszul.tests
4
5 [
6     { V{ { } } V{ { 1 } } V{ { 2 3 } { 7 8 } } V{ { 4 5 6 } } }
7 ] [
8     { { 1 } { 2 3 } { 4 5 6 } { 7 8 } { } } graded
9 ] unit-test
10
11 SYMBOLS: x1 x2 x3 x4 x5 x6 z1 z2 ;
12
13 [ H{ { { x1 } 3 } } ] [ x1 3 wedge ] unit-test
14
15 [ H{ { { x1 } 3 } { { x2 } 4 } } ]
16 [ x1 3 wedge x2 4 wedge alt+ ] unit-test
17
18 x1 x2 wedge z1 d=
19 x3 x4 wedge z2 d=
20
21 [ H{ { { x1 x2 z2 } 1 } { { x3 x4 z1 } -1 } } ]
22 [ z1 z2 wedge d ] unit-test
23
24 ! Unimodular example
25 boundaries get clear-assoc
26
27 SYMBOLS: x y w z ;
28
29 x y wedge z d=
30 y z wedge x d=
31 z x wedge y d=
32
33 [ { 1 0 0 1 } ] [ { x y z } graded-betti ] unit-test
34
35 ! Solvable example
36 boundaries get clear-assoc
37
38 x y wedge y d=
39
40 [ { 1 1 0 } ] [ { x y } graded-betti ] unit-test
41
42 ! Nilpotent example
43 boundaries get clear-assoc
44
45 x1 x2 wedge x3 x4 wedge alt+ z d=
46
47 [ { 1 4 5 5 4 1 } ]
48 [ { x1 x2 x3 x4 z } graded-betti ] unit-test
49
50 [ { { 1 4 5 0 0 } { 0 0 5 4 1 } } ]
51 [ { x1 x2 x3 x4 } { z } bigraded-betti ] unit-test
52
53 ! Free 2-step on 4 generators
54 boundaries get clear-assoc
55
56 SYMBOLS: e12 e13 e14 e23 e24 e34 ;
57
58 x1 x2 wedge e12 d=
59 x1 x3 wedge e13 d=
60 x1 x4 wedge e14 d=
61 x2 x3 wedge e23 d=
62 x2 x4 wedge e24 d=
63 x3 x4 wedge e34 d=
64
65 [ { 1 4 20 56 84 90 84 56 20 4 1 } ]
66 [ { x1 x2 x3 x4 e12 e13 e14 e23 e24 e34 } graded-betti ]
67 unit-test
68
69 ! Make sure this works
70 [ ] [ e12 d alt. ] unit-test
71
72 [ ] [
73     { x1 x2 x3 x4 x5 x6 } { w z }
74     bigraded-laplacian-kernel bigraded-basis.
75 ] unit-test