.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/1D_simulation(crystalline)/plot_6_dipolar_coupled.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_6_dipolar_coupled.py: Coupled spin-1/2 (Static dipolar spectrum) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ¹³C-¹H static dipolar coupling simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-18 .. code-block:: Python import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site, Coupling from mrsimulator.method.lib import BlochDecaySpectrum from mrsimulator import signal_processor as sp from mrsimulator.spin_system.tensors import SymmetricTensor from mrsimulator.method import SpectralDimension .. GENERATED FROM PYTHON SOURCE LINES 20-21 Create a 13C-1H coupled spin system. .. GENERATED FROM PYTHON SOURCE LINES 21-28 .. code-block:: Python spin_system = SpinSystem( sites=[ Site(isotope="13C", isotropic_chemical_shift=0.0), Site(isotope="1H", isotropic_chemical_shift=0.0), ], couplings=[Coupling(site_index=[0, 1], dipolar=SymmetricTensor(D=-2e4))], ) .. GENERATED FROM PYTHON SOURCE LINES 29-30 Create a BlochDecaySpectrum method. .. GENERATED FROM PYTHON SOURCE LINES 30-38 .. code-block:: Python method = BlochDecaySpectrum( channels=["13C"], magnetic_flux_density=9.4, # in T rotor_frequency=0, # in Hz rotor_angle=0, # in rads spectral_dimensions=[SpectralDimension(count=2048, spectral_width=8.0e4)], ) .. GENERATED FROM PYTHON SOURCE LINES 39-40 Create the Simulator object and add the method and the spin system object. .. GENERATED FROM PYTHON SOURCE LINES 40-43 .. code-block:: Python sim = Simulator(spin_systems=[spin_system], methods=[method]) sim.run() .. GENERATED FROM PYTHON SOURCE LINES 44-45 Add post-simulation signal processing. .. GENERATED FROM PYTHON SOURCE LINES 45-54 .. code-block:: Python processor = sp.SignalProcessor( operations=[ sp.IFFT(), sp.apodization.Exponential(FWHM="500 Hz"), sp.FFT(), ] ) processed_dataset = processor.apply_operations(dataset=sim.methods[0].simulation) .. GENERATED FROM PYTHON SOURCE LINES 55-61 .. code-block:: Python 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_6_dipolar_coupled_001.png :alt: plot 6 dipolar coupled :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_6_dipolar_coupled_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.275 seconds) .. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_6_dipolar_coupled.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_6_dipolar_coupled.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_6_dipolar_coupled.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_