etmc / tmLQCD

tmLQCD is a freely available software suite providing a set of tools to be used in lattice QCD simulations. This is mainly a HMC implementation (including PHMC and RHMC) for Wilson, Wilson Clover and Wilson twisted mass fermions and inverter for different versions of the Dirac operator. The code is fully parallelised and ships with optimisations for various modern architectures, such as commodity PC clusters and the Blue Gene family.
http://www.itkp.uni-bonn.de/~urbach/software.html
GNU General Public License v3.0
32 stars 47 forks source link

Possible bug in the correction term #397

Closed sbacchio closed 6 years ago

sbacchio commented 6 years ago

Never mind

This is a bit technical point. @urbach @kostrzewa Looks to me that the correction term for the rational approximation, as it is done now, it is fine but not completely correct.

Problem: Following Luesher notes for rhmc in openQCD, the rational approximation comes with a constant amplitude A which depends on the order of the rational approximation and on the epsilon parameter. In the tmLQCD notes the amplitude is omitted for clear reasons (since it's constant, it's not important to integrate it) but this brings to an error at the moment we do the expansion for the correction term. Indeed the correction term is expanded around Z=Q^2 R^2 - 1 which is Z~0 considering R~1/sqrt(Q^2) as written in the notes. But the R we are considering is still omitting the amplitude. So R~1/sqrt(A^2 Q^2) and Q^2 R^2 ~ 1/A^2. At this point we are doing the expansion around Z~1/A^2 - 1 and not Z~0. Somehow the series is still converging, probably because A~1 for the cases we are considering, but it's not done in the optimal way.

Solution: The series should be done expanding for Z=A^2 Q^2 R^2 - 1

In the code: the amplitude I'm referring to is computed in the file rational/zolotarev.c and in rational/rational.c is assigned to rat->A; but after that never used. The amplitude in rational/rational.c is correctly normalized with the largest eigenvalue since also the operator Q is normalized with it. Just the file monomial/ndratcor.c should be fixed and I can do it immediately as soon as confirm what I said above.

kostrzewa commented 6 years ago

?

sbacchio commented 6 years ago

I was wrong, it is done in the code. Just my "grep" didn't work correctly and I didn't see it. It is done here: https://github.com/etmc/tmLQCD/blob/946cfdff9190e5d5aa0e7645072736b0a9d374c6/monomial/ndratcor_monomial.c#L233 Sorry for it!^^

On the other hand I've other doubts on some points of the code. Do you have time to discuss them? @kostrzewa