Skip to main content

A python toolbox for simulating fast real-time solid-state NMR spectra.

Project description

The Mrsimulator project

Deployment PyPI version PyPI - Python Version
Build Status GitHub Workflow Status Read the Docs
License License
Metrics Total alerts Language grade: Python codecov CodeFactor

mrsimulator is an open-source python package for fast computation/analysis of solid-state magnetic resonance (NMR) spectra of both crystalline and amorphous materials.

Why use mrsimulator?

  • It is open-source and free.
  • It is a fast and versatile solid-state NMR simulator of one and two-dimensional static, MAS, and VAS spectra of nuclei experiencing chemical shift (nuclear shielding) and quadrupolar coupling interactions.
  • It includes simulations of weakly coupled nuclei experiencing J and dipolar couplings.
  • It is fully documented with a stable and simple API and is easily incorporated into your python scripts and web apps.
  • It is compatible with modern python packages, such as scikit-learn, Keras, etc.
  • Packages using mrsimulator:

Install

pip install mrsimulator

Please refer to our installation document for details.

A 1D static and MAS example

from mrsimulator import Simulator, SpinSystem, Site
from mrsimulator.method.lib import BlochDecaySpectrum
import matplotlib.pyplot as plt

# Make Site and SpinSystem objects
H_site = Site(isotope="1H", shielding_symmetric={"zeta": 13.89, "eta": 0.25})
spin_system = SpinSystem(sites=[H_site])

# Make static and MAS one-pulse acquire Method objects
static = BlochDecaySpectrum(channels=["1H"]   )
mas = BlochDecaySpectrum(channels=["1H"], rotor_frequency=1000)  # in Hz

# Setup and run the Simulation object
sim = Simulator(spin_systems=[spin_system], methods=[static, mas])
sim.run()

# Plot the spectra
fig, ax = plt.subplots(1, 2, figsize=(6, 3), subplot_kw={"projection": "csdm"})
ax[0].plot(sim.methods[0].simulation.real, color="black", linewidth=1)
ax[0].set_title("Static")
ax[1].plot(sim.methods[1].simulation.real, color="black", linewidth=1)
ax[1].set_title("MAS")
plt.tight_layout()
plt.show()

This should produce the following figure.


Check out our extensive documentation and more example.

Simulation Fitting


Features

The mrsimulator package currently offers the following

  • Fast simulation of one and two-dimensional solid-state NMR spectra.

  • Simulation of coupled and uncoupled spin system

    • for spin I=1/2, and quadrupole I>1/2 nuclei
    • at arbitrary macroscopic magnetic flux density
    • at arbitrary rotor angles
    • at arbitrary spinning frequency
  • A library of NMR methods,

    • 1D Bloch decay spectrum
    • 1D Bloch decay central transition spectrum
    • 2D Multi-Quantum Variable Angle Spinning (MQ-VAS)
    • 2D Satellite-transition Variable Angle Spinning (MQ-VAS)
    • 2D Dynamic Angle Spinning (DAS)
    • 2D isotropic/anisotropic sideband correlation spectrum (e.g. PASS and MAT)
    • 2D Magic Angle Flipping (MAF)
    • Custom user-defined 1D and 2D methods (Method)
  • Models for tensor parameter distribution in amorphous materials.

    • Czjzek
    • Extended Czjzek
    • Custom user-defined models

For more information, refer to the documentation.

Reporting Bugs

Submit bug reports or feature requests on the Github issue tracker.

Discussions are welcome on the Github discussion page.

How to cite

If you use mrsimulator in your publication, please consider citing the following.

  • Deepansh J. Srivastava, Matthew Giammar, Maxwell C. Venetos, Shyam Dwaraknath, Philip J. Grandinetti, & Alexis McCarthy. (2021). mrsimulator: v0.6.1. Zenodo. https://doi.org/10.5281/zenodo.5559730

  • Srivastava DJ, Vosegaard T, Massiot D, Grandinetti PJ (2020) Core Scientific Dataset Model: A lightweight and portable model and file format for multi-dimensional scientific data. PLOS ONE 15(1): e0225953. https://doi.org/10.1371/journal.pone.0225953

Additionally, if you use lmfit for least-squares fitting, consider citing the lmfit package. Zenodo. http://doi.org/10.5281/zenodo.4516651

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

mrsimulator-0.7.0rc2.tar.gz (330.9 kB view hashes)

Uploaded Source

Built Distributions

mrsimulator-0.7.0rc2-cp310-cp310-win_amd64.whl (8.9 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

mrsimulator-0.7.0rc2-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64

mrsimulator-0.7.0rc2-cp310-cp310-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

mrsimulator-0.7.0rc2-cp39-cp39-win_amd64.whl (8.9 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

mrsimulator-0.7.0rc2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

mrsimulator-0.7.0rc2-cp39-cp39-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

mrsimulator-0.7.0rc2-cp38-cp38-win_amd64.whl (8.9 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

mrsimulator-0.7.0rc2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (11.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

mrsimulator-0.7.0rc2-cp38-cp38-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

mrsimulator-0.7.0rc2-cp37-cp37m-win_amd64.whl (8.9 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

mrsimulator-0.7.0rc2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (10.8 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

mrsimulator-0.7.0rc2-cp37-cp37m-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

mrsimulator-0.7.0rc2-cp36-cp36m-win_amd64.whl (8.9 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

mrsimulator-0.7.0rc2-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (10.8 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

mrsimulator-0.7.0rc2-cp36-cp36m-macosx_10_9_x86_64.whl (12.8 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page