CompPhysVienna / n2p2

n2p2 - A Neural Network Potential Package
https://compphysvienna.github.io/n2p2/
GNU General Public License v3.0
217 stars 82 forks source link

pynnp example #113

Closed cengc13 closed 3 years ago

cengc13 commented 3 years ago

Hi,

I came across an error while running the example in the folder n2p2/examples/pynnp/symfunc-only, please see below for the error. I am using gcc 9.3.0 and python 3.8.5.

  File "/home/hughes/usr/n2p2/examples/pynnp/symfunc-only/example.py", line 36, in <module>
    m.calculateSymmetryFunctionGroups(s, False)
  File "Mode.pyx", line 69, in pynnp.Mode.calculateSymmetryFunctionGroups
    self.thisptr.calculateSymmetryFunctionGroups(deref(structure.thisptr),
IndexError: vector::_M_range_check: __n (which is 1) >= this->size() (which is 0)_

Also, I wonder how I can get the derivatives? setting m.calculateSymmetryFunctionGroups(s, True) gives me the error ArithmeticError: ERROR: Number of symmetry function derivatives unset, cannot allocate. Any help would be very appreciated.

Thank you.

singraber commented 3 years ago

Hello!

Thanks for pointing this out, it seems two setup calls were missing in pynnp and the python example scripts. I added them in the latest commit, so it should work now, please have a try!

Best, Andreas

cengc13 commented 3 years ago

It works now. Thanks for you quick fix.

Best, Cheng