TRIQS / tprf

TPRF: The Two-Particle Response Function tool box for TRIQS
https://triqs.github.io/tprf
Other
14 stars 12 forks source link

Spin susceptibility in Sr2RuO4 and RPA tutorial broken #42

Open andrewkhardy opened 10 months ago

andrewkhardy commented 10 months ago

I am not sure the last time the tutorials have been updated. Currently trying to run calc_sc_dmft and the ParameterCollection() is missing t, n_iter, and B as attributes.

I can add them, but the CTHYB solver also needs the Green's function structure to be defined. The density of bugs makes me wonder if there is a newer version that is just missing from the website or the tutorial has just not been touched in a while. I can make a pull request with everything fixed, but wanted to check if there was a correct version first.

GingrasO commented 10 months ago

Also the first figure of the tutorial is now wrong. Actually it's probably the path, I think it comes from the new way to construct the path coming from TRIQS. figure_1 If I divide by about the units of the BZ t_r.bz, it seems about right, so something in the generation of the k-points has a prefactor somewhere.

GingrasO commented 10 months ago

Actually the calc_sc_DMFT code works well for me with the unstable branch.

HugoStrand commented 10 months ago

Dear Andrew and Olivier,

Thank you both for reporting the issues.

To help me backtrace the issues could you please help me reproduce them?

What versions of triqs+tprf+cthyb+w2dynamics_interface are you using and what version of the tutorial?

Please note that the default documentation points to the latest release (not unstable). If you want to get the tutorial files from a given version, I'd recommend to pick up the files from the repo rather than downloading from the web, see e.g.

https://github.com/TRIQS/tprf/tree/3.2.x/doc/user_guide/dmft_susceptibility_dbse and https://github.com/TRIQS/tprf/tree/unstable/doc/user_guide/dmft_susceptibility_dbse

Cheers, Hugo

andrewkhardy commented 10 months ago

Hugo,

Thanks for the quick response. I am using v3.2.0 for TRIQS, TPRF, CTHYB, and Version 1.1.3, July 2022 for w2dynamics. I indeed pulled from the website. With Olivier's suggestion, the unstable branch does seem to work.

By the way, on the topic of the path, the X,M points are also flipped in the RPA tutorial image

andrewkhardy commented 7 months ago

@HugoStrand Is there a plan to update the tutorials at some point? In the unstable branch, theplot_chi_1D() function of the RPA tutorial uses variables that are never defined. I am attaching a corrected function that works. I could make a pull request if that would be helpful, but perhaps unnecessary if there's an overhaul in progress.

def plot_chi_1D(chi,H,  label=None):
    paths = [(G, X), (X, M), (M, G)]
    k_vecs, k_plot, k_ticks = k_space_path(paths, bz=H.bz)
    chi_SzSz = chi_SzSz_contraction(chi)
    chi_interp = interpolate_chi(chi_SzSz, k_vecs)

    plt.plot(k_plot, chi_interp.real, label=label)

    plt.grid()
    plt.xticks(ticks=k_ticks, labels=[r'$\Gamma$',r'$X$',r'$M$',r'$\Gamma$'])
    plt.title(r'Spin-response $\chi_{S_z S_z}(\mathbf{q}, \omega=0)$')