Skip to main content

A python interface to Simpson

Project description

SimPYson: A Pythonic Interface for SIMPSON

DOI Python - Version PyPI - Version

SimPYson is a Python package that makes it easier to work with SIMPSON, a code for simulating solid-state NMR experiments. It handles preparing input files from DFT calculations, running simulations, and reading results — all from Python.

Features

  • Run SIMPSON simulations from Python: Use simulate_spectrum() for smart defaults or SimpCalc for full control over spin systems, pulse sequences, and output.
  • Convert DFT data to SIMPSON input files: Prepare spin systems from CASTEP, Quantum Espresso, and VASP calculations via ASE and Soprano.
  • Read SIMPSON output files: Load .spe, .fid, .xreim, and .csdf files into a unified Simpy object with automatic FID↔spectrum conversion and ppm scaling.
  • Pulse sequence templates: Built-in templates for no-pulse, 90° pulse, and CPMAS experiments. Custom Tcl sequences are also supported.
  • Graphical User Interface: Launch with simpyson gui to inspect and process spectra without any coding.

Quick Start

Read a SIMPSON output file:

from simpyson import read_simp

data = read_simp("ethanol.spe", b0="400MHz", nucleus="1H")
print(data.ppm['ppm'])   # ppm axis, auto-calculated
print(data.spe['hz'])    # Hz axis

Accessing .fid on a spectrum file (or .spe on a FID) triggers automatic conversion via FFT — no manual processing needed.

Simulate a spectrum directly from Python:

from simpyson import simulate_spectrum

spinsys = """
channels 13C
nuclei 13C 13C
shift 1 10p 0 0 0 0 0
shift 2 50p 0 0 0 0 0
"""

result = simulate_spectrum(spinsys, proton_frequency=400e6, spin_rate=10000)
print(result.ppm['ppm'])

simulate_spectrum() automatically estimates the spectral width and carrier offset from the chemical shifts. For full control over all parameters, use SimpCalc directly — see the documentation.

Installation

pip install git+https://github.com/nuts-org/simpyson.git

Requires Python ≥ 3.10 and a working SIMPSON installation for running simulations.

Documentation

Full documentation and tutorials are available at nuts-org.github.io/simpyson.

Planned Features

  • Additional pulse sequence templates for more complex NMR experiments.
  • Broader support for DFT codes — suggestions welcome.

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

simpyson-0.2.0.tar.gz (47.4 kB view details)

Uploaded Source

File details

Details for the file simpyson-0.2.0.tar.gz.

File metadata

  • Download URL: simpyson-0.2.0.tar.gz
  • Upload date:
  • Size: 47.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for simpyson-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e3201bf269ae3373ae2cb9424baedd456de6ba949d9c03b025f5e756849005a9
MD5 863a5d30c967c939547948d863409c6b
BLAKE2b-256 d2e5409d8adffabf8f29af3266016b084de83985428ef77e3af28afc4c29ec64

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