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.1.tar.gz (232.2 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.1-py3-none-any.whl (59.7 kB view details)

Uploaded Python 3

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

Hashes for molecular_dynamics_toy-0.3.1.tar.gz
Algorithm Hash digest
SHA256 86174cc049a5d0df22b21931ef7ee8f56053818b910753184f58e3d642d42847
MD5 8c57acfe08881a49da46f812c06213c1
BLAKE2b-256 229e58d97ed6cd97d6409e4fe7d18deb5c514e31f5e9fc28ec14417f43b7ed64

See more details on using hashes here.

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

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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for molecular_dynamics_toy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b78714800b2b45f7e1d141863b06e91084ba6a323b0803ba4f3031162948a63e
MD5 b62f5737861eaa5b322cc3fcb765200b
BLAKE2b-256 467c027c5f3d1d0f21c2219bf0e6ebbb4c43377e21b068f85ceb46868ce15e2a

See more details on using hashes here.

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

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