Skip to content

Commit

Permalink
Merge pull request #88 from numericalEFT/finiteT
Browse files Browse the repository at this point in the history
Fix ipynb example and finite-T chemical potential; update to v0.2.6
  • Loading branch information
houpc authored Jan 16, 2025
2 parents 495633d + 91b7d12 commit 042e239
Show file tree
Hide file tree
Showing 8 changed files with 10,691 additions and 9,322 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ElectronGas"
uuid = "8c98e03e-8755-48b1-a5ef-1e2e7812a7c9"
authors = ["Xiansheng Cai, Pengcheng Hou, Kun Chen"]
version = "0.2.5"
version = "0.2.6"

[deps]
CompositeGrids = "b5136c89-beeb-4521-9139-60d2cac8be56"
Expand Down
4,607 changes: 3,541 additions & 1,066 deletions example/G0W0_2D.ipynb

Large diffs are not rendered by default.

11,581 changes: 4,910 additions & 6,671 deletions example/G0W0_3D.ipynb

Large diffs are not rendered by default.

3,282 changes: 1,952 additions & 1,330 deletions example/G0_KO.ipynb

Large diffs are not rendered by default.

68 changes: 34 additions & 34 deletions example/linearresponse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ using DelimitedFiles
export measure_chi

function measure_chi(F_freq::GreenFunc.MeshArray)
F_dlr = F_freq |> to_dlr
F_ins = real(dlr_to_imtime(F_dlr, [F_freq.mesh[1].representation.β,])) * (-1)
kgrid = F_ins.mesh[2]
integrand = view(F_ins, 1, :)
return real(CompositeGrids.Interp.integrate1D(integrand, kgrid))
F_dlr = F_freq |> to_dlr
F_ins = real(dlr_to_imtime(F_dlr, [F_freq.mesh[1].representation.β])) * (-1)
kgrid = F_ins.mesh[2]
integrand = view(F_ins, 1, :)
return real(CompositeGrids.Interp.integrate1D(integrand, kgrid))
end

function measure_chi(dim, θ, rs; kwargs...)
param = Parameter.rydbergUnit(θ, rs, dim)
channel = 0
lamu, R_freq, F_freq = BSeq.linearResponse(param, channel
; kwargs...)
result = measure_chi(F_freq)
println("1/chi=", 1 / result)

data = [1 / θ 1 / result lamu channel rs]

dir = "./run/"
fname = "gap_chi_rs$(rs)_l$(channel).txt"
open(dir * fname, "a+") do io
writedlm(io, data, ' ')
end

return 1 / result
param = Parameter.rydbergUnit(θ, rs, dim)
channel = 0
lamu, R_freq, F_freq = BSeq.linearResponse(param, channel
; kwargs...)
result = measure_chi(F_freq)
println("1/chi=", 1 / result)

data = [1 / θ 1 / result lamu channel rs]

dir = "./run/"
fname = "gap_chi_rs$(rs)_l$(channel).txt"
open(dir * fname, "a+") do io
writedlm(io, data, ' ')
end

return 1 / result
end

end
Expand All @@ -42,16 +42,16 @@ using Test
using .MeasureChi

@testset "measure chi" begin
# println(measure_chi(3, 1e-2, 2.0))
dim = 3
rs = 7.0
num = 20
# beta = [6.25 * 2^i for i in LinRange(0, num - 1, num)]
# beta = [2000, 2200.0, 2229.78,]
beta = [3200,]
# num = 18
# beta = [6.25 * sqrt(2)^i for i in LinRange(0, num - 1, num)]
# chi = [measure_chi(dim, 1 / b, rs; sigmatype=:g0w0) for b in beta]
chi = [measure_chi(dim, 1 / b, rs; atol=1e-10, rtol=1e-10, verbose=true) for b in beta]
println(chi)
end
# println(measure_chi(3, 1e-2, 2.0))
dim = 3
rs = 7.0
num = 20
# beta = [6.25 * 2^i for i in LinRange(0, num - 1, num)]
# beta = [2000, 2200.0, 2229.78,]
beta = [3200]
# num = 18
# beta = [6.25 * sqrt(2)^i for i in LinRange(0, num - 1, num)]
# chi = [measure_chi(dim, 1 / b, rs; sigmatype=:g0w0) for b in beta]
chi = [measure_chi(dim, 1 / b, rs; atol = 1e-10, rtol = 1e-10, verbose = true) for b in beta]
println(chi)
end
Loading

2 comments on commit 042e239

@houpc
Copy link
Member Author

@houpc houpc commented on 042e239 Jan 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/123159

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.6 -m "<description of version>" 042e239f48316b0f41d17a47d95519023e6c6d80
git push origin v0.2.6

Please sign in to comment.