-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_QuickArpackBigMAC_MD_frame.jl
66 lines (51 loc) · 1.74 KB
/
run_QuickArpackBigMAC_MD_frame.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
55
56
57
58
59
60
61
62
63
64
65
66
module run_QuickArpackBigMAC
include("./QuickArpackBigMAC.jl")
include("./SpectralLanczos.jl")
include("./CoordsIO.jl")
include("./TightBinding.jl")
using .QuickArpackBigMAC, .SpectralLanczos, .CoordsIO, .TightBinding
using LinearAlgebra, SparseArrays, PyCall, Base.Filesystem
#posfile = expanduser(ARGS[1])
#strucindex = parse(Int,split(split(split(posfile,'/')[end],'-')[2], '_')[1])
temp = parse(Int, ARGS[1])
frame_index = parse(Int, ARGS[2])
trajfile = "../../../lammps_MD/$(temp)K_no-rotate/dump_traj.xsf"
println("Reading coords from file: $trajfile...")
fullpos = get_frame(trajfile, frame_index)
println(size(fullpos))
const rCC::Float64 = 1.8 #max nearest neighbour distance in angstrom
py"""import numpy as np
from qcnico.remove_dangling_carbons import remove_dangling_carbons
rCC = $rCC
pos = remove_dangling_carbons($(PyObject(fullpos)),$rCC)
"""
pos = PyArray(py"pos"o)
println("Constructing hamiltonian...")
H = lindbergHtb_sparse(pos,rCC)
println("Done!")
py"""import numpy as np
frame = $frame_index
np.save(f"H-{frame}.npy",$(PyObject(H)))
"""
N = size(H,1)
if N % 2 != 0
error("Number of atoms needs to be even! We have N = $N.")
end
nhalf = Int(N/2)
#eps_QCFFPI = 2.7e-7
eps_tb = 1e-7
print("Estimating eHOMO...")
approx_eHOMO, Rspectrum = estimate_eHOMO(H,eps_tb*100) #Rspectrum = spectral range
print("Done! ")
println("Estimated eHOMO = $(approx_eHOMO) eV")
println("Spectral range = $Rspectrum eV")
print("Running one-shot Lanczos... ")
ε, ψ, iLUMO = LUMO_arpack_MAC(H, approx_eHOMO, Rspectrum)
nconv = size(ε,1)
println("Done! Obtained $nconv eigenvalues. iLUMO = $iLUMO")
py"""import numpy as np
ii = $iLUMO
np.save(f"eARPACK_bigMAC_iLUMO={ii}.npy",$(PyObject(ε)))
np.save(f"MOs_ARPACK_bigMAC_iLUMO={ii}.npy",$(PyObject(ψ)))
"""
end