Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linear optical response and second-harmonic generation implementation & incorporation of many-body excitonic effects into the linear and quadratic optical responses #449

Open
wants to merge 30 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3529b6a
Addition of the new features within this contribution
peio-gg Jul 11, 2023
ae5721d
Figures to reproduce in the new example35
peio-gg Jul 11, 2023
d825ceb
Figures to reproduce in the new example35
peio-gg Jul 11, 2023
9a98f2c
Addition of the tutotial guide for the new examples 34 and 35
peio-gg Jul 11, 2023
34c2ccc
Addition of new references for the new examples in the tutorial guide…
peio-gg Jul 11, 2023
8ca03da
Addition of the new features decription for the linear optical respon…
peio-gg Jul 12, 2023
ba9f247
Addition of new parameters (temperature and intraband smearing energy…
peio-gg Jul 12, 2023
cbfbf4c
Addition of the description of the new utility mb.py for including ma…
peio-gg Jul 12, 2023
c30f647
Addition of the new examples (34 and 35) description within the READM…
peio-gg Jul 12, 2023
311a2a0
Addition of necessary files for example34
peio-gg Jul 12, 2023
258fbb8
Addition of necessary files for example35
peio-gg Jul 12, 2023
7ee6097
Addition of a new pseudopotential for example34
peio-gg Jul 12, 2023
200fa92
Addition of the new utility mb.py for including many-body excitonic e…
peio-gg Jul 12, 2023
d3a430e
Addition fof the parse script for the new functionality: eps
peio-gg Jul 12, 2023
f923df1
Addition fof the parse script for the new functionality: shg
peio-gg Jul 12, 2023
fc22c6f
Modification of the userconfig file for the new functionalities: eps …
peio-gg Jul 12, 2023
ec8a2f0
Modification of the jobconfig file for the new functionalities: eps &…
peio-gg Jul 12, 2023
2e7cd44
Test-run addition for the new functionality: eps
peio-gg Jul 12, 2023
a75be40
Test-run addition for the new functionality: shg
peio-gg Jul 12, 2023
1766baf
Addition of the subroutine utility_get_degen for calculating second-o…
peio-gg Jul 12, 2023
2fa2bc2
Addition of the new parameters: temperature & smr_gamma
peio-gg Jul 12, 2023
550df31
Addition of the subroutine wham_get_del2eig_a_b for calculating secon…
peio-gg Jul 12, 2023
15809fb
Addition of the new parameters: temperature & smr_gamma
peio-gg Jul 12, 2023
d6d479e
Addition of the read/write routines for the new parameters: temperatu…
peio-gg Jul 12, 2023
7f75c9e
Addition of the new parameters: temperature & smr_gamma for distribut…
peio-gg Jul 12, 2023
a67af76
Addition of the num_elec_per_state input for the berry module
peio-gg Jul 12, 2023
e4374d4
Implementation of the berry_get_eps_klist and berry_get_shg_klist sub…
peio-gg Jul 12, 2023
1aa1d93
Fixing long-line warnings
peio-gg Jul 12, 2023
4f3a74a
Fixing long-line warnings
peio-gg Jul 12, 2023
907008d
Fixing long-line warnings
peio-gg Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Addition fof the parse script for the new functionality: shg
peio-gg committed Jul 12, 2023
commit f923df14ed8626b4e006edd824eeb8e134c10f64
54 changes: 54 additions & 0 deletions test-suite/tools/parsers/parse_shg_dat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""
Parser function parse() to parse the <seedname>-shg*.dat output file of postw90.x.

"""
from __future__ import print_function

import inspect
import re
from collections import defaultdict

from . import show_output

def parse(fname):
"""
Open the file, parses it and return the values.
"""
retdict = defaultdict(list)

if show_output:
print("[{}.{}] Parsing file '{}'".format(
__name__, inspect.currentframe().f_code.co_name, fname))

with open(fname) as f:
lines = f.readlines()

for lno, l in enumerate(lines):

if l.strip().startswith('#'):
# Skip headers
continue

pieces = l.split()

if len(pieces) == 0 :
# skip blank line
continue

if len(pieces) == 5 :
retdict['energy'].append(float(pieces[0]))
retdict['re_chi'].append(float(pieces[1]))
retdict['im_chi'].append(float(pieces[2]))
retdict['re_sigma'].append(float(pieces[3]))
retdict['im_sigma'].append(float(pieces[4]))
else:
raise ValueError("Wrong line length ({}, instead of 3); line content: {}".format(
len(pieces)), l)


retdict = dict(retdict)
if show_output:
for k in sorted(retdict):
print(" {}: {}".format(k, retdict[k]))
print("-"*72)
return retdict