Skip to main content

Interactive molecular dynamics simulation for educational purposes

Project description

molecular-dynamics-toy

An interactive molecular dynamics simulation GUI.

This app lets you run a real molecular dynamics simulation on your laptop or home computer. It includes interactive features like clicking to add new atoms, changing the temperature and simulation cell size live, and loading preset atomic configurations.

It uses a pre-trained universal machine learning interatomic potential (MatterSim) with a molecular dynamics integrator from the Atomic Simulation Environment to do the physics, then provides the graphical user interface using pygame.

Physical limitations of this simulation are those of the chosen interatomic potential. Specifically, MatterSim is optimised for bulk materials (i.e. things which fill the whole unit cell) and not for molecules or chemical reactivity. While the physics engine is science-grade, this app is intended for demonstration purposes, and no warranty is given for the accuracy of any results.

Installation

Standalone Executable

Go to Releases and download the file corresponding to your operating system. Windows and MacOS are currently supported. MacOS has two builds: an app (which you click on like normal apps), and an executable inside a directory. The app build is easier to use, although the executable provides a debug window.

Unzip/unarchive/extract the file (attempting to open it will usually do this). For the MacOS and Ubuntu releases, you may need to extract it twice (this is a limitation of GitHub's workflows).

Enter the MDToy directory then click on/open MDToy.

Your computer will likely flag this as an untrusted app from an unknown publisher. On MacOS, right-click on the file then click Open, then click Open in the pop-up. On Windows, select More info in the pop-up then Open anyway.

Then you're done! The molecular dynamics toy will be running. The first time it runs, it requires an internet connection to download the MatterSim interatomic potential. It will do this to $HOME/.local/mattersim, and should require only 17 MB.

Python installation

Set up a virtual Python environment, such as with Conda.

After installing Conda, you can create a Conda environment in the command line with

conda env create -n mdtoy "python=3.13"
conda activate mdtoy

(You can replace "mdtoy" with a name of your choice.)

Then, install the app with

pip install git+https://github.com/bfield1/molecular-dynamics-toy

Finally, run the app with

python -m molecular_dynamics_toy

It will automatically download the pre-trained Mattersim model the first time you run it.

(You will need to have the virtual environment you created earlier active, so if you open a new terminal run conda activate mdtoy again.)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

molecular_dynamics_toy-0.2.0.tar.gz (224.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

molecular_dynamics_toy-0.2.0-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file molecular_dynamics_toy-0.2.0.tar.gz.

File metadata

  • Download URL: molecular_dynamics_toy-0.2.0.tar.gz
  • Upload date:
  • Size: 224.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for molecular_dynamics_toy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ec23835bee2b81ae107832347b4077ec9fa49065e0f0e6a67ee7b602e0cadf36
MD5 a86a272fc630e183225c685b01c51ef2
BLAKE2b-256 618ff6386957a1972c5f69b7578733e7c2f6d508f7930549952547882b7f9a75

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecular_dynamics_toy-0.2.0.tar.gz:

Publisher: publish-to-pypi.yaml on bfield1/molecular-dynamics-toy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file molecular_dynamics_toy-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for molecular_dynamics_toy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d60c9915f2470316352f1c149aea26a5aa5bfc3343c3437916e8c00739b465d2
MD5 08b3f1e78b21dd8416a9424f1ab7cfc3
BLAKE2b-256 2e25937f5165ffaa5b2bbe5dd0d419879af426b723434f011f0b18da171f9b8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecular_dynamics_toy-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on bfield1/molecular-dynamics-toy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page