Ejemplo n.º 1
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")
Ejemplo n.º 2
0
def ed():
    # 1-10: Ni-3d valence orbitals, 11-16: Ni-2p core orbitals
    # Single particle basis: complex shperical Harmonics
    ndorb, nporb, ntot = 10, 6, 16
    emat_i = np.zeros((ntot, ntot), dtype=np.complex)
    emat_n = np.zeros((ntot, ntot), dtype=np.complex)

    # 4-index Coulomb interaction tensor, parameterized by
    # Slater integrals, which are obtained from Cowan's code
    F2_d, F4_d = 7.9521, 4.9387
    # Averaged dd Coulomb interaction is set to be zero
    F0_d = edrixs.get_F0('d', F2_d, F4_d)
    G1_dp, G3_dp = 4.0509, 2.3037
    # Averaged dp Coulomb interaction is set to be zero
    F0_dp, F2_dp = edrixs.get_F0('dp', G1_dp, G3_dp), 7.33495
    umat_i = edrixs.get_umat_slater(
        'dp',
        F0_d,
        F2_d,
        F4_d,  # dd
        0,
        0,
        0,
        0,  # dp
        0,
        0)  # pp
    umat_n = edrixs.get_umat_slater(
        'dp',
        F0_d,
        F2_d,
        F4_d,  # dd
        F0_dp,
        F2_dp,
        G1_dp,
        G3_dp,  # dp
        0,
        0)  # pp

    # Atomic spin-orbit coupling
    zeta_d, zeta_p = 0.083, 11.24
    emat_i[0:ndorb, 0:ndorb] += edrixs.atom_hsoc('d', zeta_d)
    emat_n[0:ndorb, 0:ndorb] += edrixs.atom_hsoc('d', zeta_d)
    emat_n[ndorb:ntot, ndorb:ntot] += edrixs.atom_hsoc('p', zeta_p)

    # Tetragonal crystal field splitting terms,
    # which are first defined in the real cubic Harmonics basis,
    # and then transformed to complex shperical Harmonics basis.
    dt, ds, dq = 0.011428, 0.035714, 0.13
    tmp = np.zeros((5, 5), dtype=np.complex)
    tmp[0, 0] = 6 * dq - 2 * ds - 6 * dt  # d3z2-r2
    tmp[1, 1] = -4 * dq - 1 * ds + 4 * dt  # dzx
    tmp[2, 2] = -4 * dq - 1 * ds + 4 * dt  # dzy
    tmp[3, 3] = 6 * dq + 2 * ds - 1 * dt  # dx2-y2
    tmp[4, 4] = -4 * dq + 2 * ds - 1 * dt  # dxy
    tmp[:, :] = edrixs.cb_op(tmp, edrixs.tmat_r2c('d'))
    emat_i[0:ndorb:2, 0:ndorb:2] += tmp
    emat_i[1:ndorb:2, 1:ndorb:2] += tmp
    emat_n[0:ndorb:2, 0:ndorb:2] += tmp
    emat_n[1:ndorb:2, 1:ndorb:2] += tmp

    # Build Fock basis in its binary form
    basis_i = edrixs.get_fock_bin_by_N(ndorb, 8, nporb, nporb)
    basis_n = edrixs.get_fock_bin_by_N(ndorb, 9, nporb, nporb - 1)
    ncfg_i, ncfg_n = len(basis_i), len(basis_n)

    # Build many-body Hamiltonian in Fock basis
    hmat_i = np.zeros((ncfg_i, ncfg_i), dtype=np.complex)
    hmat_n = np.zeros((ncfg_n, ncfg_n), dtype=np.complex)
    hmat_i[:, :] += edrixs.two_fermion(emat_i, basis_i, basis_i)
    hmat_i[:, :] += edrixs.four_fermion(umat_i, basis_i)
    hmat_n[:, :] += edrixs.two_fermion(emat_n, basis_n, basis_n)
    hmat_n[:, :] += edrixs.four_fermion(umat_n, basis_n)

    # Do exact-diagonalization to get eigenvalues and eigenvectors
    eval_i, evec_i = np.linalg.eigh(hmat_i)
    eval_n, evec_n = np.linalg.eigh(hmat_n)

    # Build dipolar transition operators
    dipole = np.zeros((3, ntot, ntot), dtype=np.complex)
    T_abs = np.zeros((3, ncfg_n, ncfg_i), dtype=np.complex)
    T_emi = np.zeros((3, ncfg_i, ncfg_n), dtype=np.complex)
    tmp = edrixs.get_trans_oper('dp')
    for i in range(3):
        dipole[i, 0:ndorb, ndorb:ntot] = tmp[i]
        # First, in the Fock basis
        T_abs[i] = edrixs.two_fermion(dipole[i], basis_n, basis_i)
        # Then, transfrom to the eigenvector basis
        T_abs[i] = edrixs.cb_op2(T_abs[i], evec_n, evec_i)
        T_emi[i] = np.conj(np.transpose(T_abs[i]))

    return eval_i, eval_n, T_abs, T_emi
Ejemplo n.º 3
0
    evec_n = np.zeros((2, ncfgs_n, ncfgs_n), dtype=np.complex128)
    for i in range(2):
        hmat_n[i] += edrixs.two_fermion(emat_n[i], basis_n[i], basis_n[i])
        hmat_n[i] += edrixs.four_fermion(umat_n[i], basis_n[i])
        eval_n[i], evec_n[i] = scipy.linalg.eigh(hmat_n[i])
    print("edrixs >>> Done!")

    edrixs.write_tensor(eval_i, 'eval_i.dat')
    edrixs.write_tensor(eval_n, 'eval_n.dat')

    # Building transition operators
    print("edrixs >>> building transition operators ...")
    tran_ptod = edrixs.get_trans_oper('t2gp')
    for i in range(3):
        tran_ptod[i, :, :] = edrixs.cb_op2(tran_ptod[i],
                                           edrixs.tmat_c2r('t2g', True),
                                           edrixs.tmat_c2r('p', True))
    dipole_n = np.zeros((2, 3, norbs, norbs), dtype=np.complex128)
    dipole_n[0, :, 0:6, 12:18] = tran_ptod
    dipole_n[1, :, 6:12, 18:24] = tran_ptod
    trop_n = np.zeros((2, 3, ncfgs_n, ncfgs_i), dtype=np.complex128)
    for i in range(2):
        for j in range(3):
            trop_n[i, j] = edrixs.two_fermion(dipole_n[i, j], basis_n[i],
                                              basis_i)
            trop_n[i, j] = edrixs.cb_op2(trop_n[i, j], evec_n[i], evec_i)

    Ir_trop = np.zeros((2, 3, ncfgs_n, ncfgs_i), dtype=np.complex128)
    for i in range(2):
        for j in range(3):
            Ir_trop[i, j] = Ir_loc2g[i, 0, j] * trop_n[i, 0] + \
Ejemplo n.º 4
0
def get_s_l_ls_values_n(l,basis,evec,ref,ndorb,ntot):
    """
    For the 2p to 3d transitions
    Calaculate the  S_x-, S_y-, S_z-, and S^2-Values after diagonalization
    Calaculate the  L_x-, L_y-, L_z-, and L^2-Values after diagonalization
    Calaculate the LS-Values after diagonalization
    Parameters
    ----------

    ndorb: int
        Total number of 3d-electrons

    ntot:
        Total number of electrons

    l: int
        The overall-angular moment l

    evac: 2d complex array
        The impurity vector after demoralization.

    basis: list of array
        Left fock basis :math:`<F_{l}|`.
        AND:
        Right fock basis :math:`|F_{r}>`.
        rb = lb

    Returns
    -------

    spin_prop: list of numpy-arrays
        Expectation-Value of S_x, S_y, S_z, and S^2
    lang_prop: list of numpy-arrays
        Expectation-Value of L_x, L_y, L_z, and L^2
    ls: float-numpy-array
        Expectation-Value of LS
    """
    
    # Creating the intial Spin-Hamiltonian, which has to be a 16*16 for 2p3d
    hh_sx = np.zeros_like(ref)
    hh_sy = np.zeros_like(ref)
    hh_sz = np.zeros_like(ref)
    
    hh_sx[0:ndorb,0:ndorb] += edrixs.get_sx(l=l)
    hh_sy[0:ndorb,0:ndorb] += edrixs.get_sy(l=l)
    hh_sz[0:ndorb,0:ndorb] += edrixs.get_sz(l=l)
    hh_sx[ndorb:ntot,ndorb:ntot] += edrixs.get_sx(l=l-1)
    hh_sy[ndorb:ntot,ndorb:ntot] += edrixs.get_sy(l=l-1)
    hh_sz[ndorb:ntot,ndorb:ntot] += edrixs.get_sz(l=l-1)
    # Setting up the Spin-Hamiltonian
    h_sx = edrixs.two_fermion(hh_sx, basis, basis)
    h_sy = edrixs.two_fermion(hh_sy, basis, basis)
    h_sz = edrixs.two_fermion(hh_sz, basis, basis)

    # Calculating the S-Expectation-Value depending on the Wavefunction-Coefficient
    sx = edrixs.cb_op2(h_sx, evec, evec)
    sy = edrixs.cb_op2(h_sy, evec, evec)
    sz = edrixs.cb_op2(h_sz, evec, evec)
    # S2-Value has to be calculated as the mutated-product of the single xyz-Hamiltonian consistent with theory
    s2 = edrixs.cb_op2(np.matmul(h_sx,h_sx)+np.matmul(h_sy,h_sy)+np.matmul(h_sz,h_sz), evec, evec)
    # Probably are more elegant way is possible as s2 = sx**2 + sy**2 + sz**2, however generates more numerical noise
    # ls = np.matmul(sx,sx)+np.matmul(sy,sy)+np.matmul(sz,sz)
    # Summarize everything as a list
    spin_prop = [sx.diagonal().real,sy.diagonal().real,sz.diagonal().real,s2.diagonal().real]
    print("Done with Sx-,Sy-,Sz-, and S2-values!")
    
    
     # Creating the intial Angular-Hamiltonian, which has to be a 16*16 for 2p3d
    hh_lx = np.zeros_like(ref)
    hh_ly = np.zeros_like(ref)
    hh_lz = np.zeros_like(ref)
    
    hh_lx[0:ndorb,0:ndorb] += edrixs.get_lx(l=l,ispin=True)
    hh_ly[0:ndorb,0:ndorb] += edrixs.get_ly(l=l,ispin=True)
    hh_lz[0:ndorb,0:ndorb] += edrixs.get_lz(l=l,ispin=True)
    hh_lx[ndorb:ntot,ndorb:ntot] += edrixs.get_lx(l=l-1,ispin=True)
    hh_ly[ndorb:ntot,ndorb:ntot] += edrixs.get_ly(l=l-1,ispin=True)
    hh_lz[ndorb:ntot,ndorb:ntot] += edrixs.get_lz(l=l-1,ispin=True)
    # Setting up the Angular-Hamiltonian
    h_lx = edrixs.two_fermion(hh_lx, basis, basis)
    h_ly = edrixs.two_fermion(hh_ly, basis, basis)
    h_lz = edrixs.two_fermion(hh_lz, basis, basis)


    # Calculating the L-Expectation-Value depending on the Wavefunction-Coefficient
    lx = edrixs.cb_op2(h_lx, evec, evec)
    ly = edrixs.cb_op2(h_ly, evec, evec)
    lz = edrixs.cb_op2(h_lz, evec, evec)
    # L2-Value has to be calculated as the mutated-product of the single xyz-Hamiltonian consistent with theory
    l2 = edrixs.cb_op2(np.matmul(h_lx,h_lx)+np.matmul(h_ly,h_ly)+np.matmul(h_lz,h_lz), evec, evec)
    # Probably are more elegant way is possible as l2 = lx**2 + ly**2 + lz**2, however generates more numerical noise
    # l2 = np.matmul(lx,lx)+np.matmul(ly,ly)+np.matmul(lz,lz)
    lang_prop = [lx.diagonal().real,ly.diagonal().real,lz.diagonal().real,l2.diagonal().real]
    print("Done with Lx-,Ly-,Lz-, and L2-values!")

    # L2-Value has to be calculated as the mutated-product of the single xyz-Hamiltonian consistent with theory
    ls = edrixs.cb_op2(np.matmul(h_lx,h_sx)+np.matmul(h_ly,h_sy)+np.matmul(h_lz,h_sz), evec, evec)
    # Probably are more elegant way is possible as l2 = lx**2 + ly**2 + lz**2, however generates more numerical noise
    # ls = np.matmul(lx,sx)+np.matmul(ly,sy)+np.matmul(sz,sz)
    print("Done with LS-values!")
    
    return spin_prop, lang_prop, ls.diagonal().real