Exact values for comparison

This commit is contained in:
ysyapa 2024-01-23 18:54:44 +00:00
parent e869d32343
commit a569302ca2
2 changed files with 12 additions and 1 deletions

View File

@ -57,10 +57,14 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"extrapolate_points = range(0.40, 0.20, 5)\n", "extrapolate_points = range(0.40, 0.20, 5)\n",
"extrapolate_E = Vector{ComplexF64}(undef, length(extrapolate_points))\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",
"extrapolate_E = Vector{ComplexF64}(undef, length(extrapolate_points))\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",
"\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) * H * EC_basis\n",
@ -72,6 +76,7 @@
"end\n", "end\n",
"\n", "\n",
"scatter(real.(training_E), imag.(training_E), label=\"training\")\n", "scatter(real.(training_E), imag.(training_E), label=\"training\")\n",
"scatter!(real.(exact_E), imag.(exact_E), label=\"exact\")\n",
"scatter!(real.(extrapolate_E), imag.(extrapolate_E), label=\"extrapolated\")\n", "scatter!(real.(extrapolate_E), imag.(extrapolate_E), label=\"extrapolated\")\n",
"plot!(real.(mesh_E), imag.(mesh_E), label=\"contour\")\n", "plot!(real.(mesh_E), imag.(mesh_E), label=\"contour\")\n",
"xlims!(0,1)" "xlims!(0,1)"

View File

@ -39,4 +39,10 @@ function identify_pole_i(p, evals, μ=0.5)
end end
end end
return current_i return current_i
end
function quick_pole_E(V_pq, μ=0.5; cs_angle=0.5, cutoff=8.0, meshpoints=256)
p, w = get_mesh([0, cutoff * exp(-1im * cs_angle)], meshpoints)
evals = eigvals(get_H_matrix(V_pq, p, w))
return evals[identify_pole_i(p, evals)]
end end