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

NEB routine to target equal energy difference between knots #3596

Merged
merged 29 commits into from Jan 16, 2023

Conversation

tomswinburne
Copy link
Collaborator

@tomswinburne tomswinburne commented Jan 12, 2023

Summary

NEB 'ideal' aims to give equidistant knots; this PR implements a NEB style 'equal' which aims to give knots equidistant in energy. From the proposed fix_neb.rst:

With a value of ideal, the spring force is computed as suggested in ref(WeinanE) <WeinanE>

Fnudge_parallel = -Kspring * (RD-RDideal) / (2 * meanDist)

where RD is the "reaction coordinate" see :doc:neb <neb> section, and RDideal is the ideal RD for which all the images are equally spaced. I.e. RDideal = (I-1)*meanDist when the climbing replica is off, where I is the replica number). The meanDist is the average distance between replicas. Note that in this case the specified Kspring is in force units.

Note that the ideal form of nudging can often be more effective at keeping the replicas equally spaced.

With a value of equal the spring force is computed as for ideal before the climbing stage, then is computed to promote equidistant spacing in energy rather than distance:

Fnudge_parallel = -Kspring * (ED-EDideal) / (2 * meanEDist)

where ED is the cumulative sum of absolute energy differences ED=sum(i<I)|E(Ri+1)-E(Ri)|, EDideal = (I-1)*meanEdist and meanEdist is the average absolute energy difference between replicas. This form of nudging is to aid schemes which integrate forces along NEB pathways such as [:doc:fix_pafi <fix_pafi>], by providing optimal quadrature points.

Related Issue(s)

Author(s)
Tom D Swinburne, CNRS / Aix-Marseille University, thomas.swinburne at cnrs.fr

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility
no

Implementation Notes
Fully checked in lammps, minimal changes to code

Post Submission Checklist

  • The feature or features in this pull request is complete
  • Licensing information is [complete]
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • Suitable tests have been added to the unittest tree.
  • A package specific README file has been included or updated
  • One or more example input decks are included

Further Information, Files, and Links

Test image:
neb_test_c15

Copy link
Member

@akohlmey akohlmey left a comment

Choose a reason for hiding this comment

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

As indicated in individual comments, this needs changes to the code and documentation and some explanation. It would also be an opportunity to do some refactoring beyond your changes, especially for the documentation to make it better aligned with the latest style and conventions that we are trying to establish for better readability and visual appeal.

doc/src/fix_neb.rst Outdated Show resolved Hide resolved
src/REPLICA/fix_neb.cpp Outdated Show resolved Hide resolved
src/REPLICA/fix_neb.cpp Outdated Show resolved Hide resolved
src/REPLICA/fix_neb.cpp Outdated Show resolved Hide resolved
src/REPLICA/neb.cpp Outdated Show resolved Hide resolved
@akohlmey akohlmey requested a review from athomps January 12, 2023 16:32
@akohlmey akohlmey self-assigned this Jan 12, 2023
@akohlmey akohlmey added this to the Stable Release Summer 2023 milestone Jan 12, 2023
@tomswinburne
Copy link
Collaborator Author

I have implemented the changes @akohlmey , I added a similar enum for the verbose keyword also.

@tomswinburne
Copy link
Collaborator Author

To confirm @akohlmey , I will not edit anymore until future notice

@akohlmey
Copy link
Member

To confirm @akohlmey , I will not edit anymore until future notice

I am done with my changes

@tomswinburne
Copy link
Collaborator Author

Many thanks for the quick changes @akohlmey

@akohlmey akohlmey requested a review from sjplimp January 13, 2023 17:45
Copy link
Contributor

@athomps athomps left a comment

Choose a reason for hiding this comment

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

  1. I suggest replacing terse and verbose keywords with a single optional keyword verbosity that is followed by values normal or terse or verbose. This will fully reflect the values of print_mode in the implementation. The doc page should be updated accordingly, including in Default section at the bottom "{verbosity} = {normal}"
  2. The plot included in the PR shows that EDideal is different on the left and right sides of the climbing image. This should be reflected in the doc page definition of Fparallel, at least in the form of a comment, but ideally in the form of a mathematical expression.

@akohlmey akohlmey added test_for_regression Enable to trigger regression tests and removed test_for_regression Enable to trigger regression tests labels Jan 14, 2023
@akohlmey
Copy link
Member

  1. I suggest replacing terse and verbose keywords with a single optional keyword verbosity that is followed by values normal or terse or verbose. This will fully reflect the values of print_mode in the implementation. The doc page should be updated accordingly, including in Default section at the bottom "{verbosity} = {normal}"

This is done now.

@tomswinburne
Copy link
Collaborator Author

2. The plot included in the PR shows that `EDideal` is different on the left and right sides of the climbing image.  This should be reflected in the doc page definition of Fparallel, at least in the form of a comment, but ideally in the form of a mathematical expression.

Updated doc page to reflect the operation of equal and ideal. During climbing, the ideal style no longer targets equal spacing, but equal spacing each side of the climbing image. The equal style is identical to ideal before climbing, then during climbing the target is equal absolute energy differences each side of the climbing image.

@akohlmey akohlmey requested a review from athomps January 16, 2023 14:02
Copy link
Contributor

@athomps athomps left a comment

Choose a reason for hiding this comment

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

I approve.

@athomps
Copy link
Contributor

athomps commented Jan 16, 2023

Updated doc page to reflect the operation of equal and ideal. During climbing, the ideal style no longer targets equal spacing, but equal spacing each side of the climbing image. The equal style is identical to ideal before climbing, then during climbing the target is equal absolute energy differences each side of the climbing image.
@tomswinburne Thanks for also clarifying the effect of ideal style in climbing mode.

@akohlmey akohlmey merged commit 0a5f97c into lammps:develop Jan 16, 2023
@tomswinburne
Copy link
Collaborator Author

Many thanks @akohlmey and @athomps !

@tomswinburne tomswinburne deleted the energy_spacing_neb branch January 16, 2023 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants