Major bug fix for R2R extrapolation

This commit is contained in:
ysyapa 2024-02-15 17:38:06 +00:00
parent 01767fd713
commit 2a19f64f6c
1 changed files with 6 additions and 4 deletions

View File

@ -16,7 +16,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"vertices = (0, 0.4 - 0.2im, 0.8, 6)\n", "vertices = (0, 0.4 - 0.15im, 0.8, 6)\n",
"subdivisions = 128\n", "subdivisions = 128\n",
"p, w = get_mesh(vertices, subdivisions)\n", "p, w = get_mesh(vertices, subdivisions)\n",
"mesh_E = p.*p ./ (2*0.5)\n", "mesh_E = p.*p ./ (2*0.5)\n",
@ -53,19 +53,21 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"extrapolate_points = range(0.40, 0.20, 5)\n", "extrapolate_points = range(0.40, 0.25, 5)\n",
"ref_E = 0.2 - 0.1im\n", "ref_E = 0.2 - 0.1im\n",
"\n", "\n",
"exact_E = Vector{ComplexF64}(undef, length(extrapolate_points))\n", "exact_E = Vector{ComplexF64}(undef, length(extrapolate_points))\n",
"extrapolate_E = Vector{ComplexF64}(undef, length(extrapolate_points))\n", "extrapolate_E = Vector{ComplexF64}(undef, length(extrapolate_points))\n",
"\n", "\n",
"EC_basis_w = EC_basis .* w\n",
"N_EC = transpose(EC_basis_w) * EC_basis\n",
"\n",
"for (j, c) in enumerate(extrapolate_points)\n", "for (j, c) in enumerate(extrapolate_points)\n",
" exact_E[j] = quick_pole_E(V_system(c))\n", " exact_E[j] = quick_pole_E(V_system(c))\n",
"\n", "\n",
" EC_basis_w = EC_basis .* w\n", " EC_basis_w = EC_basis .* w\n",
" H = get_H_matrix(V_system(c), p, w)\n", " H = get_H_matrix(V_system(c), p, w)\n",
" H_EC = transpose(EC_basis) * H * EC_basis\n", " H_EC = transpose(EC_basis_w) * H * EC_basis\n",
" N_EC = transpose(EC_basis) * EC_basis\n",
" evals = eigvals(H_EC, N_EC)\n", " evals = eigvals(H_EC, N_EC)\n",
" i = argmin(abs.(evals .- ref_E))\n", " i = argmin(abs.(evals .- ref_E))\n",
" ref_E = evals[i]\n", " ref_E = evals[i]\n",