Skip to main content

dynasor

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 an MD simulation, i.e., a file containing snapshots of the particle coordinates and optionally velocities that correspond to consecutive, equally spaced points in simulation time.

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

from dynasor import Trajectory, compute_dynamic_structure_factors
from dynasor.qpoints import get_spherical_qpoints

traj = Trajectory('dump.xyz', trajectory_format='extxyz')
q_points = get_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_npz('test.npz')

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

Metadata

Release files for dynasor 2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dynasor 2.5
File Size Uploaded
dynasor-2.5.tar.gz 210.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dynasor 2.5
File Interpreter ABI Platform
dynasor-2.5-py3-none-any.whl Python 3 none any Details

Total release size: 378.8 kB

Release files / dynasor-2.5.tar.gz

Download URL dynasor-2.5.tar.gz
Size 210.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c538a91107e64be4a1b71f39c9cd65ba0dd79ea3d44d39214a072b0b9864592d
BLAKE2b-256 checksum
How to use checksums
7e51172dd21c364e90da17ed432484d01f62646ed8d0d91704e18125226993dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / dynasor-2.5-py3-none-any.whl

Download URL dynasor-2.5-py3-none-any.whl
Size 168.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d62f56b2c68d1e46d92de08cb2607e42e922ed40c8b53676397de9b34945ab
BLAKE2b-256 checksum
How to use checksums
0592264398524163b9a8404e42347130b9ecef0865f1ea5448f8bb0bc5cab9de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

2.5 This release

2 release files

2.4

2 release files

2.3

2 release files

2.2

2 release files

2.1

1 release file

2.0

1 release file

1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0

1 release file

0.1.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page