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. 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


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.3.0.tar.gz (226.9 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.3.0-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: molecular_dynamics_toy-0.3.0.tar.gz
  • Upload date:
  • Size: 226.9 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.3.0.tar.gz
Algorithm Hash digest
SHA256 3e4b7df9ac29e4b064ead1fbf2eacaa3268c6c527123dbce1f29926206d5094d
MD5 aee9a12707713f0916462d654c7a009f
BLAKE2b-256 999e884c9f2866cae69a7ece952aa1bfe1093b70269c2058f5c6a53c49d9178f

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecular_dynamics_toy-0.3.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for molecular_dynamics_toy-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10381e7cd7043a4ebe67be4bc45a0fc44e9f60da0af69713f745c77f0c9f2c33
MD5 db672728dde26eadf9fc8d8f083f6112
BLAKE2b-256 12946fdba79310ee812cfa0fd50b861dcb05fc0c9c44e5a3cb0f2b1a8a0a04ad

See more details on using hashes here.

Provenance

The following attestation bundles were made for molecular_dynamics_toy-0.3.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