Skip to main content

Dynamical structure factors and correlation functions from molecular dynamics trajectories

Project description

dynasor is a tool for calculating total and partial dynamic structure factors as well as related correlation functions from molecular dynamics (MD) simulations. By analyzing these functions one can access the dynamics of a system without resorting to perturbative approaches. Moreover by combining in particular the structure factor with the cross sections (or form factors) of, e.g., neutrons, X-rays or electrons, one can predict experimental spectra. The main input consists of a trajectory from a MD simulation, i.e., a file containing snapshots of the particle coordinates and optionally velocities, that correspond to consecutively and equally spaced points in (simulation) time.

dynasor provides both python and a command line interface. The following snippet illustrates how one can calculate dynamic structure factors using the former.

traj = Trajectory('dump.xyz', trajectory_format='extxyz')
q_points = generate_spherical_qpoints(traj.cell, q_max=20)
sample = compute_dynamic_structure_factors(traj, q_points=q_points, dt=5, window_size=100)
sample.write_to_npy('test.npy')

dynasor can be installed via pip or conda. Please consult the installation section of the user guide for details.

The full documentation can be found in the user guide. For questions and help please use the dynasor discussion forum on matsci.org. dynasor and its development are hosted on gitlab.

When using dynasor in your research please cite the following papers:

Dynasor – A tool for extracting dynamical structure factors and current correlation functions from molecular dynamics simulations
Erik Fransson, Mattias Slabanja, Paul Erhart, and Göran Wahnström
Advanced Theory and Simulations 4, 2000240 (2021); DOI:10.1002/adts.202000240
Dynasor 2: From simulation to experiment through correlation functions
Esmée Berger, Erik Fransson, Fredrik Eriksson, Eric Lindgren, Göran Wahnström, Thomas Holm Rod, and Paul Erhart
Computer Physics Communications 316, 109759 (2025); DOI: 10.1016/j.cpc.2025.109759

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

dynasor-2.3.tar.gz (150.0 kB view details)

Uploaded Source

Built Distribution

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

dynasor-2.3-py3-none-any.whl (143.3 kB view details)

Uploaded Python 3

File details

Details for the file dynasor-2.3.tar.gz.

File metadata

  • Download URL: dynasor-2.3.tar.gz
  • Upload date:
  • Size: 150.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for dynasor-2.3.tar.gz
Algorithm Hash digest
SHA256 b9e582e0f6260b3d63d1428167eddfeb3518d51a42679abef64beac7927c06db
MD5 2ba431fcf7233eb50087be540bcc2134
BLAKE2b-256 3205d19d3baea53c894b01c58543176fc1a6074ca5cd6001f77b3985586cf311

See more details on using hashes here.

File details

Details for the file dynasor-2.3-py3-none-any.whl.

File metadata

  • Download URL: dynasor-2.3-py3-none-any.whl
  • Upload date:
  • Size: 143.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.6

File hashes

Hashes for dynasor-2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8a09c885b07b2798ad7225cae763d953eb6f042f898c7f87af31d0fe9d01ea
MD5 55f877a8f3ce071d8e1fd2cb131079d4
BLAKE2b-256 37bd0df6fbd9eaf8278f8218528111fbf64f11ad605aeab9a01e430dd3301417

See more details on using hashes here.

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