Skip to content

Commit

Permalink
Merge from master
Browse files Browse the repository at this point in the history
  • Loading branch information
houpc committed Mar 30, 2024
2 parents 5cff694 + 52bcac6 commit 66090ee
Show file tree
Hide file tree
Showing 29 changed files with 9,135 additions and 136 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ deps/src/
*.aux
*.DS_Store
*.xdv
*.xcf
*.dat
*.err
*.out
Expand All @@ -49,4 +50,8 @@ Manifest.toml
.vscode
.history
LocalPreferences.toml
run/
run/
results/
archives/
benchmark/
test_runs/
4 changes: 2 additions & 2 deletions example/freeE/plot_freeE.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Fs = [-0.0,]
# beta = [25.0]
beta = [80.0]
order = [5,]
const fileName = "freeE_$(dim)d.dat"
const filename = "freeE_$(dim)d.dat"
const val_benchmark =
cdict = Dict(["blue" => "#0077BB", "cyan" => "#33BBEE", "teal" => "#009988", "orange" => "#EE7733", "red" => "#CC3311", "magenta" => "#EE3377", "grey" => "#BBBBBB"]);

Expand Down Expand Up @@ -53,7 +53,7 @@ end

if abspath(PROGRAM_FILE) == @__FILE__

freeE_data = readdlm(fileName)
freeE_data = readdlm(filename)
num_data = size(freeE_data)[1]

freeE_total, error_total, mass2_total = [], [], []
Expand Down
99 changes: 69 additions & 30 deletions example/input.jl
Original file line number Diff line number Diff line change
@@ -1,36 +1,75 @@
# dim = 2 # dimension of the problem
dim = 3 # dimension of the problem
# rs = [0.5]
# rs = [5.0]
rs = [1.0]
# mass2 = [1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0,] # screening parameter
# mass2 = [1.125] # screening parameter
mass2 = [1.0,] # screening parameter
Fs = [-0.0,] # Fermi liquid parameter with zero angular momentum
# beta = [10.0, 20.0, 40.0, 80.0, 160.0] # inverse temperature beta = β*E_F
# beta = [5.0, 10.0, 20.0, 40.0, 80.0, 160.0] # inverse temperature beta = β*E_F
# beta = [80.0,] # inverse temperature beta = β*E_F
beta = [25.0,] # inverse temperature beta = β*E_F
order = [4,] # order of diagrams
# order = [5,] # order of diagrams
# neval = 5e7 # number of Monte Carlo samples
# order = [6,] # order of diagrams
neval = 1e7 # number of Monte Carlo samples
isDynamic = false # whether to use effective field theory with dynamic screening or not
isFock = false # whether to use Fock renormalization or not
# Use finalized lambda scans to determine mass2 for maximum orders N = 4, 5, 6
include("lambda_scans.jl")
dim = 3 # dimension of the problem
rs = [6.0]
order = [5] # maximum diagram order of the run
mass2 = rs_to_lambdas[dim][order[1]][rs[1]]

# diagGenerate = :GV # :GV or :Parquet, algorithm to generate diagrams
diagGenerate = :Parquet
# isLayered2D = true # whether to use layered 2D system or not
isLayered2D = false # whether to use layered 2D system or not
Fs = [-0.0] # Fermi liquid parameter with zero angular momentum
beta = [40.0] # inverse temperature beta = β*E_F
neval = 1e11 # number of Monte Carlo samples
isDynamic = false # whether to use effective field theory with dynamic screening or not
isFock = false # whether to use Fock renormalization or not

diagGenerate = :GV # :GV or :Parquet, algorithm to generate diagrams
isLayered2D = false # whether to use layered 2D system or not

spin = 2 # 2 for unpolarized, 1 for polarized
# spin = 1 # 2 for unpolarized, 1 for polarized
spinPolarPara = 2 / spin - 1 # spin-polarization parameter (n_up - n_down) / (n_up + n_down) ∈ [0,1]
# spinPolarPara = 2 / spin - 1 # spin-polarization parameter (n_up - n_down) / (n_up + n_down) ∈ [0,1]
ispolarized = spin < 2

println("rs = $rs, mass2 = $mass2, order = $order, neval = $neval")

if isLayered2D
const parafilename = "para_wn_1minus0_layered2d.csv"
else
# const parafilename = "para_wn_1minus0.csv"
const parafilename = "para_wn_1minus0_3d.csv"
# Build file base names
basenames = [
"para_wn_1minus0",
"data$(dim)d_Z",
"data$(dim)d_K",
"meff_$(dim)d",
"inverse_meff_$(dim)d",
"zfactor_$(dim)d",
"inverse_zfactor_$(dim)d",
"chemical_potential_$(dim)d",
"dispersion_ratio_$(dim)d",
"inverse_dispersion_ratio_$(dim)d",
]
for i in eachindex(basenames)
if spin != 2
basenames[i] *= "_spin$(spin)"
end
if ispolarized
basenames[i] *= "_polarized"
end
if isLayered2D
@assert dim == 2 "Layered 2D mode is only available for dim = 2!"
basenames[i] *= "_layered2d"
end
end
para_basename,
sigma_z_basename,
sigma_k_basename,
meff_basename,
inverse_meff_basename,
zfactor_basename,
inverse_zfactor_basename,
chemical_potential_basename,
dispersion_ratio_basename,
inverse_dispersion_ratio_basename = basenames

# Directory paths
data_directory = joinpath(@__DIR__, "sigma/data$(dim)d")
res_directory = joinpath(@__DIR__, "sigma")
para_directory = "" # src directory

# File paths
const parafilename = joinpath(para_directory, para_basename * ".csv")
const sigma_z_filename = joinpath(data_directory, sigma_z_basename * ".jld2")
const sigma_k_filename = joinpath(data_directory, sigma_k_basename * ".jld2")
const meff_filename = joinpath(res_directory, meff_basename * ".dat")
const inverse_meff_filename = joinpath(res_directory, inverse_meff_basename * ".dat")
const zfactor_filename = joinpath(res_directory, zfactor_basename * ".dat")
const zinv_filename = joinpath(res_directory, inverse_zfactor_basename * ".dat")
const chemical_potential_filename = joinpath(res_directory, chemical_potential_basename * ".dat")
const dispersion_ratio_filename = joinpath(res_directory, dispersion_ratio_basename * ".dat")
const inverse_dispersion_ratio_filename = joinpath(res_directory, inverse_dispersion_ratio_basename * ".dat")
53 changes: 53 additions & 0 deletions example/lambda_scans.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const LambdaDictType = Dict{Float64, Vector{Float64}}

# Finalized 3D lambda scans for maximum orders N = 4, 5, 6
const rs_to_lambdas_3d_N4 = LambdaDictType(
0.5 => [1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0],
1.0 => [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.5, 3.0, 3.5, 4.0],
2.0 => [0.5, 0.75, 1.0, 1.25, 1.5, 1.625, 1.75, 1.875, 2.0, 2.5, 3.0],
3.0 => [0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.125, 1.25, 1.5, 1.75, 2.0],
4.0 => [0.375, 0.5, 0.625, 0.75, 0.875, 1.0, 1.125, 1.25, 1.5, 2.0],
5.0 => [0.375, 0.5, 0.625, 0.75, 0.8125, 0.875, 0.9375, 1.0, 1.125, 1.25, 1.5],
6.0 => [0.375, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 3.0, 4.0, 5.0],
)
const rs_to_lambdas_3d_N5 = LambdaDictType(
0.5 => [3.0, 3.5, 4.0, 4.5, 5.0],
1.0 => [1.5, 1.75, 2.0, 3.0, 3.5],
2.0 => [1.625, 1.75, 1.875, 2.0, 2.125, 2.25, 2.5],
3.0 => [1.0, 1.125, 1.25, 1.5, 1.75, 2.0],
4.0 => [0.875, 1.0, 1.125, 1.25, 1.5, 2.0],
5.0 => [0.8125, 0.875, 0.9375, 1.0, 1.125],
6.0 => [0.625, 0.75, 0.875, 1.0, 1.125, 1.25],
)
const rs_to_lambdas_3d_N6 = LambdaDictType() # TODO: Add N = 6 3D lambda scans and datfile entries

# TODO: Add N = 4, 5, 6 2D lambda scans and datfiles
const rs_to_lambdas_2d_N4 = LambdaDictType()
const rs_to_lambdas_2d_N5 = LambdaDictType()
const rs_to_lambdas_2d_N6 = LambdaDictType()

"""
Dict of dict of 3D lambda scans vs N and rs (usage: `rs_to_lambdas_3d[N][rs]`).
"""
const rs_to_lambdas_3d = Dict(
4 => rs_to_lambdas_3d_N4,
5 => rs_to_lambdas_3d_N5,
6 => rs_to_lambdas_3d_N6,
)

"""
Dict of dict of 2D lambda scans vs N and rs (usage: `rs_to_lambdas_3d[N][rs]`).
"""
const rs_to_lambdas_2d = Dict(
4 => rs_to_lambdas_2d_N4,
5 => rs_to_lambdas_2d_N5,
6 => rs_to_lambdas_2d_N6,
)

"""
Dict of dict of dict of lambda scans vs dim, N, and rs (usage: `rs_to_lambdas[dim][N][rs]`).
"""
const rs_to_lambdas = Dict(
2 => rs_to_lambdas_2d,
3 => rs_to_lambdas_3d,
)
Loading

0 comments on commit 66090ee

Please sign in to comment.