# Bath hamiltonian in matrix representation h_bath_mat = diag(eps_bath) # Coupling matrix V_mat = matrix([[1., 1., 0.2, 0.2], [0.2, 0.2, 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] h_int = h_int_kanamori( spin_names, orb_names, array([[0, V - J], [V - J, 0]]), # Interaction for equal spins array([[U, V], [V, U]]), # Interaction for opposite spins J, True) h_loc = h_0 + h_int # ==== Bath & Coupling hamiltonian ==== orb_bath_names = ['b_' + str(o) for o in orb_bath_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
# create interaction Hamiltonian Hint = h_int_slater(spin_names, orb_names, off_diag=True, U_matrix=Umat_full_rotated) elif h_int_type == 'kan': mpi.report('setting up Kanamori Hamiltonian') Umat, Upmat = U_matrix_kanamori(n_orb=n_orb, U_int=U, J_hund=J) # create interaction Hamiltonian if h_int_offdiag: mpi.report('... with spin-flip and pair-hopping') Hint = h_int_kanamori(spin_names, orb_names, off_diag=True, U=Umat, Uprime=Upmat, J_hund=J) else: mpi.report('... only den den terms') Hint = h_int_density(spin_names, orb_names, off_diag=True, U=Umat, Uprime=Upmat) # store data obtained if store_h5 and mpi.is_master_node(): with HDFArchive(store_h5_file, 'a') as ar: ar['Hint'] = Hint
def test_quartic(verbose=False): if verbose: print('--> test_quartic') num_orbitals = 2 num_spins = 2 U, J = 1.0, 0.2 up, do = 0, 1 spin_names = [up, do] orb_names = list(range(num_orbitals)) U_ab, UPrime_ab = U_matrix_kanamori(n_orb=2, U_int=U, J_hund=J) if verbose: print('U_ab =\n', U_ab) print('UPrime_ab =\n', UPrime_ab) T_ab = np.array([ [1., 1.], [1., -1.], ]) / np.sqrt(2.) # -- Check hermitian np.testing.assert_array_almost_equal( np.mat(T_ab) * np.mat(T_ab).H, np.eye(2)) I = np.eye(num_spins) T_ab_spin = np.kron(T_ab, I) H_int = h_int_kanamori(spin_names, orb_names, U_ab, UPrime_ab, J_hund=J, off_diag=True, map_operator_structure=None, H_dump=None) op_imp = [c(up, 0), c(do, 0), c(up, 1), c(do, 1)] Ht_int = operator_single_particle_transform(H_int, T_ab_spin, op_imp) if verbose: print('H_int =', H_int) print('Ht_int =', Ht_int) from transform_kanamori import h_int_kanamori_transformed Ht_int_ref = h_int_kanamori_transformed([T_ab, T_ab], spin_names, orb_names, U_ab, UPrime_ab, J_hund=J, off_diag=True, map_operator_structure=None, H_dump=None) if verbose: print('Ht_int_ref =', Ht_int_ref) assert ((Ht_int_ref - Ht_int).is_zero())
# Definition of a 3-orbital atom spin_names = ('up','dn') orb_names = [0,1,2] # Set of fundamental operators fops = [(sn,on) for sn, on in product(spin_names,orb_names)] # Numbers of particles with spin up/down N_up = n('up',0) + n('up',1) + n('up',2) N_dn = n('dn',0) + n('dn',1) + n('dn',2) # Construct Hubbard-Kanamori Hamiltonian U = 3.0 * np.ones((3,3)) Uprime = 2.0 * np.ones((3,3)) J_hund = 0.5 H = h_int_kanamori(spin_names, orb_names, U, Uprime, J_hund, True) # Add chemical potential H += -4.0 * (N_up + N_dn) # Add hopping terms between orbitals 0 and 1 with some complex amplitude H += 0.1j * (c_dag('up',0) * c('up',1) - c_dag('up',1) * c('up',0)) H += 0.1j * (c_dag('dn',0) * c('dn',1) - c_dag('dn',1) * c('dn',0)) # Split H into blocks and diagonalize it using N_up and N_dn quantum numbers ad = AtomDiag(H, fops, [N_up,N_dn]) print(ad.n_subspaces) # Number of invariant subspaces, 4 * 4 = 16 # Now split using the total number of particles, N = N_up + N_dn ad = AtomDiag(H, fops, [N_up+N_dn]) print(ad.n_subspaces) # 7
mu = 0.0 beta, n_w, n_k = 1.0, 100, 4 U, J = 2.3, 0.4 print('U, J =', U, J) spin_names = ['up', 'do'] #orb_names = [0, 1, 2] orb_names = [0] norb = 2*len(orb_names) gf_struct = set_operator_structure(spin_names, orb_names, False) # orbital diag U_mat, UPrime_mat = U_matrix_kanamori(n_orb=len(orb_names), U_int=U, J_hund=J) H_int = h_int_kanamori( spin_names, orb_names, U_mat, UPrime_mat, J_hund=J, off_diag=False, map_operator_structure=None, H_dump=None) # orbital diag # ------------------------------------------------------------------ # -- Tightbinding model t = 1.0 h_loc = np.kron(np.eye(2), np.diag([0., -0.1, 0.1])) T = - t * np.kron(np.eye(2), np.diag([0.01, 1., 1.])) t_r = TBLattice( units = [(1, 0, 0)], hopping = { # nearest neighbour hopping -t (0,): h_loc, (+1,): T,
orb_names = [0, 1, 2] spin_names = ['up', 'do'] norb = len(orb_names) gf_struct = set_operator_structure(spin_names, orb_names, True) # orbital off diag fundamental_operators = fundamental_operators_from_gf_struct(gf_struct) U_ab, UPrime_ab = U_matrix_kanamori(n_orb=len(orb_names), U_int=U, J_hund=J) H_int = h_int_kanamori(spin_names, orb_names, U_ab, UPrime_ab, J_hund=J, off_diag=True, map_operator_structure=None, H_dump=None) # orgital offdiag U_abcd = get_rpa_tensor(H_int, fundamental_operators) U_c, U_s = split_quartic_tensor_in_charge_and_spin(U_abcd) U_abcd_ref = quartic_tensor_from_charge_and_spin(U_c, U_s) U_c_ref, U_s_ref = kanamori_charge_and_spin_quartic_interaction_tensors( norb, U, U - 2 * J, J, J) U_abcd_ref_2 = kanamori_quartic_tensor(norb, U, U - 2 * J, J, J)