Skip to content

Commit dbb20e8

Browse files
committed
fix typos of mu and EF in the note
1 parent 8ebd114 commit dbb20e8

File tree

2 files changed

+13
-78
lines changed

2 files changed

+13
-78
lines changed

example/spinfermion.jl

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
using ElectronGas
44
using Test, Printf, DelimitedFiles
55

6-
β = 1e3
7-
rs = 1.0
6+
dim = 2
7+
beta, rs = 1e2, 1.0
88
espin = 1.0
9-
# param = Interaction.Parameter.defaultUnit(beta, rs)
10-
param = Interaction.Parameter.rydbergUnit(β, rs)
11-
# param_b = Parameter.Para(param, e0 = 0.0, espin = 1.0)
9+
param = Interaction.Parameter.defaultUnit(1 / beta, rs, dim)
1210

13-
Λa = Polarization.Polarization0_ZeroTemp(0.0, 0, param) * (espin^2)
11+
Λa = Polarization.Polarization0_ZeroTemp(0.0, 0, param) * (-espin^2) / param.ϵ0
1412
println(Λa)
1513

1614
param = Parameter.Para(param, e0 = 0.0, espin = espin, Λa = Λa)
1715

1816
Euv, rtol = 100 * param.EF, 1e-10
19-
Nk, order = 8, 4
17+
# Nk, order, minK = 8, 4, 1e-7
18+
Nk, order, minK = 11, 4, 1e-8
2019

21-
Σ = SelfEnergy.G0W0(param, Euv, rtol, Nk, 10 * param.kF, 1e-7 * param.kF, order, :rpa)
20+
Σ = SelfEnergy.G0W0(param, Euv, rtol, Nk, 10 * param.kF, minK * param.kF, order, :rpa)
2221
Σ = SelfEnergy.GreenFunc.toMatFreq(Σ)
2322

2423
kgrid = Σ.spaceGrid
@@ -32,14 +31,11 @@ println(kF_label)
3231
println.instant[1, 1, :])
3332
println(ΣR[1, 1, kF_label, :])
3433

35-
f = open("./data/SigmaIm.txt", "w")
36-
for (n, ω) in enumerate(ΣI[1, 1, kF_label, :])
37-
# if ωgrid.n[n] < 0
38-
# continue
39-
# end
40-
println(n, ' ', ωgrid.n[n], ' ', ωgrid.ωn[n], ' ', ω)
41-
writedlm(f, [ωgrid.n[n] ωgrid.ωn[n] ω])
34+
# f = open("./data/Nk$Nk/SigmaIm_b1e2_m0.txt", "w")
35+
for (n, sigma) in enumerate(ΣI[1, 1, kF_label, :])
36+
println(n, ' ', ωgrid.n[n], ' ', ωgrid.ωn[n], ' ', sigma)
37+
writedlm(f, [ωgrid.n[n] ωgrid.ωn[n] sigma])
4238
end
43-
close(f)
39+
# close(f)
4440

4541
println(SelfEnergy.zfactor(Σ))

src/polarization.jl

Lines changed: 1 addition & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,6 @@ rundir = isempty(ARGS) ? pwd() : (pwd() * "/" * ARGS[1])
1616
# include(srcdir*"/convention.jl")
1717
# using .Convention
1818

19-
# Analytical calculated integrand of Π0 in 2D.
20-
# @inline function _ΠT2d_integrand(k, q, ω, param)
21-
# @unpack me, β, EF = param
22-
# density = me / 2π
23-
24-
# v1 = me * ω - q^2 / 2
25-
# v2 = me * ω + q^2 / 2
26-
# nk = 1.0 / (exp(β * (k^2 / 2 / me - EF)) + 1)
27-
28-
# theta1, theta2 = abs(v1) - k * q, abs(v2) - k * q
29-
# if theta1 <= 0 && theta2 <= 0
30-
# integrand = 0.0
31-
# elseif theta1 <= 0 && theta2 > 0
32-
# integrand = k * nk * (-sign(v2) / √(v2^2 - k^2 * q^2))
33-
# elseif theta1 > 0 && theta2 <= 0
34-
# integrand = k * nk * sign(v1) / √(v1^2 - k^2 * q^2)
35-
# else
36-
# integrand = k * nk * (sign(v1) / √(v1^2 - k^2 * q^2) - sign(v2) / √(v2^2 - k^2 * q^2))
37-
# end
38-
39-
# return density * integrand
40-
# end
41-
4219
# Analytical calculated integrand of Π0 in 2D.
4320
@inline function _ΠT2d_integrand(k, q, ω, param)
4421
@unpack me, β, μ = param
@@ -82,7 +59,7 @@ end
8259
Finite temperature one-spin Π0 function for matsubara frequency and momentum. Analytically sum over transfer frequency and angular
8360
dependence of momentum, and numerically calculate integration of magnitude of momentum.
8461
Slower(~200μs) than Polarization0_ZeroTemp.
85-
Assume G_0^{-1} = iω_n - (k^2/(2m) - E_F)
62+
Assume G_0^{-1} = iω_n - (k^2/(2m) - mu)
8663
8764
#Arguments:
8865
- q: momentum
@@ -122,44 +99,6 @@ function Polarization0_FiniteTemp(q::Float64, n::Int, param, maxk = 20, scaleN =
12299
end
123100

124101

125-
# @inline function Polarization0_2dZeroTemp(q, n, param)
126-
# @unpack me, kF, β = param
127-
# density = me / 2π
128-
# # check sign of q, use -q if negative
129-
# if q < 0
130-
# q = -q
131-
# end
132-
# # if q is too small, set to 1000eps
133-
# if q < eps(0.0) * 1e6
134-
# q = eps(0.0) * 1e6
135-
# end
136-
137-
# Π = 0.0
138-
# x = q / 2 / kF
139-
# ω_n = 2 * π * n / β
140-
# y = me * ω_n / q / kF
141-
142-
# if abs(y - x) <= 1 && abs(y + x) <= 1
143-
# Π = 1.0
144-
# elseif abs(y - x) <= 1 && abs(y + x) > 1
145-
# Π = 1.0 - sign(y + x) * √((y + x)^2 - 1) / 2x
146-
# elseif abs(y - x) > 1 && abs(y + x) <= 1
147-
# Π = 1.0 + sign(y - x) * √((y - x)^2 - 1) / 2x
148-
# else
149-
# z = q / (me * ω_n)
150-
# a = 1.0 / (me * ω_n)
151-
# if z < 3.8e-4
152-
# a = 1.0 / (me * ω_n)
153-
# Π = -z^2 / 2 - 3 * z^4 / 8 - (5 + 8 * a^2) * z^6 / 16
154-
# else
155-
# Π = 1.0 + (sign(y - x) * √((y - x)^2 - 1) - sign(y + x) * √((y + x)^2 - 1)) / 2x
156-
# end
157-
# end
158-
159-
# return -density * Π
160-
# end
161-
162-
163102
@inline function Polarization0_2dZeroTemp(q, n, param)
164103
@unpack me, kF, β = param
165104
density = me / 2π

0 commit comments

Comments
 (0)