A python toolbox for simulating fast real-time solid-state NMR spectra.
Project description
The Mrsimulator project
Deployment | |
Build Status | |
License | |
Metrics |
Shortly after the birth of Nuclear Magnetic Resonance (NMR) spectroscopy, it was realized that spin and spatial degrees of freedom could be manipulated on a time scale faster than the coherence lifetimes of the nuclear spin transitions. This led to an explosion of multi-pulse and sample reorientation methodologies in magnetic resonance for probing the structure and dynamics of matter over a wide range of length and time scales.
Numerical simulations of the NMR spectra from these methods have long been a critical
part of their analyses. The most robust and rigorous numerical approaches employ the full density
operator, ideal for dealing with finite pulse effects, weak to intermediate to strong couplings,
non-commuting Hamiltonians, and relaxation and exchange processes. However, such approaches can be
highly inefficient, particularly when Hamiltonians commute, pulses are ideal, and transverse relaxation
can be treated as an ad-hoc line broadening. mrsimulator
, an open-source python package, achieves
high benchmarks in spectral simulations and analyses by limiting itself to these simpler situations.
Fortunately, working within this limit only prevents mrsimulator
from modeling spectra of a small
fraction of popular NMR methods. The efficiency gains with this approach over conventional density
operator simulations are tremendous.
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 documentation 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.
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 isotropic/anisotropic sideband correlation spectrum (e.g. PASS and MAT)
- 2D Magic Angle Flipping (MAF)
- 2D Dynamic Angle Spinning (DAS)
- Custom user-defined 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.
-
Please use the GitHub citation tool to cite this repository. The tool in located in the About section under the
Cite this repository
category. -
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 dataset. 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. https://doi.org/10.5281/zenodo.4516651
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for mrsimulator-0.8.0rc0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34a67548a4e04819726181979b32e5ddd24f1f14755d5711adf51450e05b8310 |
|
MD5 | f7ee15ed688e8c01ca3a011136b1015c |
|
BLAKE2b-256 | b69e410815462383b17bc852dbd980b5ce3e2d403303df43618c0b05fc93e2b6 |
Hashes for mrsimulator-0.8.0rc0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4085d76f6894a4bd9b2124c3479483700370adb557fb454d543fae2fb56e0415 |
|
MD5 | 5df0d15ead61cd7fb53e3570163e56fc |
|
BLAKE2b-256 | eda7d14fb049cac1a282c84e555b6504a6f8cf61a2830afe51dba10d6577491c |
Hashes for mrsimulator-0.8.0rc0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 153c44fb37359abad1889447e8c69753f2a061d72bdf44648f9e7aa48f73d2ee |
|
MD5 | 598ea68e3cd708c36693f1908bed876f |
|
BLAKE2b-256 | 81894f18d7898a3965b9badb0271e6f878575f5ba8f13705e3677354e10e1f1f |
Hashes for mrsimulator-0.8.0rc0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce180575e394715e548a5b82aaf7843290d2d414d086dcc6f2e261a374115a0f |
|
MD5 | 4ff040c584b2f2c05d54960cc1d47595 |
|
BLAKE2b-256 | a7a3bf4c6e38c8347ab7193f5bf415efb5b226d1da265ff64fae66008d73b0cd |
Hashes for mrsimulator-0.8.0rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f2cb61b67fd267cf1152a9365a9b2ef7a436925e90b182e1ddfcedbaaa4477d |
|
MD5 | 500c4bfbe4ae73931e5c912901d3eaf0 |
|
BLAKE2b-256 | 502915c88f9ad3ce7a3958d078b9309a429cd409a75867dd0c9aced98ecc4ec1 |
Hashes for mrsimulator-0.8.0rc0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0045f29cddb13dc1e8d9d9826482c0a35b73d56ad03206cd720c70380ebaa6 |
|
MD5 | 0fd7098d975e2bdc3cbc2f7801d7a6dd |
|
BLAKE2b-256 | 53d761c867702076e5e56b176ebffad6f78970ebe4c318e8d07c0a2d431ff829 |
Hashes for mrsimulator-0.8.0rc0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71c348b81a4c677e2279db692388171a3c16f5a28e3091e6f713bcdf8fc2f61e |
|
MD5 | d15747c7e93954ae2aaffb8ff4b745fd |
|
BLAKE2b-256 | aa5f03711fbbf4f3f29742654b929841c90b1658c202b94d341bdee7e9721b6f |
Hashes for mrsimulator-0.8.0rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c4baab59078f4711c4089a955a1bc1319eac35cd0a2261b7f039b784487b13c |
|
MD5 | 37af75363037f0bb4a9aa8a81047cc05 |
|
BLAKE2b-256 | a53ed083183d28a2b74d004abe28e4c970fd8fbf48c0adfefa4f2cc924259d01 |
Hashes for mrsimulator-0.8.0rc0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5989ec305f1d5b6d99deed3dc4d72df6df533f06897513657d8b3c04b9212831 |
|
MD5 | 0cef1f10158b09516ae328b65e660fe3 |
|
BLAKE2b-256 | eb8166651d25dce13959603e462b57dbd42117c1b73762f1768dc62b64e6131e |
Hashes for mrsimulator-0.8.0rc0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2e38eda707acd945e2b34bf670f4300e5ce730d72776b3858d10a19d0676214 |
|
MD5 | d0c2349be3356c007c98a8e57da4a3d3 |
|
BLAKE2b-256 | 902c8bbf86871712f6320541bbd5972a460d5d6a776bbf44d6c21d9cc9f6df89 |
Hashes for mrsimulator-0.8.0rc0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ab9879812c8877d0a2cbd2857478faf1712b1c3785d4d7fe68510571d3f8c9b |
|
MD5 | 3ac78acd6057500a5da31de630a9c413 |
|
BLAKE2b-256 | 1f16d12995b7d262ffe6a16e38bdc790ce6a0a2e8b33eddb18fe4f35b020e486 |
Hashes for mrsimulator-0.8.0rc0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d6fc5dd7222199103955d3537590415c90423eebb9a178f498cfbebd7f272d |
|
MD5 | 43aefcd8d301bfa8295d2b30d5bbdbab |
|
BLAKE2b-256 | 33b6dc2ffe1a02dba14c95a09e639f7de192042d77097cdc55b04649cddd8b98 |
Hashes for mrsimulator-0.8.0rc0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b74aa0bea0de756b3c7912b8c135eada23587662d248fc3fe576a257c8cf898 |
|
MD5 | 5cf55fa9c0705489b09e29d55fc4df3a |
|
BLAKE2b-256 | 073ee20e052802194c262bc04572b72b64dee72b1104182d93615435b3e3ec9e |
Hashes for mrsimulator-0.8.0rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a38ebffc4c497061f9c051be0a5cc8e2e12a10fd776614a550ef54d417332a35 |
|
MD5 | ed32205bf33a74fe920148374598d593 |
|
BLAKE2b-256 | f77bc6be0fddfd72b9344deb5c1ebdd51636507d82906049b72aa50ff28ce265 |
Hashes for mrsimulator-0.8.0rc0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4923b9861f2e2dbc88e469601624ffa28df3d31a370f9c00218b2abafe3db8fc |
|
MD5 | da8200900cf287e0c35684ece47baf5d |
|
BLAKE2b-256 | a24b4b8410c808f19305e068edb2c2a594d87ea9e3385d8bd6099ee1e812cdb9 |