Skip to content

Commit 5c8fa60

Browse files
authored
Merge pull request #16 from SpM-lab/fix/author-issues-jl
Fix the Julia notebooks reported in the author issues
2 parents e17fa5c + c4aa55f commit 5c8fa60

3 files changed

Lines changed: 16 additions & 8 deletions

File tree

‎src/BgG_jl.ipynb‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,18 +1094,22 @@
10941094
"end\n",
10951095
"\n",
10961096
"\n",
1097+
"# RSCG stops when |r|^2 max_j|rho_j| < eps. The default eps = 1e-12 is too loose at eta = 0.01:\n",
1098+
"# the local DOS then deviates from exact diagonalization by up to 0.06. With eps = 1e-60 it agrees to 1e-11.\n",
1099+
"eps_rscg = 1e-60\n",
1100+
"\n",
10971101
"ix = Nx ÷ 2\n",
10981102
"iy = Ny ÷ 2\n",
10991103
"ispin =1\n",
11001104
"\n",
11011105
"i = (( iy-1)*Nx + ix-1)*2 + ispin\n",
11021106
"j = i\n",
1103-
"Gij1 = greensfunctions(i,j,σ,Htsc) \n",
1107+
"Gij1 = greensfunctions(i,j,σ,Htsc; eps=eps_rscg)\n",
11041108
"\n",
11051109
"ispin =2\n",
11061110
"i = (( iy-1)*Nx + ix-1)*2 + ispin\n",
11071111
"j = i\n",
1108-
"Gij2 = greensfunctions(i,j,σ,Htsc) \n",
1112+
"Gij2 = greensfunctions(i,j,σ,Htsc; eps=eps_rscg)\n",
11091113
"plot(real.(σ),(-1/π)*imag.(Gij1 .+ Gij2),\n",
11101114
" xlabel = \"Energy [t]\",\n",
11111115
" ylabel = \"Local DOS\",)\n"
@@ -1132,12 +1136,12 @@
11321136
"\n",
11331137
"i = (( iy-1)*Nx + ix-1)*2 + ispin\n",
11341138
"j = i\n",
1135-
"Gij1 = greensfunctions(i,j,σ,Htsc) \n",
1139+
"Gij1 = greensfunctions(i,j,σ,Htsc; eps=eps_rscg)\n",
11361140
"\n",
11371141
"ispin =2\n",
11381142
"i = (( iy-1)*Nx + ix-1)*2 + ispin\n",
11391143
"j = i\n",
1140-
"Gij2 = greensfunctions(i,j,σ,Htsc) \n",
1144+
"Gij2 = greensfunctions(i,j,σ,Htsc; eps=eps_rscg)\n",
11411145
"plot(real.(σ),(-1/π)*imag.(Gij1 .+ Gij2),\n",
11421146
" xlabel = \"Energy [t]\",\n",
11431147
" ylabel = \"Local DOS\",)"

‎src/DMFT_IPT_jl.ipynb‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,16 @@
4242
"$\\mathcal{G}$ is the cavity Green function defined as\n",
4343
"\n",
4444
"$$\n",
45-
"\\mathcal{G}(\\mathrm{i}\\nu) = \\frac{1}{\\mathrm{i}\\nu - \\mu - \\Delta(\\mathrm{i}\\nu)},\n",
45+
"\\mathcal{G}(\\mathrm{i}\\nu) = \\frac{1}{\\mathrm{i}\\nu + \\mu - \\Delta(\\mathrm{i}\\nu)},\n",
4646
"$$\n",
4747
"\n",
4848
"$\\Delta$ is the hybrization function,\n",
4949
"$\\tau$ is the imaginary time, $\\beta$ is the inverse temperature.\n",
5050
"Here, we compute the self-energy within the interative perturbation theory (IPT) [1].\n",
5151
"\n",
52+
"At half filling, $\\mu = U/2$ cancels the Hartree term $\\Sigma_\\mathrm{H} = U n_\\sigma = U/2$ of the self-energy. The code therefore contains neither $\\mu$ nor $\\Sigma_\\mathrm{H}$: its $\\Sigma$ is the second-order term, the denominator of $G_{\\mathrm{loc}}$ reads $\\mathrm{i}\\nu-\\omega-\\Sigma(\\mathrm{i}\\nu)$, and $\\mathcal{G}^{-1} = G_{\\mathrm{loc}}^{-1} + \\Sigma$ gives $\\mathrm{i}\\nu - \\Delta(\\mathrm{i}\\nu)$, the cavity function shifted by $\\Sigma_\\mathrm{H}$ that enters IPT.\n",
53+
"The semicircular density of states above is that of the Bethe lattice with hopping $t_\\star = 1$, for which these equations are equivalent to $\\mathcal{G}^{-1}(\\mathrm{i}\\nu) = \\mathrm{i}\\nu - t_\\star^2 G_{\\mathrm{loc}}(\\mathrm{i}\\nu)$. Particle-hole symmetry makes $\\mathcal{G}(\\mathrm{i}\\nu)$ purely imaginary (the code keeps only its imaginary part), so that $\\mathcal{G}(\\beta-\\tau) = \\mathcal{G}(\\tau)$ and $\\Sigma(\\tau) = U^2\\mathcal{G}^3(\\tau)$. The equations are therefore the same as in the [Python version](DMFT_IPT_py.ipynb) of this tutorial.\n",
54+
"\n",
5255
"### Renormalization factors\n",
5356
"\n",
5457
"The Mott transition can be detected by monitoring the renormalization factor\n",
@@ -161,7 +164,7 @@
161164
" smpl_matsu = MatsubaraSampling(basis)\n",
162165
" smpl_tau = TauSampling(basis)\n",
163166
"\n",
164-
" new(U, basis, SparseIR.beta(basis), rho_omega, omega_range, quad_rule, smpl_matsu, smpl_tau)\n",
167+
" new(U, basis, SparseIR.beta(basis), rho, omega_range, quad_rule, smpl_matsu, smpl_tau)\n",
165168
" end\n",
166169
"end\n",
167170
";"

‎src/FLEX_jl.ipynb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,14 @@
188188
"end\n",
189189
"\n",
190190
"function k_to_r(mesh::Mesh, obj_k)\n",
191-
" \"\"\" Fourier transform from k-space to real space \"\"\"\n",
191+
" \"\"\" Fourier transform from k-space to real space, A(r) = sum_k exp(-ik.r) A(k), without a factor 1/nk \"\"\"\n",
192192
" obj_r = fft(obj_k, [2, 3])\n",
193193
" return obj_r\n",
194194
"end\n",
195195
"\n",
196196
"function r_to_k(mesh::Mesh, obj_r)\n",
197-
" \"\"\" Fourier transform from real space to k-space \"\"\"\n",
197+
" \"\"\" Fourier transform from real space to k-space, A(k) = (1/nk^2) sum_r exp(ik.r) A(r) (1/nk from ifft and 1/nk here),\n",
198+
" so that the product of two k_to_r arrays A(r)B(r) gives the convolution (1/nk) sum_q A(q)B(k-q) \"\"\"\n",
198199
" obj_k = ifft(obj_r, [2, 3]) / mesh.nk\n",
199200
" return obj_k\n",
200201
"end\n",

0 commit comments

Comments
 (0)