.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/1D_simulation(crystalline)/plot_5_multi-quantum_spectrum.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_5_multi-quantum_spectrum.py: Arbitrary spin transition (multi-quantum) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ³³S (I=5/2) quadrupolar spectrum simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-10 Simulate a triple quantum spectrum. .. GENERATED FROM PYTHON SOURCE LINES 10-18 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator.method import Method, SpectralDimension, SpectralEvent from mrsimulator.spin_system.tensors import SymmetricTensor .. GENERATED FROM PYTHON SOURCE LINES 20-21 Create a single-site arbitrary spin system. .. GENERATED FROM PYTHON SOURCE LINES 21-29 .. code-block:: Python site = Site( name="27Al", isotope="27Al", isotropic_chemical_shift=35.7, # in ppm quadrupolar=SymmetricTensor(Cq=2.959e6, eta=0.98), # Cq is in Hz ) spin_system = SpinSystem(sites=[site]) .. GENERATED FROM PYTHON SOURCE LINES 30-44 Selecting the triple-quantum transition --------------------------------------- For single-site spin-5/2 spin system, there are three triple-quantum transition - :math:`|1/2\rangle\rightarrow|-5/2\rangle` (:math:`P=-3, D=6`) - :math:`|3/2\rangle\rightarrow|-3/2\rangle` (:math:`P=-3, D=0`) - :math:`|5/2\rangle\rightarrow|-1/2\rangle` (:math:`P=-3, D=-6`) To select one or more triple-quantum transitions, assign the respective value of P and D to the symmetry query object of `transition_queries`. Refer to the :ref:`transition_query_documentation` for details. Here, we select the symmetric triple-quantum transition. .. GENERATED FROM PYTHON SOURCE LINES 44-70 .. code-block:: Python method = Method( name="Arbitrary Transition Method", channels=["27Al"], magnetic_flux_density=21.14, # in T rotor_frequency=np.inf, # in Hz rotor_angle=54.7356 * np.pi / 180, # in rads spectral_dimensions=[ SpectralDimension( count=1024, spectral_width=5e3, # in Hz reference_offset=2.5e4, # in Hz events=[ SpectralEvent( # symmetric triple quantum transitions transition_queries=[{"ch1": {"P": [-3], "D": [0]}}] ), ], ) ], ) # A graphical representation of the method object. plt.figure(figsize=(4, 2.5)) method.plot() plt.show() .. image-sg:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_5_multi-quantum_spectrum_001.png :alt: Arbitrary Transition Method :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_5_multi-quantum_spectrum_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 71-72 Create the Simulator object and add the method and the spin system object. .. GENERATED FROM PYTHON SOURCE LINES 72-82 .. code-block:: Python sim = Simulator(spin_systems=[spin_system], 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_5_multi-quantum_spectrum_002.png :alt: plot 5 multi quantum spectrum :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_5_multi-quantum_spectrum_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.448 seconds) .. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_5_multi-quantum_spectrum.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_5_multi-quantum_spectrum.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_5_multi-quantum_spectrum.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_