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
adding resonance for adsorbates #2511
Open
bjkreitz
wants to merge
6
commits into
main
Choose a base branch
from
adsorbate_resonance
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+413
−63
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e8988e7
adding resonance for adsorbates
bjkreitz def17d2
incorporate feedback
bjkreitz e3063dc
add multidentate check to fragment
bjkreitz ff95b0e
add resonance to get_thermo_for_surface_species
bjkreitz 52a5e38
fix pathfinder and get_thermo bug
bjkreitz 53afb85
add tests and fix pathfinderTest
bjkreitz File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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 |
---|---|---|
|
@@ -480,3 +480,57 @@ | |
return (((atom.is_nitrogen() or atom.is_sulfur()) and atom.lone_pairs in [1, 2, 3]) | ||
or (atom.is_oxygen() and atom.lone_pairs in [2, 3]) | ||
or atom.is_carbon() and atom.lone_pairs == 1) | ||
|
||
alongd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
def find_adsorbate_delocalization_paths(atom1): | ||
""" | ||
Find all multidentate adsorbates which have a bonding configuration X-C-C-X. | ||
|
||
Examples: | ||
|
||
- XCXC, XCHXCH, XCXCH, where X is the surface site. The adsorption site X is always placed on the left-hand side of | ||
the adatom and every adatom is bonded to only one surface site X. | ||
|
||
In this transition atom1 and atom4 are surface sites while atom2 and atom3 are carbon atoms. | ||
""" | ||
cython.declare(paths=list, atom2=Vertex, atom3=Vertex, atom4=Vertex, bond12=Edge, bond23=Edge, bond34=Edge) | ||
|
||
path = [] | ||
|
||
if atom1.is_surface_site(): | ||
for atom2, bond12 in atom1.edges.items(): | ||
if atom2.is_carbon(): | ||
for atom3, bond23 in atom2.edges.items(): | ||
if atom3.is_carbon(): | ||
for atom4, bond34 in atom3.edges.items(): | ||
if atom4.is_surface_site(): | ||
path.append([atom1, atom2, atom3, atom4, bond12, bond23, bond34]) | ||
|
||
return path | ||
|
||
def find_adsorbate_conjugate_delocalization_paths(atom1): | ||
""" | ||
Find all multidentate adsorbates which have a bonding configuration X-C-C-C-X. | ||
|
||
Examples: | ||
|
||
- XCHCHXCH/XCHCHXC, where X is the surface site. The adsorption site X is always placed on the left-hand side of | ||
the adatom and every adatom is bonded to only one surface site X. | ||
|
||
In this transition atom1 and atom5 are surface sites while atom2, atom3, and atom4 are carbon atoms. | ||
""" | ||
cython.declare(paths=list, atom2=Vertex, atom3=Vertex, atom4=Vertex, atom5=Vertex, bond12=Edge, bond23=Edge, bond34=Edge, bond45=Edge) | ||
|
||
path = [] | ||
|
||
if atom1.is_surface_site(): | ||
for atom2, bond12 in atom1.edges.items(): | ||
if atom2.is_carbon(): | ||
for atom3, bond23 in atom2.edges.items(): | ||
if atom3.is_carbon(): | ||
for atom4, bond34 in atom3.edges.items(): | ||
if atom2 is not atom4 and atom4.is_carbon(): | ||
for atom5, bond45 in atom4.edges.items(): | ||
if atom5.is_surface_site(): | ||
path.append([atom1, atom2, atom3, atom4, atom5, bond12, bond23, bond34, bond45]) | ||
|
||
return path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. minor: please leave an empty line at the end of each file |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we also return
True
if the molecule is tridentate. Would we like to reflect that in the docstring (if not in the function name)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I renamed the function to is_multidentate since all multidentate species can have resonance.