def create_eliashberg_ingredients(p): H = create_model_for_tests(**p) kmesh = H.get_kmesh(n_k=[p.nk] * p.dim + [1] * (3 - p.dim)) e_k = H.fourier(kmesh) wmesh = MeshImFreq(beta=p.beta, S="Fermion", n_max=p.nw) g0_wk = lattice_dyson_g0_wk(mu=p.mu, e_k=e_k, mesh=wmesh) chi0_wk = imtime_bubble_chi0_wk(g0_wk, nw=p.nw) U_d, U_m = kanamori_charge_and_spin_quartic_interaction_tensors( p.norb, p.U, p.Up, p.J, p.Jp) chi_d = solve_rpa_PH(chi0_wk, U_d) chi_m = solve_rpa_PH(chi0_wk, -U_m) # Minus for correct charge rpa equation phi_d_wk = construct_phi_wk(chi_d, U_d) phi_m_wk = construct_phi_wk(chi_m, U_m) gamma = construct_gamma_singlet_rpa(U_d, U_m, phi_d_wk, phi_m_wk) eliashberg_ingredients = ParameterCollection( g0_wk=g0_wk, gamma=gamma, U_m=U_m, U_d=U_d, chi_m=chi_m, chi_d=chi_d, ) return eliashberg_ingredients
def test_gamma_triplet_constant_only(chi_d, chi_m, U_d, U_m): phi_d_wk = construct_phi_wk(chi_d, U_d) phi_m_wk = construct_phi_wk(chi_m, U_m) gamma_triplet = construct_gamma_triplet_rpa(U_d, U_m, 0 * phi_d_wk, 0 * phi_m_wk) benchmark_value = -0.5 * U_d + 0.5 * U_m np.testing.assert_equal(gamma_triplet.data[0, 0], benchmark_value)
def test_gamma_triplet_mesh_type(chi_d, chi_m, U_d, U_m): phi_d_wk = construct_phi_wk(chi_d, U_d) phi_m_wk = construct_phi_wk(chi_m, U_m) gamma_triplet = construct_gamma_triplet_rpa(U_d, U_m, phi_d_wk, phi_m_wk) assert type(gamma_triplet.mesh) == MeshProduct assert type(gamma_triplet.mesh[0]) == MeshImFreq assert type(gamma_triplet.mesh[1]) == MeshBrZone
def test_phi_wk_one_zero(chi_d, U_d): phi_d_wk = construct_phi_wk(chi_d, 0 * U_d) np.testing.assert_equal(phi_d_wk.data, 0.0) phi_d_wk = construct_phi_wk(0 * chi_d, U_d) np.testing.assert_equal(phi_d_wk.data, 0.0)
def test_phi_wk_mesh_type(chi_d, U_d): phi_d_wk = construct_phi_wk(chi_d, U_d) assert type(phi_d_wk.mesh) == MeshProduct assert type(phi_d_wk.mesh[0]) == MeshImFreq assert type(phi_d_wk.mesh[1]) == MeshBrZone