Perform various analyses of particle simulations.
Project description
freud
The freud library provides users the ability to analyze molecular dynamics and Monte Carlo simulation trajectories for advanced metrics such as the radial distribution function and various order parameters. Its modules work with and return NumPy arrays, and are able to process both 2D and 3D data. Features in freud include computing the radial distribution function, local density, hexagonal order parameter and local bond order parameters, potentials of mean force and torque (PMFTs), Voronoi tessellations, and more.
When using freud to process data for publication, please use this citation.
Mailing List
If you have a question, please consider posting to the freud-users mailing list.
Examples
Example Jupyter notebooks can be found in a separate repository. These notebooks may be launched interactively on Binder or downloaded and run on your own system.
Installing freud
Official binaries of freud are available via conda through conda-forge. To install freud, first download and install miniconda following conda's instructions. Then install freud:
$ conda install -c conda-forge freud
Compiling freud
Building freud from source follows the typical setuptools pattern for Python packages:
git clone --recurse-submodules https://bitbucket.org/glotzer/freud.git
cd freud
python setup.py install
By default, freud installs to the USER_SITE directory, which is in ~/.local
on Linux and in ~/Library
on macOS.
USER_SITE
is on the Python search path by default, so there is no need to modify PYTHONPATH
.
If you want to test freud without installing it for your system, you can instead build it in place.
python setup.py build_ext --inplace
For more detailed instructions, see the documentation.
Note
The freud library makes use of submodules. If you would like to update submodules yourself, please execute the following command after cloning:
git submodule update --init
Requirements
- Required:
- Python >= 2.7 (3.5+ recommended)
- NumPy >= 1.7
- C++11 capable compiler (tested with gcc >= 4.8.5, clang 3.5)
- Intel Threading Building Blocks
- Optional:
- Cython >= 0.23 (to compile your own
_freud.cpp
)
- Cython >= 0.23 (to compile your own
Job scripts
The freud library is called using Python scripts.
Here is a simple example.
import freud
# create a freud compute object (rdf is the canonical example)
rdf = freud.density.rdf(rmax=5, dr=0.1)
# load in your data (freud does not provide a data reader)
box_data = np.load("path/to/box_data.npy")
pos_data = np.load("path/to/pos_data.npy")
# create freud box
box = freud.box.Box(Lx=box_data[0]["Lx"], Ly=box_data[0]["Ly"], is2D=True)
# compute RDF
rdf.compute(box, pos_data[0], pos_data[0])
# get bin centers, rdf data
r = rdf.getR()
y = rdf.getRDF()
Documentation
The documentation is available online at https://freud.readthedocs.io.
To build the documentation yourself, please install sphinx:
conda install sphinx
OR
pip install sphinx
To view the full documentation run the following commands in the source directory:
# Linux
cd doc
make html
xdg-open build/html/index.html
# Mac
cd doc
make html
open build/html/index.html
If you have latex and/or pdflatex, you may also build a pdf of the documentation:
# Linux
cd doc
make latexpdf
xdg-open build/latex/freud.pdf
# Mac
cd doc
make latexpdf
open build/latex/freud.pdf
Unit Tests
The unit tests for freud use the Python unittest
framework:
# Run tests from the tests directory
cd tests
python -m unittest discover .
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 Distributions
File details
Details for the file freud-analysis-0.10.0.tar.gz
.
File metadata
- Download URL: freud-analysis-0.10.0.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce935e53bffb061ad095336c7e90ebe1966d0678aabec7468bfdb0d32af902d0 |
|
MD5 | 29ee660b46132bcc0f57eaa4189efd8c |
|
BLAKE2b-256 | 8349d2b1cda7cb3b916f75986aeb19904edb21a0dbaa11a70fbbb426eafa3cb3 |
File details
Details for the file freud_analysis-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: freud_analysis-0.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db48c7462cec7ce0035172fb9441a929845b293ca7e305b9299b29dd7b33dab3 |
|
MD5 | 9bf50265448fd278e895ba7b6487ad32 |
|
BLAKE2b-256 | 39db1e0857057740601614350aafa4a96a2967a87df1aeefdd883746980115f0 |
File details
Details for the file freud_analysis-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: freud_analysis-0.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9004246a604808b62c67869e15ed17263f38665400d83b4b1847cbcf882f5203 |
|
MD5 | 159afd2557e9e2c3a7518f89e5f71b8b |
|
BLAKE2b-256 | f4830540c4b1c2b4402f5f5a598e8f0c74cc287493a08aa58d033273ad74b231 |
File details
Details for the file freud_analysis-0.10.0-cp35-cp35m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: freud_analysis-0.10.0-cp35-cp35m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.5m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fe06d4fa4f21da7c9437a12e8435d9a2dc58c7c79cf613911443ccca5b36fd6 |
|
MD5 | 286c284bd9c9037c0d724103ad1b5192 |
|
BLAKE2b-256 | ab24bddcb01f0faf2c2fc07a3fc8c5b857e5bc415ee0738e383ee1216262534a |
File details
Details for the file freud_analysis-0.10.0-cp27-cp27m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: freud_analysis-0.10.0-cp27-cp27m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 2.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a9de09e5e95500d6ca87c3de6951b8cdc77b21d6cc5dfa5ca1411d4f9ba030 |
|
MD5 | 7ef9ba4ff09782a5223e6d85bf3a3a24 |
|
BLAKE2b-256 | f193c619a9486fe7aa80cdce798d1dfd45b55c6e8be1bb468e6f001ad4a531f1 |