Skip to content
Snippets Groups Projects

Support dipole moments in ORCA (taken over !3020)

This MR is taken over from !3020 (closed) (made by @jfojt; thank you so much for the nice addition!) to add a dipole-moment parser for the ORCA output.

There are several remaining issues to be fixed in !3020 (closed), which are addressed in the present MR:

  • There are 3 merge commits (9f47df72, d1e998c6, 3eb28afa) including inherited changes on several hundreds of files. These may be better not to be included in the master-branch history, and for that we probably need git rebase.
  • As commented by @askhl (here), it should nowadays be avoided to add a big file to testdata, and it is instead now recommended to use a short string snippet to test a new functionality. To not inherit the big file in the commits in !3020 (closed), here it is also required to do git rebase.

In the beginning I wanted to simply update !3020 (closed) (following the guidance of Gitlab) via the forked repository jfojt/ase:fix-orca, but I found that probably I cannot update it when I did a full rebase. I therefore needed to open this as this new MR.

@askhl @AndrewRosen I would be very happy if you kindly review if this MR makes sense.

Closes !3020 (closed) (I will do by hand if the present MR is accepted.)

Checklist

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
97 continue
98 if getgrad and "#" not in line:
99 grad = line.split()[-1]
100 tempgrad.append(float(grad))
101 if len(tempgrad) == 3:
102 gradients.append(tempgrad)
103 tempgrad = []
104 if '# The at' in line:
105 getgrad = False
106
107 forces = -np.array(gradients) * Hartree / Bohr
154 fd.readline() # skip line only with '#'
155 gradients = [float(fd.readline()) for _ in range(3 * natoms)]
156 break
157 gradients = np.array(gradients).reshape((-1, 3))
158 forces = -1.0 * gradients * Hartree / Bohr
  • Comment on lines +145 to +158

    @yuzie007: Just one final question before proceeding. What was the motivation for updating the read_orca_engrad function? Is this fixing some functionality, is it more robust, faster, just for refactoring's sake, etc?

    Since the original scope of the MR is about dipole moments, I want to make sure the motivation behind any other decisions are known.

  • Yuji Ikeda changed this line in version 4 of the diff

    changed this line in version 4 of the diff

  • Author Maintainer

    Thank you @AndrewRosen for the check!

    This was just a refactoring (which for myself was easy to read), but I admit that I did not do a careful and objective performance check. I now reverted to the original implementation. I fully agree that it is better here to focus on the dipole-moment parser, and if in future we found the necessity of refactoring, we can open a separate MR.

  • Thank you, @yuzie007! I appreciate it, even if it meant reverting some of your work. If potential issues arise, this separation of work helps ensure that it is easier to identify the change that breaks things. For something as crucial as force parsing, I felt keeping it separate would be worthwhile.

  • Please register or sign in to reply
  • Yuji Ikeda added 7 commits

    added 7 commits

    • f1c2e8b7 - ORCA: Restructure reading.
    • 16b71141 - ORCA: Support dipole moments
    • a45124e5 - Test parsing of dipole
    • 60f9d364 - ORCA: Test dipole in calculator
    • cce6e804 - ORCA gives dipole in center of mass frame
    • b8540cae - Parse center of mass and charge in orca parser
    • 3e8e5745 - Reduce usage of `re`

    Compare with previous version

  • Ready to go!!

  • Andrew Rosen mentioned in commit a4b1986e

    mentioned in commit a4b1986e

  • merged

  • Yuji Ikeda mentioned in merge request !3020 (closed)

    mentioned in merge request !3020 (closed)

  • Please register or sign in to reply
    Loading