
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "auto_examples/core/plot_EIT.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_auto_examples_core_plot_EIT.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_auto_examples_core_plot_EIT.py:


EIT
===

This examples employs a 3-level system to show the effect of EIT.

EIT (electromagnetically-induced transparency).

.. GENERATED FROM PYTHON SOURCE LINES 12-14

Import
------

.. GENERATED FROM PYTHON SOURCE LINES 14-20

.. code-block:: Python

    from MoleCool import System, np, plt, pi

    det_pump = 0*1e6 # pump laser detuning for for EIT resonance position in Hz
    I_probe  = 0.2 # laser intensity of probe beam in W/m^2
    I_pump   = 5.0 # laser intensity of pump beam in W/m^2
    gr_split = 1000 # splitting between both ground states in MHz







.. GENERATED FROM PYTHON SOURCE LINES 21-23

Calculation routine
-------------------

.. GENERATED FROM PYTHON SOURCE LINES 23-62

.. code-block:: Python

    Deltas  = np.array([*np.arange(-3,-0.5,0.1),*np.arange(-0.5,0.,0.01)])*1e6
    Deltas  = np.array([*Deltas,*(-np.flip(Deltas[:-1]))]) + det_pump

    rho     = np.zeros((2,len(Deltas)),dtype=complex) # steady state density matrix elements
    for i in range(2):
        system = System('testingEIT')
        system.levels.add_electronicstate('e', 'exs') # first add only excited state
        system.levels.e.add(F=1,mF=0) # add single mF=0 with F=1 as F=0 would be forbidden

        # simple two-level case:
        if i == 0:
            system.levels.add_electronicstate('g', 'gs') # ground electronic state
            system.levels.g.add(J=0.5,F=0,mF=0) # add a single level with F=0
            # initial population can be specified but makes no difference for steady state
            system.N0 = [1,0]
        
        # Lambda-level scheme for EIT case:
        if i == 1:
            system.levels.add_electronicstate('g', 'gs') # ground electronic state
            system.levels.g.add(J=0.5,F=0,mF=0) # add two single levels with F=0
            system.levels.g.add(J=1.5,F=0,mF=0)
            system.levels.g.freq.iloc[1] = -gr_split # detuning in MHz between both ground states
    
        # Iterating over all detunings of scanning probe laser:
        for j,Delta in enumerate(Deltas):
            del system.lasers[:] # delete laser instances in every iteration
            system.lasers.add(I=I_probe, freq_shift=Delta) # (weak) probe laser
            # only add pump laser for EIT case:
            if i == 1:
                system.lasers.add(I=I_pump, freq_shift=+gr_split*1e6+det_pump)
        
            T_Om = 2*pi/np.abs(system.calc_Rabi_freqs()).max() # period time of Rabi frequency
            # calculate dynamics until steady state is reached
            system.calc_OBEs(t_int=5*T_Om, steadystate=True, verbose=False)
        
            # transform density matrix elements (ymat) to the other rotating frame
            # which rotates with level's transition frequency instead laser frequency
            rho[i,j] = (system.ymat[0,-1,:] * np.exp(1j*system.t*Delta*2*pi)).mean()
    




.. rst-class:: sphx-glr-script-out

 .. code-block:: none

    System is created with description: testingEIT
    /home/docs/checkouts/readthedocs.org/user_builds/molecool-py/checkouts/v3.7.2/MoleCool/Levelsystem.py:1573: UserWarning: Gamma must be defined for ElectronicState e! By default, it is now set to 1 MHz!
      warnings.warn(text)
    /home/docs/checkouts/readthedocs.org/user_builds/molecool-py/checkouts/v3.7.2/MoleCool/Levelsystem.py:293: UserWarning: There is no dipole matrix or reduced dipole matrix available!So a reduced matrix has been created only with ones:
    exs         e
    F           1
    gs J   F     
    g  0.5 0  1.0
      warnings.warn(warn_txt)
    System is created with description: testingEIT
    /home/docs/checkouts/readthedocs.org/user_builds/molecool-py/checkouts/v3.7.2/MoleCool/Levelsystem.py:1573: UserWarning: Gamma must be defined for ElectronicState e! By default, it is now set to 1 MHz!
      warnings.warn(text)
    /home/docs/checkouts/readthedocs.org/user_builds/molecool-py/checkouts/v3.7.2/MoleCool/Levelsystem.py:293: UserWarning: There is no dipole matrix or reduced dipole matrix available!So a reduced matrix has been created only with ones:
    exs         e
    F           1
    gs J   F     
    g  1.5 0  1.0
       0.5 0  1.0
      warnings.warn(warn_txt)




.. GENERATED FROM PYTHON SOURCE LINES 63-65

Plotting results
----------------

.. GENERATED FROM PYTHON SOURCE LINES 65-72

.. code-block:: Python

    plt.figure('Susceptibility')
    for i,case in enumerate(['1+1','2+1']):
        plt.plot(Deltas*1e-6,rho[i].imag,'--',label=f"Im, {case}", c='C'+str(i))
        plt.plot(Deltas*1e-6,rho[i].real,'-',label=f"Re, {case}", c='C'+str(i))
    
    plt.xlabel('Probe laser detuning ($\Gamma$)')
    plt.ylabel('Susceptibility $\\rho_{eg}$')
    plt.legend(loc='upper right')


.. image-sg:: /auto_examples/core/images/sphx_glr_plot_EIT_001.png
   :alt: plot EIT
   :srcset: /auto_examples/core/images/sphx_glr_plot_EIT_001.png
   :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 .. code-block:: none


    <matplotlib.legend.Legend object at 0x7cc6dbc94790>




.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 7.596 seconds)


.. _sphx_glr_download_auto_examples_core_plot_EIT.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: plot_EIT.ipynb <plot_EIT.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: plot_EIT.py <plot_EIT.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: plot_EIT.zip <plot_EIT.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
