JuLIP.jl icon indicating copy to clipboard operation
JuLIP.jl copied to clipboard

Missing methods for ASEAtoms compatibility

Open jameskermode opened this issue 5 years ago • 8 comments

Would you be happy to add the following method:

energy(calc::ASE.ASECalculator, at::JuLIP.Atoms) = energy(calc, ASE.ASEAtoms(at))

and the same for forces, stress etc? It would make code which has to call ASECalculators more convenient. Should it go in ASE.jl or JuLIP.jl?

cc. @SMakri

jameskermode avatar Aug 24 '18 12:08 jameskermode

Should go into ASE.jl

cortner avatar Aug 24 '18 13:08 cortner

And the analogue with a non-ASE calculator and ASEAtoms

cortner avatar Aug 24 '18 13:08 cortner

I can donut later or Stela can make a PR?

cortner avatar Aug 24 '18 13:08 cortner

Sounds good. minimise!() is a bit more difficult as it modifies the atoms object in place, so copying the input won't work - do you have an idea for that?

jameskermode avatar Aug 24 '18 13:08 jameskermode

This is probably silly, but what does "PR" stand for?

SMakri avatar Aug 24 '18 13:08 SMakri

Pull request

cortner avatar Aug 24 '18 13:08 cortner

I suppose this would work:

function minimise!(at::ASEAtoms, ...) 
    jat = JuLIP.Atoms(at)
    minimise!(jat, ...)
    set_dofs!(at, dofs(jat))
end function

jameskermode avatar Aug 24 '18 13:08 jameskermode

I need to look at minimise!. Let’s see

cortner avatar Aug 24 '18 13:08 cortner