data.oc.core.interface_config#

Classes#

InterfaceConfig

Class to represent a solvent, adsorbate, slab, ion config. This class only

Module Contents#

class data.oc.core.interface_config.InterfaceConfig(slab: fairchem.data.oc.core.slab.Slab, adsorbates: list[fairchem.data.oc.core.adsorbate.Adsorbate], solvent: fairchem.data.oc.core.solvent.Solvent, ions: list[fairchem.data.oc.core.ion.Ion] | None = None, num_sites: int = 100, num_configurations: int = 1, interstitial_gap: float = 0.1, vacuum_size: int = 15, solvent_interstitial_gap: float = 2, solvent_depth: float = 8, pbc_shift: float = 0.0, packmol_tolerance: float = 2, mode: str = 'random_site_heuristic_placement')#

Bases: fairchem.data.oc.core.multi_adsorbate_slab_config.MultipleAdsorbateSlabConfig

Class to represent a solvent, adsorbate, slab, ion config. This class only returns a fixed combination of adsorbates placed on the surface. Solvent placement is performed by packmol (https://m3g.github.io/packmol/userguide.shtml), with the number of solvent molecules controlled by its corresponding density. Ion placement is random within the desired volume.

Parameters:
  • slab (Slab) – Slab object.

  • adsorbates (List[Adsorbate]) – List of adsorbate objects to place on the slab.

  • solvent (Solvent) – Solvent object

  • ions (List[Ion] = []) – List of ion objects to place

  • num_sites (int) – Number of sites to sample.

  • num_configurations (int) – Number of configurations to generate per slab+adsorbate(s) combination. This corresponds to selecting different site combinations to place the adsorbates on.

  • interstitial_gap (float) – Minimum distance, in Angstroms, between adsorbate and slab atoms as well as the inter-adsorbate distance.

  • vacuum_size (int) – Size of vacuum layer to add to both ends of the resulting atoms object.

  • solvent_interstitial_gap (float) – Minimum distance, in Angstroms, between the solvent environment and the adsorbate-slab environment.

  • solvent_depth (float) – Volume depth to be used to pack solvents inside.

  • pbc_shift (float) – Cushion to add to the packmol volume to avoid overlapping atoms over pbc.

  • packmol_tolerance (float) – Packmol minimum distance to impose between molecules.

  • mode (str) –

    “random”, “heuristic”, or “random_site_heuristic_placement”. This affects surface site sampling and adsorbate placement on each site.

    In “random”, we do a Delaunay triangulation of the surface atoms, then sample sites uniformly at random within each triangle. When placing the adsorbate, we randomly rotate it along xyz, and place it such that the center of mass is at the site.

    In “heuristic”, we use Pymatgen’s AdsorbateSiteFinder to find the most energetically favorable sites, i.e., ontop, bridge, or hollow sites. When placing the adsorbate, we randomly rotate it along z with only slight rotation along x and y, and place it such that the binding atom is at the site.

    In “random_site_heuristic_placement”, we do a Delaunay triangulation of the surface atoms, then sample sites uniformly at random within each triangle. When placing the adsorbate, we randomly rotate it along z with only slight rotation along x and y, and place it such that the binding atom is at the site.

    In all cases, the adsorbate is placed at the closest position of no overlap with the slab plus interstitial_gap along the surface normal.

solvent#
ions#
vacuum_size#
solvent_depth#
solvent_interstitial_gap#
pbc_shift#
packmol_tolerance#
n_mol_per_volume#
create_interface_on_sites(atoms_list: list[ase.Atoms], metadata_list: list[dict])#

Given adsorbate+slab configurations generated from (Multi)AdsorbateSlabConfig and its corresponding metadata, create the solvent/ion interface on top of the provided atoms objects.

create_packmol_atoms(geometry: fairchem.data.oc.utils.geometry.Geometry, n_solvent_mols: int)#

Pack solvent molecules in a provided unit cell volume. Packmol is used to randomly pack solvent molecules in the desired volume.

Parameters:
  • geometry (Geometry) – Geometry object corresponding to the desired cell.

  • n_solvent_mols (int) – Number of solvent molecules to pack in the volume.

run_packmol(packmol_input: str)#

Run packmol.

randomize_coords(atoms: ase.Atoms)#

Randomly place the atoms in its unit cell.