Skip to content

Commit

Permalink
fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
peter0627ustc committed Apr 9, 2024
2 parents d339e7a + 4868207 commit 45d2841
Show file tree
Hide file tree
Showing 151 changed files with 604,652 additions and 604,652 deletions.
84 changes: 42 additions & 42 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
name = "ElectronLiquid"
uuid = "fe3a0b7f-0e79-43cc-aa0f-33de5212abe5"
authors = ["Kun Chen <chenkun0228@gmail.com>"]
version = "0.1.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CompositeGrids = "b5136c89-beeb-4521-9139-60d2cac8be56"
Cuba = "8a292aeb-7a57-582c-b821-06e4c11590b1"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
ElectronGas = "8c98e03e-8755-48b1-a5ef-1e2e7812a7c9"
FeynmanDiagram = "e424a512-dbd9-41ff-9883-094748823e72"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Lehmann = "95bf888a-8996-4655-9f35-1c0506bdfefe"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MCIntegration = "ea1e2de9-7db7-4b42-91ee-0cd1bf6df167"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
CompositeGrids = "0.0, 0.1"
Cuba = "2"
DataFrames = "1"
DataStructures = "0.18"
DelimitedFiles = "1"
ElectronGas = "0.2"
FeynmanDiagram = "1.0"
JLD2 = "0.4"
Lehmann = "0.1, 0.2"
MCIntegration = "0.4"
Measurements = "2.9"
Parameters = "0.12"
StaticArrays = "1"
TaylorSeries = "0.15"
CSV = "0.10"
julia = "1.6"
name = "ElectronLiquid"
uuid = "fe3a0b7f-0e79-43cc-aa0f-33de5212abe5"
authors = ["Kun Chen <chenkun0228@gmail.com>"]
version = "0.1.0"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CompositeGrids = "b5136c89-beeb-4521-9139-60d2cac8be56"
Cuba = "8a292aeb-7a57-582c-b821-06e4c11590b1"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
ElectronGas = "8c98e03e-8755-48b1-a5ef-1e2e7812a7c9"
FeynmanDiagram = "e424a512-dbd9-41ff-9883-094748823e72"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
Lehmann = "95bf888a-8996-4655-9f35-1c0506bdfefe"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MCIntegration = "ea1e2de9-7db7-4b42-91ee-0cd1bf6df167"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"

[compat]
CompositeGrids = "0.0, 0.1"
Cuba = "2"
DataFrames = "1"
DataStructures = "0.18"
DelimitedFiles = "1"
ElectronGas = "0.2"
FeynmanDiagram = "1.0"
JLD2 = "0.4"
Lehmann = "0.1, 0.2"
MCIntegration = "0.4"
Measurements = "2.9"
Parameters = "0.12"
StaticArrays = "1"
TaylorSeries = "0.15"
CSV = "0.10"
julia = "1.6"
58 changes: 29 additions & 29 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
using ElectronLiquid
using Documenter

DocMeta.setdocmeta!(ElectronLiquid, :DocTestSetup, :(using ElectronLiquid); recursive=true)

makedocs(;
modules=[ElectronLiquid],
authors="Kun Chen",
repo="https://github.com/numericaleft/ElectronLiquid.jl/blob/{commit}{path}#{line}",
sitename="ElectronLiquid.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://numericaleft.github.io/ElectronLiquid.jl",
assets=String[]
),
pages=[
"Home" => "index.md",
"SubModules" => [
"Parameter" => "lib/UEG.md",
"CounterTerm" => "lib/CounterTerm.md",
"Ver4" => "lib/Ver4.md",
]
]
)

deploydocs(;
repo="github.com/numericalEFT/ElectronLiquid.jl",
devbranch="master"
)
using ElectronLiquid
using Documenter

DocMeta.setdocmeta!(ElectronLiquid, :DocTestSetup, :(using ElectronLiquid); recursive=true)

makedocs(;
modules=[ElectronLiquid],
authors="Kun Chen",
repo="https://github.com/numericaleft/ElectronLiquid.jl/blob/{commit}{path}#{line}",
sitename="ElectronLiquid.jl",
format=Documenter.HTML(;
prettyurls=get(ENV, "CI", "false") == "true",
canonical="https://numericaleft.github.io/ElectronLiquid.jl",
assets=String[]
),
pages=[
"Home" => "index.md",
"SubModules" => [
"Parameter" => "lib/UEG.md",
"CounterTerm" => "lib/CounterTerm.md",
"Ver4" => "lib/Ver4.md",
]
]
)

deploydocs(;
repo="github.com/numericalEFT/ElectronLiquid.jl",
devbranch="master"
)
12 changes: 6 additions & 6 deletions docs/src/lib/Ver4.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 4-Vertex

This module provides the functions to calculate the 4-vertex function.

```@autodocs
Modules = [ElectronLiquid.Ver4]
# 4-Vertex

This module provides the functions to calculate the 4-vertex function.

```@autodocs
Modules = [ElectronLiquid.Ver4]
```
206 changes: 103 additions & 103 deletions example/RG/gamma4_oneloop.jl
Original file line number Diff line number Diff line change
@@ -1,104 +1,104 @@
using ElectronLiquid
using ElectronGas
using CompositeGrids
using FiniteDifferences
using GreenFunc
using MCIntegration
using FeynmanDiagram
using JLD2
using Printf

include("gamma4_treelevel.jl")

# rs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0]
# rs = [1.0, 2.0, 3.0, 4.0, 5.0]
# rs = [6.0, 8.0, 10.0]
rs = [4.0,]
mass2 = [0.001,]
beta = [25.0,]
order = [1,]
neval = 2e8

function print_ver4(ver4, lgrid, Λgrid, para)
kF = para.kF
if isnothing(ver4) == false
for (p, data) in ver4
printstyled("permutation: $p\n", color=:yellow)
for (li, l) in enumerate(lgrid)
printstyled("l = $l\n", color=:green)
@printf("%12s %16s %16s %16s %16s %16s %16s\n", "k/kF", "uu", "ud", "di", "ex", "symmetric", "asymmetric")
for (ki, k) in enumerate(Λgrid)
factor = 1.0
d1, d2 = real(data[1, li, ki]) * factor, real(data[2, li, ki]) * factor
s, a = (d1 + d2) / 2.0, (d1 - d2) / 2.0
di, ex = (s - a), (a) * 2.0
@printf("%12.6f %16s %16s %16s %16s %16s %16s\n", k / kF, "$d1", "$d2", "$di", "$ex", "$s", "$a")
end
end
end

end
end

for (_rs, _mass2, _beta, _order) in Iterators.product(rs, mass2, beta, order)

para = UEG.ParaMC(rs=_rs, beta=_beta, Fs=-0.0, order=_order, mass2=_mass2, isDynamic=true, isFock=false)
kF = para.kF
Λgrid = CompositeGrid.LogDensedGrid(:gauss, [1.0 * para.kF, 100 * para.kF], [para.kF,], 8, 0.01 * para.kF, 8)

# f = jldopen("data_f.jld2", "r")
# key = "$(UEG.short(para))"
# Λgrid, fs, us = f[key]

_Fs = [KO(para, lambda, lambda; verbose=0)[1] for (li, lambda) in enumerate(Λgrid)]
println(_Fs)
# println(fs)

paras = [UEG.ParaMC(rs=para.rs, beta=para.beta, Fs=_Fs[li], Fa=0.0, order=para.order,
mass2=para.mass2, isDynamic=true, isFock=false) for li in eachindex(Λgrid)]


partition = [(2, 0, 0),]
channel = [
PHr,
PHEr,
PPr
]

neighbor = UEG.neighbor(partition)
filter = [NoHartree,
NoBubble,
Proper
]

n = [-1, 0, 0, -1] # q=0 and w -> 0 to measure F
lgrid = [0,] # angular momentum

println("∂Γ/∂f")
diagram = Ver4.diagram(para, partition; channel=channel, filter=filter, dR=true)
# ver4_df, result = Ver4.PH_df(paras, diagram;
# kamp=Λgrid, n=n, l=lgrid,
# neval=neval)
ver4_df, result = Ver4.PH_df(paras, diagram;
kamp=[para.kF for l in Λgrid], n=n, l=lgrid,
neval=neval)
print_ver4(ver4_df, lgrid, Λgrid, para)

println("Γ on FS")
diagram = Ver4.diagram(para, partition; channel=channel, filter=filter, dR=false)
ver4, result = Ver4.PH(paras[1], diagram;
kamp=[Λgrid[1],], n=n, l=lgrid,
neval=neval, print=0)
print_ver4(ver4, lgrid, [Λgrid[1],], para)

if isnothing(ver4) == false
jldopen("ver4_PH.jld2", "a+") do f
key = "$(UEG.short(para))"
if haskey(f, key)
@warn("replacing existing data for $key")
delete!(f, key)
end
f[key] = (Λgrid, lgrid, _Fs, ver4, ver4_df)
end
end
using ElectronLiquid
using ElectronGas
using CompositeGrids
using FiniteDifferences
using GreenFunc
using MCIntegration
using FeynmanDiagram
using JLD2
using Printf

include("gamma4_treelevel.jl")

# rs = [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0, 10.0]
# rs = [1.0, 2.0, 3.0, 4.0, 5.0]
# rs = [6.0, 8.0, 10.0]
rs = [4.0,]
mass2 = [0.001,]
beta = [25.0,]
order = [1,]
neval = 2e8

function print_ver4(ver4, lgrid, Λgrid, para)
kF = para.kF
if isnothing(ver4) == false
for (p, data) in ver4
printstyled("permutation: $p\n", color=:yellow)
for (li, l) in enumerate(lgrid)
printstyled("l = $l\n", color=:green)
@printf("%12s %16s %16s %16s %16s %16s %16s\n", "k/kF", "uu", "ud", "di", "ex", "symmetric", "asymmetric")
for (ki, k) in enumerate(Λgrid)
factor = 1.0
d1, d2 = real(data[1, li, ki]) * factor, real(data[2, li, ki]) * factor
s, a = (d1 + d2) / 2.0, (d1 - d2) / 2.0
di, ex = (s - a), (a) * 2.0
@printf("%12.6f %16s %16s %16s %16s %16s %16s\n", k / kF, "$d1", "$d2", "$di", "$ex", "$s", "$a")
end
end
end

end
end

for (_rs, _mass2, _beta, _order) in Iterators.product(rs, mass2, beta, order)

para = UEG.ParaMC(rs=_rs, beta=_beta, Fs=-0.0, order=_order, mass2=_mass2, isDynamic=true, isFock=false)
kF = para.kF
Λgrid = CompositeGrid.LogDensedGrid(:gauss, [1.0 * para.kF, 100 * para.kF], [para.kF,], 8, 0.01 * para.kF, 8)

# f = jldopen("data_f.jld2", "r")
# key = "$(UEG.short(para))"
# Λgrid, fs, us = f[key]

_Fs = [KO(para, lambda, lambda; verbose=0)[1] for (li, lambda) in enumerate(Λgrid)]
println(_Fs)
# println(fs)

paras = [UEG.ParaMC(rs=para.rs, beta=para.beta, Fs=_Fs[li], Fa=0.0, order=para.order,
mass2=para.mass2, isDynamic=true, isFock=false) for li in eachindex(Λgrid)]


partition = [(2, 0, 0),]
channel = [
PHr,
PHEr,
PPr
]

neighbor = UEG.neighbor(partition)
filter = [NoHartree,
NoBubble,
Proper
]

n = [-1, 0, 0, -1] # q=0 and w -> 0 to measure F
lgrid = [0,] # angular momentum

println("∂Γ/∂f")
diagram = Ver4.diagram(para, partition; channel=channel, filter=filter, dR=true)
# ver4_df, result = Ver4.PH_df(paras, diagram;
# kamp=Λgrid, n=n, l=lgrid,
# neval=neval)
ver4_df, result = Ver4.PH_df(paras, diagram;
kamp=[para.kF for l in Λgrid], n=n, l=lgrid,
neval=neval)
print_ver4(ver4_df, lgrid, Λgrid, para)

println("Γ on FS")
diagram = Ver4.diagram(para, partition; channel=channel, filter=filter, dR=false)
ver4, result = Ver4.PH(paras[1], diagram;
kamp=[Λgrid[1],], n=n, l=lgrid,
neval=neval, print=0)
print_ver4(ver4, lgrid, [Λgrid[1],], para)

if isnothing(ver4) == false
jldopen("ver4_PH.jld2", "a+") do f
key = "$(UEG.short(para))"
if haskey(f, key)
@warn("replacing existing data for $key")
delete!(f, key)
end
f[key] = (Λgrid, lgrid, _Fs, ver4, ver4_df)
end
end
end
Loading

0 comments on commit 45d2841

Please sign in to comment.