Coder Social home page Coder Social logo

aceinterfaces's People

Contributors

14yapkc1 avatar bernstei avatar cortner avatar davkovacs avatar

Watchers

 avatar  avatar  avatar

aceinterfaces's Issues

Get ACE descriptors only from ACE1.jl

Dear developers,

My name is Howard Yanxon, a postdoc at Argonne National Laboratory. I am interested in using ACE descriptor to train a neural network (NN) potential for battery applications.

I wonder if there is a method to get only the ACE descriptors from your Julia ACE package given an ASE structure and ACE parameters in python. It will be great if the descriptor derivative w.r.t. position (dD_i/dR_m) and descriptor stress can be extracted along with the ACE descriptors. In addition, I already have a NN pipeline that can take any descriptors for training.

Please let me know if more clarifications are needed.

I really appreciate for the guidance.

unphysical behavior when the ASE ACECalculator is called on a system with small cell vectors but pbc=False

Minimizing energy for a system which is in a small cell but has pbc=False can lead to complete breakdown, with atoms moving in all sorts of unphysical ways and energy diverging to negative values. I'm not sure what the right way to deal with this is (my instinct would be for the cell vectors to just be ignored) - might be best to be consistent with what ASE thinks should happen. But it'd be nice if this was detected at least.

"free_energy" ASE calculator property

At least some operations of the testing framework (https://github.com/libAtoms/testing-framework) lead to an error with the free_energy property, e.g.

  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/optimize/precon/lbfgs.py", line 365, in run
    return Optimizer.run(self, fmax, steps)
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/optimize/optimize.py", line 273, in run
    return Dynamics.run(self)
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/optimize/optimize.py", line 156, in run
    for converged in Dynamics.irun(self):
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/optimize/optimize.py", line 128, in irun
    self.log()
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/optimize/precon/lbfgs.py", line 381, in log
    e = self.atoms.get_potential_energy()
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/constraints.py", line 2469, in get_potential_energy
    atoms_energy = self.atoms.get_potential_energy(
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/atoms.py", line 728, in get_potential_energy
    energy = self._calc.get_potential_energy(
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/calculators/abc.py", line 24, in get_potential_energy
    return self.get_property(name, atoms)
  File "/share/apps/ase/ase-local/2021-12-09/lib/python3.8/site-packages/ase/calculators/calculator.py", line 484, in get_property
    raise PropertyNotImplementedError('{} property not implemented'
ase.calculators.calculator.PropertyNotImplementedError: free_energy property not implemented

I think potentials need to implement that property (which is really meant to be the version of the energy that's consistent with derivatives such as forces, originally for ASE DFT calculators) as being identical to the internal energy

ACEinterfaces ASE calculator fails internal test

With the latest ACE1pack, following the directions for building and testing the ASE interface fails with

tin 1085 : python test_ase_calc.py 
Positions of the atoms
[[-1.62840152 -0.37075213 -0.00382227]
 [-0.64824885  0.40373766  0.01092238]
 [ 0.74097139  0.2639896  -0.21126373]
 [ 1.86825371 -0.26794094  0.08327051]
 [-2.70772314  0.05711336  0.20306806]
 [-1.33723688 -1.40824032 -0.04185092]
 [-0.90577459  1.40605712  0.30104554]
 [ 2.95528626 -0.22913523  0.263096  ]]
TEST energy call

signal (11): Segmentation fault
in expression starting at none:0
typekeyvalue_hash at /buildworker/worker/package_linux64/build/src/jltypes.c:1152 [inlined]
lookup_typevalue at /buildworker/worker/package_linux64/build/src/jltypes.c:722
jl_inst_arg_tuple_type at /buildworker/worker/package_linux64/build/src/jltypes.c:1589
arg_type_tuple at /buildworker/worker/package_linux64/build/src/gf.c:1845 [inlined]
jl_lookup_generic_ at /buildworker/worker/package_linux64/build/src/gf.c:2373 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2425
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_call2 at /buildworker/worker/package_linux64/build/src/jlapi.c:256
energy at /home/cluster2/bernstei/src/work/ACE/ACEinterfaces/ase/ace/ace_c.so (unknown line)
ffi_call_unix64 at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
ffi_call_int at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
_call_function_pointer at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:921 [inlined]
_ctypes_callproc at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:1264
PyCFuncPtr_call at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/_ctypes.c:4201
_PyObject_MakeTpCall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
PyEval_EvalCodeEx at python (unknown line)
PyEval_EvalCode at python (unknown line)
unknown function (ip: 0x55e85bd332e2)
unknown function (ip: 0x55e85bd4f542)
unknown function (ip: 0x55e85bd54561)
PyRun_SimpleFileExFlags at python (unknown line)
Py_RunMain at python (unknown line)
Py_BytesMain at python (unknown line)
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x55e85bcc7d68)
Allocations: 7772677 (Pool: 7769525; Big: 3152); GC: 6
Segmentation fault (core dumped)

Since that has no info on where the julia calls failed, I tried to run a pure julia evaluation of the potential in assets/, which is the one tested by the python test, which fails with

ERROR: LoadError: JuLIP.FIO.read_dict no implemented for symbol ACE_PolyPairPot

Doing sed 's/"ACE_/"ACE1_/' on the reference potential json just changes the error to complaining about ACE1_PolyPairPot.

test_ase_calc.py seg faults with new ACE1

With the new ACE1 configured for julia, running the ase interface test (ensuring that JULIA_PROJECT is set correctly) crashes with the following stack trace. This is inside the call to the ace_c.c function energy(), specifically the call to jlE = jl_call2(_energyfcn, calc, at);.

[ADDED LATER] Note that this stack trace is probably irrelevant. The problem is the reference potential file being incompatible with ACE1.

signal (11): Segmentation fault
in expression starting at none:0
typekeyvalue_hash at /buildworker/worker/package_linux64/build/src/jltypes.c:1152 [inlined]
lookup_typevalue at /buildworker/worker/package_linux64/build/src/jltypes.c:722
jl_inst_arg_tuple_type at /buildworker/worker/package_linux64/build/src/jltypes.c:1589
arg_type_tuple at /buildworker/worker/package_linux64/build/src/gf.c:1845 [inlined]
jl_lookup_generic_ at /buildworker/worker/package_linux64/build/src/gf.c:2373 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2425
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_call2 at /buildworker/worker/package_linux64/build/src/jlapi.c:256
energy at /home/cluster2/bernstei/src/work/ACE/ACEinterfaces/ase/ace/ace_c.c:92
ffi_call_unix64 at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
ffi_call_int at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
_call_function_pointer at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:921 [inlined]
_ctypes_callproc at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:1264
PyCFuncPtr_call at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/_ctypes.c:4201
_PyObject_MakeTpCall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
_PyFunction_Vectorcall at python (unknown line)
_PyEval_EvalFrameDefault at python (unknown line)
_PyEval_EvalCodeWithName at python (unknown line)
PyEval_EvalCodeEx at python (unknown line)
PyEval_EvalCode at python (unknown line)
unknown function (ip: 0x555b45aa32e2)
unknown function (ip: 0x555b45abf542)
unknown function (ip: 0x555b45ac4561)
PyRun_SimpleFileExFlags at python (unknown line)
Py_RunMain at python (unknown line)
Py_BytesMain at python (unknown line)
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x555b45a37d68)
Allocations: 21638703 (Pool: 21634084; Big: 4619); GC: 16
Segmentation fault (core dumped)

Segfaults pretty much instantly using NS

ACEinterfaces segfaults after ~50 steps using NS. Pyjulip also segfaults occasionally but only every ~100K steps or so. I've gone back to using PyJulip for NS now...

virial vs stress

@davkovacs I'm surprised you implemented stress instead of virial. Is this the more fundamental quantity in ASE? In JuLIP, I take virial as the fundamental quantity while stress is a derived quantity. Can you clarify?

better error message from when json file is wrong

The current error when you pass an json that is not actually an ACE potential is not at all helpful - just a seg fault and a string of unintelligible package internals. Some error checking and a more informative message would be nicer.

Loading potential: __ase_calc__ = read_dict( load_dict("ACE_perov_harmonic_5.25_3_10_rrqr_1e-08.fitting_err.json")["IP"])

signal (11): Segmentation fault
in expression starting at none:0
typekeyvalue_hash at /buildworker/worker/package_linux64/build/src/jltypes.c:1152 [inlined]
lookup_typevalue at /buildworker/worker/package_linux64/build/src/jltypes.c:722
jl_inst_arg_tuple_type at /buildworker/worker/package_linux64/build/src/jltypes.c:1589
arg_type_tuple at /buildworker/worker/package_linux64/build/src/gf.c:1845 [inlined]
jl_lookup_generic_ at /buildworker/worker/package_linux64/build/src/gf.c:2373 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:2425
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1788 [inlined]
jl_call2 at /buildworker/worker/package_linux64/build/src/jlapi.c:256
forces at /home/cluster2/bernstei/.local/lib/python3.8/site-packages/ace-0.1-py3.8.egg/ace/ace_c.so (unknown line)
ffi_call_unix64 at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
ffi_call_int at /home/Software/python/anaconda3/lib/python3.8/lib-dynload/../../libffi.so.8 (unknown line)
_call_function_pointer at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:921 [inlined]
_ctypes_callproc at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/callproc.c:1264
PyCFuncPtr_call at /usr/local/src/conda/python-3.8.12/Modules/_ctypes/_ctypes.c:4201
_PyObject_MakeTpCall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyFunction_Vectorcall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyFunction_Vectorcall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyEval_EvalCodeWithName at python3 (unknown line)
_PyFunction_Vectorcall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyEval_EvalCodeWithName at python3 (unknown line)
_PyFunction_Vectorcall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyEval_EvalCodeWithName at python3 (unknown line)
_PyFunction_Vectorcall at python3 (unknown line)
_PyEval_EvalFrameDefault at python3 (unknown line)
_PyEval_EvalCodeWithName at python3 (unknown line)
PyEval_EvalCodeEx at python3 (unknown line)
PyEval_EvalCode at python3 (unknown line)
unknown function (ip: 0x562ee74102e2)
unknown function (ip: 0x562ee742c542)
unknown function (ip: 0x562ee7431561)
PyRun_SimpleFileExFlags at python3 (unknown line)
Py_RunMain at python3 (unknown line)
Py_BytesMain at python3 (unknown line)
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x562ee73a4d68)
Allocations: 20740058 (Pool: 20735736; Big: 4322); GC: 15
Segmentation fault (core dumped)

silent creation of ASE calculator

I think it would be preferable not to print Loading potential: __ase_calc__ = read_dict( load_dict("run_dir/ACE.B_test.json")["IP"]) by default every time a calculator is created.

ACE Versions

If we want to use this interface also for other ACE versions we need to figure out how to manage this. At the moment the version is hard-coded in Project.toml. Maybe there is a better way. Pass the version into the initialization?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.