.. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_1D_simulation(crystalline)_plot_2_Coesite.py: Coesite, 17O (I=5/2) ^^^^^^^^^^^^^^^^^^^^ 17O (I=5/2) quadrupolar spectrum simulation. Coesite is a high-pressure (2-3 GPa) and high-temperature (700°C) polymorph of silicon dioxide :math:`\text{SiO}_2`. Coesite has five crystallographic :math:`^{17}\text{O}` sites. In the following, we use the :math:`^{17}\text{O}` EFG tensor information from Grandinetti `et. al.` [#f1]_ .. code-block:: python import matplotlib as mpl import matplotlib.pyplot as plt import mrsimulator.signal_processing as sp import mrsimulator.signal_processing.apodization as apo from mrsimulator import Simulator, SpinSystem, Site from mrsimulator.methods import BlochDecayCentralTransitionSpectrum # global plot configuration mpl.rcParams["figure.figsize"] = [4.5, 3.0] **Step 1:** Create the sites. .. code-block:: python # default unit of isotropic_chemical_shift is ppm and Cq is Hz. O17_1 = Site( isotope="17O", isotropic_chemical_shift=29, quadrupolar={"Cq": 6.05e6, "eta": 0.000} ) O17_2 = Site( isotope="17O", isotropic_chemical_shift=41, quadrupolar={"Cq": 5.43e6, "eta": 0.166} ) O17_3 = Site( isotope="17O", isotropic_chemical_shift=57, quadrupolar={"Cq": 5.45e6, "eta": 0.168} ) O17_4 = Site( isotope="17O", isotropic_chemical_shift=53, quadrupolar={"Cq": 5.52e6, "eta": 0.169} ) O17_5 = Site( isotope="17O", isotropic_chemical_shift=58, quadrupolar={"Cq": 5.16e6, "eta": 0.292} ) # all five sites. sites = [O17_1, O17_2, O17_3, O17_4, O17_5] **Step 2:** Create the spin systems from these sites. For optimum performance, we create five single-site spin systems instead of a single five-site spin system. The abundance of each spin system is taken from above reference. .. code-block:: python abundance = [0.83, 1.05, 2.16, 2.05, 1.90] spin_systems = [SpinSystem(sites=[s], abundance=a) for s, a in zip(sites, abundance)] **Step 3:** Create a central transition selective Bloch decay spectrum method. .. code-block:: python method = BlochDecayCentralTransitionSpectrum( channels=["17O"], rotor_frequency=14000, # in Hz spectral_dimensions=[ { "count": 2048, "spectral_width": 50000, # in Hz "label": r"$^{17}$O resonances", } ], ) The above method is set up to record the :math:`^{17}\text{O}` resonances at the magic angle, spinning at 14 kHz and 9.4 T (default, if the value is not provided) external magnetic flux density. The resonances are recorded over 50 kHz spectral width using 2048 points. **Step 4:** Create the Simulator object and add the method and spin system objects. .. code-block:: python sim = Simulator() sim.spin_systems = spin_systems # add the spin systems sim.methods = [method] # add the method **Step 5:** Simulate the spectrum. .. code-block:: python sim.run() # The plot of the simulation before signal processing. ax = plt.subplot(projection="csdm") ax.plot(sim.methods[0].simulation.real, color="black", linewidth=1) ax.invert_xaxis() plt.tight_layout() plt.show() .. image:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_001.png :alt: plot 2 Coesite :class: sphx-glr-single-img **Step 6:** Add post-simulation signal processing. .. code-block:: python processor = sp.SignalProcessor( operations=[ sp.IFFT(), apo.Exponential(FWHM="30 Hz"), apo.Gaussian(FWHM="145 Hz"), sp.FFT(), ] ) processed_data = processor.apply_operations(data=sim.methods[0].simulation) # The plot of the simulation after signal processing. ax = plt.subplot(projection="csdm") ax.plot(processed_data.real, color="black", linewidth=1) ax.invert_xaxis() plt.tight_layout() plt.show() .. image:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_002.png :alt: plot 2 Coesite :class: sphx-glr-single-img .. [#f1] Grandinetti, P. J., Baltisberger, J. H., Farnan, I., Stebbins, J. F., Werner, U. and Pines, A. Solid-State :math:`^{17}\text{O}` Magic-Angle and Dynamic-Angle Spinning NMR Study of the :math:`\text{SiO}_2` Polymorph Coesite, J. Phys. Chem. 1995, **99**, *32*, 12341-12348. `DOI: 10.1021/j100032a045 `_ .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.446 seconds) .. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_2_Coesite.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/DeepanshS/mrsimulator/master?urlpath=lab/tree/docs/_build/html/../../notebooks/examples/1D_simulation(crystalline)/plot_2_Coesite.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_2_Coesite.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_2_Coesite.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_