carstenbauer / MonteCarlo.jl

Classical and quantum Monte Carlo simulations in Julia
https://carstenbauer.github.io/MonteCarlo.jl/dev/
Other
186 stars 18 forks source link

Non-deterministic test failure #50

Closed carstenbauer closed 4 years ago

carstenbauer commented 4 years ago

Came up in #47.

See CI log here: https://github.com/crstnbr/MonteCarlo.jl/runs/316807579

Excerpt:

[ Info: Running DQMC β=1.0, 10k + 20k sweeps, ≈1min
[ Info: Running ED
Attractive Hubbard Model (ED): Test Failed at D:\a\MonteCarlo.jl\MonteCarlo.jl\test\ED\ED_tests.jl:93
  Expression: isapprox(G_DQMC[i, j], G_ED[i, j], atol=0.025, rtol=0.1)
   Evaluated: isapprox(0.1197478321658655, 0.09341371846249304; atol=0.025, rtol=0.1)
Stacktrace:
 [1] top-level scope at D:\a\MonteCarlo.jl\MonteCarlo.jl\test\ED\ED_tests.jl:93
 [2] top-level scope at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Test\src\Test.jl:1113
 [3] top-level scope at D:\a\MonteCarlo.jl\MonteCarlo.jl\test\ED\ED_tests.jl:74

@ffreyer Can you check/fix this?

carstenbauer commented 4 years ago

Should be fixed now. However, I noted that the difference between G_DQMC and G_ED doesn't decrease on lowering delta_tau... Why? @ffreyer, any idea?

ffreyer commented 4 years ago

It has been like this since I added those tests, iirc. I don't think I ever got them to match closely. Maybe ´eigen` is becoming unprecise or we get precision errors when calculating observables in ED?

carstenbauer commented 4 years ago

My first thought was that the issue is the high temperature. When calculating the time-displaced GF in ED one can't get the short time behavior (tau=0+epsilon or equivalently tau=beta-epsilon) correct at high temperatures when using an approximate iterative eigen solver like ARPACK. However, this shouldn't apply for the equal-time GF. Also you are using eigen which isn't (deliberately) approximate.

In any case, for beta=10 they are much closer to each other (haven't checked the delta_tau scaling).

We should definitely check what's going on here. As a first step, I will calculate the Green's function for the model using my ED code on Monday.

carstenbauer commented 4 years ago

I think I found the issue. In ED.jl's HamiltonianMatrix(::HubbardModelAttractive) you do not negate the sign of U. Hence it calculates the Green's function for the repulsive Hubbard model. If I change it to use -U the agreement is much better (~delta_tau^2 as it should be).

carstenbauer commented 4 years ago

The scaling still seems strange. @ffreyer and I should investigate this further at some point. Let's close this for now.