Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple paths #258

Merged
merged 8 commits into from
Feb 12, 2024
Merged

Multiple paths #258

merged 8 commits into from
Feb 12, 2024

Conversation

SCiarella
Copy link
Contributor

This PR has the following two main objectives

(1) Fix a small bug in the definition of the free energy graph:

Instead of weighting the graph edge between i and j as
weight = F[j]
we now do instead
weight = 0.5*(F[i] + F[j]).
This guarantees that the graph is well balanced and the optimal path is calculated corrected in all edge cases.
The tests have been update according to this new definition.

(2) Address #204

I have added the function paths.multiple_paths that returns a list of Pathway object, corresponding to the desired number of optimal paths between two selected sites.
The multiple paths are collected according to this algorithm (implemented in networkx ) , while discarding all the ones that are too similar.
I have updated energy_along_path and path_on_landscape to accept lists of paths as input and produce plots like this one:
2

Add multiple paths finding

Update tests according to correct F
@SCiarella SCiarella linked an issue Feb 8, 2024 that may be closed by this pull request
@SCiarella
Copy link
Contributor Author

I have added this notebook to showcase the multiple path functionality.

@SCiarella SCiarella requested a review from stefsmeets February 8, 2024 13:24
src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/path.py Outdated Show resolved Hide resolved
Copy link
Contributor

@stefsmeets stefsmeets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, nice work! Some python suggestions/nitpicks from my side.

src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/path.py Show resolved Hide resolved
src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/plots/matplotlib/_paths.py Show resolved Hide resolved
src/gemdat/plots/matplotlib/_paths.py Show resolved Hide resolved
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
@SCiarella SCiarella marked this pull request as draft February 9, 2024 08:36
SCiarella and others added 2 commits February 9, 2024 09:37
Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
@SCiarella SCiarella marked this pull request as ready for review February 9, 2024 09:18
@SCiarella SCiarella requested a review from stefsmeets February 9, 2024 10:05
src/gemdat/path.py Outdated Show resolved Hide resolved
src/gemdat/path.py Outdated Show resolved Hide resolved
Copy link
Contributor

@stefsmeets stefsmeets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 🚀

Co-authored-by: Stef Smeets <stefsmeets@users.noreply.github.com>
@SCiarella SCiarella merged commit efd7def into main Feb 12, 2024
3 checks passed
@SCiarella SCiarella deleted the multiple_paths branch February 12, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Energy landscape: Multiple short paths
2 participants