Coordination
This module contains functions to compute the coordination number of atoms in a system, including generalized coordination numbers and their strained editions.
snow.descriptors.coordination
coordination_number(coords, cut_off, neigh_list=False, pbc=False, box=None)
Computes the coordination number (number of nearest neighbours within a cutoff) for each atom in the system.
Optionally, the neighbour list (which is the heavy part of the calculation) can be returned with neigh_list=True.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
Array of the coordinates of the atoms forming the system. |
required |
cut_off
|
float
|
The cutoff distance for determining nearest neighbors. |
required |
neigh_list
|
bool
|
Option to return the neighbour list as well as the coordination number of each atom |
False
|
pbc
|
bool
|
Whether to apply periodic boundary conditions. |
False
|
box
|
ndarray
|
Simulation box size (either [Lx, Ly, Lz] or [[xmin, xmax], [ymin, ymax], [zmin, zmax]] or 3 cell vectors (shape (3,3) - slower)). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
neighs |
list
|
neighbour list, the list of indeces of the neighbours of each atom. Only returned if |
coord_num |
ndarray
|
the coordination numbers of each atom |
Source code in snow/descriptors/coordination.py
agcn_calculator(coords, cut_off, cn_max=12.0, strained=False, pbc=False, box=None, **kwargs)
Calculates the atop Generalized Coordination Number (GCN) for a site. The GCN is defined as the sum of the coordination numbers of the neighbors of each atom divided by the maximum typical coordination number in the specific system (cn_max).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
Array of the coordinates of the atoms forming the system. |
required |
cut_off
|
float
|
The cutoff distance for determining nearest neighbors. |
required |
cn_max
|
float
|
Maximum coordination number in the specific system (default is 12.0, ok for fcc materials). |
12.0
|
strained
|
bool
|
if True, computes the strained aGCN. |
False
|
pbc
|
bool
|
Whether to apply periodic boundary conditions. Defaults to False. |
False
|
box
|
ndarray
|
Simulation box size (either [Lx, Ly, Lz] or [[xmin, xmax], [ymin, ymax], [zmin, zmax]] or 3 cell vectors (shape (3,3) - slower)). |
None
|
kwargs
|
thr_cn: int, optional a threshold coordination number value. If provided, only atoms with coordination < thr_cn are considered for the GCN calculation (e.g. useful if you only want to consider surface atoms in your calculation) dbulk: float, optional Bulk distance for strained aGCN (default is None), has to be provided if strained is True |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
sites |
ndarray
|
sites (atomic coordinates. If thr_cn is enabled, only coordinates of atoms selected by the coordination condition) |
gcns |
ndarray
|
Values of the atop GCN. |
Source code in snow/descriptors/coordination.py
bridge_gcn(coords, cut_off, thr_cn, dbulk=None, cn_max=18.0, phantom=True, strained=False, pbc=False, box=None)
Identifies bridge absorption sites and computes the Generalized Coordination Number (GCN) for a site. The GCN is defined as the sum of the coordination numbers of the neighbors of the two atoms forming the site, counted only once, divided by the reference maximum cn.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
Array of the coordinates of the atoms forming the system. |
required |
cut_off
|
float
|
The cutoff distance for determining nearest neighbors. |
required |
cn_max
|
float
|
Maximum typical coordination number in the specific system (default is 18.0 - ok for FCC systems). |
18.0
|
phantom
|
bool
|
If True, also returns the coordinates of the midpoints between pairs ('phantom' atoms indicating the bridge sites) (default is True). |
True
|
thr_cn
|
int
|
a threshold coordination number value. Only atoms with coordination < thr_cn are considered for the GCN calculation (only surface bridge sites are considered) |
required |
strained
|
bool
|
if True, computes the strained aGCN. |
False
|
dbulk
|
float
|
Bulk distance for strained aGCN (default is None), has to be provided if strained is True |
None
|
pbc
|
bool
|
Whether to apply periodic boundary conditions. Defaults to False. |
False
|
box
|
ndarray
|
Simulation box size (either [Lx, Ly, Lz] or [[xmin, xmax], [ymin, ymax], [zmin, zmax]] or 3 cell vectors (shape (3,3) - slower)). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
sites |
ndarray
|
Coordinates of the midpoints. Only returned if |
pairs |
list
|
List of pairs. |
bgcns |
ndarray
|
Values of the bridge GCN ordered as the pairs. |
Source code in snow/descriptors/coordination.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
three_hollow_gcn(coords, cut_off, thr_cn, phantom=True, dbulk=None, cn_max=22.0, strained=False, pbc=None, box=None)
Finds the location of three-hollow sites and returns their location and GCN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
Array with the XYZ coordinates of the atoms, shape (n_atoms, 3). |
required |
cut_off
|
float
|
Cutoff distance for finding neighbors in angstrom. |
required |
thr_cn
|
int
|
a threshold coordination number value. Only atoms with coordination < thr_cn are considered for the GCN calculation (only surface hollow sites are considered). |
required |
phantom
|
bool
|
If True, also returns the coordinates of the midpoints between triplets ('phantom' atoms indicating the 3-hollow sites) |
True
|
dbulk
|
float
|
Bulk distance for strained aGCN (default is None), has to be provided if strained is True |
None
|
cn_max
|
float
|
Maximum typical coordination number in the specific system (default is 22.0 - ok for FCC materials). |
22.0
|
strained
|
bool
|
if True, computes the strained aGCN. |
False
|
pbc
|
bool
|
Whether to apply periodic boundary conditions. |
False
|
box
|
ndarray
|
Simulation box size (either [Lx, Ly, Lz] or [[xmin, xmax], [ymin, ymax], [zmin, zmax]] or 3 cell vectors (shape (3,3) - slower)). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
sites |
ndarray
|
Coordinates of the triplets midpoints. Only returned if |
triplets |
list[list]
|
List of atomic indexes labelling triplets. |
th_gcns |
ndarray
|
Values of the three-hollow GCN ordered as the pairs. |
Source code in snow/descriptors/coordination.py
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 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 | |
four_hollow_gcn(coords, cut_off, thr_cn, phantom=True, dbulk=None, cn_max=26.0, strained=False, pbc=False, box=None)
Finds the location of four-hollow sites and returns their location and GCN
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coords
|
ndarray
|
Array with the XYZ coordinates of the atoms, shape (n_atoms, 3). |
required |
cut_off
|
float
|
Cutoff distance for finding neighbors in angstrom. |
required |
thr_cn
|
int
|
a threshold coordination number value. Only atoms with coordination < thr_cn are considered for the GCN calculation (e.g. only surface atoms are considered) |
required |
phantom
|
bool
|
If True, also returns the coordinates of the midpoints between fourplets ('phantom' atoms indicating the 4-hollow sites) |
True
|
dbulk
|
float
|
Bulk distance for strained aGCN (default is None), has to be provided if strained is True |
None
|
cn_max
|
float
|
Maximum typical coordination number in the specific system (default is 26.0 - ok for FCC materials). |
26.0
|
strained
|
bool
|
if True, computes the strained aGCN. |
False
|
pbc
|
bool
|
Whether to apply periodic boundary conditions. Defaults to False. |
False
|
box
|
ndarray
|
Simulation box size (either [Lx, Ly, Lz] or [[xmin, xmax], [ymin, ymax], [zmin, zmax]] or 3 cell vectors (shape (3,3) - slower)). |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
tuple
|
|
|
sites |
ndarray
|
Coordinates of the fourplets midpoints. Only returned if |
fourplets |
list[list]
|
List of atomic indexes labelling fourplets. |
fh_gcns |
ndarray
|
Values of the four-hollow GCN ordered as the pairs. |
Source code in snow/descriptors/coordination.py
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 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |