# `scipy <https://scipy.org>`_ diagonalization routine. This returns eigenvalues
# :code:`e` and eignvectors :code:`v` where eigenvalue :code:`e[i]` corresponds
# to eigenvector :code:`v[:,i]`.
e, v = scipy.linalg.eigh(H)
print("{} eignvalues and {} eigvenvectors {} elements long.".format(
    len(e), v.shape[1], v.shape[0]))

################################################################################
# Computing expectation values
# ------------------------------------------------------------------------------
# To interpret the results, it is informative to compute the expectations values
# related to the spin :math:`\mathbf{S}`, orbital :math:`\mathbf{L}`,
# and total :math:`\mathbf{J}`, angular momentum. We first load the relevant
# matrices for these quantities for a `p` atomic shell.  We need to specifiy
# that we would like to include spin when loading the orbital operator.
orb_mom = edrixs.get_orb_momentum(l, ispin=True)
spin_mom = edrixs.get_spin_momentum(l)
tot_mom = orb_mom + spin_mom

################################################################################
# We again transform these matrices to our Fock basis to build the operators
n_fermion = 2
opL, opS, opJ = edrixs.build_opers(n_fermion, [orb_mom, spin_mom, tot_mom],
                                   basis)

################################################################################
# Recall that quantum mechanics forbids us from knowing all three Cartesian
# components of angular momentum at once, so we want to compute the squares of
# these operators i.e.
#
#     .. math::
Esempio n. 2
0
emat_soc = edrixs.atom_hsoc('t2g', soc_zeta)
# Four fermion terms: Coulomb interaction
# The 4-rank tensor is in the complex spherical Harmonics basis
umat = edrixs.get_umat_slater('t2g', F0, F2, F4)
# Fock basis in the complex spherical Harmonics basis with the orbital ordering:
# |-1,up>, |-1,dn>, |0,up>, |0,dn>, |+1,up>, |+1,dn>
# basis: 2d list of integers with 1 or 0, the shape is (15, 6) in this case
# where, 15=6*5/2 is the total number of Fock basis and 6 is the total number of
# single-particle orbitals
basis = edrixs.get_fock_bin_by_N(norb, noccu)

# quantum number of orbital angular momentum for t2g: l=1
ll = 1
# Matrices of lx,ly,lz,sx,sy,sz,jx,jy,jz in the single-particle basis
# lx: l_orb[0], ly: l_orb[1], lz: l_orb[2]
l_orb = edrixs.get_orb_momentum(ll, True)
# sx: s_spin[0], sy: s_spin[1], sz: s_spin[2]
s_spin = edrixs.get_spin_momentum(ll)
# jx: j_so[0], jy: j_so[1], jz: j_so[2]
j_so = l_orb + s_spin

# very small Zeeman splitting along z-direction
emat_zeeman = (l_orb[2] + s_spin[2]) * 1e-10

# many-body operators of L^2, Lz
Lxyz = edrixs.build_opers(2, l_orb, basis)
L2 = np.dot(Lxyz[0], Lxyz[0]) + np.dot(Lxyz[1], Lxyz[1]) + np.dot(
    Lxyz[2], Lxyz[2])
Lz = Lxyz[2]
# many-body operators of S^2, Sz
Sxyz = edrixs.build_opers(2, s_spin, basis)
Esempio n. 3
0
# Coulomb interaction tensor
umat = edrixs.get_umat_slater('p', F0, F2)
# build Fock basis
basis = edrixs.get_fock_bin_by_N(norb, noccu)
# build Hamiltonian, four fermion terms
H = edrixs.build_opers(4, umat, basis)
# do ED
e1, v1 = scipy.linalg.eigh(H)
# add spin-orbit coupling (SOC)
soc = edrixs.atom_hsoc('p', 0.2)
# build Hamiltonian, two_fermion terms
H2 = H + edrixs.build_opers(2, soc, basis)
# do ED
e2, v2 = scipy.linalg.eigh(H2)

orb_mom = edrixs.get_orb_momentum(1, True)
spin_mom = edrixs.get_spin_momentum(1)
tot_mom = orb_mom + spin_mom
opL, opS, opJ = edrixs.build_opers(2, [orb_mom, spin_mom, tot_mom], basis)
# L^2 = Lx^2 + Ly^2 +Lz^2, S^2 = Sx^2 + Sy^2 + Sz^2, J^2 = Jx^2 + Jy^2 + Jz^2
L2 = np.dot(opL[0], opL[0]) + np.dot(opL[1], opL[1]) + np.dot(opL[2], opL[2])
S2 = np.dot(opS[0], opS[0]) + np.dot(opS[1], opS[1]) + np.dot(opS[2], opS[2])
J2 = np.dot(opJ[0], opJ[0]) + np.dot(opJ[1], opJ[1]) + np.dot(opJ[2], opJ[2])

# print out results
print("Without SOC")
L2_val = edrixs.cb_op(L2, v1).diagonal().real
S2_val = edrixs.cb_op(S2, v1).diagonal().real
print("    #           eigenvalue     L(L+1)    S(S+1)")
for i, e in enumerate(e1):
    print("{:5d}{:20.6f}{:10.1f}{:10.1f}".format(i, e, L2_val[i], S2_val[i]))