TRIQS / hartree_fock

Hartree-Fock lattice and impurity solvers based on the TRIQS library
https://triqs.github.io/hartree_fock
Other
0 stars 2 forks source link

off_diag=False for Hint, i.e. gf_struct=[('up_0', 1),('up_1', 1),('dn_0', 1),('dn_1', 1)] #3

Open the-hampel opened 1 year ago

the-hampel commented 1 year ago

This part of the code:

for term, coef in h_int:
                bl1, u1 = term[0][1]
                bl2, u2 = term[3][1]
                bl3, u3 = term[1][1]
                bl4, u4 = term[2][1]

                assert(bl1 == bl2 and bl3 == bl4)
                Sigma_int[bl1][u2, u1] += coef * G_dens[bl3][u4, u3] 
                Sigma_int[bl3][u4, u3] += coef * G_dens[bl1][u2, u1]

                if bl1 == bl3 and with_fock:
                    Sigma_int[bl1][u4, u1] -= coef * G_dens[bl3][u2, u3]
                    Sigma_int[bl3][u2, u3] -= coef * G_dens[bl1][u4, u1]

assumes that den-den term appear only directly between two blocks of the fundamental operator set, i.e. up and down. There is no room for a structure like [('up_0', 1),('up_1', 1),('dn_0', 1),('dn_1', 1)] , where the density term is coupling different blocks. This should be made possible, and is possible in the TPRF hartree solver by converting the hint to a general U tensor with the function: get_rpa_tensor.

edit: see correction below. Code works correctly.

the-hampel commented 1 year ago

I have to correct my issue. The code works as expected. It only complains and triggers the assert, when the block structure of the interaction Hamiltonian would create contributions to Sigma that are not captures by its block structure. TODO: improve assert message.