From 907a79bd11e53f7629fb13b8c34792d5e0c0436c Mon Sep 17 00:00:00 2001 From: Frederic Freyer Date: Tue, 25 Jan 2022 20:43:04 +0100 Subject: [PATCH] fix SFD (#154) --- src/flavors/DQMC/measurements/extensions.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/flavors/DQMC/measurements/extensions.jl b/src/flavors/DQMC/measurements/extensions.jl index fde0bf6b..119ac226 100644 --- a/src/flavors/DQMC/measurements/extensions.jl +++ b/src/flavors/DQMC/measurements/extensions.jl @@ -165,8 +165,13 @@ function dia_K_x(mc, G, idxs) N = length(lattice(mc)) Kx = ComplexF64(0) - f = 1.0 + (model(mc).U > 0) - for shift in 0:N:size(G, 1)-1 + flv = max(nflavors(field(mc)), nflavors(model(mc))) + if flv == 1; f = 2.0 + elseif flv == 2; f = 1.0 + else error("The diamagnetic contribution to the superfluid density has no implementation for $flv flavors") + end + + for shift in 0 : N : flv*N - 1 for i in idxs for (src, trg) in dir2srctrg[i] # c_j^† c_i = δ_ij - G[i, j], but δ always 0 cause no onsite