Common Neighbour Analysis
pySNOW contains functions that allow users to compute CNA signature for each pair of nearest neighbours as well as identify to which signature each atom in the system partecipates to. The latter is especially useful in cathegorizing the atom based on its belonging to a particular geometrical structure, extending what done in Ovito, where atoms are only catheorized based on the local cristalline structure, allowing to identify atoms belonging to a facet, an edge or a vertex.
The CNA signature is a triplet of numbers (r, s, t) for each pair of neighbours where:
- r: number of common neighbours of the pair
- s: number of bonds between the r common neighbours
- t: the longest path that can be formed by joining the r neighbours that are neighbours of each other
Functions
The CNA calculator containes a series of functions for the comutation of the CAN signatures and patterns:
Calculate CNA Fast
Faster version of calculate_cna that precomputes neighbor sets.
Parameters
index_frame : int description coords : ndarray 3xNatoms array containing the coordinates of each atom cut_off : float cutoff radius for the determination of nearest neighbors return_pair : bool, optional Whether to return an ordered list of the indices of the atoms forming a given pair, by default False
Returns
tuple[int, np.ndarray, list] The number of pairs, the cna signatures [r, s, t] for each pair and the ordered list of pairs (if return_pair == True) tuple[int, np.ndarray] The number of pairs, the cna signatures [r, s, t] for each pair
Source code in snow/lodispp/cna.py
Write CNA to file
Source code in snow/lodispp/cna.py
CNA Patterns per atoms
Optimized per-atom CNA calculation by precomputing a mapping from atom indices to pair indices. This avoids scanning the entire pair list for every atom.
Parameters
index_frame : int description coords : np.ndarray Array containing the coordinates of each atom. cut_off : float Cutoff radius for nearest-neighbor determination.
Returns
list of tuple[np.ndarray, np.ndarray] For each atom, a tuple (unique_signatures, counts) representing the unique CNA signatures from all pairs involving that atom and their respective counts.
Source code in snow/lodispp/cna.py
CNAp Index per atom
Usage:
cnap_peratom(index_frame: int, coords: np.ndarray, cut_off: float = None, pbc: bool = False) -> np.ndarray
Computes the CNA Patterns for each atom in the system, assigning to each an integer which can be used to identify the local structure, mapping integer-structure can be found in the README.
Parameters
index_frame : int description coords : np.ndarray 3xNatoms array containing the coordainates of the atoms in the system cut_off : float Cutoff radius for the determination of neighbours
Returns
np.ndarray 1D array containing for each atom an integer identifing the structure (check the documentation)
Source code in snow/lodispp/cna.py
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 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 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 |
|