pbc_tools module

Full Documentation for hippynn.molecular_dynamics.pbc_tools module. Click here for a summary page.

extract_cell_diagonal(cell, check_diagonal=True)[source]

use when cell shape is (3, 3)

extract_multicell_diagonal(multicell, check_diagonal=True)[source]

use when cell shape is (n_frames, 3, 3)

find_mic(vecs, cell)[source]

Compute the minimum image displacement of vectors under periodic boundary conditions. Only works for orthorhombic cells with lattice vectors on the Cartesian axes, i.e. cells which can be written as a diagonal matrix.

Parameters:
  • vecs (array_like, shape (n_particles, 3)) – Displacement vectors.

  • cells (array_like, shape (3, 3)) – Cell matrix.

Returns:

The minimum image displacement vectors.

Return type:

ndarray, shape (n_particles, 3)

is_diagonal_cell(cell, rtol=1e-05, atol=1e-08)[source]

use when cell shape is (3, 3)

is_diagonal_multicell(multicell, rtol=1e-05, atol=1e-08)[source]

use when cell shape is (n_frames, 3, 3)

validate_diagonal_cell(cell=None, multicell=None)[source]