Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] imtime gf interp #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

HugoStrand
Copy link
Contributor

Dear Joseph,

I think there might be a problem with the interpolation for imaginary time Green's functions. The interpolation result seems not to be time-translational invariant. I was expecting that

$$ G(\tau_1, \tau_2) = G(\tau_1 - \tau_2, 0) $$

In this pull request is a test that checks for this by calling the interpolation routine for the two cases above, comparing the result.

For me the test fails with:

% j time_gf.jl 
Test Summary: | Pass  Total
time_gf       |    8      8
t0  = BranchPoint(0.0 + 0.0im, 0.0, imaginary_branch)
t12 = BranchPoint(0.0 - 0.4im, 0.4, imaginary_branch)
t1  = BranchPoint(0.0 - 0.5im, 0.5, imaginary_branch)
t2  = BranchPoint(0.0 - 0.1im, 0.1, imaginary_branch)
d_12  = 0.0 - 0.16222222222222224im
d_120 = 0.0 - 0.16000000000000003im
imtime interpolation: Test Failed at /.../dev/Keldysh.jl/test/time_gf.jl:127
  Expression: diff < tol
   Evaluated: 0.0022222222222222088 < 1.0e-12
Stacktrace:
 [1] macro expansion
   @ /.../julia/share/julia/stdlib/v1.7/Test/src/Test.jl:445 [inlined]
 [2] macro expansion
   @ ~/dev/Keldysh.jl/test/time_gf.jl:127 [inlined]
 [3] macro expansion
   @ /.../julia/share/julia/stdlib/v1.7/Test/src/Test.jl:1283 [inlined]
 [4] top-level scope
   @ ~/dev/Keldysh.jl/test/time_gf.jl:93
Test Summary:        | Fail  Total
imtime interpolation |    1      1
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
in expression starting at /.../dev/Keldysh.jl/test/time_gf.jl:91

Could this be a bug?

Best, Hugo

@kleinhenz
Copy link
Owner

I believe this is because the interpolation function is doing bilinear interpolation on $G(\tau_1, \tau_2)$ rather than linear interpolation on $G(\tau_1 - \tau_2, 0)$. The reason for this is that the interpolation function is generic so it is doing the same thing in imaginary time as in real time and doesn't know anything about the symmetries of the problem. All of the symmetries are implemented at the level of discrete indexing. I believe the invariance should hold up to the same accuracy as the interpolation scheme overall.

In #13 I implement the imaginary time invariance symmetry exactly.

@HugoStrand
Copy link
Contributor Author

Dear Joseph,

Ok, I understand. I think you are right that the error difference is only linear in $\Delta \tau$. Thank you for the fix in #13 it is good to exploit the simplification in imaginary time here.

I found this behaviour while trying to debug some other code and was a bit puzzled. I think the difference is not a big deal in the end. It turned out that I had bigger problems like time differences that should be $0^+$ but that were rounded to $0^-$ and wrapped to $\beta$ with a fermi sign.

Cheers, Hugo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants