Skip to content

Commit 8e58aed

Browse files
committed
add absorptionFW
1 parent c465005 commit 8e58aed

File tree

1 file changed

+22
-24
lines changed

1 file changed

+22
-24
lines changed

atomate/vasp/fireworks/absorption.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -39,40 +39,39 @@ def __init__(
3939
db_file=DB_FILE,
4040
vasptodb_kwargs=None,
4141
parents=None,
42-
vasp_input_set_params={},
42+
vasp_input_set_params=None,
4343
**kwargs,
4444
):
4545
"""
46-
FW that calculates frequency dpendent dielectric function within
46+
FW that calculates frequency dependent dielectric function within
4747
indenpendent-particle-approxiamtion. A previous ground state calculation
48-
with WAVECAR is required by specifying mode = 'static'; in the case of no
48+
with the output WAVECAR is required by specifying mode = 'static'; in the case of no
4949
parent, a PBE functional ground state calculation will be performed and
50-
the WAVECAR will be saved. Then another calculation with 'ALGO = EXACT, LOPTICS = True'
51-
with variable NBANDS will be performed (MODE = "IPA"). This calculation
52-
can save the WAVECAR and WAVEDER in case one wants to run RPA level absorption
50+
the WAVECAR will be saved. Then, perform another calculation with 'ALGO = EXACT, LOPTICS = True'
51+
with variable NBANDS by specifying MODE = "IPA". This calculation will save the
52+
WAVECAR and WAVEDER in case one wants to run RPA level absorption
5353
spectra. For RPA-DFT absorption spectrum, run another mode = 'RPA' calculation
5454
with the WAVECAR, WAVEDER saved from previous IPA calc.
5555
Args:
5656
structure (Structure): Input structure. For an interpolation, this
5757
is a dummy structure. See interpolate arg description.
58-
name (str): Name for the polarization FireWork.
59-
static_name (str): Name for the SCF run to be used in PassCalcLoc
60-
if copy_vasp_outputs != True.
61-
mode: 'STATIC', 'IPA', or 'RPA'. Default is 'IPA'
58+
name (str): Name for the FireWork.
59+
mode: 'STATIC', 'IPA', or 'RPA'.
60+
nbands: number of bands to use, leave to None, and use nbands_factor instead
61+
nbands_factor: the multiplication of the number of bands
62+
reciprocal_density: k-point density
63+
nkred: reduced number of k-points, for RPA calculation use only, reduces the computing time
64+
nedos: energy mesh for DOS
6265
vasp_cmd (str): Command to run vasp.
66+
prev_calc_loc (bool or str): If true (default), copies outputs from previous calc. If
67+
a str value, retrieves a previous calculation output by name.
6368
vasp_input_set (str): string name for the VASP input set (e.g.,
6469
"MPAbsorptionSet").
65-
vasp_input_set_params (dict): Dict of vasp_input_set_kwargs.
6670
db_file (str): Path to file specifying db credentials.
6771
parents (Firework): Parents of this particular Firework. FW or list
6872
of FWS.
69-
vasp_cmd (str): Command to run vasp.
70-
prev_calc_loc (bool or str): If true (default), copies outputs from previous calc. If
71-
a str value, retrieves a previous calculation output by name. If False/None, will create
72-
new SCAN calculation using the provided structure.
73+
vasp_input_set_params (dict): Dict of vasp_input_set_kwargs.
7374
prev_calc_dir (str): Path to a previous calculation to copy from
74-
db_file (str): Path to file specifying db credentials.
75-
parents (Firework): Parents of this particular Firework. FW or list of FWs.
7675
vasptodb_kwargs (dict): kwargs to pass to VaspToDb
7776
**kwargs: Other kwargs that are passed to Firework.__init__.
7877
@@ -89,8 +88,6 @@ def __init__(
8988
structure.composition.reduced_formula if structure else "unknown", name, mode
9089
)
9190

92-
has_previous_calc = False
93-
9491
# define what wavecars to copy from the previous run
9592
if mode == "STATIC":
9693
wavecars = []
@@ -157,14 +154,14 @@ def __init__(
157154
# when mode = "static"
158155
elif mode == "STATIC":
159156
if prev_calc_dir:
160-
# Copy only the CONTCAR from previous calc directory
157+
# Copy only the CONTCAR from previous calc directory (often a relaxation run)
161158
t.append(CopyVaspOutputs(
162159
calc_dir=prev_calc_dir,
163160
contcar_to_poscar=True,
164161
additional_files=wavecars)
165162
)
166163

167-
t.append(WriteVaspStaticFromPrev(user_incar_settings={"LWAVE": "TRUE"}))
164+
t.append(WriteVaspStaticFromPrev(other_params = {"user_incar_settings": {"LWAVE": "TRUE"}}))
168165

169166
elif parents:
170167
# Copy only the CONTCAR from previous calc
@@ -176,7 +173,8 @@ def __init__(
176173
)
177174
)
178175

179-
t.append(WriteVaspStaticFromPrev(user_incar_settings={"LWAVE": "TRUE"}))
176+
t.append(
177+
WriteVaspStaticFromPrev(other_params = {"user_incar_settings": {"LWAVE": "TRUE"}}))
180178

181179
elif structure:
182180
vasp_input_set = MPStaticSet(
@@ -187,10 +185,10 @@ def __init__(
187185
)
188186

189187
else:
190-
raise ValueError("Must specify structure or previous calculation for Static calculation")
188+
raise ValueError("Must specify structure or previous calculation for static calculation")
191189

192190
else:
193-
raise ValueEroor("Must specify mode from 'STATIC', 'IPA', or 'RPA'")
191+
raise ValueEroor("Must specify a mode from 'STATIC', 'IPA', or 'RPA'")
194192

195193
# use the 'default' custodian handler group
196194
handler_group = "default"

0 commit comments

Comments
 (0)