-
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.
Merge pull request #5 from arnaudon/weighted
correct weights
- Loading branch information
Showing
4 changed files
with
77 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from simplicial_kuramoto.frustration_scan import plot_projections, plot_order | ||
import matplotlib.pyplot as plt | ||
|
||
if __name__ == "__main__": | ||
for i in range(50): | ||
path = f"results/square_{i}.pkl" | ||
plot_projections(path, f"projections_{i:02d}.png") | ||
plot_order(path, f"order_{i:02d}.png") | ||
plt.close('all') |
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,39 @@ | ||
import numpy as np | ||
|
||
from simplicial_kuramoto import SimplicialComplex | ||
from simplicial_kuramoto.frustration_scan import scan_frustration_parameters | ||
from simplicial_kuramoto.graph_generator import delaunay_with_holes | ||
from simplicial_kuramoto.plotting import draw_simplicial_complex | ||
|
||
if __name__ == "__main__": | ||
points = [[-1, -1], [-1, 1], [1, 1], [1, -1]] | ||
w = 0.1 | ||
ws = np.linspace(0.1, 1.5, 50) | ||
for i, w in enumerate(ws): | ||
graph, points = delaunay_with_holes(points=points) | ||
for _i, (u, v) in enumerate(graph.edges): | ||
if _i == 0: | ||
graph[u][v]["weight"] = w | ||
else: | ||
graph[u][v]["weight"] = 1.0 | ||
|
||
Gsc = SimplicialComplex(graph=graph, face_weights=[w, w]) | ||
draw_simplicial_complex(Gsc, "complex.pdf") | ||
|
||
alpha1 = np.linspace(0, 2.5, 80) | ||
alpha2 = np.linspace(0, np.pi / 2.0, 120) | ||
n_repeats = 1 | ||
t_max = 1000 | ||
n_t = 500 | ||
n_workers = 80 | ||
|
||
scan_frustration_parameters( | ||
Gsc, | ||
filename=f"square_{i}.pkl", | ||
alpha1=alpha1, | ||
alpha2=alpha2, | ||
repeats=n_repeats, | ||
n_workers=n_workers, | ||
t_max=t_max, | ||
n_t=n_t, | ||
) |
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