Creating supercells with pymatgen

The Pymatgen python library allows to setup solid-state calculations using a flexible set of classes as well as an API to an online data base of structures. Its Structure and Lattice objects are directly supported by the DFTK load_atoms and load_lattice functions, such that DFTK may be readily used to run calculation on systems defined in pymatgen. Using the pymatgen_structure function a conversion from DFTK to pymatgen structures is also possible. In the following we use this to create a silicon supercell and find its LDA ground state using direct minimisation. To run this example Julia's PyCall package needs to be able to find an installation of pymatgen.

First we setup the silicon lattice in DFTK.

using DFTK

a = 10.263141334305942  # Lattice constant in Bohr
lattice = a / 2 .* [[0 1 1.]; [1 0 1.]; [1 1 0.]]
Si = ElementPsp(:Si, psp=load_psp("hgh/lda/Si-q4"))
atoms     = [Si, Si]
positions = [ones(3)/8, -ones(3)/8];

Next we make a [2, 2, 2] supercell using pymatgen

pystruct = pymatgen_structure(lattice, atoms, positions)
pystruct.make_supercell([2, 2, 2])
lattice   = load_lattice(pystruct)
positions = load_positions(pystruct)
atoms     = fill(Si, length(positions));

Setup an LDA model and discretize using a single k-point and a small Ecut of 5 Hartree.

model = model_LDA(lattice, atoms, positions)
basis = PlaneWaveBasis(model; Ecut=5, kgrid=(1, 1, 1))
PlaneWaveBasis discretization:
    Ecut                 : 5.0 Ha
    fft_size             : (32, 32, 32), 32768 total points
    kgrid type           : Monkhorst-Pack
    kgrid                : [1, 1, 1]
    num. irred. kpoints  : 1

    Discretized Model(lda_x+lda_c_pw, 3D):
        lattice (in Bohr)    : [0         , 10.2631   , 10.2631   ]
                               [10.2631   , 0         , 10.2631   ]
                               [10.2631   , 10.2631   , 0         ]
        unit cell volume     : 2162.1 Bohr³
    
        atoms                : Si₁₆
        atom potentials      : ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
                               ElementPsp(Si, psp="hgh/lda/si-q4")
    
        num. electrons       : 64
        spin polarization    : none
        temperature          : 0 Ha
    
        terms                : Kinetic()
                               AtomicLocal()
                               AtomicNonlocal()
                               Ewald()
                               PspCorrection()
                               Hartree()
                               Xc(DftFunctionals.Functional[lda_x, lda_c_pw])

Find the ground state using direct minimisation and newton (always using SCF is boring ...)

scfres = direct_minimization(basis; tol=1e-3);
ψ, _ = DFTK.select_occupied_orbitals(basis, scfres.ψ, scfres.occupation)
scfres_newton = newton(basis, ψ; tol=1e-12)
(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 =  1139), 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 =  1139), [0.0, 0.14054984958423578, 0.5621993983369431, 1.264948646258122, 2.2487975933477724, 3.513746239605895, 3.513746239605895, 2.2487975933477724, 1.264948646258122, 0.5621993983369431  …  1.1243987966738864, 2.014547844040713, 3.185796590576011, 4.638145036279781, 4.12279558780425, 2.7641470418233043, 1.6865981950108295, 0.8901490473668268, 0.37479959889129544, 0.14054984958423578]), 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 =  1139), [-0.3000838204844498 -0.38651676076138597 … -0.6442304016759319 -0.38651676076138597; -0.3865167607613855 -0.7681321217768902 … -0.25003406483655016 -0.24218268965121845; … ; -0.6442304016759325 -0.25003406483655144 … -3.021154286108645 -1.4664153489045082; -0.38651676076138664 -0.24218268965121906 … -1.4664153489045082 -0.7681321217768909;;; -0.38651676076138636 -0.768132121776891 … -0.2500340648365508 -0.24218268965121917; -0.768132121776891 -1.8161936706060129 … -0.13699557143111532 -0.3129884204939666; … ; -0.2500340648365512 -0.13699557143111618 … -0.9870510298301413 -0.5277759153846143; -0.2421826896512194 -0.31298842049396663 … -0.527775915384614 -0.31298842049396625;;; -0.6442304016759328 -1.4664153489045084 … -0.08831357031439235 -0.25003406483655155; -1.4664153489045086 -4.114878101698636 … -0.14040892324046153 -0.5277759153846154; … ; -0.08831357031439296 -0.14040892324046184 … -0.2698375024260708 -0.14040892324046036; -0.25003406483655166 -0.5277759153846152 … -0.14040892324046036 -0.13699557143111532;;; … ;;; -0.9859863776629753 -0.35824744851610085 … -4.090627806711935 -2.29024663594558; -0.35824744851610074 -0.08635610801077623 … -1.4293432742461858 -0.8160371791715014; … ; -4.090627806711936 -1.4293432742461873 … -8.358403967979378 -8.33163370910521; -2.290246635945581 -0.8160371791715015 … -8.33163370910521 -5.770468454471793;;; -0.6442304016759323 -0.250034064836551 … -3.0211542861086462 -1.4664153489045084; -0.25003406483655094 -0.13699557143111532 … -0.9870510298301413 -0.5277759153846147; … ; -3.0211542861086467 -0.9870510298301428 … -12.395558685839042 -8.358412346516134; -1.4664153489045086 -0.5277759153846152 … -8.358412346516134 -4.114878101698635;;; -0.3865167607613861 -0.24218268965121875 … -1.4664153489045078 -0.7681321217768909; -0.24218268965121853 -0.31298842049396564 … -0.5277759153846142 -0.31298842049396597; … ; -1.4664153489045084 -0.5277759153846157 … -8.358412346516134 -4.114878101698635; -0.7681321217768915 -0.3129884204939667 … -4.114878101698635 -1.8161936706060136]), 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 =  1139), ComplexF64[0.039452912441695784 + 0.0im 0.061120189138426866 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.035545620743758055 - 0.014723478195035007im 0.05414494805835375 - 0.0224275718197569im … 0.0037550740153000813 - 0.00906555061545225im -0.0037550740153000813 + 0.00906555061545225im; … ; 0.0 + 0.036896930431453305im 0.0 + 0.054608091620134955im … -0.018575895426229238 + 0.0im 0.0 + 0.0im; 0.014723478195035009 + 0.035545620743758055im 0.022427571819756905 + 0.05414494805835375im … 0.00906555061545225 + 0.0037550740153000813im 0.00906555061545225 + 0.0037550740153000813im], [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 =  1139)), 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 =  1139)), 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 =  1139), [0.4147537431690293 0.39667717340073305 … 0.35153735663248087 0.39667717340073344; 0.3966771734007332 0.37893916766752217 … 0.3294684992403434 0.3773084908157702; … ; 0.3515373566324807 0.3294684992403431 … 0.3055322803146656 0.3369272441461743; 0.39667717340073333 0.37730849081577 … 0.3369272441461743 0.3789391676675226;;; 0.39667717340073333 0.3789391676675223 … 0.32946849924034344 0.3773084908157705; 0.3789391676675224 0.3562927712405079 … 0.30816723398386436 0.36133865102719553; … ; 0.3294684992403432 0.308167233983864 … 0.2925295693553704 0.32135530620365743; 0.3773084908157702 0.3613386510271953 … 0.32135530620365754 0.3613386510271956;;; 0.35153735663248087 0.3369272441461743 … 0.27624730570260275 0.32946849924034355; 0.3369272441461744 0.31709362589533424 … 0.2653418753166573 0.32135530620365765; … ; 0.2762473057026025 0.2653418753166568 … 0.23782576133390798 0.26534187531665704; 0.3294684992403432 0.32135530620365726 … 0.2653418753166572 0.30816723398386436;;; … ;;; 0.3043050825406202 0.27477283611458037 … 0.28977472646894725 0.30205476271423237; 0.27477283611458037 0.24249812764598702 … 0.26708985527975937 0.2793703352786075; … ; 0.2897747264689476 0.2670898552797597 … 0.29263539728460625 0.29263539728460625; 0.3020547627142324 0.27937033527860766 … 0.29263539728460614 0.29811662665409683;;; 0.3515373566324807 0.329468499240343 … 0.30553228031466556 0.3369272441461743; 0.329468499240343 0.30816723398386375 … 0.2925295693553702 0.3213553062036573; … ; 0.3055322803146658 0.2925295693553704 … 0.28354300367580454 0.29263539728460614; 0.33692724414617425 0.3213553062036572 … 0.292635397284606 0.31709362589533435;;; 0.39667717340073333 0.37730849081577 … 0.33692724414617425 0.37893916766752256; 0.37730849081577006 0.361338651027195 … 0.32135530620365743 0.36133865102719537; … ; 0.33692724414617437 0.3213553062036573 … 0.292635397284606 0.3170936258953343; 0.3789391676675224 0.3613386510271953 … 0.31709362589533424 0.356292771240508]), 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 =  1139), [-0.511314964193465 -0.5025077544820489 … -0.4766324832577907 -0.5025077544820491; -0.5025077544820489 -0.4858848714601923 … -0.47647042401624995 -0.49665680133961126; … ; -0.47663248325779056 -0.4764704240162497 … -0.3891035353053051 -0.44527691908406697; -0.5025077544820491 -0.49665680133961104 … -0.445276919084067 -0.4858848714601926;;; -0.502507754482049 -0.48588487146019227 … -0.4764704240162499 -0.49665680133961126; -0.48588487146019244 -0.44768088614572027 … -0.46911089882616186 -0.4889624560175817; … ; -0.4764704240162497 -0.46911089882616147 … -0.43613878735067524 -0.46613036405018626; -0.49665680133961115 -0.48896245601758154 … -0.4661303640501864 -0.48896245601758176;;; -0.47663248325779056 -0.44527691908406675 … -0.4562036919120277 -0.4764704240162499; -0.44527691908406697 -0.38057362659163213 … -0.4513650797562188 -0.4661303640501864; … ; -0.4562036919120275 -0.45136507975621837 … -0.4363491190518316 -0.4513650797562187; -0.4764704240162497 -0.46613036405018604 … -0.4513650797562188 -0.46911089882616186;;; … ;;; -0.4421917735594027 -0.4499100439944881 … -0.3545229619998283 -0.4023490353971862; -0.4499100439944881 -0.4416961440262568 … -0.4041068100588272 -0.4355541400376868; … ; -0.3545229619998284 -0.40410681005882726 … -0.2948006187935126 -0.2948006187935126; -0.4023490353971862 -0.43555414003768683 … -0.29480061879351244 -0.3375734615379338;;; -0.4766324832577907 -0.47647042401624967 … -0.3891035353053051 -0.445276919084067; -0.4764704240162498 -0.46911089882616164 … -0.4361387873506753 -0.46613036405018626; … ; -0.3891035353053052 -0.4361387873506752 … -0.211865246190386 -0.2948006187935127; -0.4452769190840669 -0.46613036405018615 … -0.2948006187935126 -0.38057362659163224;;; -0.5025077544820491 -0.4966568013396111 … -0.445276919084067 -0.48588487146019255; -0.49665680133961115 -0.48896245601758154 … -0.4661303640501864 -0.48896245601758176; … ; -0.44527691908406686 -0.46613036405018615 … -0.29480061879351277 -0.38057362659163224; -0.48588487146019244 -0.48896245601758165 … -0.3805736265916323 -0.44768088614572055])], 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 =  1139), [0.0, 0.14054984958423578, 0.5621993983369431, 1.264948646258122, 2.2487975933477724, 3.513746239605895, 3.513746239605895, 2.2487975933477724, 1.264948646258122, 0.5621993983369431  …  1.1243987966738864, 2.014547844040713, 3.185796590576011, 4.638145036279781, 4.12279558780425, 2.7641470418233043, 1.6865981950108295, 0.8901490473668268, 0.37479959889129544, 0.14054984958423578]), 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 =  1139), [-0.3966450415088855 -0.4923473418427018 … -0.7693255283012417 -0.4923473418427016; -0.4923473418427012 -0.8750778255695604 … -0.39703598961245673 -0.36153100017505946; … ; -0.7693255283012423 -0.39703598961245806 … -3.1047255410992842 -1.5747650238424007; -0.4923473418427024 -0.3615310001750601 … -1.574765023842401 -0.8750778255695609;;; -0.492347341842702 -0.875077825569561 … -0.39703598961245723 -0.3615310001750599; -0.875077825569561 -1.9075817855112251 … -0.2979392362734128 -0.44061222548435275; … ; -0.39703598961245773 -0.2979392362734137 … -1.1306602478254462 -0.6725509732311432; -0.36153100017506035 -0.44061222548435286 … -0.6725509732311428 -0.4406122254843524;;; -0.7693255283012426 -1.5747650238424007 … -0.2682699565238173 -0.3970359896124579; -1.5747650238424011 -4.1783581023949345 … -0.32643212768002305 -0.6725509732311441; … ; -0.26826995652381797 -0.3264321276800234 … -0.4683608601439944 -0.32643212768002206; -0.3970359896124582 -0.672550973231144 … -0.32643212768002194 -0.2979392362734128;;; … ;;; -1.1238730686817577 -0.5333846563960085 … -4.155376042242816 -2.390540908628534; -0.5333846563960085 -0.285554124391046 … -1.5663602290252536 -0.9722209839305807; … ; -4.155376042242817 -1.5663602290252547 … -8.360569189488285 -8.333798930614117; -2.3905409086285347 -0.9722209839305807 … -8.333798930614117 -5.80992528935563;;; -0.7693255283012422 -0.3970359896124577 … -3.1047255410992856 -1.5747650238424011; -0.39703598961245773 -0.29793923627341323 … -1.1306602478254464 -0.6725509732311437; … ; -3.1047255410992864 -1.1306602478254477 … -12.323880928353624 -8.360577568025041; -1.5747650238424011 -0.6725509732311441 … -8.360577568025041 -4.178358102394933;;; -0.49234734184270185 -0.36153100017505985 … -1.5747650238424005 -0.8750778255695609; -0.3615310001750596 -0.4406122254843522 … -0.6725509732311432 -0.44061222548435236; … ; -1.574765023842401 -0.6725509732311445 … -8.360577568025041 -4.178358102394933; -0.8750778255695615 -0.440612225484353 … -4.178358102394934 -1.9075817855112263]), 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 =  1139), ComplexF64[0.039452912441695784 + 0.0im 0.061120189138426866 + 0.0im … 0.0 + 0.0im 0.0 + 0.0im; 0.035545620743758055 - 0.014723478195035007im 0.05414494805835375 - 0.0224275718197569im … 0.0037550740153000813 - 0.00906555061545225im -0.0037550740153000813 + 0.00906555061545225im; … ; 0.0 + 0.036896930431453305im 0.0 + 0.054608091620134955im … -0.018575895426229238 + 0.0im 0.0 + 0.0im; 0.014723478195035009 + 0.035545620743758055im 0.022427571819756905 + 0.05414494805835375im … 0.00906555061545225 + 0.0037550740153000813im 0.00906555061545225 + 0.0037550740153000813im], [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}[[7.23367813634801e-8 + 6.333945524739093e-7im -3.8069518409514885e-5 + 2.606875554895467e-6im … 0.012815246629018772 + 0.15270896028650444im 2.7304802584037798e-5 - 4.148689096049438e-6im; -3.3376325791424766e-7 + 4.9962274855229185e-6im 2.05610353726545e-5 - 4.008354007212492e-6im … -3.347418419672856e-7 + 2.659436141606946e-5im -3.409766489068537e-5 + 1.807882721158933e-6im; … ; -0.012129015566368192 + 0.021870924310663942im -2.1556492654639518e-5 + 2.09148290327035e-6im … 0.000801432095719068 + 0.20391011297649614im 2.266956542439287e-5 - 1.430910666000429e-6im; -1.3912311790587062e-6 + 3.2591391854098657e-6im 2.703398632836189e-5 - 9.587876872897553e-6im … -1.0337167979971405e-6 + 5.432115146317139e-5im -2.704078880920401e-5 - 3.12850016811476e-6im;;; -8.747966957360932e-6 - 2.5936338774274045e-5im -1.3489475487809974e-5 - 2.1634240322254017e-6im … -3.1921731427715935e-6 - 9.023423703817186e-6im 1.0850442877418806e-5 + 8.687955107721892e-7im; -5.001055854495412e-6 - 1.1757547062538676e-5im 1.9838649065052887e-5 + 3.044443954890467e-5im … -2.323959789787651e-6 - 6.473301394278238e-6im 6.57597314051407e-6 + 3.822618481313955e-5im; … ; -7.03540739688945e-6 - 2.1944570309641633e-5im -8.050358735849314e-6 - 5.312908142377744e-6im … -2.0900383083804634e-6 - 7.232293380808665e-6im 5.637168407176551e-6 - 1.2163815657044275e-5im; 2.5103124710859564e-6 - 8.558462631081894e-6im 2.4954739613405523e-5 + 2.8447823736284885e-5im … 3.375830393475421e-6 + 2.2003525013196767e-6im 7.998999587922082e-6 + 3.0204887987394096e-5im;;; 0.08526406616006948 - 0.02738625189001421im -1.6902687879318663e-5 + 3.206630319952652e-6im … 0.028358923545488912 + 0.03623617998809413im 1.9729323628666197e-5 - 1.931311772140973e-6im; 4.2336159298424694e-5 + 1.354106558990249e-6im 2.8754411521394035e-5 - 8.836365400376617e-7im … 1.6355684298208167e-5 - 1.885913122485122e-6im -9.566857685260895e-6 + 1.7924268046289635e-6im; … ; 0.02114647151562609 - 0.0015946867164633393im -6.904702683146957e-6 + 9.415732297220541e-7im … -0.015204704252210953 + 0.08952938005653896im 6.481814145662807e-6 - 6.884210681761556e-7im; 1.797799013703112e-5 + 1.502318345362505e-6im 2.8243657639732565e-5 - 5.255960310271979e-6im … -3.0855052481783224e-6 + 2.2061998037031374e-5im -1.0823655883401931e-5 - 2.1890360842957057e-6im;;; … ;;; 4.285300594134516e-6 + 1.3266436329642215e-5im -1.6558810570299256e-5 - 1.594819541441275e-5im … 3.056515227434981e-6 + 9.71270355541502e-6im 1.9748351498452403e-6 - 8.103643820596247e-6im; -2.8511516251762194e-6 - 4.375036248856086e-6im 1.9249939175972545e-5 + 1.9382928231937493e-5im … 1.1102807713546552e-6 + 3.476689302046728e-6im 7.871751917174303e-6 + 1.8000725415781837e-5im; … ; -2.6919792777467696e-6 - 9.61402371540758e-6im -2.3105703848070463e-6 - 1.1761739302123745e-5im … -2.4965610425433796e-6 - 8.554072129953916e-6im 1.1698462084674624e-5 - 4.606770854318156e-6im; 1.9044213851926613e-6 - 1.7476722663142054e-6im 1.5041646573466934e-5 + 1.418600700488197e-5im … 4.601179362728585e-6 + 9.060846494238336e-6im -7.385080651801581e-8 + 8.479251758238973e-6im;;; 0.08526406616006965 - 0.027386251890014424im -4.366223477956216e-6 + 5.586418347617651e-7im … 0.11455745222899194 + 0.14637727565103437im 6.136897687976392e-5 - 4.881702889825586e-6im; 1.836774972038518e-5 + 2.142571158901156e-6im 7.06627670558054e-6 - 2.519706728001731e-6im … 2.761279936882239e-5 + 3.503388514672077e-5im -2.7164775819101825e-5 + 2.1176999662819283e-6im; … ; 0.08542232330393787 - 0.00644276033952383im 1.695344620769875e-5 + 3.5957951081323524e-7im … 0.08595013946434588 + 0.1471922513449576im 5.059866880259566e-5 - 1.452623601058794e-6im; 4.107006929004778e-5 - 7.256824319990452e-7im 1.0645739505776568e-5 - 4.9306871487780654e-6im … 4.158214777563176e-5 + 5.0267182346057726e-5im -2.313706680437441e-5 + 7.550561928507117e-8im;;; 1.943402950328483e-6 + 6.527884509039024e-6im -2.8723550772928685e-5 - 2.3152466996489342e-5im … 6.772329208058345e-6 + 2.149620380618547e-5im -2.9061364144892464e-6 - 1.82781483870665e-5im; -6.123533593884187e-6 - 1.1671269812133551e-5im 3.570290249350938e-5 + 4.3014450805648404e-5im … -1.964286590817547e-6 + 2.7505126577149185e-7im 1.8747162468229376e-5 + 4.477151505673387e-5im; … ; -1.879711209985175e-6 - 7.592390667552396e-6im -1.883972798847636e-5 - 2.7021197979450397e-5im … 2.0928265976570286e-6 + 4.738996697786991e-6im -3.1673213781743698e-6 - 2.9535367176154828e-5im; 1.6865247947222036e-6 - 6.799876971712187e-6im 3.7125928941268886e-5 + 3.499315397973218e-5im … 3.7781474531357175e-6 + 8.767680790899822e-6im 1.6662199404275532e-5 + 3.071006089452094e-5im]],))]), basis = PlaneWaveBasis(model = Model(lda_x+lda_c_pw, spin_polarization = :none), Ecut = 5.0 Ha, kgrid = [1, 1, 1]), energies = Energies(total = -62.277715861368264), converged = true, ρ = [0.09610720131645252 0.09085401337903731 … 0.07655587366892057 0.09085401337903748; 0.09085401337903735 0.0814777699093837 … 0.07647151840790542 0.08747433053333155; … ; 0.07655587366892046 0.0764715184079053 … 0.039565804955566004 0.06138424717760115; 0.09085401337903745 0.08747433053333144 … 0.06138424717760118 0.08147776990938387;;; 0.09085401337903738 0.08147776990938368 … 0.07647151840790538 0.08747433053333159; 0.08147776990938375 0.06246757364720446 … 0.07270707893262957 0.083161488152493; … ; 0.07647151840790532 0.07270707893262938 … 0.0573830845266439 0.07121914197097814; 0.0874743305333315 0.08316148815249291 … 0.07121914197097821 0.08316148815249304;;; 0.07655587366892047 0.061384247177601055 … 0.06641329348308396 0.07647151840790538; 0.06138424717760115 0.03680319832570172 … 0.06415300528581826 0.07121914197097821; … ; 0.06641329348308386 0.06415300528581805 … 0.05747311921178381 0.0641530052858182; 0.07647151840790532 0.07121914197097803 … 0.06415300528581824 0.07270707893262957;;; … ;;; 0.06001281548290847 0.06348370462360756 … 0.029186011399814922 0.04413141881688758; 0.06348370462360756 0.059794460955252635 … 0.044763120215037776 0.05713332556637921; … ; 0.02918601139981494 0.04476312021503781 … 0.015925084145457517 0.01592508414545752; 0.04413141881688758 0.057133325566379234 … 0.0159250841454575 0.024857443207089387;;; 0.07655587366892051 0.07647151840790527 … 0.03956580495556601 0.06138424717760117; 0.07647151840790535 0.07270707893262944 … 0.057383084526643924 0.07121914197097817; … ; 0.03956580495556604 0.05738308452664387 … 0.0053378787650426454 0.01592508414545754; 0.061384247177601124 0.0712191419709781 … 0.01592508414545752 0.036803198325701766;;; 0.09085401337903747 0.08747433053333145 … 0.06138424717760117 0.08147776990938385; 0.08747433053333149 0.08316148815249291 … 0.07121914197097821 0.08316148815249305; … ; 0.06138424717760113 0.07121914197097812 … 0.015925084145457548 0.03680319832570176; 0.08147776990938378 0.08316148815249297 … 0.03680319832570177 0.06246757364720459;;;;], eigenvalues = Any[[-0.16217594588317258, -0.07512573394494348, -0.07512573394494343, -0.07512573394494307, -0.07512573394494278, -0.010168114055590476, -0.010168114055590425, -0.010168114055590347, -0.010168114055590306, -0.010168114055590096  …  0.2243629990120929, 0.22436299901209295, 0.22436299901209295, 0.22436299901209297, 0.22436299901209308, 0.22436299901209322, 0.2243629990120933, 0.27059897188676124, 0.2705989718867614, 0.2705989718867615]], occupation = [[2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0  …  2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0]], εF = nothing, n_iter = 4, ψ = Matrix{ComplexF64}[[-0.10858779705633284 - 0.9508153064945394im 5.250045732353714e-16 - 1.0220748469032433e-15im … -1.4855761460802431e-16 - 4.311281234494141e-17im -5.883559673055335e-17 + 4.282842103290078e-17im; -8.313120157532605e-17 - 9.55690333728082e-16im -0.2990906889037568 + 0.20592530378512006im … -1.7684353872775282e-16 + 1.2712185769097814e-16im 1.8286679001567815e-16 - 3.316405039043707e-16im; … ; -1.1424928623331772e-16 + 1.0231819189653046e-16im -1.0952644227766456e-16 - 2.0244765065735582e-16im … 3.9375173586063406e-16 + 1.537540982119584e-15im -9.922279469408435e-16 + 2.464962438266001e-15im; -3.859827496684176e-16 - 1.5021621099786664e-16im 0.006952759376661399 - 0.4396283332900167im … -8.162687106100242e-17 - 3.013268887880338e-16im 5.457390927512094e-16 - 1.0762874966263603e-15im]], stage = :finalize, algorithm = "Newton")
scfres_newton.energies
Energy breakdown (in Ha):
    Kinetic             25.7697876
    AtomicLocal         -18.8616201
    AtomicNonlocal      14.8540134
    Ewald               -67.1831486
    PspCorrection       -2.3569765
    Hartree             4.8508714 
    Xc                  -19.3506430

    total               -62.277715861368