{ "cells": [ { "cell_type": "markdown", "source": [ "# Eigenvalues of the dielectric matrix\n", "\n", "We compute a few eigenvalues of the dielectric matrix (q=0,ω=0) iteratively." ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "n Energy log10(ΔE) log10(Δρ) Diag\n", "--- --------------- --------- --------- ----\n", " 1 -7.233096356919 -0.50 6.0\n", " 2 -7.250003805877 -1.77 -1.40 1.0\n", " 3 -7.251230766897 -2.91 -1.92 4.0\n", " 4 -7.251145176002 + -4.07 -2.01 4.0\n", " 5 -7.251295350161 -3.82 -2.35 3.0\n", " 6 -7.251337022151 -4.38 -2.97 2.0\n", " 7 -7.251338758578 -5.76 -3.93 2.0\n", " 8 -7.251338782460 -7.62 -3.95 5.0\n", " 9 -7.251338797524 -7.82 -4.48 3.0\n", " 10 -7.251338798391 -9.06 -4.82 2.0\n", " 11 -7.251338798695 -9.52 -5.53 3.0\n", " 12 -7.251338798704 -11.09 -5.87 2.0\n", " 13 -7.251338798704 -12.37 -6.07 1.0\n", " 14 -7.251338798704 -12.37 -6.44 3.0\n", " 15 -7.251338798705 -13.10 -6.89 2.0\n", " 16 -7.251338798705 -13.97 -7.19 2.0\n", " 17 -7.251338798705 -14.57 -8.02 4.0\n" ] }, { "output_type": "execute_result", "data": { "text/plain": "(ham = Hamiltonian(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), HamiltonianBlock[DFTK.DftHamiltonianBlock(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), Any[DFTK.FourierMultiplication{Float64, Vector{Float64}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [0.0, 0.5625437115174675, 2.25017484606987, 2.25017484606987, 0.5625437115174675, 0.5625437115174675, 0.7500582820232901, 2.0626602755640477, 4.50034969213974, 3.5627768396106276 … 3.7502914101164504, 3.7502914101164504, 2.0626602755640477, 1.5001165640465801, 0.7500582820232901, 2.0626602755640477, 4.50034969213974, 3.5627768396106276, 1.5001165640465801, 0.5625437115174675]), DFTK.RealSpaceMultiplication{Float64, Array{Float64, 3}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [-0.30116136598756804 -0.36869760795125184 … -0.5702190219244254 -0.36869760795125195; -0.3686976079512516 -0.6560706269776427 … -0.2646141643947948 -0.2539389812456163; … ; -0.5702190219244256 -0.264614164394795 … -2.291992881132685 -1.1751172086054253; -0.3686976079512515 -0.2539389812456162 … -1.1751172086054256 -0.6560706269776425;;; -0.3686976079512517 -0.6560706269776427 … -0.2646141643947948 -0.2539389812456166; -0.6560706269776425 -1.3741022038947448 … -0.1651225671881503 -0.31565743774427135; … ; -0.2646141643947949 -0.16512256718815066 … -0.8632000905877295 -0.4898593856167607; -0.25393898124561615 -0.31565743774427135 … -0.48985938561676046 -0.31565743774427124;;; -0.5702190219244254 -1.1751172086054258 … -0.1242245197168452 -0.264614164394795; -1.1751172086054256 -2.8292222589777416 … -0.1750685951638031 -0.48985938561676046; … ; -0.1242245197168452 -0.1750685951638037 … -0.30112950922681153 -0.17506859516380358; -0.2646141643947948 -0.48985938561676046 … -0.17506859516380294 -0.1651225671881503;;; … ;;; -0.8720732197039092 -0.36117451106748844 … -3.5504427268225025 -1.881971917366274; -0.3611745110674882 -0.13192205269891222 … -1.3219289313234115 -0.747481991474731; … ; -3.5504427268225025 -1.3219289313234115 … -11.011681230319526 -8.06878895093237; -1.8819719173662737 -0.747481991474731 … -8.06878895093237 -4.5798976647669045;;; -0.5702190219244254 -0.2646141643947948 … -2.2919928811326855 -1.1751172086054256; -0.2646141643947947 -0.16512256718815055 … -0.8632000905877295 -0.48985938561676046; … ; -2.2919928811326855 -0.8632000905877297 … -11.026309596728632 -6.029372075563462; -1.1751172086054253 -0.4898593856167603 … -6.029372075563462 -2.8292222589777416;;; -0.3686976079512518 -0.2539389812456165 … -1.1751172086054256 -0.6560706269776427; -0.25393898124561626 -0.3156574377442714 … -0.4898593856167604 -0.31565743774427135; … ; -1.1751172086054256 -0.48985938561676057 … -6.029372075563461 -2.829222258977741; -0.6560706269776424 -0.3156574377442712 … -2.829222258977741 -1.3741022038947448]), DFTK.NonlocalOperator{Float64, Matrix{ComplexF64}, Matrix{Float64}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), ComplexF64[0.11164094023604486 + 0.0im 0.1729534009156557 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.07139183057793365 - 0.07139183057793365im 0.10318729458139622 - 0.10318729458139622im … -0.035578676822652595 + 0.035578676822652595im 0.035578676822652595 - 0.035578676822652595im; … ; -0.08538801146445177 + 0.0im -0.10864081623630145 + 0.0im … 0.0 + 0.08076812854291712im 0.0 - 0.0im; -0.07139183057793365 + 0.07139183057793365im -0.10318729458139622 + 0.10318729458139622im … -0.035578676822652595 + 0.035578676822652595im -0.035578676822652595 + 0.035578676822652595im], [5.90692831 -1.26189397 … 0.0 0.0; -1.26189397 3.25819622 … 0.0 0.0; … ; 0.0 0.0 … 2.72701346 0.0; 0.0 0.0 … 0.0 2.72701346]), DFTK.NoopOperator{Float64}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137)), DFTK.NoopOperator{Float64}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137)), DFTK.RealSpaceMultiplication{Float64, Array{Float64, 3}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [0.5274666766922532 0.5044274756218492 … 0.4441271548782918 0.5044274730147; 0.5044274751647267 0.47725917701168225 … 0.4288920037469707 0.4860751462520183; … ; 0.4441271555270105 0.42889200483103956 … 0.3670950995033213 0.4173035756664436; 0.5044274734176969 0.48607514710114413 … 0.41730357542411 0.4772591730524132;;; 0.5044274754988628 0.4772591773022449 … 0.4288920039913367 0.4860751465698912; 0.47725917682777946 0.4445296916520628 … 0.4098211909261986 0.46474453830287465; … ; 0.4288920046470063 0.40982119202404815 … 0.36030626778971375 0.4089019880286142; 0.486075146976891 0.4647445391741427 … 0.4089019877734056 0.4647445365894251;;; 0.4441271592148318 0.41730358081082286 … 0.37467442877384965 0.4288920063400371; 0.4173035803260851 0.38733679211489397 … 0.3577719565447778 0.40890199138085004; … ; 0.37467442942784346 0.3577719576513504 … 0.313491956007965 0.3577719552072973; 0.42889200674860545 0.40890199226739055 … 0.35777195494773995 0.409821191591826;;; … ;;; 0.3720716514621192 0.3538533868804007 … 0.3279354958362293 0.3563741601412747; 0.35385338651002446 0.33178203875432727 … 0.3099360162235558 0.3421493078291492; … ; 0.32793549639701425 0.3099360171619653 … 0.3241773287154026 0.32702014987161293; 0.35637416048718507 0.34214930854474107 … 0.32702014965767284 0.3434110404537163;;; 0.44412715514605666 0.4288920043481729 … 0.3670950996933863 0.4173035755102852; 0.4288920039448164 0.40982119126315647 … 0.36030626770666296 0.408901987551036; … ; 0.3670951002771538 0.36030626870318594 … 0.32417732794165377 0.34595875161566914; 0.41730357587983613 0.4089019883212338 … 0.34595875140997845 0.38733678718083403;;; 0.5044274731439036 0.4860751468072765 … 0.41730357537157015 0.47725917285810987; 0.48607514637421 0.464744538591881 … 0.408901987469169 0.4647445360787672; … ; 0.417303575994244 0.40890198852127974 … 0.3459587511639664 0.38733678714387865; 0.47725917324938877 0.4647445368955161 … 0.3873367869224699 0.44452968666130643]), DFTK.RealSpaceMultiplication{Float64, SubArray{Float64, 3, Array{Float64, 4}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, Int64}, true}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [-0.55755176431042 -0.547947130736894 … -0.5185332235098592 -0.5479471299714888; -0.547947130577322 -0.5318143678927882 … -0.5184377228409959 -0.5418065876627307; … ; -0.5185332237658941 -0.5184377232298994 … -0.4296212260931343 -0.4895688408917974; -0.5479471301109264 -0.5418065879513972 … -0.48956884077479207 -0.5318143668230296;;; -0.5479471307426292 -0.5318143680669084 … -0.5184377229970728 -0.5418065878237837; -0.5318143678920956 -0.5005477201132951 … -0.5121183309761915 -0.5325945678868818; … ; -0.5184377232158555 -0.5121183313386073 … -0.4661344031749336 -0.5043253392107266; -0.5418065879529474 -0.5325945681806582 … -0.5043253391142496 -0.5325945674037464;;; -0.5185332249071616 -0.48956884243200255 … -0.49813277591780564 -0.5184377237718495; -0.4895688422302698 -0.4364507944749151 … -0.4900722208986032 -0.5043253402230523; … ; -0.49813277611578477 -0.4900722212633504 … -0.46519527965084073 -0.49007222046792553; -0.5184377239009279 -0.5043253405424182 … -0.49007222038767284 -0.5121183312474502;;; … ;;; -0.4726017225101775 -0.48204415548606655 … -0.3634524748428971 -0.4305619789738374; -0.48204415533420447 -0.4792205295076312 … -0.41266463636372736 -0.46009328585868764; … ; -0.36345247526858254 -0.41266463689795974 … -0.2285997359677353 -0.28481296701630304; -0.4305619791692316 -0.4600932861909427 … -0.2848129667649876 -0.3648044484988094;;; -0.5185332235106737 -0.5184377229822115 … -0.4296212258810803 -0.48956884063249617; -0.5184377228292446 -0.5121183309492348 … -0.4661344028328843 -0.5043253388280102; … ; -0.42962122624171795 -0.46613440331996314 … -0.22859973521207577 -0.3483102838636951; -0.48956884080916285 -0.5043253391462881 … -0.3483102836770384 -0.4364507928967442;;; -0.5479471299700708 -0.5418065878106888 … -0.4895688406392641 -0.5318143666798872; -0.5418065876571025 -0.5325945678762382 … -0.5043253388345063 -0.5325945671111583; … ; -0.48956884094222286 -0.5043253392690971 … -0.34831028375371037 -0.4364507930343901; -0.5318143668365299 -0.5325945674111501 … -0.4364507928929764 -0.5005477186996881])], DFTK.FourierMultiplication{Float64, Vector{Float64}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [0.0, 0.5625437115174675, 2.25017484606987, 2.25017484606987, 0.5625437115174675, 0.5625437115174675, 0.7500582820232901, 2.0626602755640477, 4.50034969213974, 3.5627768396106276 … 3.7502914101164504, 3.7502914101164504, 2.0626602755640477, 1.5001165640465801, 0.7500582820232901, 2.0626602755640477, 4.50034969213974, 3.5627768396106276, 1.5001165640465801, 0.5625437115174675]), DFTK.RealSpaceMultiplication{Float64, Array{Float64, 3}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), [-0.3312464536057348 -0.4122172630662967 … -0.6446250905559928 -0.41221726490804067; -0.4122172633638469 -0.7106258178587488 … -0.35415988348882 -0.3096704226563287; … ; -0.6446250901633093 -0.3541598827936549 … -2.354519007722498 -1.247382473830779; -0.41221726464448105 -0.3096704220958693 … -1.2473824739561077 -0.710625820748259;;; -0.41221726319501817 -0.7106258177423063 … -0.3541598834005309 -0.30967042249950905; -0.7106258180419587 -1.4301202323559772 … -0.26741970723814323 -0.38350746732827845; … ; -0.3541598829636441 -0.2674197065027098 … -0.9690282259729494 -0.5852827367988731; -0.30967042222167257 -0.38350746675078684 … -0.5852827369576045 -0.3835074685585926;;; -0.6446250876167552 -1.2473824702266054 … -0.24768286686080115 -0.3541598818266074; -1.2473824705096102 -2.8783362613377625 … -0.3073688595176285 -0.5852827344589627; … ; -0.24768286640478654 -0.3073688587758037 … -0.4528328328696873 -0.3073688604244318; -0.35415988154711725 -0.5852827338917881 … -0.3073688606037358 -0.2674197068437745;;; … ;;; -0.9726032907519675 -0.4893652796731543 … -3.58595970582917 -1.9561597361988365; -0.4893652798916682 -0.27936054345221617 … -1.424657551463583 -0.8654259695042694; … ; -3.5859597056940706 -1.424657551059406 … -10.91610363757186 -8.02658176807706; -1.9561597360483203 -0.8654259691209327 … -8.026581768039685 -4.601291072811997;;; -0.6446250902890425 -0.3541598830288334 … -2.3545190073203797 -1.2473824737276367; -0.3541598832792229 -0.26741970687422884 … -0.9690282257139509 -0.5852827368937347; … ; -2.3545190070972497 -0.9690282252045069 … -10.930732003999054 -6.031723607811488; -1.247382473534752 -0.5852827364418145 … -6.031723607830521 -2.8783362646936514;;; -0.412217264777419 -0.3096704222490288 … -1.2473824738731194 -0.71062582079942; -0.3096704225285088 -0.3835074670286286 … -0.5852827369820977 -0.3835074687766624; … ; -1.2473824735534045 -0.5852827363645778 … -6.031723608153205 -2.8783362648682527; -0.7106258205647835 -0.38350746825990517 … -2.878336264948248 -1.4301202359331264]), DFTK.NonlocalOperator{Float64, Matrix{ComplexF64}, Matrix{Float64}}(PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), KPoint([ 0, 0, 0], spin = 1, num. G vectors = 137), ComplexF64[0.11164094023604486 + 0.0im 0.1729534009156557 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.07139183057793365 - 0.07139183057793365im 0.10318729458139622 - 0.10318729458139622im … -0.035578676822652595 + 0.035578676822652595im 0.035578676822652595 - 0.035578676822652595im; … ; -0.08538801146445177 + 0.0im -0.10864081623630145 + 0.0im … 0.0 + 0.08076812854291712im 0.0 - 0.0im; -0.07139183057793365 + 0.07139183057793365im -0.10318729458139622 + 0.10318729458139622im … -0.035578676822652595 + 0.035578676822652595im -0.035578676822652595 + 0.035578676822652595im], [5.90692831 -1.26189397 … 0.0 0.0; -1.26189397 3.25819622 … 0.0 0.0; … ; 0.0 0.0 … 2.72701346 0.0; 0.0 0.0 … 0.0 2.72701346]), nothing, (ψ_reals = Array{ComplexF64, 3}[[0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im;;; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im;;; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im;;; … ;;; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im;;; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im;;; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; … ; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.0 + 0.0im 0.0 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im]],))]), basis = PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), energies = Energies(total = -7.251338798704542), converged = true, occupation_threshold = 1.0e-6, ρ = [0.12710827582525044 0.12017965660464452 … 0.10056375682329827 0.12017965606297377; 0.12017965649171682 0.10912705038696774 … 0.10050389539051967 0.11588721240468164; … ; 0.10056375698381778 0.1005038956342416 … 0.054640607020191335 0.08349600543780249; 0.12017965616165262 0.11588721260398055 … 0.08349600537316729 0.10912704967796266;;; 0.12017965660870329 0.1091270505023696 … 0.10050389548833144 0.11588721251587461; 0.10912705038650863 0.0897121208099168 … 0.09659641902420811 0.10964497779840886; … ; 0.1005038956254403 0.09659641924528585 … 0.07122114420956903 0.09192171829681123; 0.11588721260505092 0.10964497799374322 … 0.09192171823991216 0.10964497747716828;;; 0.10056375769932839 0.08349600628863084 … 0.08831868294461796 0.10050389597387628; 0.08349600617719119 0.057516676966371395 … 0.08377439413330771 0.0919217188938478; … ; 0.08831868305824524 0.08377439433525567 … 0.07075664169816544 0.08377439389485634; 0.10050389605476842 0.09192171908219936 … 0.08377439385042319 0.09659641918967897;;; … ;;; 0.07447652140378758 0.07940929809488205 … 0.031661597945897554 0.05503081394396709; 0.07940929801380948 0.0779116076392068 … 0.04792699993243917 0.06826914751502208; … ; 0.03166159806721718 0.04792700013457204 … 0.006870415760372875 0.01421539774112685; 0.055030814025209804 0.06826914767504322 … 0.014215397699773777 0.032048514835231134;;; 0.10056375682380889 0.10050389547901803 … 0.05464060693244866 0.08349600529456129; 0.10050389538315525 0.09659641900776411 … 0.07122114404000982 0.09192171807109753; … ; 0.054640607081671524 0.07122114428146244 … 0.00687041568504281 0.02754404270801722; 0.08349600539215417 0.09192171825880739 … 0.027544042659659613 0.05751667629010824;;; 0.12017965606197023 0.11588721250683377 … 0.08349600529829998 0.10912704958309205; 0.11588721240079587 0.10964497779133184 … 0.09192171807492863 0.10964497728262403; … ; 0.08349600546565812 0.09192171833123615 … 0.027544042679523203 0.05751667634909102; 0.1091270496869103 0.10964497748209104 … 0.05751667628849372 0.08971211998990779;;;;], α = 0.8, eigenvalues = [[-0.14431559199342583, 0.2969816922163559, 0.2969816927663815, 0.29698169324270485, 0.3757382671423691, 0.37573826731263454, 0.37573826761056006]], occupation = [[2.0, 2.0, 2.0, 2.0, 0.0, 0.0, 0.0]], εF = 0.3442393822016583, n_iter = 17, n_ep_extra = 3, ψ = Matrix{ComplexF64}[[0.9634089084917428 + 0.013614184769562884im -2.3179169841840472e-10 - 1.2584640777399147e-9im … 6.84617213347641e-10 - 2.9757930206370867e-10im 5.305204394865129e-10 - 9.244011478976293e-10im; 0.08622260584994057 + 0.0012184342282963692im 0.01574735303199155 + 0.09076868229128017im … -0.005451766046486205 - 0.01266978124848395im -0.09837558774356597 - 0.05760968754313452im; … ; 0.01281348371749894 + 0.00018107045818370357im 0.006460385783639887 + 0.03723808635802074im … -0.0007205829442020675 - 0.0016746719420922469im -0.0678445873908222 - 0.039730469847449525im; -0.0862226049152647 - 0.001218433409509179im 0.08603516243056354 + 0.49591221650877143im … -0.0009816944700666616 - 0.0022819036730420154im -0.5073496113825049 - 0.29710905550361233im]], diagonalization = NamedTuple{(:λ, :X, :residual_norms, :iterations, :converged, :n_matvec), Tuple{Vector{Vector{Float64}}, Vector{Matrix{ComplexF64}}, Vector{Vector{Float64}}, Vector{Int64}, Bool, Int64}}[(λ = [[-0.14431559199342583, 0.2969816922163559, 0.2969816927663815, 0.29698169324270485, 0.3757382671423691, 0.37573826731263454, 0.37573826761056006]], X = [[0.9634089084917428 + 0.013614184769562884im -2.3179169841840472e-10 - 1.2584640777399147e-9im … 6.84617213347641e-10 - 2.9757930206370867e-10im 5.305204394865129e-10 - 9.244011478976293e-10im; 0.08622260584994057 + 0.0012184342282963692im 0.01574735303199155 + 0.09076868229128017im … -0.005451766046486205 - 0.01266978124848395im -0.09837558774356597 - 0.05760968754313452im; … ; 0.01281348371749894 + 0.00018107045818370357im 0.006460385783639887 + 0.03723808635802074im … -0.0007205829442020675 - 0.0016746719420922469im -0.0678445873908222 - 0.039730469847449525im; -0.0862226049152647 - 0.001218433409509179im 0.08603516243056354 + 0.49591221650877143im … -0.0009816944700666616 - 0.0022819036730420154im -0.5073496113825049 - 0.29710905550361233im]], residual_norms = [[2.4243303900789655e-9, 8.101321111572781e-10, 1.1054153123481962e-10, 2.0310645853606034e-10, 3.697684475303189e-10, 2.9879342308672014e-10, 2.610830764795004e-10]], iterations = [4], converged = 1, n_matvec = 32)], stage = :finalize, algorithm = \"SCF\", norm_Δρ = 6.804665218290988e-9)" }, "metadata": {}, "execution_count": 1 } ], "cell_type": "code", "source": [ "using DFTK\n", "using Plots\n", "using KrylovKit\n", "using Printf\n", "\n", "# Calculation parameters\n", "kgrid = [1, 1, 1]\n", "Ecut = 5\n", "\n", "# Silicon lattice\n", "a = 10.26\n", "lattice = a / 2 .* [[0 1 1.]; [1 0 1.]; [1 1 0.]]\n", "Si = ElementPsp(:Si, psp=load_psp(\"hgh/lda/Si-q4\"))\n", "atoms = [Si, Si]\n", "positions = [ones(3)/8, -ones(3)/8]\n", "\n", "# Compute the dielectric operator without symmetries\n", "model = model_LDA(lattice, atoms, positions, symmetries=false)\n", "basis = PlaneWaveBasis(model; Ecut, kgrid)\n", "scfres = self_consistent_field(basis, tol=1e-14)" ], "metadata": {}, "execution_count": 1 }, { "cell_type": "markdown", "source": [ "Apply ε† = 1 - χ0 (vc + fxc)" ], "metadata": {} }, { "outputs": [ { "output_type": "execute_result", "data": { "text/plain": "eps_fun (generic function with 1 method)" }, "metadata": {}, "execution_count": 2 } ], "cell_type": "code", "source": [ "function eps_fun(δρ)\n", " δV = apply_kernel(basis, δρ; ρ=scfres.ρ)\n", " χ0δV = apply_χ0(scfres, δV)\n", " δρ - χ0δV\n", "end" ], "metadata": {}, "execution_count": 2 }, { "cell_type": "markdown", "source": [ "eager diagonalizes the subspace matrix at each iteration" ], "metadata": {} }, { "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ Info: Arnoldi iteration step 1: normres = 0.049770845578473895\n", "[ Info: Arnoldi iteration step 2: normres = 0.578182068445808\n", "[ Info: Arnoldi iteration step 3: normres = 0.8782963057467941\n", "[ Info: Arnoldi iteration step 4: normres = 0.24887614991288218\n", "[ Info: Arnoldi iteration step 5: normres = 0.577844527719869\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 5: 0 values converged, normres = (3.27e-02, 8.09e-02, 5.30e-01, 2.13e-01, 1.11e-02)\n", "[ Info: Arnoldi iteration step 6: normres = 0.22990754962794702\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 6: 0 values converged, normres = (6.36e-03, 1.37e-01, 1.33e-01, 9.45e-02, 3.28e-02)\n", "[ Info: Arnoldi iteration step 7: normres = 0.10569735497873059\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 7: 0 values converged, normres = (3.28e-04, 1.36e-02, 1.15e-02, 7.34e-02, 6.84e-02)\n", "[ Info: Arnoldi iteration step 8: normres = 0.10982453541751029\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 8: 0 values converged, normres = (1.58e-05, 1.09e-03, 1.02e-03, 2.87e-02, 4.43e-02)\n", "[ Info: Arnoldi iteration step 9: normres = 0.07893422346465398\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 9: 0 values converged, normres = (5.40e-07, 6.18e-05, 6.41e-05, 8.25e-03, 3.15e-02)\n", "[ Info: Arnoldi iteration step 10: normres = 0.07450867058897619\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 10: 0 values converged, normres = (1.78e-08, 3.41e-06, 3.94e-06, 2.48e-03, 2.36e-02)\n", "[ Info: Arnoldi iteration step 11: normres = 0.06676809257815863\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 11: 0 values converged, normres = (5.06e-10, 1.58e-07, 2.02e-07, 4.89e-04, 9.25e-03)\n", "[ Info: Arnoldi iteration step 12: normres = 0.08108286031103705\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 12: 0 values converged, normres = (1.77e-11, 9.07e-09, 1.29e-08, 1.28e-04, 4.99e-03)\n", "[ Info: Arnoldi iteration step 13: normres = 0.14302867013006693\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 13: 0 values converged, normres = (1.07e-12, 8.86e-10, 1.40e-09, 5.03e-05, 3.49e-03)\n", "[ Info: Arnoldi iteration step 14: normres = 0.34203886545008877\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 14: 1 values converged, normres = (3.22e-13, 1.37e-09, 6.00e-09, 3.39e-01, 2.79e-03)\n", "[ Info: Arnoldi iteration step 15: normres = 0.16628599631693455\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 15: 1 values converged, normres = (2.42e-14, 2.63e-10, 4.23e-02, 5.19e-05, 3.18e-06)\n", "[ Info: Arnoldi iteration step 16: normres = 0.22329029777936607\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 16: 1 values converged, normres = (5.63e-15, 1.71e-09, 2.01e-01, 5.91e-03, 9.33e-02)\n", "[ Info: Arnoldi iteration step 17: normres = 0.031216239596333684\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 17: 1 values converged, normres = (7.59e-17, 1.61e-08, 4.45e-03, 1.05e-03, 1.23e-03)\n", "[ Info: Arnoldi iteration step 18: normres = 0.01997209185562723\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 18: 1 values converged, normres = (6.26e-19, 5.36e-05, 2.39e-05, 1.67e-05, 1.65e-05)\n", "[ Info: Arnoldi iteration step 19: normres = 0.13284828707020094\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 19: 1 values converged, normres = (3.49e-20, 2.22e-08, 5.29e-06, 1.26e-07, 2.34e-06)\n", "[ Info: Arnoldi iteration step 20: normres = 0.09204937057920475\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 20: 1 values converged, normres = (1.56e-21, 3.08e-08, 4.22e-07, 2.79e-08, 2.12e-07)\n", "[ Info: Arnoldi iteration step 21: normres = 0.032140650479469214\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 21: 1 values converged, normres = (2.11e-23, 7.70e-09, 5.12e-09, 2.93e-09, 4.25e-09)\n", "[ Info: Arnoldi iteration step 22: normres = 0.06002962342752244\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 22: 1 values converged, normres = (5.21e-25, 3.53e-11, 3.64e-10, 1.26e-10, 1.86e-10)\n", "[ Info: Arnoldi iteration step 23: normres = 0.37519558857346375\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 23: 1 values converged, normres = (1.69e-25, 7.12e-11, 5.42e-10, 4.28e-10, 6.26e-10)\n", "[ Info: Arnoldi iteration step 24: normres = 0.014968078087652192\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 24: 1 values converged, normres = (1.14e-27, 9.50e-12, 9.91e-13, 2.62e-03, 2.86e-03)\n", "[ Info: Arnoldi iteration step 25: normres = 0.08635359399108006\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 25: 3 values converged, normres = (4.10e-29, 5.45e-13, 5.64e-14, 3.09e-09, 4.54e-09)\n", "[ Info: Arnoldi iteration step 26: normres = 0.03418182180212235\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 26: 3 values converged, normres = (6.29e-31, 1.47e-15, 1.42e-14, 6.18e-06, 3.26e-06)\n", "[ Info: Arnoldi iteration step 27: normres = 0.020860480618887553\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 27: 3 values converged, normres = (5.38e-33, 2.00e-17, 1.93e-16, 1.80e-08, 4.13e-08)\n", "[ Info: Arnoldi iteration step 28: normres = 0.10399464655473044\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 28: 3 values converged, normres = (2.39e-34, 1.45e-18, 1.40e-17, 8.10e-09, 3.76e-09)\n", "[ Info: Arnoldi iteration step 29: normres = 0.045521347164416574\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 29: 3 values converged, normres = (4.67e-36, 4.63e-20, 4.47e-19, 5.02e-11, 3.16e-10)\n", "[ Info: Arnoldi iteration step 30: normres = 0.1457021314328316\n", "[ Info: Arnoldi schursolve in iter 1, krylovdim = 30: 3 values converged, normres = (3.31e-37, 5.66e-20, 5.87e-21, 7.32e-12, 4.55e-11)\n", "[ Info: Arnoldi schursolve in iter 2, krylovdim = 19: 3 values converged, normres = (3.31e-37, 5.87e-21, 5.66e-20, 7.32e-12, 4.55e-11)\n", "[ Info: Arnoldi iteration step 20: normres = 0.03587468465484492\n", "[ Info: Arnoldi schursolve in iter 2, krylovdim = 20: 4 values converged, normres = (5.02e-39, 1.45e-22, 1.40e-21, 2.00e-13, 1.25e-12)\n", "[ Info: Arnoldi iteration step 21: normres = 0.07405290402633795\n", "┌ Info: Arnoldi eigsolve finished after 2 iterations:\n", "│ * 6 eigenvalues converged\n", "│ * norm of residuals = (1.586138971844422e-40, 6.912024808935784e-23, 6.912024808935784e-23, 1.1456701049923521e-14, 7.0610213839956e-14, 1.2217247840672085e-14)\n", "└ * number of operations = 32\n" ] } ], "cell_type": "code", "source": [ "eigsolve(eps_fun, randn(size(scfres.ρ)), 5, :LM; eager=true, verbosity=3);" ], "metadata": {}, "execution_count": 3 } ], "nbformat_minor": 3, "metadata": { "language_info": { "file_extension": ".jl", "mimetype": "application/julia", "name": "julia", "version": "1.8.1" }, "kernelspec": { "name": "julia-1.8", "display_name": "Julia 1.8.1", "language": "julia" } }, "nbformat": 4 }