Adding Molecules
pySNOW contains tools to add adsorbate atoms and molecules to the surface of you atomistic system. The use cases are documented in the correpsonding tutorial.
snow.catalysis.add_molecule
add_molecule(el, coords, site, direction, distance, el_molecule, coords_molecule, theta=0.0, phi=0.0, molecule_only=False)
Add a molecule at a distance from a given site and along a given direction.
Regarding the final orientation: the molecule will be taken as provided to the function, rotated by theta (angle wrt direction vector around the x axis) and phi (angle around the direction vector), and placed at a distance from the adsorption site along the given direction. Provide its coordinates so that the anchor atom/site is in the origin.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
el
|
list[str]
|
list of chemical symbols of atoms in the system. |
required |
coords
|
ndarray
|
positions of atoms in the system |
required |
site
|
ndarray
|
coordinates of the adsorption site. The anchor atom will be placed at a distance=distance from this site |
required |
direction
|
ndarray
|
direction (3-d vector) to place the adsorbed molecule in |
required |
distance
|
float
|
distance at which to place the (anchor atom of the) molecule |
required |
el_molecule
|
list[str]
|
list of chemical symbols of the atoms in the molecule |
required |
coords_molecule
|
ndarray
|
cooridnates of the atoms making up the molecule |
required |
theta
|
float
|
angle in radians with respect to the direction vector. The molecule will be rotated around the original x axis of an angle theta, resulting in an adsorbed configuration with theta being the angle between the direction vector and the initial z axis of your molecule |
0.0
|
phi
|
float
|
angle in radians to rotate the molecule around the direction vector. |
0.0
|
molecule_only
|
bool
|
Only return the elements list and coords array of the molecule rather than those of the entire system. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
new_el |
list[str]
|
the list of chemnical symbols of atoms in the system with the adsorbed molecule |
new_coords |
ndarray
|
coordinates of atoms in the system with the adsorbed molecule |
Source code in snow/catalysis/add_molecule.py
get_local_neighbours(coords, site, cutoff)
get coordinates of atoms inside a given cutoff wrt to a given site
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
coordinates of the atoms in the system |
required |
site
|
ndarray
|
site around which the cutoff sphere is deifned |
required |
cutoff
|
float
|
cutoff value to distinguish atoms inside or outside the bubble |
required |
Returns:
| Name | Type | Description |
|---|---|---|
neighbours |
list
|
list of coordinates of atoms inside the cutoff sphere wrt to center |
Source code in snow/catalysis/add_molecule.py
locally_normal_direction(coords, site, cutoff)
get a locally normal orinetation with respect to a site on a surface.
get a direction to place adsorbed molecules on nanoparticles and surfaces by computing the line connecting the adsorption site and the (geometric) center of mass of the local environment of the site.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
coordinates of the atoms in the system |
required |
site
|
ndarray
|
cordinates of the site |
required |
cutoff
|
float
|
cutoff value to define the local atomic environment of the site |
required |
Returns:
| Name | Type | Description |
|---|---|---|
direction |
ndarray
|
the vector pointing in the locally normal direction. |
Source code in snow/catalysis/add_molecule.py
triplet_normal(coords, triplet, cutoff)
get the normal direction wrt to a plane defined by the three atoms making up a triplet.
You still need a cutoff to define a lcoal atomic environmoment - this is used to compute the 'outside' orientation with respect to the local surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
coordinates of the atoms in the system |
required |
triplet
|
list[int]
|
list of the ids of the atoms making up the triplet |
required |
cutoff
|
float
|
cutoff value to define the local atomic environment of the atom to correctly point outwards wrt to the surface |
required |
Returns:
| Name | Type | Description |
|---|---|---|
normal |
ndarray
|
the vector pointing in the locally normal direction. |
Source code in snow/catalysis/add_molecule.py
fourplet_normal(coords, fourplet, cutoff)
get the local normal direction for a fourplet of atoms.
get the normal direction wrt to the surface defined by the atoms in a fourplet. If the four atoms are not on a single plane, an average over the planes defined by the possible triplets is returned. You still need a cutoff to define a local atomic environmoment - this is used to compute the 'outside' orientation with respect to the local surface.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
coordinates of the atoms in the system |
required |
fourplet
|
list[int]
|
list of the ids of the atoms making up the fourplet |
required |
cutoff
|
float
|
cutoff value to define the local atomic environment of the atom to correctly point outwards wrt to the surface |
required |
Returns:
| Name | Type | Description |
|---|---|---|
normal |
ndarray
|
the vector pointing in the locally normal direction. |
Source code in snow/catalysis/add_molecule.py
check_overlapping(el, coords, atomic_radii)
Check if any atom in the system is overlapping with any other atom.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
el
|
list[str]
|
list of chemical symbols of atoms in the system |
required |
coords
|
ndarray
|
coordinates of atoms in the system |
required |
atomic_radii
|
dict
|
a dictionary in the form { element : radius } to check that generated geometries do not have overlapping atoms |
required |
Returns:
| Name | Type | Description |
|---|---|---|
overlap |
bool
|
wether atoms are overlapping in this configuration or not |
Source code in snow/catalysis/add_molecule.py
cover_surface(el, coords, cutoff, thr_cn, el_adsorbate, coords_adsorbate, distance, atomic_radii, ratio=1.0, sites_type='atop', theta=0.0, phi=0.0)
Cover as much as possible the surface of a system with molecules while avoiding overlapping.
Eventually you can decide to only keep a given fraction of all the molecules with the ratio argument. The order in which sites will tentatively be covered by a molecule is random. The orientation of the molecule can be specified. The sites can be chosen as atop, bridge, three-hollow or four-hollow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
el
|
list
|
list of chemical symbols of atoms in the original system |
required |
coords
|
ndarray
|
coordinates of atoms in the original system |
required |
cutoff
|
float
|
cutoff to compute nearest neighbours and (generalized) coordination numbers |
required |
el_adsorbate
|
list
|
list of chemical symbols of atoms in the molecule to be added |
required |
coords_adsorbate
|
ndarray
|
coordinates of atoms in the molecule to be added |
required |
distance
|
float
|
distance at which the molecule should be placed from the adsorption site |
required |
atomic_radii
|
dict
|
a dictionary in the form { element : radius } to check that generated geometries do not have overlapping atoms |
required |
ratio
|
float
|
ratio of molecules to keep on the surface. Default to 1.0, which means that all molecules that were placed stayed in place. If ratio is < 1., only an according fraction of the molecules that were placed on the surface are eventually kept and returned by the function. |
1.0
|
sites_type
|
str
|
decide where the adsorbed molecules should be placed (either 'atop', 'bridge', 'three-hollow', or 'four-hollow') |
'atop'
|
theta
|
angle in radians with respect to the direction vector. The molecule will be rotated around the original x axis of an angle theta, resulting in an adsorbed configuration with theta being the angle between the direction vector and the initial z axis of your molecule |
0.0
|
|
phi
|
angle in radians to rotate the molecule around the direction vector. |
0.0
|
Returns:
| Name | Type | Description |
|---|---|---|
test_el |
list
|
list of chemical symbols of atoms in the system with the appended molecules |
test_coords |
ndarray
|
coordinates of atoms in the system with the appended molecules |
Source code in snow/catalysis/add_molecule.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | |