<jupyter_start><jupyter_text>Potassium Sulfate, ³³S (I=3/2)³³S (I=3/2) quadrupolar spectrum simulation. The following example is the $^{33}\text{S}$ NMR spectrum simulation ofpotassium sulfate ($\text{K}_2\text{SO}_4$). The quadrupole tensor parametersfor $^{33}\text{S}$ is obtained from Moudrakovski `et al.` [f3]_<jupyter_code>import matplotlib.pyplot as plt

from mrsimulator import Simulator, SpinSystem, Site
from mrsimulator.methods import BlochDecayCTSpectrum
from mrsimulator import signal_processing as sp<jupyter_output><empty_output><jupyter_text>**Step 1:** Create the spin system<jupyter_code>site = Site(
    name="33S",
    isotope="33S",
    isotropic_chemical_shift=335.7,  # in ppm
    quadrupolar={"Cq": 0.959e6, "eta": 0.42},  # Cq is in Hz
)
spin_system = SpinSystem(sites=[site])<jupyter_output><empty_output><jupyter_text>**Step 2:** Create a central transition selective Bloch decay spectrum method.<jupyter_code>method = BlochDecayCTSpectrum(
    channels=["33S"],
    magnetic_flux_density=21.14,  # in T
    rotor_frequency=14000,  # in Hz
    spectral_dimensions=[
        {
            "count": 2048,
            "spectral_width": 5000,  # in Hz
            "reference_offset": 22500,  # in Hz
            "label": r"$^{33}$S resonances",
        }
    ],
)

# A graphical representation of the method object.
plt.figure(figsize=(4, 3))
method.plot()
plt.show()<jupyter_output><empty_output><jupyter_text>**Step 3:** Create the Simulator object and add method and spin system objects.<jupyter_code>sim = Simulator()
sim.spin_systems += [spin_system]  # add the spin system
sim.methods += [method]  # add the method<jupyter_output><empty_output><jupyter_text>**Step 4:** Simulate the spectrum.<jupyter_code>sim.run()

# The plot of the simulation before signal processing.
plt.figure(figsize=(4.25, 3.0))
ax = plt.subplot(projection="csdm")
ax.plot(sim.methods[0].simulation.real, color="black", linewidth=1)
ax.invert_xaxis()
plt.tight_layout()
plt.show()<jupyter_output><empty_output><jupyter_text>**Step 5:** Add post-simulation signal processing.<jupyter_code>processor = sp.SignalProcessor(
    operations=[sp.IFFT(), sp.apodization.Exponential(FWHM="10 Hz"), sp.FFT()]
)
processed_data = processor.apply_operations(data=sim.methods[0].simulation)

# The plot of the simulation after signal processing.
plt.figure(figsize=(4.25, 3.0))
ax = plt.subplot(projection="csdm")
ax.plot(processed_data.real, color="black", linewidth=1)
ax.invert_xaxis()
plt.tight_layout()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13784954706577393, 'fraction_numerical': 0.02993304450571091, 'mean_word_length': 5.4961636828644505, 'pattern_counts': {'":': 6, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '152314', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 960, 'n_tokens_neox': 877, 'n_words': 191, 'path': 'docs/notebooks/examples/1D_simulation(crystalline)/plot_1_PotassiumSulfate.ipynb', 'repo_name': 'pjgrandinetti/mrsimulator', 'size': '2539'}