-
Notifications
You must be signed in to change notification settings - Fork 0
/
CheckBandGaps.jl
54 lines (40 loc) · 1.52 KB
/
CheckBandGaps.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module CheckBandGaps
include("./SpectralLanczos.jl")
include("./TightBinding.jl")
include("./CoordsIO.jl")
using .SpectralLanczos, .TightBinding, .CoordsIO, PyCall, Base.Filesystem
py"""
import numpy as np
vir_lbls = np.load('vir_lbls.npy')
"""
lbls = PyArray(py"vir_lbls"o)[1:2]
rCC = 1.8
for (k, n) ∈ enumerate(lbls)
println("**** $n ****")
eocc_file = expanduser("~/Desktop/simulation_outputs/percolation/40x40/eARPACK/occupied/eARPACK_bigMAC-$n.npy")
eoccs = sort(PyArray(py"np.load($eocc_file)"o))
evirt_file = expanduser("~/Desktop/simulation_outputs/percolation/40x40/eARPACK/virtual/eARPACK_bigMAC-$n.npy")
evirts = sort(PyArray(py"np.load($evirt_file)"o))
posfile = expanduser("~/Desktop/simulation_outputs/percolation/40x40/structures/bigMAC-$(n)_relaxed.xsf")
pos, _ = read_xsf(posfile;read_forces=false)
py"""
from qcnico.remove_dangling_carbons import remove_dangling_carbons
rCC = $rCC
pos = remove_dangling_carbons($(PyObject(pos)),rCC)
"""
pos = PyArray(py"pos"o)
println("Constructing hamiltonian...")
H = lindbergHtb_sparse(pos,rCC)
println("Done!")
N = size(H,1)
nhalf = Int(floor(N/2))
eHOMO = eoccs[end]
eLUMO = evirts[1]
Δn[k,1], _ = count_evals(H, eHOMO)
Δn[k,2], _ = count_evals(H, eLUMO)
print('\n')
end
py"""
np.save('gap_check.npy', $(PyObject(Δn)))
"""
end