-
Notifications
You must be signed in to change notification settings - Fork 3
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
OFF-EP 0005b #34
OFF-EP 0005b #34
Conversation
Also remove the modification of `Coulomb` -> `no-cutoff`
Co-authored-by: Jeff Wagner <[email protected]>
I haven't yet updated the |
I think I'm fine with this as well; I'd like to hear from @mattwthompson and @j-wags but it still seems relatively compact. |
I don't have a seat on the committee and but since I was asked - #30 solves, in my view, the problems we have identified as short-term blockers for version 0.11.0 of the toolkit (and a 0.2.0 release of Interchange, which will be paired with it) as I am trying to prevent #29 from creeping into Interchange. I intended for it to be unambiguously discrete in scope to the changes I need, both because I have not done research cycles on other topics and because I hoped it would be easier to review a more narrow proposal; the assumption is that it is easier to gain consensus on one move part than several. (This has been my hope with the OFF-EPs I have written, that targeted, narrow proposals would be easier to review, much like PRs to source code - even at the cost of having a larger number of proposals creating extra chatter.) I think specifying physical constants would be an excellent improvement to SMIRNOFF, but I'm not sure it's in scope here and think it would be better split out into a separate proposal. Two questions that immediately come to mind are
These needs clarification, presumably with coming changes to Should the default dielectric be 78.3 (water) or 78.5 (consistency with Amber)? Does this difference matter? Separately from this proposal, it would be worth seeing if OpenFF's fitting/benchmarking pipelines are consistent - both in terms of this constant and any other changes to the electrostatics definitions. I have no idea if the reaction field expression given in the example is supported by engines other than OpenMM; since it's not been an operational priority, I haven't dug into it and it's not a technique I'm familiar with. So I'm not able to given feedback on it except to repeat the same concern as above - if it's a requirement, it might be ignored when interfacing with slightly different implementations. I also don't know how different engines compute electrostatics of intramolecular interactions. To be honest, it's only recently come to my attention that this is a detail that engines have opinions about. I just need the specification revised to support the most common use case of our force fields: PME (with details possibly left unspecific) for periodic systems and something-close-to-exact-Coulomb for non-periodic systems. This proposal seems like it only adds content, if I'm reading things accurately. Assuming that updates to |
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.
Thanks @jchodera for adding your ideas to this proposal. I made several comments but none of them are necessary to resolve for me to approve this EP. I think the proposed changes are great and would approve this EP once the changes are propagated through to the smirnoff.md
file.
You and @mattwthompson have done most of the writing on this, so I'd be happy to edit the smirnoff.md
file with the proposed changes, and the "Backward compatibility" section of this EP with a more thorough recommendation for up-conversion (I'll have to write an up-converter anyway, so it couldn't hurt to specify exactly what it will do). Please tell me if you'd like me to make these edits and I can do so on Monday!
[CODATA 2018](https://physics.nist.gov/cuu/Constants/index.html) physical constants are used. | ||
Future OFF-EPs may migrate the specification of which self-consistent physical constants are used to a higher-level attribute. |
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.
(not blocking) I would approve an EP modifying the text of the 0.3 SMIRNOFF specification to say that 2018 CODATA values are assumed. I would approve that change in this EP or a different one, but given the asynchronous nature of our org I'd prefer that go in another EP.
I'd also approve an EP to add a top-level attribute to a SMIRNOFF FF specifying which CODATA should be used. But that should definitely be a different EP.
I share Matt's concerns that ensuring use of a specific CODATA will be very difficult when crossing the the boundaries of software ecosystems (like, when we export to another package, what if they use different physical constants? What if that other package updates its constants in a new release - How would we know which version we're exporting to?). But the "different physical constants" problem already exists. This step would change it from a "the answer is not defined" issue into a "the implementation doesn't follow the spec" issue, and that's an improvement to me. I don't know when I'll have time to do a deep audit of the physical constants in our current implementation, but a bug in the tracker is better than undefined behavior.
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.
I share Matt's concerns that ensuring use of a specific CODATA will be very difficult when crossing the the boundaries of software ecosystems (like, when we export to another package, what if they use different physical constants?
As I note below, if the constants defined in the force field and simulation package are explicitly specified/known, the parameters can be correctly converted to reproduce the intended energies.
What if that other package updates its constants in a new release - How would we know which version we're exporting to?).
This question answers itself: Export requires the specific release of the package to be specified in order to correctly export the parameters in a manner that ensures the energies are correctly computed.
To minimize pain in implementations, we can allow implementations continue to accept `method="PME"` as a synonym for `periodic_potential="Ewald3D-ConductingBoundary"` for a few releases, | ||
issuing a warning that the spec has changed and this behavior may be removed in a future release. |
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.
(not blocking) Thankfully, I don't think this is a concern. Since this change will be accompanied by an Electrostatics
section version change, implementations will know which keywords are expected from each version. My plan for the Toolkit would be to just automatically up-convert any Electrostatics section that is read from 0.3 to 0.4 (though if there are strong objections I could try to implement round trip support for both versions, but that would be expensive, brittle, and complex).
The optional `cutoff` tag attribute is added to specify the cutoff used for `periodic_potential` if applicable, defaulting to `None`. | ||
No value of `cutoff` is allowed for Ewald methods---only finite-ranged methods. | ||
|
||
The optional `solvent_dielectric` tag attribute is added to specify the solvent dielectric used with finite-ranged potentials, defaulting to `78.5`. |
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.
(not blocking) To other reviewers - I have no strong opinion about this default value, but you should be aware that 78.5
matches the default solvent_dielectric
value in the GBSA tag.
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.
It should likely be none
unless a reaction-field / custom expression that makes use of it is used?
(not blocking) This would be good to answer. I don't see it as a hard blocker for my approval, and I don't know enough about PME implementations to write this in |
@mattwthompson @j-wags : Thanks so much for your detailed feedback! Scope: My assumed scope differed from @mattwthompson's #29 in that I considered the scope of this OFF-EP to be "eliminate ambiguities in the definition of the
With my assumed scope of eliminating ambiguities, this was an ambiguity in the definition of how the potential was calculated that we need to explicitly address in this OFF-EP.
If we know which constants a package uses internally to compute the potential energy from our parameters, it is trivial to adjust the parameters on export to ensure the energies match their intended values. This is only possible if we specify what physical constants we intend the spec to use. If we do not, we will just get different energies in each package.
As noted above, a future OFF-EP could explicitly specify the physical constants used at a higher level---perhaps at top level---and remove the specification of which physical constants are used from the
We need to agree on a criteria for this, but my assumption here is that we will first need to see some data before we can construct a criteria. One possible approach, for example, would be to curate a set of test systems for which we could provide Interchange parameters and reference energies for a true Ewald implementation, and benchmark the exported energies in other packages with a variety of settings (e.g. different
We can choose not to define a default dielectric in this spec.
I did not define any keywords for reaction field electrostatics because I haven't had time to review which functional forms are implemented in different packages. It will require some effort to make sure implementations are standardized or can be implemented or approximated in multiple packages. For now, the safest thing to do is either exclude them (which is inconvenient, since we know we need to support Cresset with an optimized reaction field form) or explicitly specify the functional form (which likely for Cresset with their OpenMM implementation). Some refinement of this part of the proposal may be necessary, however, if we want to easily be able to render this to
These details matter for the energies they produce, so we cannot ignore them.
@j-wags : Please feel free to make further changes to the branch directly! My goal here was to provide the basis of an alternative OFF-EP that more thoroughly addressed all identified ambiguities in the I'll respond to the other comments inline. |
Fix typo. Co-authored-by: Jeff Wagner <[email protected]>
The remaining loose ends (PME details, reaction field implementation, intramolecular interactions) are each improved or not made worse by this proposal, so I don't see any reason to reject these proposals (a. I think we're in a good position to tackle them in the future. |
The optional `cutoff` tag attribute is added to specify the cutoff used for `periodic_potential` if applicable, defaulting to `None`. | ||
No value of `cutoff` is allowed for Ewald methods---only finite-ranged methods. |
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.
I'm updating the SMIRNOFF spec text and realized that I don't understand this - The existing Electrostatics
tag already has a cutoff
attribute, which defaults to 9.0 * unit.angstrom
. Is the proposal here to split the existing cutoff
attribute into cutoff_periodic
and cutoff_nonperiodic
?
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.
I think (especially if I wrote this, I don't know) that line 88 should refer to "cutoff_potential
if applicable ..."and not allowed/ignored for Ewald/Ewald-X methods that do not have a concept of a cutoff.
Another cup of coffee later, I guess we do have to consider the possibility of encoding separate cutoffs for periodic and non-periodic methods? I think reaction field has the concept of a cutoff? If the periodic method is reaction field and the non-periodic method is ... I don't know, some sort of hard cutoff, I guess they could differ?
OpenFF's common use case of PME + no-cutoff would result in both being ignored. I'm fine kicking the can down the road on this, but I think the most thorough solution suitable for the long term would be to split cutoff
into two new attributes.
…d migration guide, propagate proposed changes into actual spec.
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.
I've assumed that the answer to my last question is "yes, we need to split cutoff
into periodic_cutoff
and nonperiodic_cutoff
", then realized that we need to do the same with switch_width
, and gone ahead with:
- extending the
Reverse Compatibility
section of the EP with suggestions for upconverting to the new spec - propagated the proposed changes into the SMIRNOFF spec text
I approve merging this EP in its current form.
Thanks for the changes, @j-wags! Do we expect that (1) we will want to use a cutoff for non-periodic systems (which are primarily intended to match QM calculations) at some point in the future, and (2) we will want to at some point enable the cutoffs to be distinct in these cases? If so, this seems like a good future-proof change. I just couldn't envision a use case for either. |
No opinion - my experience with cutoff potentials is limited. @SimonBoothroyd or @davidlmobley, do you have an opinion? |
The Shirts, 2017 way of testing for energy equivalence (which I would like to be able to do, #6) uses a hard cut-off for electrostatics. But I don't know if this is something that must be supported for both periodic and non-periodic systems. I can't think of a use case outside of that (which would be strictly testing-only and never touch production). If there is any friction associated with officially supporting this feature I'd just modify a system after preparation to do this, which is only a tiny detour away from official SMIRNOFF.
I can't think of any cases; a cutoff being used in either periodic or non-periodic treatments should be rare and the possibility of shipping a force field using both should be vanishingly rare ... but I guess possible? |
Re the question directed at me: I personally don't expect a hard cutoff for nonperiodic systems. And I don't see a use case for separate cutoffs in the two cases. I also read everything else here and am fine with where this has ended up, so I approve this EP as written in its current form. @SimonBoothroyd ? |
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.
Thanks @jchodera these changes would indeed be a very welcome clarification / improvement to the spec.
I also can't think of a reason to use a hard cut-off with a plain Coulomb potential, and would suggest this be disallowed by the spec. If a user really wants this behaviour they can just provide the Coulomb potential as a custom expression and set the cut-off.
I think the two documents need another pass through to ensure consistency as the EP and SMIRNOFF spec seem to be mismatched in places.
Thanks for the close read, @SimonBoothroyd and everyone else! I'll take another swing this today - basically
Some of the defaults that Simon suggested changing to |
…efaults to none. fix inconsistencies per SB's review.
Ok, I think this is in good shape now. Thanks again @SimonBoothroyd for catching the inconsistencies. The notable changes now (beyond just fixing inconsistencies) are:
to
|
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.
Just a few last inconsistencies in the text but otherwise looks good to me.
For `periodic_potential`: | ||
|
||
* `Ewald3D-ConductingBoundary` (default) denotes that the Ewald potential with conducting (dielectric 0) boundary conditions are used | ||
* `Coulomb` denotes that the standard Coulomb potential should be used with specified cutoff `cutoff` and optionally switch width `switch_width` |
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.
* `Coulomb` denotes that the standard Coulomb potential should be used with specified cutoff `cutoff` and optionally switch width `switch_width` | |
* `Coulomb` denotes that the standard Coulomb potential should be used with no cutoff or reaction-field attenuation |
Co-authored-by: SimonBoothroyd <[email protected]>
…n table to treat 0.3 Coulomb as identical to PME
An alternative proposal to #30 to fix #29.
Other modifications that may be possible:
solvent_dielectric
to specify both reaction field dielectric constants and the Ewald boundary conditions dielectric constant (currently specified as part of the verboseEwald3D-ConductingBoundary
keyword)pi
andepsilon0
are used)