Skip to content

Adsorption workflow

A reproducible adsorption calculation retains the host/adsorbate definition, constraints, electronic state, energy references, and vibrational subspace. The example uses water at a finite (LiF)₂ coordination site with PBE/def2-SVP.

Terminal window
python visual-tutorials.py --output adsorption-study

Download the script. It generates the electronic fields, nine constraint variants, and analytical fixed-host adsorbate modes. All electronic calculations use CPU. The outputs include trajectories, force histories, absolute energies, a wavefunction, and portable viewer snapshots.

from atomli import Atoms
from atomli.calculators import QC
from atomli.constraints import FixAtoms
from atomli.optimize import BFGS
atoms = Atoms("LiFLiFOH2", positions=[
[0, 0, 0], [1.7, 0, 0], [1.7, 1.7, 0], [0, 1.7, 0],
[-0.3, -0.25, 2.15], [-0.3, 0.513, 2.746], [-0.3, -1.013, 2.746],
])
host_indices = [0, 1, 2, 3]
adsorbate_indices = [4, 5, 6]
atoms.set_constraint(FixAtoms(indices=host_indices))
atoms.calc = QC(xc="PBE", basis="def2-svp", device="cpu", scf={"energy_tolerance": 1e-8})
if not BFGS(atoms, maxstep=0.12).run(fmax=0.003, steps=160):
raise RuntimeError("Adsorption geometry did not converge")

Converged water adsorption on a finite frozen LiF host

The host coordinates remain fixed while all water coordinates relax. The raw force on the host can remain nonzero. The reported optimization criterion is the largest projected atomic force norm.

For the fixed-host model,

ΔEads=Ehost+H2O−Ehost−EH2O.\Delta E_\mathrm{ads}=E_{\mathrm{host+H_2O}}-E_\mathrm{host}-E_{\mathrm{H_2O}}.

The host reference uses the same frozen coordinates; isolated water is relaxed with the same method and basis. Retain all three absolute energies, charges, spin states, and geometries.

energy_ads = energy_complex - energy_frozen_host - energy_relaxed_water

Absolute energy terms and reference convention. This is an electronic energy difference without counterpoise, thermal, standard-state, dielectric, or coverage corrections. The small finite host and double-zeta basis require convergence studies before quantitative surface inference.

from atomli.visualize import view_field
field = atoms.calc.get_field(atoms=atoms, kind="electron_density",
shape=[45, 45, 45], margin=2.5)
view_field(atoms, field, isovalue=0.05).write_html("adsorption-density.html")

Retained electron density of the optimized LiF water adsorption complex

The contour is total electron density. Charge-transfer analysis requires a specified population scheme or a matched-grid density difference.

Calculate the fixed-host adsorbate Hessian

Section titled “Calculate the fixed-host adsorbate Hessian”
from atomli.vibrations import Vibrations
vib = Vibrations(atoms, indices=adsorbate_indices, method="analytical").run()
frequencies = vib.get_frequencies()

Analytical O H stretching dominated mode of the adsorbed water

The nine-coordinate block includes frustrated translation and rotation. Host response is excluded. Its eigenvectors must not be interpreted as the full cluster modes. Additional bond/line/plane constraints require their own independent-coordinate treatment.

OutputContents
adsorption-fixed-host.extxyzAccepted optimization frames
adsorption-fixed-host.jsonGeometry, constraints, distances, raw/projected force residuals
adsorption-energy.jsonAbsolute energies and subtraction convention
adsorbate-hessian.jsonAnalytical Hessian, eigenvectors, and frequencies
adsorption-density.snapshot.jsonRegistered density grid and isosurface settings
adsorption.h5Electronic wavefunction payload

Electronic wavefunction payloads do not serialize the native constraints. Retain the constraint definition and atom ordering separately. The HTML files open independently of a notebook kernel.

Constraint variants · Volumetric fields · Adsorbate modes