.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/1D_simulation(crystalline)/plot_2_Coesite.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_1D_simulation(crystalline)_plot_2_Coesite.py: Coesite, ¹⁷O (I=5/2) ^^^^^^^^^^^^^^^^^^^^ ¹⁷O (I=5/2) quadrupolar spectrum simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-13 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]_ .. GENERATED FROM PYTHON SOURCE LINES 13-22 .. code-block:: Python import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator import signal_processor as sp from mrsimulator.method.lib import BlochDecayCTSpectrum from mrsimulator.spin_system.tensors import SymmetricTensor from mrsimulator.method import SpectralDimension .. GENERATED FROM PYTHON SOURCE LINES 24-25 Create the sites. .. GENERATED FROM PYTHON SOURCE LINES 25-56 .. 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=SymmetricTensor(Cq=6.05e6, eta=0.000), ) O17_2 = Site( isotope="17O", isotropic_chemical_shift=41, quadrupolar=SymmetricTensor(Cq=5.43e6, eta=0.166), ) O17_3 = Site( isotope="17O", isotropic_chemical_shift=57, quadrupolar=SymmetricTensor(Cq=5.45e6, eta=0.168), ) O17_4 = Site( isotope="17O", isotropic_chemical_shift=53, quadrupolar=SymmetricTensor(Cq=5.52e6, eta=0.169), ) O17_5 = Site( isotope="17O", isotropic_chemical_shift=58, quadrupolar=SymmetricTensor(Cq=5.16e6, eta=0.292), ) # all five sites. sites = [O17_1, O17_2, O17_3, O17_4, O17_5] .. GENERATED FROM PYTHON SOURCE LINES 57-62 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. Here we are iterating over both the *sites* and *abundance* list concurrently using a list comprehension to construct a list of SpinSystems .. GENERATED FROM PYTHON SOURCE LINES 62-65 .. 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)] .. GENERATED FROM PYTHON SOURCE LINES 66-67 Create a central transition selective Bloch decay spectrum method. .. GENERATED FROM PYTHON SOURCE LINES 67-79 .. code-block:: Python method = BlochDecayCTSpectrum( channels=["17O"], rotor_frequency=14000, # in Hz spectral_dimensions=[ SpectralDimension( count=2048, spectral_width=50000, # in Hz label=r"$^{17}$O resonances", ) ], ) .. GENERATED FROM PYTHON SOURCE LINES 80-84 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. .. GENERATED FROM PYTHON SOURCE LINES 86-87 Create the Simulator object and add method and spin system objects. .. GENERATED FROM PYTHON SOURCE LINES 87-98 .. code-block:: Python sim = Simulator(spin_systems=spin_systems, methods=[method]) 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() .. image-sg:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_001.png :alt: plot 2 Coesite :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 99-100 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 100-118 .. code-block:: Python processor = sp.SignalProcessor( operations=[ sp.IFFT(), sp.apodization.Exponential(FWHM="30 Hz"), sp.apodization.Gaussian(FWHM="145 Hz"), sp.FFT(), ] ) processed_dataset = processor.apply_operations(dataset=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_dataset.real, color="black", linewidth=1) ax.invert_xaxis() plt.tight_layout() plt.show() .. image-sg:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_002.png :alt: plot 2 Coesite :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_2_Coesite_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 119-125 .. [#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.594 seconds) .. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_2_Coesite.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_2_Coesite.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_2_Coesite.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_