orbital-materials / orb-models

ORB forcefield models from Orbital Materials
Apache License 2.0
190 stars 22 forks source link

Performing slab calculations #7

Closed tomdemeyere closed 1 month ago

tomdemeyere commented 2 months ago

Hello,

I tried to perform some slab calculations with one atomic oxygen adsorbed on elemental surfaces. However there are some important issues such as relatively high deformation and translations of the slab.

I am using the script provided in the README. Issues seem to occur with the simple and d3 model.

Are the models usable for such systems? Thanks

benrhodes26 commented 1 month ago

Hi Tom! Thanks for raising this. If you could provide code, then we would be happy to debug on our end.

We are aware of some extrapolation issues with our V1 models when generalising to non-bulk structures. We are actively working on V2 models that should hopefully address these problems! :)

benrhodes26 commented 1 month ago

Also, we just released V0.3.2, so if you pip install --upgrade orb-models, you'll be able to use our new finetuning script.

You may find that finetuning on in-domain slab data improves performance.

tomdemeyere commented 1 month ago

Hello again! Sorry for missing your email: that's what I used to test the models:

If it matters, I am running that on Apple M1.


from ase.build import add_adsorbate, fcc111
from ase.optimize import BFGS
from orb_models.forcefield import pretrained
from orb_models.forcefield.calculator import ORBCalculator

elements = ["Ni", "Cu", "Ir", "Au", "Pd", "Ag"]

orbff = pretrained.orb_d3_sm_v1()

calc = ORBCalculator(orbff, device="cpu")

for el in elements:
    atoms = fcc111(el, (3, 3, 5), vacuum=10)
    add_adsorbate(atoms, adsorbate="O", position="fcc", height=1.5)

    atoms.calc = calc

    opt = BFGS(atoms, trajectory=f"{atoms.get_chemical_formula()}.traj")

    opt.run(fmax=0.01)
benrhodes26 commented 1 month ago

Hi Tom.

Sorry for the long delay on this one; we have been developing orb-v2 models to make the model more robust for use-cases like yours. We should release these models in 1 - 1.5 weeks.

However, I am not really sure what to expect when running your code. I tried running Ni with MACE, orb-v1 and orb-v2 (not released yet). The videos are below:

MACE (medium) https://github.com/user-attachments/assets/a958f7ab-286d-4ee6-919a-d2f5a46ba82b

Orb-sm-v1 https://github.com/user-attachments/assets/9d907a21-1ff5-45dd-bc58-071c1a1aa63c

Orb-sm-v2 https://github.com/user-attachments/assets/a1bad43d-4c04-497c-b5fa-9320031d3905

Would you deem all of these as having "relatively high deformation and translations of the slab"?

tomdemeyere commented 1 month ago

Hello @benrhodes26

Would you deem all of these as having "relatively high deformation and translations of the slab"?

Not at all! MACE has the tendency to highly overestimate the distance between O and Ni(111), I would say that Orb-sm-v2 probably improves things since you can see that the adsorbate gets closer.

I will rerun these when I have more time, thanks a lot for helping on this!

benrhodes26 commented 1 month ago

Okay, good to hear!

I will close this issue for now, but please do reopen it if you have any problems with the v2 models once they are released.