poltype_rixs = [('linear', 0, 'linear', 0),
                ('linear', 0, 'linear', np.pi / 2.0)]  # for RIXS

# Energy grid
ominc_xas = np.linspace(off - 10, off + 20, 1000)  # for XAS
ominc_rixs_L3 = np.linspace(-5.9 + off, -0.9 + off,
                            100)  # incident energy at L3 edge
ominc_rixs_L2 = np.linspace(10.4 + off, 14.9 + off,
                            100)  # incident energy at L3 edge
eloss = np.linspace(-0.5, 5.0, 1000)  # energy loss for RIXS

# Run ED
eval_i, eval_n, trans_op = edrixs.ed_1v1c_py(('d', 'p'),
                                             shell_level=(0.0, -off),
                                             v_soc=(zeta_d_i, zeta_d_n),
                                             c_soc=zeta_p_n,
                                             v_noccu=noccu,
                                             slater=slater,
                                             v_cfmat=cf)

# Run XAS
xas = edrixs.xas_1v1c_py(eval_i,
                         eval_n,
                         trans_op,
                         ominc_xas,
                         gamma_c=gamma_c,
                         thin=thin,
                         phi=phi,
                         pol_type=poltype_xas,
                         gs_list=[0, 1, 2],
                         temperature=300)
Exemple #2
0
    gs_list = range(0, 2)
    poltype_rixs = [('linear', 0.0, 'linear', 0.0),
                    ('linear', 0.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 = np.zeros((len(ominc), len(eloss), len(poltype_rixs), natom),
                    dtype=np.float)
    # Loop over all the atoms
    for iatom in range(natom):
        print()
        print("edrixs >>> atom: ", iatom)
        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,
def do_ed(dq10=1.6, d1=0.1, d3=0.75, ex_x=0., ex_y=0., ex_z=0.):
    """
    Diagonalize Hamiltonian for Ni 3d8 system in tetragonal crytals field and
    applied exchange field.

    Parameters
    ----------
    dq10: float
        Cubic crystal field parameter (eV)
        Cubic splitting
    dq1: float
        Cubic crystal field parameter (eV)
        t2g splitting
    dq3: float
        Cubic crystal field parameter (eV)
        eg splitting
    ex_x: float
        Magnitude of the magnetic exchange field in the x direction (eV)
    ex_y: float
        Magnitude of the magnetic exchange field in the y direction (eV)
    ex_z: float
        Magnitude of the magnetic exchange field in the z direction (eV)

    Returns
    --------
    eval_i: 1d array
        Eigenvalues of initial state Hamiltonian
    eval_n: 1d array
        Eigenvalues of intermediate state Hamiltonian
    dipole_op: 3d array
        Dipole operator from 2p to 3d state
    """
    # PARAMETERS:
    # ------------
    F2_dd, F4_dd = 12.234 * 0.65, 7.598 * 0.65
    Ud_av = 0.0
    F0_dd = Ud_av + edrixs.get_F0('d', F2_dd, F4_dd)

    G1_dp, G3_dp = 5.787 * 0.7, 3.291 * 0.7
    F2_dp = 7.721 * 0.95
    Udp_av = 0.0
    F0_dp = Udp_av + edrixs.get_F0('dp', G1_dp, G3_dp)

    slater = (
        [F0_dd, F2_dd, F4_dd],  # Initial
        [F0_dd, F2_dd, F4_dd, F0_dp, F2_dp, G1_dp, G3_dp]  # Intermediate
    )

    zeta_d_i = 0.083
    zeta_d_n = 0.102
    zeta_p_n = 11.24

    cf = edrixs.cf_tetragonal_d(dq10, d1, d3)

    ext_B = np.array([ex_x, ex_y, ex_z])
    result = edrixs.ed_1v1c_py(shell_name=('d', 'p'),
                               v_soc=(zeta_d_i, zeta_d_n),
                               c_soc=zeta_p_n,
                               v_noccu=8,
                               slater=slater,
                               ext_B=ext_B,
                               on_which='spin',
                               v_cfmat=cf)
    return result
        ('L2', 'd', 12385 + 5),
        ('L3', 'd', 10871 + 5),  # Keep all the 5d orbitals
        ('L2', 't2g', 12385 + 5),
        ('L3', 't2g', 10871 + 5)  # Keep only t2g orbitals
    ]

    for case, v_name, om_shift in transition:
        # Run ED
        c_name = edrixs.edge_to_shell_name(case)
        print("edrixs >>> ", c_name, " to ", v_name)
        if v_name == 'd':
            eloss = np.linspace(-0.5, 5.5, 1000)
            result = edrixs.ed_1v1c_py(
                shell_name=(v_name, c_name),
                v_soc=(zeta_d_i, zeta_d_n),
                v_noccu=noccu,
                slater=slater,
                v_cfmat=cf  # add CF
            )
        else:
            eloss = np.linspace(-0.5, 2, 1000)
            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,
################################################################################
# Diagonalization
# ------------------------------------------------------------------------------
# We obtain the ground and intermediate state eigenenergies and the transition
# operators via matrix diagonalization. Note that the calculation does not know
# the core hole energy, so we need to adjust the energy that the resonance will
# appear at by hand. We know empirically that the resonance is at 11215 eV
# and that putting four electrons into the valance band costs about 
# :math:`4 F^0_d\approx6` eV. In this case 
# we are assuming a perfectly cubic crystal field, which we have already
# implemented when we specified the use of the :math:`t_{2g}` subshell only
# so we do not need to pass an additional :code:`v_cfmat` matrix.

off = 11215 - 6
out = edrixs.ed_1v1c_py(shell_name, shell_level=(0, -off), v_soc=v_soc,
                        c_soc=info['c_soc'], v_noccu=v_noccu, slater=slater)
eval_i, eval_n, trans_op = out

################################################################################
# Compute XAS
# ------------------------------------------------------------------------------
# To calculate XAS we need to correctly specify the orientation of the x-rays
# with respect to the sample. By default, the :math:`x, y, z` coordinates
# of the sample's crystal field, will be aligned with our lab frame, passing 
# :code:`loc_axis` to :code:`ed_1v1c_py` can be used to specify a different 
# convention. The experimental geometry is specified following the angles
# shown in Figure 1 of Y. Wang et al.,
# `Computer Physics Communications 243, 151-165 (2019)
# <https://doi.org/10.1016/j.cpc.2019.04.018>`_. The default 
# setting has x-rays along :math:`z` for :math:`\theta=\pi` rad
# and the x-ray beam along :math:`-x` for 
    # L3-edge
    gamma_c, gamma_f = 0.275, 0.1
    ominc_rixs = np.linspace(-5.9 + off, -0.9 + off, 100)
    # L2-edge
    # gamma_c, gamma_f = 0.7, 0.1
    # ominc_rixs = np.linspace(10.9 + off, 14.9 + off, 100)
    eloss = np.linspace(-0.5, 5.0, 1000)
    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)]
    # Run ED
    eval_i, eval_n, trans_op = edrixs.ed_1v1c_py(shell_name=('d', 'p'),
                                                 shell_level=(0, -off),
                                                 v_soc=(zeta_d_i, zeta_d_n),
                                                 c_soc=zeta_p_n,
                                                 v_noccu=8,
                                                 slater=slater,
                                                 v_cfmat=cf,
                                                 verbose=1)

    # Run XAS
    xas = edrixs.xas_1v1c_py(eval_i,
                             eval_n,
                             trans_op,
                             ominc_xas,
                             gamma_c=gamma_c,
                             thin=thin,
                             phi=phi,
                             pol_type=poltype_xas,
                             gs_list=[0, 1, 2],
                             temperature=300)
            gamma_c[i] = 1.05 / 2.0 + step * (i - last_one)
        else:
            gamma_c[i] = 6.5 / 2.0

    poltype_xas = [('isotropic', 0.0)]
    poltype_rixs = [('linear', 0.0, 'linear', 0.0),
                    ('linear', 0.0, 'linear', np.pi / 2.0),
                    ('linear', np.pi / 2.0, 'linear', 0.0),
                    ('linear', np.pi / 2.0, 'linear', np.pi / 2.0)]
    # END of Parameters
    # ------------------

    # Run ED
    eval_i, eval_n, trans_op = edrixs.ed_1v1c_py(('f', 'd'),
                                                 shell_level=(0, -om_shift),
                                                 v_soc=(zeta_f_i, zeta_f_n),
                                                 c_soc=zeta_d_n,
                                                 v_noccu=noccu,
                                                 slater=slater)

    # Run XAS
    xas = edrixs.xas_1v1c_py(eval_i,
                             eval_n,
                             trans_op,
                             ominc,
                             gamma_c=gamma_c,
                             thin=thin,
                             phi=phi,
                             pol_type=poltype_xas,
                             gs_list=gs_list,
                             temperature=300)