Exemple #1
0
        c_name = edrixs.edge_to_shell_name('L3')
        eval_i, eval_n, trans_op = edrixs.ed_1v1c_py(('t2g', c_name),
                                                     v_soc=(zeta_d, zeta_d),
                                                     v_noccu=noccu,
                                                     v_cfmat=cf,
                                                     slater=slater,
                                                     loc_axis=loc_axis[iatom])

        rixs[:, :, :,
             iatom] = edrixs.rixs_1v1c_py(eval_i,
                                          eval_n,
                                          trans_op,
                                          ominc,
                                          eloss,
                                          gamma_c=gamma_c,
                                          gamma_f=gamma_f,
                                          thin=thin,
                                          thout=thout,
                                          phi=phi,
                                          pol_type=poltype_rixs,
                                          gs_list=gs_list,
                                          scatter_axis=scattering_plane,
                                          temperature=300)
    # Summation of all the atoms
    rixs_tot = np.sum(rixs, axis=3)
    # Summation of polarization
    rixs_pi = np.sum(rixs_tot[:, :, 0:2], axis=2)
    rixs_sigma = np.sum(rixs_tot[:, :, 2:4], axis=2)
    np.savetxt('rixs_pi.dat',
               np.concatenate((np.array([eloss]).T, rixs_pi.T), axis=1))
    np.savetxt('rixs_sigma.dat',
               np.concatenate((np.array([eloss]).T, rixs_sigma.T), axis=1))
                         ominc_xas,
                         gamma_c=gamma_c,
                         thin=thin,
                         phi=phi,
                         pol_type=poltype_xas,
                         gs_list=[0, 1, 2],
                         temperature=300)

# Run RIXS at L3 edge
rixs_L3 = edrixs.rixs_1v1c_py(eval_i,
                              eval_n,
                              trans_op,
                              ominc_rixs_L3,
                              eloss,
                              gamma_c=gamma_c,
                              gamma_f=gamma_f,
                              thin=thin,
                              thout=thout,
                              phi=phi,
                              pol_type=poltype_rixs,
                              gs_list=[0, 1, 2],
                              temperature=300)

# Run RIXS at L2 edge
rixs_L2 = edrixs.rixs_1v1c_py(eval_i,
                              eval_n,
                              trans_op,
                              ominc_rixs_L2,
                              eloss,
                              gamma_c=gamma_c,
                              gamma_f=gamma_f,
            result = edrixs.ed_1v1c_py(
                shell_name=(v_name, c_name),
                v_soc=(zeta_d_i, zeta_d_n),
                v_noccu=noccu,
                slater=slater  # NO CF
            )
        eval_i, eval_n, trans_op = result

        # Run RIXS
        rixs = edrixs.rixs_1v1c_py(eval_i,
                                   eval_n,
                                   trans_op,
                                   ominc,
                                   eloss,
                                   gamma_c=gamma_c,
                                   gamma_f=gamma_f,
                                   thin=thin,
                                   thout=thout,
                                   phi=phi,
                                   pol_type=poltype_rixs,
                                   gs_list=gs_list,
                                   temperature=300)
        # In rixs: axis-0 is for ominc, axis-1 is for eloss, axis-2 is for polarization
        rixs_pi = np.sum(rixs[:, :, 0:2], axis=2)  # pi-pi + pi-sigma
        rixs_sigma = np.sum(rixs[:, :, 2:4], axis=2)  # sigma-pi + sigma-sigma
        # The first column is eloss, other columns are RIXS cut, useful when plotting with gnuplot
        fname = 'rixs_pi_' + case + v_name + '.dat'
        np.savetxt(fname,
                   np.concatenate((np.array([eloss]).T, rixs_pi.T), axis=1))
        fname = 'rixs_sigma_' + case + v_name + '.dat'
        np.savetxt(fname,
def get_rixs(eval_i,
             eval_n,
             dipole_ops,
             om_mesh=np.linspace(-8, 0, 100),
             om_offset=857.40,
             eloss_mesh=np.linspace(-1, 5.0, 1000),
             thin=115 / 180.0 * np.pi,
             thout=15 / 180.0 * np.pi,
             phi=0.0,
             gamma_c=0.5,
             gamma_f=0.10,
             emi_res=0,
             T=30.):
    """
    Calculate RIXS map.

    Parameters
    ----------
    eval_i: array
        Eigenvalues of initial state Hamiltonian
    eval_n: array
        Eigenvalues of intermediate state Hamiltonian
    dipole_op: array
        Dipole operator from 2p to 3d state
    om_mesh: array
        Incident energies to calculate the spectrum.
        In eV without the offset.
    om_offset: float
        Offset between theoretical and experimental energy axes
    eloss_mesh: array
        axis to evalulate RIXS on.
    thin: float
        Incident x-ray angle in radians w.r.t. plane perpendicular to the
        c-axis
    th_out: float
        Emitted x-ray angle in radians w.r.t. plane perpendicular to the
        c-axis
    phi: float
        Azimutal x-ray angle in radians
    gamma_c: float
        core-hole life-time Lorentzian broadening
    gamma_f: float
        final state life-time Lorentzian broadening
    emi_res: float
        resolution for the emitted x-rays
        Gaussian convolution defined as sigma (not FWHM)
    T: float
        Temperature in Kelvin

    Returns
    -------
    om_mesh: array
        Incident energies to calculate the spectrum.
        In eV without the offset.
    om_offset: float
        Offset between theoretical and experimental energy axes
    eloss_mesh: array
        axis to evalulate RIXS on.
    rixs: array
        X-ray absorption intensity. Shape (len(om_mesh), len(eloss_mesh), 4)
        Where the last axis denotes the polarization
        pi-pi
        pi-sigma
        sigma-pi
        sigma-sigma
    """
    poltype_rixs = [('linear', 0, 'linear', 0),
                    ('linear', 0, 'linear', np.pi / 2.0),
                    ('linear', np.pi / 2.0, 'linear', 0.0),
                    ('linear', np.pi / 2.0, 'linear', np.pi / 2.0)]
    rixs = edrixs.rixs_1v1c_py(eval_i,
                               eval_n,
                               dipole_ops,
                               om_mesh,
                               eloss_mesh,
                               gamma_c=gamma_c,
                               gamma_f=gamma_f,
                               thin=thin,
                               thout=thout,
                               phi=phi,
                               pol_type=poltype_rixs,
                               gs_list=[0, 1, 2],
                               temperature=T)
    # Apply gaussian broadening
    if emi_res > 0:
        dx = np.mean(np.abs(eloss_mesh[1:] - eloss_mesh[:-1]))
        rixs = np.apply_along_axis(gaussian_filter1d, 2, rixs, emi_res / dx)

    return om_mesh, om_offset, eloss_mesh, rixs
# 
# The angle and polarization of the emitted beam must also be specified.
# If, as is common in experiments, the emitted polarization is not resolved
# one needs to add both emitted polarization channels, which is what we will
# do later on in this example. 

eloss = np.linspace(-.5, 6, 400)
pol_type_rixs = [('linear', 0, 'linear', 0), ('linear', 0, 'linear', np.pi/2)]

thout = 60*np.pi/180
gamma_f = 0.02

rixs = edrixs.rixs_1v1c_py(
    eval_i, eval_n, trans_op, ominc, eloss,
    gamma_c=info['gamma_c'], gamma_f=gamma_f,
    thin=thin, thout=thout, phi=phi,
    pol_type=pol_type_rixs, gs_list=gs_list,
    temperature=temperature
)

################################################################################
# The array :code:`xas` will have shape
# :code:`(len(ominc_xas), len(pol_type))`

################################################################################
# Plot XAS and RIXS
# ------------------------------------------------------------------------------
# Let's plot everything. We will use a function so we can reuse the code later.
# Note that the rixs array :code:`rixs` has shape
# :code:`(len(ominc_xas), len(ominc_xas), len(pol_type))`. We will use some numpy 
# tricks to sum over the two different emitted polarizations.