pydiffuser


Namepydiffuser JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryA simulation framework for nonequilibrium statistical physics
upload_time2024-07-30 12:38:42
maintainerNone
docs_urlNone
authorYurim Jung
requires_python>=3.10
licenseNone
keywords nonequilibrium statistical physics langevin dynamics stochastic process computer simulation
VCS
bugtrack_url
requirements black ruff mypy pre-commit mkdocs-material pytest-cov codecov hatch flit jax jaxlib
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
    <img src=https://github.com/jung235/pydiffuser/assets/96967431/a9f54ef6-d1d4-4fcf-88bf-8c336dd671c0 width="30%">
    <h1 align="center">Pydiffuser</h1>
</p>

[![pypi](https://img.shields.io/badge/pypi-v0.0.3-blue)](https://pypi.org/project/pydiffuser/)
[![python](https://img.shields.io/badge/python-3.10_|_3.11_|_3.12-blue)](https://pypi.org/project/pydiffuser/)
[![doi](https://zenodo.org/badge/703392021.svg)](https://zenodo.org/doi/10.5281/zenodo.10017027)
[![codecov](https://codecov.io/gh/jung235/pydiffuser/graph/badge.svg?token=UAT5VEBK0O)](https://codecov.io/gh/jung235/pydiffuser)
[![ci](https://github.com/jung235/pydiffuser/actions/workflows/ci.yml/badge.svg)](https://github.com/jung235/pydiffuser/actions/workflows/ci.yml)
[![docs](https://img.shields.io/badge/docs-dev-black)](https://github.com/jung235/pydiffuser/blob/main/README.md)
[![status](https://img.shields.io/badge/status-alpha-blueviolet)](https://github.com/jung235/pydiffuser)

Pydiffuser is a numerical simulation framework for nonequilibrium statistical physics based on [JAX](https://github.com/google/jax).

This package mainly aims:
- to share code to implement a numerical simulation on physical models written in various forms of [stochastic differential equations](https://en.wikipedia.org/wiki/Stochastic_differential_equation).
- to revisit recent research highlights in nonequilibrium statistical physics.
- to reduce the repeated code on time-series data analysis, e.g., statistical analysis of [single-particle trajectory](https://en.wikipedia.org/wiki/Single-particle_trajectory) for [SPT](https://en.wikipedia.org/wiki/Single-particle_tracking) experiments.
- to provide the skeleton of stochastic modeling for anyone interested in stochastic processes.

## Installation

### Requirements

Python 3.10+, [`jax>=0.4.18`](https://pypi.org/project/jax/), and [`jaxlib>=0.4.18`](https://pypi.org/project/jaxlib/).

### From [PyPI](https://pypi.org/project/pydiffuser/)

```console
$ pip install pydiffuser
```

If properly installed, you can run:

```console
$ pydiffuser --version
pydiffuser, version 0.0.3
```

## Quickstart

Pydiffuser provides various stochastic models that implement a numerical simulation based on the [Monte Carlo method](https://en.wikipedia.org/wiki/Monte_Carlo_method).
All Pydiffuser's models inherit an abstract class `pydiffuser.models.BaseDiffusion` and initiate the simulation after a method `generate` is called.
For the simplest case, you can produce a non-interacting [Brownian motion](https://en.wikipedia.org/wiki/Brownian_motion) at low Reynolds numbers as follows:

```python
from pydiffuser.models import BrownianMotion
from pydiffuser.tracer import Ensemble, Trajectory


model = BrownianMotion()
ensemble: Ensemble = model.generate()
tracer: Trajectory = ensemble[0]  # the 0th particle
```

Relevant stochastic observables, such as [mean-squared displacement](https://en.wikipedia.org/wiki/Mean_squared_displacement) and normalized [velocity autocorrelation function](https://en.wikipedia.org/wiki/Autocorrelation), can be calculated through the [methods](#observables) of `Trajectory` and `Ensemble`.

```python
tamsd = tracer.get_mean_squared_displacement(lagtime=1, rolling=True)
eamsd = ensemble.get_mean_squared_displacement(lagtime=1, rolling=False)
eatamsd = ensemble.get_mean_squared_displacement(lagtime=1, rolling=True)
```

You can visualize the trajectory using [matplotlib](https://github.com/matplotlib/matplotlib):

<p align="center" width="100%">
    <img width="25%" src=https://github.com/jung235/pydiffuser/assets/96967431/544f3d2f-1b51-46f6-8036-ee7f296fddad>
</p>

It is obtained by `matplotlib.pyplot.plot(tracer.position_x1, tracer.position_x2)`.

## CLI

List all stochastic models supported by Pydiffuser.

```console
$ pydiffuser model list
NAME            MODEL                           CONFIG                          DIMENSION       
abp             ActiveBrownianParticle          ActiveBrownianParticleConfig    2d              
aoup            ActiveOUParticle                ActiveOUParticleConfig          1d, 2d, 3d      
bm              BrownianMotion                  BrownianMotionConfig            1d, 2d, 3d      
levy            LevyWalk                        LevyWalkConfig                  1d, 2d, 3d      
mips            PhaseSeparation                 PhaseSeparationConfig           1d, 2d, 3d      
rtp             RunAndTumbleParticle            RunAndTumbleParticleConfig      1d, 2d, 3d      
smoluchowski    SmoluchowskiEquation            SmoluchowskiEquationConfig      1d, 2d          
vicsek          VicsekModel                     VicsekModelConfig               2d              
```

## Features

### How fast is it?

When generating $N$ realizations consisting of $L$ footprints, we have:

```julia
═════════════════════════════════════════════════════════════════════════════════════════════════
Model               Method              Running time [s] for N x L =                             
                                        10² x 10⁵          10³ x 10⁴          10⁴ x 10³          
─────────────────────────────────────────────────────────────────────────────────────────────────
`loop` [*]                              3.62 (0.19)        3.45 (0.23)        3.37 (0.21)        
─────────────────────────────────────────────────────────────────────────────────────────────────
`abp`               `generate`          1.95 (0.14)        1.74 (0.12)        1.59 (0.11)        
`aoup`              `generate`          1.61 (0.08)        1.61 (0.15)        1.55 (0.09)        
`bm`                `generate`          1.45 (0.11)        1.46 (0.13)        1.46 (0.14)        
`smoluchowski`      `generate`          1.71 (0.12)        1.67 (0.15)        1.64 (0.13)        
─────────────────────────────────────────────────────────────────────────────────────────────────
`bm`                `create`            1440.72 (158.16)   964.90 (83.06)     1195.41 (94.28)    
═════════════════════════════════════════════════════════════════════════════════════════════════
```

<details>
<summary>[*]</summary>

```python
def loop(N: int, L: int) -> float:
    """Even the most straightforward loop requires over 3 [s] for all (N, L) conditions.
    """

    t1 = time.time()

    xes = []
    for _ in range(N):
        x = []
        for _ in range(1, L):
            x.append([])
        xes.append(x)

    t2 = time.time()
    return t2 - t1
```
</details>

The represented running time is a mean $\mu$ (standard deviation $\sigma$) of five trials.

### Observables

*class* `pydiffuser.tracer.Trajectory` ∈ *class* `pydiffuser.tracer.Ensemble`

- `get_increments`
- `get_displacement_moment`
- `get_mean_squared_displacement`
- `get_cosine_moment`
- `get_velocity_autocorrelation`
- `get_real_time`

The above methods are defined in both `Trajectory` and `Ensemble` to enhance transparency.
Using `Trajectory`, the statistical analysis of [single-particle trajectory](https://en.wikipedia.org/wiki/Single-particle_trajectory) can be accelerated.

### Configuration

We introduce a configuration to deal with extensive parameter manipulation.
For instance, see [`config.json`](https://github.com/jung235/pydiffuser/blob/main/docs/features/configs/config.json), which contains all parameters demanded to instantiate `pydiffuser.ActiveBrownianParticle`.
Every JSON of the configurations listed in [CLI](#cli) can be obtained as follows:

```python
import pydiffuser as pyd
from pydiffuser.models import ActiveBrownianParticle, ActiveBrownianParticleConfig


config = ActiveBrownianParticleConfig()
config.to_json(json_path=<JSON_PATH>)
```

We suggest a research pipeline:

```python
┌────┐     ┌─────────────────────┐     ┌───────────────┐     ┌──────────┐     ┌────────────┐
│JSON├──>──┤`BaseDiffusionConfig`├──>──┤`BaseDiffusion`├──>──┤`Ensemble`├──>──┤NPY | PICKLE│
└────┘ [1] └─────────────────────┘ [2] └───────────────┘ [3] └──────────┘ [4] └────────────┘
```

It can be automized as follows:

```python
config = ActiveBrownianParticleConfig.from_json(json_path=<JSON_PATH>)  # [1]
model = ActiveBrownianParticle.from_config(config=config)  # [2]
ensemble = model.generate()  # [3]
ensemble.to_npy(npy_path=<NPY_PATH>)  # [4]
```

You can save and load any picklable object through `pydiffuser.save` and `pydiffuser.load`.

```python
MODEL_PATH = "model.pickle"


pyd.save(obj=model, pickle_path=MODEL_PATH)  # Here, <PICKLE_PATH> = MODEL_PATH
model = pyd.load(pickle_path=MODEL_PATH)
```

## Related Works

[Hyperdiffusion of Poissonian run-and-tumble particles in two dimensions](https://arxiv.org/abs/2308.00554)

## License

[Apache License 2.0](https://github.com/jung235/pydiffuser/blob/main/LICENSE)

## Citation

```bibtex
@misc{jung2023pydiffuser,
  title = {Pydiffuser: a simulation framework for nonequilibrium statistical physics},
  author = {Jung, Yurim},
  year = {2023},
  note = {doi: 10.5281/zenodo.10017027},
}
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pydiffuser",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "nonequilibrium statistical physics, langevin dynamics, stochastic process, computer simulation",
    "author": "Yurim Jung",
    "author_email": "jung65537@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/81/40/312bafee8f8e8864c5ce3041955038663f21e4a8693b03fb5dfae73e04c9/pydiffuser-0.0.3.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n    <img src=https://github.com/jung235/pydiffuser/assets/96967431/a9f54ef6-d1d4-4fcf-88bf-8c336dd671c0 width=\"30%\">\n    <h1 align=\"center\">Pydiffuser</h1>\n</p>\n\n[![pypi](https://img.shields.io/badge/pypi-v0.0.3-blue)](https://pypi.org/project/pydiffuser/)\n[![python](https://img.shields.io/badge/python-3.10_|_3.11_|_3.12-blue)](https://pypi.org/project/pydiffuser/)\n[![doi](https://zenodo.org/badge/703392021.svg)](https://zenodo.org/doi/10.5281/zenodo.10017027)\n[![codecov](https://codecov.io/gh/jung235/pydiffuser/graph/badge.svg?token=UAT5VEBK0O)](https://codecov.io/gh/jung235/pydiffuser)\n[![ci](https://github.com/jung235/pydiffuser/actions/workflows/ci.yml/badge.svg)](https://github.com/jung235/pydiffuser/actions/workflows/ci.yml)\n[![docs](https://img.shields.io/badge/docs-dev-black)](https://github.com/jung235/pydiffuser/blob/main/README.md)\n[![status](https://img.shields.io/badge/status-alpha-blueviolet)](https://github.com/jung235/pydiffuser)\n\nPydiffuser is a numerical simulation framework for nonequilibrium statistical physics based on [JAX](https://github.com/google/jax).\n\nThis package mainly aims:\n- to share code to implement a numerical simulation on physical models written in various forms of [stochastic differential equations](https://en.wikipedia.org/wiki/Stochastic_differential_equation).\n- to revisit recent research highlights in nonequilibrium statistical physics.\n- to reduce the repeated code on time-series data analysis, e.g., statistical analysis of [single-particle trajectory](https://en.wikipedia.org/wiki/Single-particle_trajectory) for [SPT](https://en.wikipedia.org/wiki/Single-particle_tracking) experiments.\n- to provide the skeleton of stochastic modeling for anyone interested in stochastic processes.\n\n## Installation\n\n### Requirements\n\nPython 3.10+, [`jax>=0.4.18`](https://pypi.org/project/jax/), and [`jaxlib>=0.4.18`](https://pypi.org/project/jaxlib/).\n\n### From [PyPI](https://pypi.org/project/pydiffuser/)\n\n```console\n$ pip install pydiffuser\n```\n\nIf properly installed, you can run:\n\n```console\n$ pydiffuser --version\npydiffuser, version 0.0.3\n```\n\n## Quickstart\n\nPydiffuser provides various stochastic models that implement a numerical simulation based on the [Monte Carlo method](https://en.wikipedia.org/wiki/Monte_Carlo_method).\nAll Pydiffuser's models inherit an abstract class `pydiffuser.models.BaseDiffusion` and initiate the simulation after a method `generate` is called.\nFor the simplest case, you can produce a non-interacting [Brownian motion](https://en.wikipedia.org/wiki/Brownian_motion) at low Reynolds numbers as follows:\n\n```python\nfrom pydiffuser.models import BrownianMotion\nfrom pydiffuser.tracer import Ensemble, Trajectory\n\n\nmodel = BrownianMotion()\nensemble: Ensemble = model.generate()\ntracer: Trajectory = ensemble[0]  # the 0th particle\n```\n\nRelevant stochastic observables, such as [mean-squared displacement](https://en.wikipedia.org/wiki/Mean_squared_displacement) and normalized [velocity autocorrelation function](https://en.wikipedia.org/wiki/Autocorrelation), can be calculated through the [methods](#observables) of `Trajectory` and `Ensemble`.\n\n```python\ntamsd = tracer.get_mean_squared_displacement(lagtime=1, rolling=True)\neamsd = ensemble.get_mean_squared_displacement(lagtime=1, rolling=False)\neatamsd = ensemble.get_mean_squared_displacement(lagtime=1, rolling=True)\n```\n\nYou can visualize the trajectory using [matplotlib](https://github.com/matplotlib/matplotlib):\n\n<p align=\"center\" width=\"100%\">\n    <img width=\"25%\" src=https://github.com/jung235/pydiffuser/assets/96967431/544f3d2f-1b51-46f6-8036-ee7f296fddad>\n</p>\n\nIt is obtained by `matplotlib.pyplot.plot(tracer.position_x1, tracer.position_x2)`.\n\n## CLI\n\nList all stochastic models supported by Pydiffuser.\n\n```console\n$ pydiffuser model list\nNAME            MODEL                           CONFIG                          DIMENSION       \nabp             ActiveBrownianParticle          ActiveBrownianParticleConfig    2d              \naoup            ActiveOUParticle                ActiveOUParticleConfig          1d, 2d, 3d      \nbm              BrownianMotion                  BrownianMotionConfig            1d, 2d, 3d      \nlevy            LevyWalk                        LevyWalkConfig                  1d, 2d, 3d      \nmips            PhaseSeparation                 PhaseSeparationConfig           1d, 2d, 3d      \nrtp             RunAndTumbleParticle            RunAndTumbleParticleConfig      1d, 2d, 3d      \nsmoluchowski    SmoluchowskiEquation            SmoluchowskiEquationConfig      1d, 2d          \nvicsek          VicsekModel                     VicsekModelConfig               2d              \n```\n\n## Features\n\n### How fast is it?\n\nWhen generating $N$ realizations consisting of $L$ footprints, we have:\n\n```julia\n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\nModel               Method              Running time [s] for N x L =                             \n                                        10\u00b2 x 10\u2075          10\u00b3 x 10\u2074          10\u2074 x 10\u00b3          \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n`loop` [*]                              3.62 (0.19)        3.45 (0.23)        3.37 (0.21)        \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n`abp`               `generate`          1.95 (0.14)        1.74 (0.12)        1.59 (0.11)        \n`aoup`              `generate`          1.61 (0.08)        1.61 (0.15)        1.55 (0.09)        \n`bm`                `generate`          1.45 (0.11)        1.46 (0.13)        1.46 (0.14)        \n`smoluchowski`      `generate`          1.71 (0.12)        1.67 (0.15)        1.64 (0.13)        \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n`bm`                `create`            1440.72 (158.16)   964.90 (83.06)     1195.41 (94.28)    \n\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n```\n\n<details>\n<summary>[*]</summary>\n\n```python\ndef loop(N: int, L: int) -> float:\n    \"\"\"Even the most straightforward loop requires over 3 [s] for all (N, L) conditions.\n    \"\"\"\n\n    t1 = time.time()\n\n    xes = []\n    for _ in range(N):\n        x = []\n        for _ in range(1, L):\n            x.append([])\n        xes.append(x)\n\n    t2 = time.time()\n    return t2 - t1\n```\n</details>\n\nThe represented running time is a mean $\\mu$ (standard deviation $\\sigma$) of five trials.\n\n### Observables\n\n*class* `pydiffuser.tracer.Trajectory` \u2208 *class* `pydiffuser.tracer.Ensemble`\n\n- `get_increments`\n- `get_displacement_moment`\n- `get_mean_squared_displacement`\n- `get_cosine_moment`\n- `get_velocity_autocorrelation`\n- `get_real_time`\n\nThe above methods are defined in both `Trajectory` and `Ensemble` to enhance transparency.\nUsing `Trajectory`, the statistical analysis of [single-particle trajectory](https://en.wikipedia.org/wiki/Single-particle_trajectory) can be accelerated.\n\n### Configuration\n\nWe introduce a configuration to deal with extensive parameter manipulation.\nFor instance, see [`config.json`](https://github.com/jung235/pydiffuser/blob/main/docs/features/configs/config.json), which contains all parameters demanded to instantiate `pydiffuser.ActiveBrownianParticle`.\nEvery JSON of the configurations listed in [CLI](#cli) can be obtained as follows:\n\n```python\nimport pydiffuser as pyd\nfrom pydiffuser.models import ActiveBrownianParticle, ActiveBrownianParticleConfig\n\n\nconfig = ActiveBrownianParticleConfig()\nconfig.to_json(json_path=<JSON_PATH>)\n```\n\nWe suggest a research pipeline:\n\n```python\n\u250c\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510     \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502JSON\u251c\u2500\u2500>\u2500\u2500\u2524`BaseDiffusionConfig`\u251c\u2500\u2500>\u2500\u2500\u2524`BaseDiffusion`\u251c\u2500\u2500>\u2500\u2500\u2524`Ensemble`\u251c\u2500\u2500>\u2500\u2500\u2524NPY | PICKLE\u2502\n\u2514\u2500\u2500\u2500\u2500\u2518 [1] \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 [2] \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 [3] \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 [4] \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\nIt can be automized as follows:\n\n```python\nconfig = ActiveBrownianParticleConfig.from_json(json_path=<JSON_PATH>)  # [1]\nmodel = ActiveBrownianParticle.from_config(config=config)  # [2]\nensemble = model.generate()  # [3]\nensemble.to_npy(npy_path=<NPY_PATH>)  # [4]\n```\n\nYou can save and load any picklable object through `pydiffuser.save` and `pydiffuser.load`.\n\n```python\nMODEL_PATH = \"model.pickle\"\n\n\npyd.save(obj=model, pickle_path=MODEL_PATH)  # Here, <PICKLE_PATH> = MODEL_PATH\nmodel = pyd.load(pickle_path=MODEL_PATH)\n```\n\n## Related Works\n\n[Hyperdiffusion of Poissonian run-and-tumble particles in two dimensions](https://arxiv.org/abs/2308.00554)\n\n## License\n\n[Apache License 2.0](https://github.com/jung235/pydiffuser/blob/main/LICENSE)\n\n## Citation\n\n```bibtex\n@misc{jung2023pydiffuser,\n  title = {Pydiffuser: a simulation framework for nonequilibrium statistical physics},\n  author = {Jung, Yurim},\n  year = {2023},\n  note = {doi: 10.5281/zenodo.10017027},\n}\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simulation framework for nonequilibrium statistical physics",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/jung235",
        "Source": "https://github.com/jung235/pydiffuser"
    },
    "split_keywords": [
        "nonequilibrium statistical physics",
        " langevin dynamics",
        " stochastic process",
        " computer simulation"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "40761d62e9ebd6edb550580b20eb912a8547b5ce294b0c32f183681ca071119c",
                "md5": "bb5da9d9714df0bf00f2a75c862aa9f0",
                "sha256": "73aed9978ecf5f812e1b6f30ab78eb66e59bcce08d2568bc4c4fc110dafd23a0"
            },
            "downloads": -1,
            "filename": "pydiffuser-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bb5da9d9714df0bf00f2a75c862aa9f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 41254,
            "upload_time": "2024-07-30T12:38:39",
            "upload_time_iso_8601": "2024-07-30T12:38:39.195121Z",
            "url": "https://files.pythonhosted.org/packages/40/76/1d62e9ebd6edb550580b20eb912a8547b5ce294b0c32f183681ca071119c/pydiffuser-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8140312bafee8f8e8864c5ce3041955038663f21e4a8693b03fb5dfae73e04c9",
                "md5": "3b138f1d16f10ca21e3d1fd71ad3e83c",
                "sha256": "3a790a9b104a4f50b7f5ffa8a4102cdccb3ff463703a7e68927ad502a12870a2"
            },
            "downloads": -1,
            "filename": "pydiffuser-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3b138f1d16f10ca21e3d1fd71ad3e83c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 385821,
            "upload_time": "2024-07-30T12:38:42",
            "upload_time_iso_8601": "2024-07-30T12:38:42.398324Z",
            "url": "https://files.pythonhosted.org/packages/81/40/312bafee8f8e8864c5ce3041955038663f21e4a8693b03fb5dfae73e04c9/pydiffuser-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-30 12:38:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "jung235",
    "github_project": "pydiffuser",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "black",
            "specs": [
                [
                    ">=",
                    "24.3.0"
                ]
            ]
        },
        {
            "name": "ruff",
            "specs": [
                [
                    "==",
                    "0.0.285"
                ]
            ]
        },
        {
            "name": "mypy",
            "specs": [
                [
                    "==",
                    "1.4.1"
                ]
            ]
        },
        {
            "name": "pre-commit",
            "specs": [
                [
                    ">=",
                    "2.21.0"
                ]
            ]
        },
        {
            "name": "mkdocs-material",
            "specs": [
                [
                    ">=",
                    "9.2.3"
                ]
            ]
        },
        {
            "name": "pytest-cov",
            "specs": [
                [
                    ">=",
                    "4.1.0"
                ]
            ]
        },
        {
            "name": "codecov",
            "specs": [
                [
                    ">=",
                    "2.1.13"
                ]
            ]
        },
        {
            "name": "hatch",
            "specs": [
                [
                    ">=",
                    "1.7.0"
                ]
            ]
        },
        {
            "name": "flit",
            "specs": [
                [
                    ">=",
                    "3.9.0"
                ]
            ]
        },
        {
            "name": "jax",
            "specs": [
                [
                    ">=",
                    "0.4.18"
                ]
            ]
        },
        {
            "name": "jaxlib",
            "specs": [
                [
                    ">=",
                    "0.4.18"
                ]
            ]
        }
    ],
    "lcname": "pydiffuser"
}
        
Elapsed time: 1.04113s