No project description provided
Project description
Fast calculation of structural and autocorrelation functions
fastatomstruct
is a Python package written in Rust that includes functions to calculate atomic structural quantities.
If possible, thread-based parallelization (using rayon
) is employed to speed up calculations and take advantage of multicore processors.
What can this package do?
The package can currently calculate the following quantities:
- Structural
- Angular-limited three-body correlation (ALTBC)
- Bond length ratio (BLR)
- Atomic distances
- Coordination numbers
- Nearest neighbours
- Bond orientational parameter (Steinhardt et al.) and Bond Order Correlation parameter
- Tetrahedral order parameter
- Dynamical
- Autocorrelation (with and without interpolation)
Installation
From PyPI
fastatomstruct
can be installed from the Python Package Index. Currently, only Linux with a Python version >= 3.6 is supported. In addition, your processor has to be x86-64 with AVX2 support. Most all processors since 2015 should meet those criteria. If your system doesn't, you can still install fastatomstruct
from source (see next subsection).
To run the installation, use
pip install fastatomstruct
From source
Installing fastatomstruct
from source requires
- Python 3
- pip
- a working Rust installation (1.56 and newer), including cargo
maturin
, a Python package that can e.g. be installed usingpip3 install --upgrade maturin
To build the Python wheel, run
maturin build --release
The resulting wheel will be located in target/wheels/
. You can install it using
python3 -m pip install target/wheels/fastatomstruct-version.whl
Replace "version" with your actual Python version.
The package can then be used in Python using e.g. from fastatomstruct import coordination_numbers
.
Documentation
The documentation can be found here.
Example usage
This example uses the Atomistic Simulation Environment, which can also be installed using pip (pip install ase
).
from ase.build import bulk
from fastatomstruct import distances, coordination_numbers
# Lithium in the BCC phase with the unit cell repeated
# 10x10x10 times
atoms = bulk("Li", "bcc", 3.45).repeat((10, 10, 10))
pos, cell = atoms.get_positions(), atoms.cell.array
# Atomic distances
dists = distances(pos, cell)
# Coordination numbers with a cutoff of 3 A
coordination = coordination_numbers(pos, cell, 3)
Optimizing your installation for performance
Condider using
RUSTFLAGS="-C target-cpu=native" maturin build --release
to optimize the binary for your local processor. As a downside, this will make the resulting Python wheel less portable.
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 Distributions
Built Distributions
Hashes for fastatomstruct-0.3.0-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15a672c33f8d0934603de3e353b90d16eed3de695a7215d579d4286edc28eefb |
|
MD5 | a59e711d32f3b2702ad1662f11fc2794 |
|
BLAKE2b-256 | 9429d6a7aa42c094b7de04d31cc78eee43928f28fae03b8c9e4a40d5bb23b18d |
Hashes for fastatomstruct-0.3.0-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de34791495d8529ed412f74e87e7b9ba6859da94535089098550e3d070702b01 |
|
MD5 | ef5d6468186208c0286f8ea1b0eb0cef |
|
BLAKE2b-256 | 2bb6f30e49fc6ca42c1cab4c5104f6423641a4ed8fa84cdae0c8fc6aac2bc11b |
Hashes for fastatomstruct-0.3.0-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c21b884b469eec0e70f652d05642af5027222a15519ef221e7f36b2c3c27439d |
|
MD5 | 263437521fadd464270f522a010c9d13 |
|
BLAKE2b-256 | aaf4d2faf688a2a31687fba4f920d2a2febafbcc9c726951159dcbacb5eff867 |
Hashes for fastatomstruct-0.3.0-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6586ab205c784010fa15587ae16a3ad82afab9b04e509cf7fa761826413d28ad |
|
MD5 | 92534a79efdda25f6117dc41fadd1ea2 |
|
BLAKE2b-256 | 9bb3e358d100b89086e096f1ac299f72f06acc03ad0ccae215051edfd46d97ff |
Hashes for fastatomstruct-0.3.0-cp36-cp36m-manylinux_2_24_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd67d4495ccf436365060cfc28d5224ccad2bdc95e15b08079c4020b475ccff |
|
MD5 | 1c982d2fc986b94780103a302f69f53c |
|
BLAKE2b-256 | 2cf8bc6ee112283e3efffce11a9868cec1f6575d2ab16f1bdba8338ad199b35c |