# Bath hamiltonian in matrix representation h_bath_mat = diag(eps_bath) - matrix([[0, t_bath], [t_bath, 0]]) # Coupling matrix V_mat = matrix([[1., 1.], [1., 1.]]) # ==== Local Hamiltonian ==== c_dag_vec = { s: matrix([[c_dag(s,o) for o in orb_names]]) for s in spin_names } c_vec = { s: matrix([[c(s,o)] for o in orb_names]) for s in spin_names } h_0 = sum(c_dag_vec[s] * h_0_mat * c_vec[s] for s in spin_names)[0,0] Umat, Upmat = U_matrix_kanamori(n_orb, U_int=U, J_hund=J) h_int = h_int_kanamori(spin_names, orb_names, Umat, Upmat, J, off_diag=True) h_imp = h_0 + h_int # ==== Bath & Coupling hamiltonian ==== orb_bath_names = ['b_' + str(o) for o in orb_names] c_dag_bath_vec = { s: matrix([[c_dag(s, o) for o in orb_bath_names]]) for s in spin_names } c_bath_vec = { s: matrix([[c(s, o)] for o in orb_bath_names]) for s in spin_names } h_bath = sum(c_dag_bath_vec[s] * h_bath_mat * c_bath_vec[s] for s in spin_names)[0,0] h_coup = sum(c_dag_vec[s] * V_mat * c_bath_vec[s] + c_dag_bath_vec[s] * V_mat * c_vec[s] for s in spin_names)[0,0] # FIXME Adjoint # ==== Total impurity hamiltonian ==== h_tot = h_imp + h_coup + h_bath
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 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 = (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, orb_names, Umat, Upmat, J, off_diag=True, map_operator_structure=op_map) h_imp = h_0 + h_int # ==== Non-Interacting Impurity Green function ==== iw_mesh = MeshImFreq(beta, 'Fermion', n_iw) k_mesh = MeshBrZone(TBL.bz, n_k) k_iw_mesh = MeshProduct(k_mesh, iw_mesh)