Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
parser-exciting
Commits
b4262dc0
Commit
b4262dc0
authored
Oct 24, 2017
by
Pardini, Lorenzo (lopa)
Browse files
Few gw metadata
parent
1208962b
Changes
2
Hide whitespace changes
Inline
Side-by-side
parser/parser-exciting/exciting_parser_gw.py
View file @
b4262dc0
...
...
@@ -21,9 +21,11 @@ class GWParser(object):
self
.
vertexLabels
=
[]
self
.
vertexNum
=
0
def
parseGW
(
self
,
gwFile
,
backend
,
dftMethodSectionGindex
,
dftSingleConfigurationGindex
,
xcName
,
unitCellVol
):
def
parseGW
(
self
,
gwFile
,
backend
,
dftMethodSectionGindex
,
dftSingleConfigurationGindex
,
xcName
,
unitCellVol
,
gmaxvr
):
# logging.error("GW onClose_section_single_configuration_calculation")
# print("xcNameGW=", xcName)
self
.
gmaxvr
=
float
(
gmaxvr
[
0
])
# print("gkmax= ",self.gmaxvr)
self
.
unitCellVol
=
float
(
unitCellVol
[
0
])
backend
.
openNonOverlappingSection
(
"section_single_configuration_calculation"
)
if
dftSingleConfigurationGindex
is
not
None
:
...
...
@@ -50,7 +52,7 @@ class GWParser(object):
if
os
.
path
.
exists
(
inputFile
):
selfGWSetGIndex
=
backend
.
openSection
(
"section_method"
)
backend
.
addValue
(
'electronic_structure_method'
,
"G0W0"
)
backend
.
addValue
(
'
x_exciting_
gw_starting_point'
,
xcName
)
backend
.
addValue
(
'gw_starting_point'
,
xcName
)
if
dftMethodSectionGindex
is
not
None
:
m2mGindex
=
backend
.
openNonOverlappingSection
(
"section_method_to_method_refs"
)
backend
.
addValue
(
"method_to_method_ref"
,
dftMethodSectionGindex
)
...
...
@@ -66,8 +68,13 @@ class GWParser(object):
fgrid
=
"gaule2"
lmaxmb
=
3
epsmb
=
0.0001
#
gmb = 1.0
gmb
=
1.0
sciavtype
=
"isotropic"
cutofftype
=
"none"
pwm
=
2.0
ngridq
=
[
2
,
2
,
2
]
freqmax
=
1.0
nomeg
=
16
k1
=
0
k2
=
0
# f1 = 0
...
...
@@ -90,8 +97,8 @@ class GWParser(object):
s
=
s
.
split
(
'='
)
if
s
[
0
]
==
"<gw"
:
k1
=
i
if
s
[
0
]
==
"</gw>"
:
k2
=
i
#
if s[0] == "<freqgrid": f1 = i
#
if s[0] == "</freqgrid>": f2 = i
if
s
[
0
]
==
"<freqgrid"
:
f1
=
i
if
s
[
0
]
==
"</freqgrid>"
:
f2
=
i
if
s
[
0
]
==
"<selfenergy"
:
s1
=
i
if
s
[
0
]
==
"</selfenergy>"
:
s2
=
i
if
s
[
0
]
==
"<mixbasis"
:
m1
=
i
...
...
@@ -100,6 +107,8 @@ class GWParser(object):
if
s
[
0
]
==
"</barecoul>"
:
bc2
=
i
if
s
[
0
]
==
"<scrcoul"
:
sc1
=
i
if
s
[
0
]
==
"</scrcoul>"
:
sc2
=
i
# print("m1= ",m1)
# print("m2= ",m2)
with
open
(
inputFile
)
as
g
:
i
=
0
while
1
:
...
...
@@ -108,43 +117,105 @@ class GWParser(object):
if
not
s
:
break
s
=
s
.
strip
()
s
=
s
.
split
(
'='
)
if
(
s
[
0
]
==
"coreflag"
)
and
(
i
>=
k1
):
if
(
s
[
0
]
==
"coreflag"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
))
:
coreflag
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"singularity"
)
and
(
i
>=
k1
):
elif
(
s
[
0
]
==
"coreflag"
)
and
(
i
==
(
k2
-
1
)):
coreflag
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"singularity"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
freq_conv
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"actype"
)
and
(
i
>=
k1
):
elif
(
s
[
0
]
==
"singularity"
)
and
(
i
==
(
k2
-
1
)):
freq_conv
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"actype"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
actype
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"npol"
)
and
(
i
>=
k1
):
npol
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
k1
)
and
(
i
<=
k2
):
pnempty
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"scrtype"
)
and
(
i
>=
k1
):
elif
(
s
[
0
]
==
"actype"
)
and
(
i
==
(
k2
-
1
)):
actype
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"ngridq"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
dummy
=
s
[
1
].
split
(
'"'
)
dummy1
=
dummy
[
1
].
split
()
for
j
in
range
(
0
,
3
):
ngridq
[
j
]
=
int
(
dummy1
[
j
])
elif
(
s
[
0
]
==
"ngrid"
)
and
(
i
==
(
k2
-
1
)):
dummy
=
s
[
1
].
split
(
'"'
)
dummy1
=
dummy
[
1
].
split
()
for
j
in
range
(
0
,
3
):
ngridq
[
j
]
=
int
(
dummy1
[
j
])
if
(
s
[
0
]
==
"npol"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
npol
=
int
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"npol"
)
and
(
i
==
(
k2
-
1
)):
npol
=
int
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
pnempty
=
int
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"nempty"
)
and
(
i
==
(
k2
-
1
)):
pnempty
=
int
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"scrtype"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
scrtype
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
s1
)
and
(
i
<=
s2
):
snempty
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
m1
)
and
(
i
<=
m2
):
lmaxmb
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
m1
)
and
(
i
<=
m2
):
epsmb
=
s
[
1
][
1
:
-
1
]
# if (s[0] == "nempty") and (i >= m1) and (i <= m2):
# gmb = s[1][1:-1]
if
(
s
[
0
]
==
"sciavtype"
)
and
(
i
>=
sc11
)
and
(
i
<=
sc2
):
elif
(
s
[
0
]
==
"scrtype"
)
and
(
i
==
(
k2
-
1
)):
scrtype
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"nempty"
)
and
(
i
>=
s1
)
and
(
i
<
(
s2
-
1
)):
snempty
=
int
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"nempty"
)
and
(
i
==
(
s2
-
1
)):
snempty
=
int
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"freqmax"
)
and
(
i
>=
f1
)
and
(
i
<
(
f2
-
1
)):
freqmax
=
float
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"freqmax"
)
and
(
i
==
(
f2
-
1
)):
freqmax
=
float
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"nomeg"
)
and
(
i
>=
f1
)
and
(
i
<
(
f2
-
1
)):
nomeg
=
int
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"nomeg"
)
and
(
i
==
(
f2
-
1
)):
nomeg
=
int
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"lmaxmb"
)
and
(
i
>=
m1
)
and
(
i
<
(
m2
-
1
)):
lmaxmb
=
int
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"lmaxmb"
)
and
(
i
==
(
m2
-
1
)):
lmaxmb
=
int
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"epsmb"
)
and
(
i
>=
m1
)
and
(
i
<
(
m2
-
1
)):
epsmb
=
float
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"epsmb"
)
and
(
i
==
(
m2
-
1
)):
epsmb
=
float
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"gmb"
)
and
(
i
>=
m1
)
and
(
i
<
(
m2
-
1
)):
gmb
=
float
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"gmb"
)
and
(
i
==
(
m2
-
1
)):
gmb
=
float
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"sciavtype"
)
and
(
i
>=
sc1
)
and
(
i
<
(
sc2
-
1
)):
sciavtype
=
s
[
1
][
1
:
-
1
]
if
(
s
[
0
]
==
"fgrid"
)
and
(
i
>=
k1
):
elif
(
s
[
0
]
==
"sciavtype"
)
and
(
i
==
(
sc2
-
1
)):
sciavtype
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"fgrid"
)
and
(
i
>=
k1
)
and
(
i
<
(
k2
-
1
)):
fgrid
=
s
[
1
][
1
:
-
1
]
backend
.
addValue
(
"x_exciting_gw_frequency_grid_type"
,
fgrid
)
backend
.
addValue
(
"x_exciting_gw_self_energy_c_empty_states"
,
int
(
snempty
))
backend
.
addValue
(
"x_exciting_gw_core_treatment"
,
coreflag
)
backend
.
addValue
(
"x_exciting_gw_self_energy_singularity_treatment"
,
singularity
)
backend
.
addValue
(
"x_exciting_gw_self_energy_c_analytical_continuation"
,
actype
)
backend
.
addValue
(
"x_exciting_gw_self_energy_c_number_of_poles"
,
int
(
npol
))
backend
.
addValue
(
"x_exciting_gw_screened_Coulomb"
,
scrtype
)
backend
.
addValue
(
"x_exciting_gw_polarizability_empty_states"
,
int
(
pnempty
))
backend
.
addValue
(
"x_exciting_gw_basis_set"
,
"mixed"
)
backend
.
addValue
(
"x_exciting_gw_mixed_basis_lmax"
,
lmaxmb
)
backend
.
addValue
(
"x_exciting_gw_mixed_basis_tolerance"
,
epsmb
)
# backend.addValue("x_exciting_gw_mixed_basis_gmax", gmb)
backend
.
addValue
(
"x_exciting_gw_screened_coulomb_volume_average"
,
sciavtype
)
elif
(
s
[
0
]
==
"fgrid"
)
and
(
i
==
(
k2
-
1
)):
fgrid
=
s
[
1
][
1
:
-
2
]
if
(
s
[
0
]
==
"pwm"
)
and
(
i
>=
bc1
)
and
(
i
<
(
bc2
-
1
)):
pwm
=
float
(
s
[
1
][
1
:
-
1
])
elif
(
s
[
0
]
==
"pwm"
)
and
(
i
==
(
bc2
-
1
)):
pwm
=
float
(
s
[
1
][
1
:
-
2
])
if
(
s
[
0
]
==
"cutofftype"
)
and
(
i
>=
bc1
)
and
(
i
<
(
bc2
-
1
)):
cutofftype
=
s
[
1
][
1
:
-
1
]
elif
(
s
[
0
]
==
"cutofftype"
)
and
(
i
==
(
bc2
-
1
)):
cutofftype
=
s
[
1
][
1
:
-
2
]
# gmb = gmb*self.gmaxvr
# pwm = pwm*gmb*self.gmaxvr
# print("gmb= ",type(gmb))
# print("pwm= ", type(pwm))
# print("self.gmaxvr= ",type(self.gmaxvr))
backend
.
addValue
(
"gw_frequency_grid_type"
,
fgrid
)
backend
.
addValue
(
"gw_self_energy_c_number_of_empty_states"
,
int
(
snempty
))
backend
.
addValue
(
"gw_core_treatment"
,
coreflag
)
backend
.
addValue
(
"gw_self_energy_singularity_treatment"
,
singularity
)
backend
.
addValue
(
"gw_self_energy_c_analytical_continuation"
,
actype
)
backend
.
addValue
(
"gw_self_energy_c_number_of_poles"
,
int
(
npol
))
backend
.
addValue
(
"gw_screened_Coulomb"
,
scrtype
)
backend
.
addValue
(
"gw_polarizability_number_of_empty_states"
,
int
(
pnempty
))
backend
.
addValue
(
"gw_basis_set"
,
"mixed"
)
backend
.
addValue
(
"gw_mixed_basis_lmax"
,
lmaxmb
)
backend
.
addValue
(
"gw_mixed_basis_tolerance"
,
epsmb
)
backend
.
addValue
(
"gw_mixed_basis_gmax"
,
gmb
*
self
.
gmaxvr
)
backend
.
addValue
(
"gw_screened_coulomb_volume_average"
,
sciavtype
)
backend
.
addValue
(
"gw_bare_coulomb_gmax"
,
pwm
*
gmb
*
self
.
gmaxvr
)
backend
.
addValue
(
"gw_ngridq"
,
ngridq
)
backend
.
addValue
(
"gw_bare_coulomb_cutofftype"
,
cutofftype
)
backend
.
addValue
(
"gw_max_frequency"
,
freqmax
)
backend
.
addValue
(
"gw_number_of_frequencies"
,
nomeg
)
backend
.
addValue
(
"gw_qp_equation_treatment"
,
"linearization"
)
# backend.addArrayValues
backend
.
closeSection
(
"section_method"
,
selfGWSetGIndex
)
if
os
.
path
.
exists
(
vertexGWFile
):
...
...
@@ -176,6 +247,7 @@ class GWParser(object):
eigvalGWGIndex
=
backend
.
openSection
(
"section_eigenvalues"
)
with
open
(
eigvalGWFile
)
as
g
:
qpGWKpoint
=
[]
Vxc
=
[[],[]]
Sx
=
[[],[]]
Sc
=
[[],[]]
qpE
=
[[],[]]
...
...
@@ -188,6 +260,7 @@ class GWParser(object):
if
"k-point"
in
s
.
split
():
qpGWKpoint
.
append
([])
for
i
in
range
(
0
,
2
):
Vxc
[
i
].
append
([])
Sx
[
i
].
append
([])
Sc
[
i
].
append
([])
qpE
[
i
].
append
([])
...
...
@@ -212,14 +285,16 @@ class GWParser(object):
Sc
[
i
][
-
1
].
append
(
fromH
(
float
(
s
[
5
])))
qpE
[
i
][
-
1
].
append
(
fromH
(
float
(
s
[
3
])))
Znk
[
i
][
-
1
].
append
(
float
(
s
[
9
]))
Vxc
[
i
][
-
1
].
append
(
fromH
(
float
(
s
[
6
])))
backend
.
addValue
(
"eigenvalues_kpoints"
,
qpGWKpoint
)
backend
.
addValue
(
"number_of_eigenvalues"
,
len
(
qpE
[
0
]))
backend
.
addValue
(
"number_of_eigenvalues_kpoints"
,
len
(
qpGWKpoint
))
backend
.
addValue
(
"eigenvalues_values"
,
qpE
)
backend
.
addValue
(
"
x_exciting_
gw_qp_linearization_prefactor"
,
Znk
)
backend
.
addValue
(
"gw_qp_linearization_prefactor"
,
Znk
)
backend
.
closeSection
(
"section_eigenvalues"
,
eigvalGWGIndex
)
backend
.
addValue
(
"x_exciting_gw_self_energy_x"
,
Sx
)
backend
.
addValue
(
"x_exciting_gw_self_energy_c"
,
Sc
)
backend
.
addValue
(
"gw_self_energy_x"
,
Sx
)
backend
.
addValue
(
"gw_self_energy_c"
,
Sc
)
backend
.
addValue
(
"gw_xc_potential"
,
Vxc
)
####################DOS######################
...
...
parser/parser-exciting/parser_exciting.py
View file @
b4262dc0
...
...
@@ -32,6 +32,7 @@ class ExcitingParserContext(object):
self
.
secRunIndex
=
None
self
.
unit_cell_vol
=
0
self
.
xcName
=
None
self
.
gmaxvr
=
0
def
onOpen_section_system
(
self
,
backend
,
gIndex
,
section
):
self
.
secSystemIndex
=
gIndex
...
...
@@ -61,7 +62,8 @@ class ExcitingParserContext(object):
dftMethodSectionGindex
=
self
.
secMethodIndex
,
dftSingleConfigurationGindex
=
self
.
secSingleConfIndex
,
xcName
=
self
.
xcName
,
unitCellVol
=
self
.
unit_cell_vol
)
unitCellVol
=
self
.
unit_cell_vol
,
gmaxvr
=
self
.
gmaxvr
)
# logging.error("Finished GW")
break
...
...
@@ -247,6 +249,8 @@ class ExcitingParserContext(object):
self
.
unit_cell_vol
=
section
[
"x_exciting_unit_cell_volume"
]
# print("self.unit_cell_vol= ",self.unit_cell_vol)
self
.
gmaxvr
=
section
[
"x_exciting_gmaxvr"
]
# print("gkmax= ", self.gkmax)
backend
.
addArrayValues
(
'configuration_periodic_dimensions'
,
np
.
asarray
([
True
,
True
,
True
]))
self
.
secSystemDescriptionIndex
=
gIndex
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment