vibe-sketcherDocumentation

vibesketcher.chem.periodic_geometry

Shared geometry for built periodic structures: neighbours, bond images, records.

Used by the periodic nanotube and framework builders. Cells are right-handed row vectors in angstrom; a bond’s image is the integer translation applied to its second site, as in PeriodicStructure.

Module Attributes

BUILDER_VERSION

Version of the nanotube and framework constructions, recorded in provenance.

Functions

bond_image(first, second, lattice, pbc)

The translation of second nearest first among neighbouring images.

neighbour_pairs(cartesian, lattice, pbc, cutoff)

All (i, j, image, distance) with |r_j + image·L - r_i| < cutoff, i < j.

Exceptions

BuildRefused

Parameters a builder cannot build; the message says why.

vibesketcher.chem.periodic_geometry.BUILDER_VERSION = 1

Version of the nanotube and framework constructions, recorded in provenance.

exception vibesketcher.chem.periodic_geometry.BuildRefused[source]

Bases: ValueError

Parameters a builder cannot build; the message says why.

vibesketcher.chem.periodic_geometry.bond_image(first, second, lattice, pbc)[source]

The translation of second nearest first among neighbouring images.

Parameters:
  • first (NDArray[float64])

  • second (NDArray[float64])

  • lattice (NDArray[float64])

  • pbc (tuple[bool, bool, bool])

Return type:

tuple[tuple[int, int, int], float]

vibesketcher.chem.periodic_geometry.neighbour_pairs(cartesian, lattice, pbc, cutoff)[source]

All (i, j, image, distance) with |r_j + image·L - r_i| < cutoff, i < j.

A hashed cubic grid of edge cutoff (the linked-cell method; Allen and Tildesley, Computer Simulation of Liquids, 2nd ed., 2017, 5.3). Images are the 27 neighbouring translations along periodic axes, so every cell vector must be longer than the cutoff.

Parameters:
Return type:

list[tuple[int, int, tuple[int, int, int], float]]