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. 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).
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 molecular-dynamics-toy
or, if you want the latest in-development version, with
pip install git+https://github.com/bfield1/molecular-dynamics-toy
Note that the MatterSim dependency requires a C++ compiler;
it should tell you where to find one when you attempt to pip install if you
don't already have one.
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
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file molecular_dynamics_toy-0.3.1.tar.gz.
File metadata
- Download URL: molecular_dynamics_toy-0.3.1.tar.gz
- Upload date:
- Size: 232.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86174cc049a5d0df22b21931ef7ee8f56053818b910753184f58e3d642d42847
|
|
| MD5 |
8c57acfe08881a49da46f812c06213c1
|
|
| BLAKE2b-256 |
229e58d97ed6cd97d6409e4fe7d18deb5c514e31f5e9fc28ec14417f43b7ed64
|
Provenance
The following attestation bundles were made for molecular_dynamics_toy-0.3.1.tar.gz:
Publisher:
publish-to-pypi.yaml on bfield1/molecular-dynamics-toy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molecular_dynamics_toy-0.3.1.tar.gz -
Subject digest:
86174cc049a5d0df22b21931ef7ee8f56053818b910753184f58e3d642d42847 - Sigstore transparency entry: 1280964133
- Sigstore integration time:
-
Permalink:
bfield1/molecular-dynamics-toy@6dd248346bf9524d41f79d498e6272cdcb1e6254 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/bfield1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@6dd248346bf9524d41f79d498e6272cdcb1e6254 -
Trigger Event:
release
-
Statement type:
File details
Details for the file molecular_dynamics_toy-0.3.1-py3-none-any.whl.
File metadata
- Download URL: molecular_dynamics_toy-0.3.1-py3-none-any.whl
- Upload date:
- Size: 59.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b78714800b2b45f7e1d141863b06e91084ba6a323b0803ba4f3031162948a63e
|
|
| MD5 |
b62f5737861eaa5b322cc3fcb765200b
|
|
| BLAKE2b-256 |
467c027c5f3d1d0f21c2219bf0e6ebbb4c43377e21b068f85ceb46868ce15e2a
|
Provenance
The following attestation bundles were made for molecular_dynamics_toy-0.3.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yaml on bfield1/molecular-dynamics-toy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
molecular_dynamics_toy-0.3.1-py3-none-any.whl -
Subject digest:
b78714800b2b45f7e1d141863b06e91084ba6a323b0803ba4f3031162948a63e - Sigstore transparency entry: 1280964136
- Sigstore integration time:
-
Permalink:
bfield1/molecular-dynamics-toy@6dd248346bf9524d41f79d498e6272cdcb1e6254 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/bfield1
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yaml@6dd248346bf9524d41f79d498e6272cdcb1e6254 -
Trigger Event:
release
-
Statement type: