An open API service indexing awesome lists of open source software.

https://github.com/eschmidt42/hardspheres-2d

Simulating hard spheres in two dimensions using event driven molecular dynamics and visualizing rotational symmetry using psi-6.
https://github.com/eschmidt42/hardspheres-2d

2d hard-spheres physics python rust symmetry uv

Last synced: 2 months ago
JSON representation

Simulating hard spheres in two dimensions using event driven molecular dynamics and visualizing rotational symmetry using psi-6.

Awesome Lists containing this project

README

          

# Hard Spheres in 2d
> Simulating hard spheres in two dimensions using event driven molecular dynamics and visualizing rotational symmetry using psi-6.

![Melting hexagon of hard spheres](./melting-hexagon.gif)

## Quickstart

uvx --from hardspheres-2d hardspheres2d --help

## Setup to develop

git clone https://github.com/eschmidt42/hardspheres-2d.git
cd hardspheres-2d
uv sync

For the installation of uv see [here](https://docs.astral.sh/uv/getting-started/installation/).

Note: this project uses Rust 1.82. So you may need to [install the rust toolchain](https://www.rust-lang.org/tools/install).

## How to use

### Command Line

To run the event driven molecular dynamics simulation from your command line within the project check out

uv run hardspheres2d --help

### Notebook

Alternatively, the notebook `./melting-hard-sphere-hexagons.ipynb` contains all the steps to set up and run event driven molecular dynamcis on your machine. As well as some sanity checks to better understand what is going on.

To visualize the dynamics you may want to install [ovito](https://www.ovito.org). The base version is sufficient.

## Developing

During your rust edits you want to update your build artefacts so you can use them from python / a notebook. For you can use

make update