-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c4b574
commit 5af98c9
Showing
7 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- [ ] Benchmark phlite vs lophat - why is phlite so much slower? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
sphinx | ||
sphinx-rtd-theme | ||
sphinxcontrib-napoleon | ||
gramag==0.4.0 | ||
gramag==0.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from gramag import MagGraph, format_rank_table | ||
|
||
# Create your graph based on a square distance matrix | ||
# use -1 to denote an infinite distance | ||
|
||
# Undirected cycle graph on N nodes | ||
N = 7 | ||
distance_matrix = [[min((j - i) % N, (i - j) % N) for j in range(N)] for i in range(N)] | ||
|
||
mg = MagGraph.from_distance_matrix(distance_matrix) | ||
# Compute generators of all MC^{(s, t)}_{k, l} for l<=6 | ||
mg.populate_paths(l_max=11) | ||
|
||
# Reports the ranks of MC^{(s, t)}_{k, l}, summed over (s, t) | ||
rk_gens = mg.rank_generators() | ||
|
||
# For each l, in parallel across each (s, t), computes MH^{(s, t)}_{k, l} | ||
# Adds up the rank for each k, l | ||
rk_hom = mg.rank_homology() | ||
|
||
# Pretty print | ||
print("Rank of MC:") | ||
print(format_rank_table(rk_gens)) | ||
|
||
print("Rank of MH:") | ||
print(format_rank_table(rk_hom)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from gramag import MagGraph, format_rank_table | ||
|
||
# Create your graph based on a square distance matrix | ||
# use -1 to denote an infinite distance | ||
|
||
# We do a digraph made up of two paths 0 -> 1 -> 2 -> 4 and 0 -> 3 -> 4 | ||
|
||
distance_matrix = [ | ||
[0, 1, 2, 1, 2], | ||
[-1, 0, 1, -1, 2], | ||
[-1, -1, 0, -1, 1], | ||
[-1, -1, -1, 0, 1], | ||
[-1, -1, -1, -1, 0], | ||
] | ||
|
||
mg = MagGraph.from_distance_matrix(distance_matrix) | ||
# Compute generators of all MC^{(s, t)}_{k, l} for l<=6 | ||
mg.populate_paths(l_max=3) | ||
|
||
# Reports the ranks of MC^{(s, t)}_{k, l}, summed over (s, t) | ||
rk_gens = mg.rank_generators() | ||
|
||
# For each l, in parallel across each (s, t), computes MH^{(s, t)}_{k, l} | ||
# Adds up the rank for each k, l | ||
rk_hom = mg.rank_homology() | ||
|
||
# Pretty print | ||
print("Rank of MC:") | ||
print(format_rank_table(rk_gens)) | ||
|
||
print("Rank of MH:") | ||
print(format_rank_table(rk_hom)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters