コード例 #1
0
ファイル: hellorixs.py プロジェクト: shenmidelin/edrixs
def rixs(eval_i, eval_n, T_abs, T_emi):
    gs = list(range(0, 3))
    prob = edrixs.boltz_dist([eval_i[i] for i in gs], 300)
    off = 857.4
    phi, thin, thout = 0, 15 / 180.0 * np.pi, 75 / 180.0 * np.pi
    Gam_c, Gam = 0.2, 0.1  # core-hole life-time and RIXS resolution
    pol = [(0, 0), (0, np.pi / 2.0)]  # pi-pi and pi-sigma polarization
    omega = np.linspace(-5.9, -0.9, 100)
    eloss = np.linspace(-0.5, 5.0, 1000)
    rixs = np.zeros((len(pol), len(eloss), len(omega)), dtype=np.float)

    # Calculate RIXS
    for i, om in enumerate(omega):
        F_fi = edrixs.scattering_mat(eval_i, eval_n, T_abs[:, :, gs], T_emi,
                                     om, Gam_c)
        for j, (alpha, beta) in enumerate(pol):
            ei, ef = edrixs.dipole_polvec_rixs(thin, thout, phi, alpha, beta)
            F_mag = np.zeros((len(eval_i), len(gs)), dtype=np.complex)
            for m in range(3):
                for n in range(3):
                    F_mag[:, :] += ef[m] * F_fi[m, n] * ei[n]
            for m in gs:
                for n in range(len(eval_i)):
                    rixs[j, :, i] += (prob[m] * np.abs(F_mag[n, m])**2 * Gam /
                                      np.pi /
                                      ((eloss -
                                        (eval_i[n] - eval_i[m]))**2 + Gam**2))

    # plot RIXS map
    plt.figure()
    ax = plt.subplot(1, 1, 1)
    a, b, c, d = min(omega) + off, max(omega) + off, min(eloss), max(eloss)
    plt.imshow(rixs[0] + rixs[1],
               extent=[a, b, c, d],
               origin='lower',
               aspect='auto',
               cmap='rainbow',
               interpolation='bicubic')
    ax.xaxis.set_major_locator(MultipleLocator(1))
    ax.xaxis.set_minor_locator(MultipleLocator(0.5))
    ax.yaxis.set_major_locator(MultipleLocator(1))
    ax.yaxis.set_minor_locator(MultipleLocator(0.5))
    plt.xlabel(r'Energy of incident photon (eV)')
    plt.ylabel(r'Energy loss (eV)')
    plt.text(851.6, 4.5, r'(b)', fontsize=25)
    plt.subplots_adjust(left=0.1,
                        right=0.95,
                        bottom=0.13,
                        top=0.95,
                        wspace=0.05,
                        hspace=0.00)
    plt.savefig("rixs_map_ni.pdf")
コード例 #2
0
ファイル: hellorixs.py プロジェクト: shenmidelin/edrixs
def xas(eval_i, eval_n, T_abs):
    gs = list(range(0, 3))  # three lowest eigenstates are used
    prob = edrixs.boltz_dist([eval_i[i] for i in gs], 300)
    off = 857.4  # offset of the energy of the incident x-ray
    Gam_c = 0.2  # core-hole life-time broadening
    pol = np.array([1.0, 1.0, 1.0]) / np.sqrt(3.0)  # isotropic
    omega = np.linspace(-10, 20, 1000)
    xas = np.zeros(len(omega), dtype=np.float)
    # Calculate XAS spectrum
    for i, om in enumerate(omega):
        for j in gs:
            F_mag = (T_abs[0, :, j] * pol[0] + T_abs[1, :, j] * pol[1] +
                     T_abs[2, :, j] * pol[2])

            xas[i] += prob[j] * np.sum(
                np.abs(F_mag)**2 * Gam_c / np.pi /
                ((om - (eval_n[:] - eval_i[j]))**2 + Gam_c**2))

    # plot XAS
    plt.figure()
    ax = plt.subplot(1, 1, 1)
    plt.ylim([0, 0.6])
    plt.plot(omega + off, xas, '-', color="blue")
    ax.xaxis.set_major_locator(MultipleLocator(5))
    ax.xaxis.set_minor_locator(MultipleLocator(2.5))
    ax.yaxis.set_major_locator(MultipleLocator(0.1))
    ax.yaxis.set_minor_locator(MultipleLocator(0.05))
    plt.xlabel(r'Energy of incident photon (eV)')
    plt.ylabel(r'XAS Intensity (a.u.)')
    plt.text(852, 0.52, r'$L_{3}$', fontsize=20)
    plt.text(869.5, 0.15, r'$L_{2}$', fontsize=20)
    plt.text(846.5, 0.55, r'(a)', fontsize=25)
    plt.subplots_adjust(left=0.15,
                        right=0.95,
                        bottom=0.13,
                        top=0.95,
                        wspace=0.05,
                        hspace=0.00)
    plt.savefig('xas_ni.pdf')
コード例 #3
0
#
# Variable :code:`pol_type` specifies a list of different x-ray
# polarizations to calculate. Here we will use so-called :math:`\pi`-polarization
# where the x-rays are parallel to the plane spanned by the incident
# beam and the sample :math:`z`-axis.
#
# We need to specify the temperature and how many eigenstates
# we use to represent the ground state. In this example, we
# calculate these states as those that have non-negligable thermal
# population. The function :code:`xas_1v1c_py` assumes that the spectral
# broadening is domainted by the inverse core hole lifetime :code:`gamma_c`,
# which is the Lorentzian half width at half maximum.

ominc = np.linspace(11200, 11230, 50)
temperature = 300 # in K
prob = edrixs.boltz_dist(eval_i, temperature)
gs_list = [n for n, prob in enumerate(prob) if prob>1e-6]

gs_list = [n for n in range(6)]

thin = 30*np.pi/180
phi = 0
pol_type = [('linear', 0)]

xas = edrixs.xas_1v1c_py(
    eval_i, eval_n, trans_op, ominc, gamma_c=info['gamma_c'],
    thin=thin, phi=phi, pol_type=pol_type,
    gs_list=gs_list)


################################################################################
コード例 #4
0
        (2, 3, ncfgs_ex, ncfgs_gs)) + 1j * data[:, 5].reshape(
            (2, 3, ncfgs_ex, ncfgs_gs)))
    trans_mat_emi = np.zeros((2, 3, ncfgs_gs, ncfgs_ex), dtype=np.complex128)
    for i in range(2):
        for j in range(3):
            trans_mat_emi[i, j] = np.conj(np.transpose(trans_mat_abs[i, j]))

    gamma_c, gamma = 5.0 / 2.0, 0.08
    phi, thin, thout = 0.0, 30 / 180.0 * np.pi, 60 / 180.0 * np.pi
    pol_vec = [(0, 0), (0, np.pi / 2.0)]

    omi_shift = 11755
    omi_mesh = np.linspace(-546, -536, 21)
    eloss_mesh = np.linspace(-0.2, 1.5, 1000)
    gs_list = range(0, 2)
    gs_dist = edrixs.boltz_dist([eval_gs[i] for i in gs_list], 30)

    rixs = np.zeros((len(pol_vec), len(eloss_mesh), len(omi_mesh)),
                    dtype=np.float64)
    for omi_ind, omi in enumerate(omi_mesh):
        print(omi_ind, omi, omi + omi_shift)
        Ffg_Ir = np.zeros((2, 3, 3, ncfgs_gs, len(gs_list)),
                          dtype=np.complex128)
        for i in range(0, 2):
            abs_trans = copy.deepcopy(trans_mat_abs[i])
            emi_trans = copy.deepcopy(trans_mat_emi[i])
            Ffg_Ir[i] = edrixs.scattering_mat(eval_gs, eval_ex[i],
                                              abs_trans[:, :, gs_list],
                                              emi_trans, omi, gamma_c)
        print('------------------------')
        for ipol, (alpha, beta) in enumerate(pol_vec):