No project description provided
Project description
pbc_distance_calculator
This Python package computes pairwise distances in a simulation box accounting for periodic boundary conditions.
The only inputs are the positions of each particle and the simulation supercell matrix.
To install:
pip install pbc_distance_calculator
Example usage:
from numpy.typing import NDArray
from pbc_distance_calculator import get_pairwise_distances
# array of shape (N, 3) where N is the number of particles
positions: NDArray = ...
# array of shape (3, 3)
cell_matrix: NDArray = ...
# array of shape (N, N)
# element (i, j) is minimum image distance between i and j
pairwise_distances: NDArray = get_pairwise_distances(positions, cell_matrix)
The cell matrix, is, in general:
$$ \begin{pmatrix} \mathbf{a} & \mathbf{b} & \mathbf{c} \end{pmatrix} $$
where $\mathbf{a}$, $\mathbf{b}$, and $\mathbf{c}$ are the lattice vectors of the supercell. Note that this definition works for any set of lattice parameters! So, no matter how weird your crystal, this package should work. If there are any issues, feel free to open an issue 🙂.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pbc_distance_calculator-1.0.1.tar.gz
.
File metadata
- Download URL: pbc_distance_calculator-1.0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bfc94554d93af88054449628bf4bc1abea72ed59365534f0623845ad97df377 |
|
MD5 | da17afd4f6a161a300cac70bb5563e21 |
|
BLAKE2b-256 | d17609f4c95d86f7959ab2447faec4146a896c42894078f766e3ea1aa8af999b |
File details
Details for the file pbc_distance_calculator-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: pbc_distance_calculator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a057120c5fc4fdf0c761a35e31ece28fb4cb43d50da2816c23914e4c6c87cf46 |
|
MD5 | 2cac2f9d405e9be6742b1c3ef84388ec |
|
BLAKE2b-256 | 03c6c9923c1617d6ab70858dce529ca9da068ba8b254afada1218d2ea6203c37 |