Skip to content

Issue using AdsorbML with ASE Atoms adsorbate #1821

@seth-porter

Description

@seth-porter

What would you like to report?

I'm having issues specifying an arbitrary ase.Atoms adsorbate (instead of the SMILES string) for the AdsorbML package. When executing run_adsorbml(), a UserWarning message appears specifying that the SMILES string was not found, and chooses a random adsorbate instead. Has anyone encountered this issue before? Any help would be very appreciated. Below is a minimal example:

`
from fairchem.core.components.calculate.recipes.adsorbml import run_adsorbml
from fairchem.data.oc.core import Adsorbate, Bulk, Slab
from fairchem.core import pretrained_mlip, FAIRChemCalculator
from ase.optimize import LBFGS
from ase.build import molecule

ase.Atoms object for use in AdsorbML

CO = molecule("CO", vacuum=10)
bulk_src_id = "mp-126" # Pt
bulk = Bulk(bulk_src_id_from_db = bulk_src_id)

adsorbate = Adsorbate(adsorbate_atoms=CO, adsorbate_binding_indices=1)
slabs = Slab.from_bulk_get_specific_millers(bulk = bulk, specific_millers=(1,1,1))
slab = slabs[0]

predictor = pretrained_mlip.get_predict_unit("uma-s-1",device="cpu")
calc = FAIRChemCalculator(predictor, task_name="oc20")
adsorption_energy_model = False

outputs = run_adsorbml(
slab=slab,
adsorbate=adsorbate,
calculator=calc,
optimizer_cls=LBFGS,
fmax=0.02,
steps=2, # Increase to 200 for practical application, 2 is used for demonstrations
num_placements=10, # Increase to 100 for practical application, 10 is used for demonstrations
reference_ml_energies=not adsorption_energy_model, #True if using a total energy model (i.e. UMA)
relaxed_slab_atoms=None,
place_on_relaxed_slab=False,
)
`
Step Time Energy fmax
LBFGS: 0 13:14:05 -284.839118 0.132643
LBFGS: 1 13:14:06 -284.841281 0.121390
LBFGS: 2 13:14:07 -284.853415 0.014798

UserWarning: An adsorbate with that SMILES string was not found. Choosing one at random instead.
warnings.warn(

  Step     Time          Energy          fmax

LBFGS: 0 13:30:46 -313.174785 3.946587
LBFGS: 1 13:30:46 -313.566463 1.675160
LBFGS: 2 13:30:47 -313.788261 1.350170
...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions