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

Use adaptive OneDMin radii #131

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Use adaptive OneDMin radii #131

wants to merge 13 commits into from

Conversation

alongd
Copy link
Member

@alongd alongd commented May 9, 2019

Assuming the species is sphere-like, determine the r_min and r_max radii to use for a OneDMin L-J calculation.
Addresses #129

@alongd alongd requested a review from goldmanm May 9, 2019 15:57
@codecov
Copy link

codecov bot commented May 9, 2019

Codecov Report

Merging #131 into master will increase coverage by 0.49%.
The diff coverage is 74.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   42.63%   43.13%   +0.49%     
==========================================
  Files          27       27              
  Lines        6105     6192      +87     
  Branches     1578     1597      +19     
==========================================
+ Hits         2603     2671      +68     
- Misses       3120     3131      +11     
- Partials      382      390       +8
Impacted Files Coverage Δ
arc/job/inputs.py 100% <ø> (ø) ⬆️
arc/scheduler.py 18.92% <0%> (-0.12%) ⬇️
arc/parser.py 85.91% <0%> (-1.86%) ⬇️
arc/common.py 85.71% <100%> (+2.61%) ⬆️
arc/__init__.py 100% <100%> (ø) ⬆️
arc/species/converter.py 68.37% <33.33%> (-0.98%) ⬇️
arc/job/job.py 18.94% <66.66%> (+0.4%) ⬆️
arc/species/species.py 62.32% <88.09%> (+1.07%) ⬆️
arc/reaction.py 41.92% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce32cac...b68ede6. Read the comment docs.

@@ -1041,6 +1042,42 @@ def set_transport_data(self, lj_path, opt_path, bath_gas, opt_level, freq_path='
comment=str(comment)
)

def determine_radius(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the xyz used in ARC have a center of mass at 0,0,0? If not, this method can easily overestimate the radius.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think this should be the center of geometry, not of mass, right? I.e., not weighting atom numbers in the average

Copy link
Contributor

Choose a reason for hiding this comment

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

I am not entirely sure what the best way to do this should be. Jasper 2014 describes $r$ as center-of-mass distance between the bath gas and molecule, so I was thinking centering around the mass would be a better metric. Though I am not convinced that the center of mass is a better metric to determine the guess for the radius. Maybe the center of atoms/geometry would be better.

'H2': 1.70, 'N2': 1.95, 'O2': 1.88} # in Angstrom
bath_gas_r = int(math.ceil(bath_gas_radii_dict[bath_gas]))
species_radius = int(math.ceil(self.determine_radius()))
r_min = species_radius + bath_gas_r
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this might be an overestimate, since the minimum radius could fall below this value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking the max distance is likely to be an overestimate. Since we are taking the max distance in the previous one, maybe this would work better as r_max instead of r_min

bath_gases = ['H2', 'N2', 'Ar', 'H2']
expected_rs = [(3, 6), (4, 7), (4, 7), (3, 6)]
for i, spc in enumerate([self.spc2, self.spc6, self.spc8, self.spc9]):
self.assertEqual(spc.determine_onedmin_radii(bath_gas=bath_gases[i]), expected_rs[i])
Copy link
Contributor

Choose a reason for hiding this comment

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

A more robust test might ensure that the actual radius that 1dmin would predict falls within the range arkane guesses.

Though even if it is within the range but near the edge, 1dmin can fail. That's what happened with my ibutanol peroxy, which eventually obtained a radius of 4.6 but failed when the range was 2-5.

Copy link
Contributor

@goldmanm goldmanm left a comment

Choose a reason for hiding this comment

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

I like the code structure which gives the ability to estimate the range based on the coordinates. I have some questions, which are discussed partially in the comments.

I added the isobutane peroxy radical (with the mass center manually adjusted to 0,0,0) in N2, which I have gotten to run in 1dmin giving a radius of 4.6, the test methods and ran it to see the range that the method gave (you can see it here. The method gave 6 and 9 as r_min and r_max respectively, which above the value estimated by r_min and r_max

  1. Are the xyz's necesarilly centered around the center of mass? if not, it would be helpful to have a centering method since that is how 1dmin calculates radius.
  2. Have the ranges presented in the test method worked when the molecules are put into 1dmin? If not, either you or I should run them to make sure they work (also see comment which could improve robustness of test)
  3. One idea might be to set the r_max to the combined max radius of both molecules found in ARC and r_min to 3 smaller than that (with 1-4 or 2-5 being the minimum radius allowed). This might work for medium sized things like the butanol peroxy. Not sure what the maximum size might be.

@alongd
Copy link
Member Author

alongd commented May 14, 2019

Thanks for the comments!
I added fixups, let me know what you think. I plan to test it out with OneDMin before merging

r_min = species_radius + bath_gas_r
bath_gas_r = bath_gas_radii_dict[bath_gas]
species_radius = self.determine_radius()
r_min = species_radius + bath_gas_r + 0.2
Copy link
Contributor

Choose a reason for hiding this comment

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

One question I have is why add 0.2 A to the minimum radius.

Copy link
Contributor

Choose a reason for hiding this comment

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

At least with the older algorithm using ibutanol peroxy as a test case, the radius given by the method appeared to be an over estimate, such that I think

r_max = max((species_radius + bath_gas_r, 4.5))
r_min = species_radius - 3

would lead to more successful calculations than the other algorithm.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we don't have the same definition to r_max. I think r_max is the farthest point the bath gas is at from the axis origin, so it cannot be species_radius + bath_gas_r, because for a spherical species this will put the bath gas right at the edge of the sphere, which is r_min

@alongd
Copy link
Member Author

alongd commented Jun 10, 2019

I removed the xyz centring function, following the e-mail conversation with Ahren. I assume that the xyz is centered around the center of mass, which is the case for ESS output.
Let me know if you have any comments, perhaps we could meet next week to discuss it.

Also added a memory attribute to OneDMin
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.

None yet

2 participants