From 9dc894f50c72d85049d46d16381d564954a38f90 Mon Sep 17 00:00:00 2001 From: phibeck Date: Fri, 2 Aug 2024 12:28:45 -0400 Subject: [PATCH] updates to Sr2RuO4_SOC --- Sr2RuO4_SOC/model.py | 43 +++++++++---- Sr2RuO4_SOC/tight_binding_model.py | 96 ------------------------------ 2 files changed, 32 insertions(+), 107 deletions(-) delete mode 100644 Sr2RuO4_SOC/tight_binding_model.py diff --git a/Sr2RuO4_SOC/model.py b/Sr2RuO4_SOC/model.py index fc34f04..5e01bb2 100644 --- a/Sr2RuO4_SOC/model.py +++ b/Sr2RuO4_SOC/model.py @@ -7,10 +7,25 @@ from triqs.operators import c, c_dag, n from triqs.operators.util import h_int_kanamori, U_matrix_kanamori from itertools import product +import numpy as np from numpy import matrix, array, diag, pi import numpy.linalg as linalg -from tight_binding_model import * +from triqs.lattice.utils import TB_from_wannier90 + +# order is xy_up, xz_up, yz_up, xy_dn, xz_dn, yz_dn +# could be replaced by triqs_dft_tools/converters/wannier90.py: generate_local_so_matrix_t2g() +# but different orbital order (xz_up, xz_dn, yz_up, yz_dn, xy_up, xy_dn) +def lambda_matrix(lam_xy, lam_z): + lam_loc = np.zeros((6,6),dtype=complex) + lam_loc[0,4] = 1j*lam_xy/2.0 + lam_loc[0,5] = lam_xy/2.0 + lam_loc[1,2] = 1j*lam_z/2.0 + lam_loc[1,3] = -1j*lam_xy/2.0 + lam_loc[2,3] = -lam_xy/2.0 + lam_loc[4,5] = -1j*lam_z/2.0 + lam_loc = lam_loc + np.transpose(np.conjugate(lam_loc)) + return lam_loc # ==== System Parameters ==== beta = 25. # Inverse temperature @@ -26,27 +41,34 @@ block_names = ['up', 'dn'] # The spins orb_names = [0, 1, 2] # The orbitals idx_lst = list(range(len(block_names) * len(orb_names))) -gf_struct = [('bl', idx_lst)] - -TBL = tight_binding_model(lambda_soc=SOC) # The Tight-Binding Lattice +n_orb = len(idx_lst) + +paths = [os.getcwd(), os.path.dirname(__file__)] +for p in paths: + if os.path.isfile(p + '/w2w_hr.dat'): + path = p + break +TBL = TB_from_wannier90(seed='/w2w', path=path, extend_to_spin=True, add_local=lambda_matrix(SOC, SOC)) TBL.bz = BrillouinZone(TBL.bl) -n_idx = len(idx_lst) # ==== Local Hamiltonian ==== c_dag_vec = matrix([[c_dag('bl', idx) for idx in idx_lst]]) c_vec = matrix([[c('bl', idx)] for idx in idx_lst]) -h_0_mat = TBL._hop[(0,0,0)] +h_0_mat = TBL.hoppings[(0,0,0)] h_0 = (c_dag_vec * h_0_mat * c_vec)[0,0] Umat, Upmat = U_matrix_kanamori(len(orb_names), U_int=U, J_hund=J) op_map = { (s,o): ('bl',i) for i, (s,o) in enumerate(product(block_names, orb_names)) } h_int = h_int_kanamori(block_names, len(orb_names), Umat, Upmat, J, off_diag=True, map_operator_structure=op_map) + h_imp = h_0 + h_int # ==== Non-Interacting Impurity Green function ==== +gf_struct = [('bl', len(idx_lst))] + iw_mesh = MeshImFreq(beta, 'Fermion', n_iw) k_mesh = MeshBrZone(TBL.bz, n_k) k_iw_mesh = MeshProduct(k_mesh, iw_mesh) @@ -54,12 +76,11 @@ G0_k_iw = BlockGf(mesh=k_iw_mesh, gf_struct=gf_struct) G0_iw = BlockGf(mesh=iw_mesh, gf_struct=gf_struct) -iw_vec = array([iw.value * np.eye(n_idx) for iw in iw_mesh]) -k_vec = array([k.value for k in k_mesh]) -e_k_vec = TBL.hopping(k_vec.T.copy() / 2. / pi).transpose(2, 0, 1) -mu_mat = mu * np.eye(n_idx) +iw_vec = array([iw.value * np.eye(n_orb) for iw in iw_mesh]) +e_k = TBL.fourier(k_mesh)[0:n_orb,0:n_orb] +mu_mat = mu * np.eye(n_orb) -G0_k_iw['bl'].data[:] = linalg.inv(iw_vec[None,...] + mu_mat[None,None,...] - e_k_vec[::,None,...]) +G0_k_iw['bl'].data[:] = linalg.inv(iw_vec[None,...] + mu_mat[None,None,...] - e_k.data[::,None,...]) G0_iw['bl'].data[:] = np.sum(G0_k_iw['bl'].data[:], axis=0) / len(k_mesh) diff --git a/Sr2RuO4_SOC/tight_binding_model.py b/Sr2RuO4_SOC/tight_binding_model.py deleted file mode 100644 index 1b53471..0000000 --- a/Sr2RuO4_SOC/tight_binding_model.py +++ /dev/null @@ -1,96 +0,0 @@ -# ---------------------------------------------------------------------- - -import os -import copy -import itertools -import numpy as np - -# ---------------------------------------------------------------------- - -from triqs.lattice.tight_binding import TBLattice -from triqs.lattice.utils import parse_hopping_from_wannier90_hr_dat -from triqs.lattice.utils import parse_lattice_vectors_from_wannier90_wout - -# ---------------------------------------------------------------------- -def extend_wannier90_to_spin(hoppings, num_wann): - - hoppings_spin = {} - for key, value in list(hoppings.items()): - hoppings_spin[key] = np.kron(np.eye(2), value) # orbital fastest idx - - return hoppings_spin, 2 * num_wann - -# ---------------------------------------------------------------------- -def tight_binding_model(crystal_field=0., lambda_soc=0.): - - paths = [os.getcwd(), os.path.dirname(__file__)] - for p in paths: - if os.path.isfile(p + '/w2w_hr.dat'): - path = p - break - - # -- Read Wannier90 results - - hoppings, num_wann = parse_hopping_from_wannier90_hr_dat(path + '/w2w_hr.dat') - orbital_names = [str(i) for i in range(num_wann)] - units = parse_lattice_vectors_from_wannier90_wout(path + '/w2w.wout') - - # -- Extend to spinful model from non-spin polarized Wannier90 result - hoppings_spin, num_wann_spin = extend_wannier90_to_spin(hoppings, num_wann) - orbital_names_spin = ["".join(tup) for tup in itertools.product(['up_', 'do_'], orbital_names)] - - # ------------------------------------------------------------------ - # order is xy_up, xz_up, yz_up, xy_dn, xz_dn, yz_dn - - def lambda_matrix_pavarini(lam_xy, lam_z): # according to https://arxiv.org/pdf/1612.03060.pdf - lam_loc = np.zeros((6,6),dtype=complex) - lam_loc[0,5] = lam_xy/2.0 - lam_loc[0,4] = 1j*lam_xy/2.0 - lam_loc[1,2] = -1j*lam_z/2.0 - lam_loc[2,3] = -lam_xy/2.0 - lam_loc[1,3] = -1j*lam_xy/2.0 - lam_loc[4,5] = 1j*lam_z/2.0 - lam_loc = lam_loc + np.transpose(np.conjugate(lam_loc)) - return lam_loc - - def lambda_matrix(lam_xy, lam_z): - lam_loc = np.zeros((6,6),dtype=complex) - lam_loc[0,4] = 1j*lam_xy/2.0 - lam_loc[0,5] = lam_xy/2.0 - lam_loc[1,2] = 1j*lam_z/2.0 - lam_loc[1,3] = -1j*lam_xy/2.0 - lam_loc[2,3] = -lam_xy/2.0 - lam_loc[4,5] = -1j*lam_z/2.0 - lam_loc = lam_loc + np.transpose(np.conjugate(lam_loc)) - return lam_loc - - def cf_matrix(cf_xy, cf_z): - cf_loc = np.zeros((6,6),dtype=complex) - cf_loc[0,0] = cf_xy - cf_loc[1,1] = cf_z - cf_loc[2,2] = cf_z - cf_loc[3,3] = cf_xy - cf_loc[4,4] = cf_z - cf_loc[5,5] = cf_z - return cf_loc - - cf_loc = cf_matrix(-crystal_field, +crystal_field) - d_lam_loc = lambda_matrix(lambda_soc, lambda_soc) - - # add soc and cf terms - hoppings = copy.deepcopy(hoppings_spin) - hoppings[(0,0,0)] += d_lam_loc+ cf_loc - - # ------------------------------------------------------------------ - - tb_lattice = TBLattice( - units = units, - hoppings = hoppings, - orbital_positions = [(0,0,0)]*num_wann_spin, - orbital_names = orbital_names_spin, - ) - - tb_lattice.lambda_soc = lambda_soc - tb_lattice.crystal_field = crystal_field - - return tb_lattice