예제 #1
0
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")
def get_transop(loc, pos):
    # get dipole transition operator in local axis
    dop = edrixs.get_trans_oper('t2gp32')
    dop_g = np.zeros((2, 3, 6, 4), dtype=np.complex)
    # transform to golobal axis
    for i in range(2):
        for j in range(3):
            for k in range(3):
                dop_g[i, j] += loc[i, j, k] * dop[k]

    # RIXS settings
    thin, thout, phi = 30 / 180.0 * np.pi, 60 / 180.0 * np.pi, 0.0
    ein, eout = 11215.0, 11215.0  # eV
    # Wavevector
    kin, kout = edrixs.get_wavevector_rixs(thin, thout, phi, ein, eout)
    # polarization pi-pi and pi-sigma
    for key, alpha, beta in [('pp', 0, 0), ('ps', 0, np.pi / 2.0)]:
        ei, ef = edrixs.dipole_polvec_rixs(thin, thout, phi, alpha, beta)
        T_i = np.zeros((2, 6, 4), dtype=np.complex)
        T_f = np.zeros((2, 4, 6), dtype=np.complex)
        for i in range(2):
            for j in range(3):
                T_i[i] += dop_g[i, j] * ei[j]
                T_f[i] += np.conj(np.transpose(dop_g[i, j] * ef[j]))
            # multiply phase factor
            T_i[i] = T_i[i] * np.exp(+1j * np.dot(pos[i], kin))
            T_f[i] = T_f[i] * np.exp(-1j * np.dot(pos[i], kout))

        transop_rixs_i = np.zeros((20, 20), dtype=np.complex)
        transop_rixs_f = np.zeros((20, 20), dtype=np.complex)
        for i in range(2):
            off1, off2 = i * 6, 12 + i * 4
            transop_rixs_i[off1:off1 + 6, off2:off2 + 4] = T_i[i]
            transop_rixs_f[off2:off2 + 4, off1:off1 + 6] = T_f[i]
        # write to file
        edrixs.write_emat(transop_rixs_i, "rixs_" + key + "/transop_rixs_i.in")
        edrixs.write_emat(transop_rixs_f, "rixs_" + key + "/transop_rixs_f.in")

    # For XAS, use isotropic polarization
    ei = np.array([1, 1, 1]) / np.sqrt(3.0)
    T_i = np.zeros((2, 6, 4), dtype=np.complex)
    for i in range(2):
        for j in range(3):
            T_i[i] += dop_g[i, j] * ei[j]

    transop_xas = np.zeros((20, 20), dtype=np.complex128)
    for i in range(2):
        off1, off2 = i * 6, 12 + i * 4
        transop_xas[off1:off1 + 6, off2:off2 + 4] = T_i[i]
    edrixs.write_emat(transop_xas, "xas/transop_xas.in")
예제 #3
0
def get_transop(loc, pos):
    dop = edrixs.get_trans_oper('t2gp')
    dop_g = np.zeros((2, 3, 6, 6), dtype=np.complex)
    for i in range(2):
        dop_g[i, 0] = loc[i, 0, 0] * dop[0] + loc[i, 0, 1] * dop[1] + loc[
            i, 0, 2] * dop[2]
        dop_g[i, 1] = loc[i, 1, 0] * dop[0] + loc[i, 1, 1] * dop[1] + loc[
            i, 1, 2] * dop[2]
        dop_g[i, 2] = loc[i, 2, 0] * dop[0] + loc[i, 2, 1] * dop[1] + loc[
            i, 2, 2] * dop[2]

    # for RIXS
    thin, thout, phi = 30 / 180.0 * np.pi, 60 / 180.0 * np.pi, 0.0
    ein, eout = 11215.0, 11215.0  # eV
    kin, kout = edrixs.get_wavevector_rixs(thin, thout, phi, ein, eout)
    # polarization pi-pi and pi-sigma
    for key, alpha, beta in [('pp', 0, 0), ('ps', 0, np.pi)]:
        ei, ef = edrixs.dipole_polvec_rixs(thin, thout, phi, alpha, beta)
        T_i = np.zeros((2, 6, 6), dtype=np.complex)
        T_o = np.zeros((2, 6, 6), dtype=np.complex)
        for i in range(2):
            T_i[i] = (dop_g[i, 0] * ei[0] + dop_g[i, 1] * ei[1] +
                      dop_g[i, 2] * ei[2]) * np.exp(1j * np.dot(pos[i], kin))
            T_o[i] = np.exp(-1j * np.dot(pos[i], kout)) * np.conj(
                np.transpose(dop_g[i, 0] * ef[0] + dop_g[i, 1] * ef[1] +
                             dop_g[i, 2] * ef[2]))
        transop_rixs_i = np.zeros((24, 24), dtype=np.complex)
        transop_rixs_f = np.zeros((24, 24), dtype=np.complex)
        for i in range(2):
            off1, off2 = i * 6, 12 + i * 6
            transop_rixs_i[off1:off1 + 6, off2:off2 + 6] = T_i[i]
            transop_rixs_f[off2:off2 + 6, off1:off1 + 6] = T_o[i]
        edrixs.write_emat(transop_rixs_i, "rixs_" + key + "/transop_rixs_i.in")
        edrixs.write_emat(transop_rixs_f, "rixs_" + key + "/transop_rixs_f.in")

    # For XAS
    ei = np.array([1, 1, 1]) / np.sqrt(3.0)
    T_i = np.zeros((2, 6, 6), dtype=np.complex)
    for i in range(2):
        T_i[i] = dop_g[i, 0] * ei[0] + dop_g[i, 1] * ei[1] + dop_g[i,
                                                                   2] * ei[2]
    transop_xas = np.zeros((24, 24), dtype=np.complex128)
    for i in range(2):
        off1, off2 = i * 6, 12 + i * 6
        transop_xas[off1:off1 + 6, off2:off2 + 6] = T_i[i]
    edrixs.write_emat(transop_xas, "xas/transop_xas.in")
예제 #4
0
def get_transop():
    tmp = edrixs.get_trans_oper('t2gp')
    dipole = np.zeros((3, 28, 28), dtype=np.complex)
    for i in range(3):
        tmp[i] = edrixs.cb_op2(tmp[i], edrixs.tmat_c2j(1), edrixs.tmat_c2j(1))
        dipole[i, 0:6, 24:28] = tmp[i, 0:6, 2:6]

    # for RIXS
    thin, thout, phi = 45 / 180.0 * np.pi, 45 / 180.0 * np.pi, 0.0
    # polarization pi-pi and pi-sigma
    for key, alpha, beta in [('pp', 0, 0), ('ps', 0, np.pi)]:
        ei, ef = edrixs.dipole_polvec_rixs(thin, thout, phi, alpha, beta)
        transop_rixs_i = dipole[0] * ei[0] + dipole[1] * ei[1] + dipole[
            2] * ei[2]
        transop_rixs_f = np.conj(
            np.transpose(dipole[0] * ef[0] + dipole[1] * ef[1] +
                         dipole[2] * ef[2]))
        edrixs.write_emat(transop_rixs_i, "rixs_" + key + "/transop_rixs_i.in")
        edrixs.write_emat(transop_rixs_f, "rixs_" + key + "/transop_rixs_f.in")

    # For XAS
    ei = np.array([1, 1, 1]) / np.sqrt(3.0)
    transop_xas = dipole[0] * ei[0] + dipole[1] * ei[1] + dipole[2] * ei[2]
    edrixs.write_emat(transop_xas, "xas/transop_xas.in")
예제 #5
0
 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):
         ein, eout = omi + omi_shift, omi + omi_shift
         ei, ef = edrixs.dipole_polvec_rixs(thin,
                                            thout,
                                            phi,
                                            alpha,
                                            beta,
                                            local_axis=np.eye(3))
         kin, kout = edrixs.get_wavevector_rixs(thin,
                                                thout,
                                                phi,
                                                ein,
                                                eout,
                                                local_axis=np.eye(3))
         Q = kout - kin
         phase_Ir = np.zeros(2, dtype=np.complex128)
         for i in range(0, 2):
             phase_Ir[i] = np.exp(-1j * np.dot(Q, Ir_pos[i]))
         Ffg = np.zeros((ncfgs_gs, len(gs_list)), dtype=np.complex128)
         for i in range(0, 2):
             for j in range(3):