soprano.calculate.nmr.simpson#

Classes and functions for interfacing with the SIMPSON spin dynamics software.

Functions

load_simpson_dat(filename)

Load a SIMPSON output .dat file and return it as a numpy array.

write_spinsys(s[, isotope_list, use_ms, ...])

Write a .spinsys input file for use with SIMPSON, given the details of a system.

Classes

SimpsonSequence(spinsys_source)

A class storing parameters and scripts for the production of a SIMPSON input file.

class soprano.calculate.nmr.simpson.SimpsonSequence(spinsys_source)[source]#

Bases: object

A class storing parameters and scripts for the production of a SIMPSON input file. The parameters of the simulation are stored in a dictionary member accessible as .pars and can be set at will.

Args:
spinsys_source (str): path of the .spinsys file to use in the
simulation
write_input(path=None)[source]#

Print out the .in file.

Args:
path (str): path to save the newly created file to. If not provided,
the contents will be simply returned as a string.
soprano.calculate.nmr.simpson.load_simpson_dat(filename)[source]#

Load a SIMPSON output .dat file and return it as a numpy array.

soprano.calculate.nmr.simpson.write_spinsys(s, isotope_list=None, use_ms=False, ms_iso=False, q_order=0, dip_sel=None, path=None, ref={}, grad=-1.0, obs_nuc=None)[source]#

Write a .spinsys input file for use with SIMPSON, given the details of a system. This is meant to be a low-level function, used by other higher level interfaces in NMRCalculator.

Args:
s (ase.Atoms): atomic structure containing the desired spins. All
atoms will be included - if that is not the desired
result, this should be accomplished by making this a
subset of the full structure.
isotope_list ([int]): list of isotopes for each element in the system.
If left to None, default NMR-active isotopes
will be used.
use_ms (bool): if True, include shift interactions from magnetic
shieldings.
ms_iso (bool): if True, all magnetic shieldings will be made
isotropic.
q_order(int): if greater than 0, include quadrupolar interactions from
Electric Field Gradients at the given order (1 or 2).
dip_sel (AtomSelection): if not None, include dipolar couplings
between atoms belonging to this set.
path (str): path to save the newly created file to. If not provided,
the contents will be simply returned as a string.
ref (dict): dictionary of reference values for the calculation. This
is used to convert from raw shielding values to chemical
shifts. The dictionary should be in the form
{element: value}, where value is the reference shielding
for that element in ppm.
grad (float|dict|list): gradient to use when converting from raw
shielding values to chemical shifts. If a
float is provided, it will be used for all
elements. If a dictionary is provided, it
should be in the form {element: value}, where
value is the gradient for that element. If a
list is provided, it should be have one value
per site. Defaults to a gradient of -1.0 for
all elements.
obs_nuc (str) : specify the nucleus to be observed, e.g. 1H.
Returns:
file_contents (str): spinsys file in string format. Only returned if
no save path is provided.