freud - Example Notebooks

The freud library enables advanced analysis of particle simulations, particularly those utilizing periodic boundary conditions. This collection of Jupyter notebooks provides examples of how the different modules of freud can be used for different types of analysis. These notebooks may be launched interactively on Binder or downloaded and run on your own system.

Run locally:

git clone
cd freud-examples
jupyter notebook  # or "jupyter lab"

See Notebook Basics and Running Code for tutorials on using Jupyter itself.

Getting Started

The recommended method for installing freud is using conda (conda install -c conda-forge freud) or pip (pip install freud-analysis). Refer to the Installation Guide for instructions to install from source.

Some of these notebooks also have a number of additional dependencies. In particular, all of these notebooks involve making plots with either Matplotlib or Bokeh, so you will also need to install those to run these notebooks locally. Note that because Bokeh uses Javascript, if you are running these notebooks using JupyterLab you will need to execute an additional command for installation:

jupyter labextension install jupyterlab_bokeh

If you have any issues with installing or seek more information about freud, please refer to the freud documentation.

Key concepts

There are a few critical concepts, algorithms, and data structures that are central to all of freud. In order to familiarize yourself with these before delving too deep into the workings of specific freud modules, we recommend looking through certain notebooks first. In this cell and the next one, each freud module is linked to the documentation for more information, while the links in the list point to Jupyter notebooks demonstrating the classes in those modules.

  • The box module defines the Box object used throughout freud to represent periodic simulation boxes. Since all analysis methods involve some representation of particles in a box of some sort, it is useful to understand boxes and periodicity before attempting to use the rest of freud.
  • freud.locality: The locality module enables NeighborQuery and NeighborList calculations, which provide information on which particles are near to other particles in a system. These are described in the Reference documentation. Additional classes are demonstrated below.

Module Examples

These notebooks go into greater detail, showing the full functionality of each module in freud.