digichem-core 6.0.0rc1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- digichem/__init__.py +75 -0
- digichem/basis.py +116 -0
- digichem/config/README +3 -0
- digichem/config/__init__.py +5 -0
- digichem/config/base.py +321 -0
- digichem/config/locations.py +14 -0
- digichem/config/parse.py +90 -0
- digichem/config/util.py +117 -0
- digichem/data/README +4 -0
- digichem/data/batoms/COPYING +18 -0
- digichem/data/batoms/LICENSE +674 -0
- digichem/data/batoms/README +2 -0
- digichem/data/batoms/__init__.py +0 -0
- digichem/data/batoms/batoms-renderer.py +351 -0
- digichem/data/config/digichem.yaml +714 -0
- digichem/data/functionals.csv +15 -0
- digichem/data/solvents.csv +185 -0
- digichem/data/tachyon/COPYING.md +5 -0
- digichem/data/tachyon/LICENSE +30 -0
- digichem/data/tachyon/tachyon_LINUXAMD64 +0 -0
- digichem/data/vmd/common.tcl +468 -0
- digichem/data/vmd/generate_combined_orbital_images.tcl +70 -0
- digichem/data/vmd/generate_density_images.tcl +45 -0
- digichem/data/vmd/generate_dipole_images.tcl +68 -0
- digichem/data/vmd/generate_orbital_images.tcl +57 -0
- digichem/data/vmd/generate_spin_images.tcl +66 -0
- digichem/data/vmd/generate_structure_images.tcl +40 -0
- digichem/datas.py +14 -0
- digichem/exception/__init__.py +7 -0
- digichem/exception/base.py +133 -0
- digichem/exception/uncatchable.py +63 -0
- digichem/file/__init__.py +1 -0
- digichem/file/base.py +364 -0
- digichem/file/cube.py +284 -0
- digichem/file/fchk.py +94 -0
- digichem/file/prattle.py +277 -0
- digichem/file/types.py +97 -0
- digichem/image/__init__.py +6 -0
- digichem/image/base.py +113 -0
- digichem/image/excited_states.py +335 -0
- digichem/image/graph.py +293 -0
- digichem/image/orbitals.py +239 -0
- digichem/image/render.py +617 -0
- digichem/image/spectroscopy.py +797 -0
- digichem/image/structure.py +115 -0
- digichem/image/vmd.py +826 -0
- digichem/input/__init__.py +3 -0
- digichem/input/base.py +78 -0
- digichem/input/digichem_input.py +500 -0
- digichem/input/gaussian.py +140 -0
- digichem/log.py +179 -0
- digichem/memory.py +166 -0
- digichem/misc/__init__.py +4 -0
- digichem/misc/argparse.py +44 -0
- digichem/misc/base.py +61 -0
- digichem/misc/io.py +239 -0
- digichem/misc/layered_dict.py +285 -0
- digichem/misc/text.py +139 -0
- digichem/misc/time.py +73 -0
- digichem/parse/__init__.py +13 -0
- digichem/parse/base.py +220 -0
- digichem/parse/cclib.py +138 -0
- digichem/parse/dump.py +253 -0
- digichem/parse/gaussian.py +130 -0
- digichem/parse/orca.py +96 -0
- digichem/parse/turbomole.py +201 -0
- digichem/parse/util.py +523 -0
- digichem/result/__init__.py +6 -0
- digichem/result/alignment/AA.py +114 -0
- digichem/result/alignment/AAA.py +61 -0
- digichem/result/alignment/FAP.py +148 -0
- digichem/result/alignment/__init__.py +3 -0
- digichem/result/alignment/base.py +310 -0
- digichem/result/angle.py +153 -0
- digichem/result/atom.py +742 -0
- digichem/result/base.py +258 -0
- digichem/result/dipole_moment.py +332 -0
- digichem/result/emission.py +402 -0
- digichem/result/energy.py +323 -0
- digichem/result/excited_state.py +821 -0
- digichem/result/ground_state.py +94 -0
- digichem/result/metadata.py +644 -0
- digichem/result/multi.py +98 -0
- digichem/result/nmr.py +1086 -0
- digichem/result/orbital.py +647 -0
- digichem/result/result.py +244 -0
- digichem/result/soc.py +272 -0
- digichem/result/spectroscopy.py +514 -0
- digichem/result/tdm.py +267 -0
- digichem/result/vibration.py +167 -0
- digichem/test/__init__.py +6 -0
- digichem/test/conftest.py +4 -0
- digichem/test/test_basis.py +71 -0
- digichem/test/test_calculate.py +30 -0
- digichem/test/test_config.py +78 -0
- digichem/test/test_cube.py +369 -0
- digichem/test/test_exception.py +16 -0
- digichem/test/test_file.py +104 -0
- digichem/test/test_image.py +337 -0
- digichem/test/test_input.py +64 -0
- digichem/test/test_parsing.py +79 -0
- digichem/test/test_prattle.py +36 -0
- digichem/test/test_result.py +489 -0
- digichem/test/test_translate.py +112 -0
- digichem/test/util.py +207 -0
- digichem/translate.py +591 -0
- digichem_core-6.0.0rc1.dist-info/METADATA +96 -0
- digichem_core-6.0.0rc1.dist-info/RECORD +111 -0
- digichem_core-6.0.0rc1.dist-info/WHEEL +4 -0
- digichem_core-6.0.0rc1.dist-info/licenses/COPYING.md +10 -0
- digichem_core-6.0.0rc1.dist-info/licenses/LICENSE +11 -0
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
# Hidden import for speed.
|
|
2
|
+
#import colour
|
|
3
|
+
# from digichem.result.spectroscopy import Spectroscopy_graph,\
|
|
4
|
+
# Absorption_emission_graph
|
|
5
|
+
|
|
6
|
+
# General imports.
|
|
7
|
+
from itertools import filterfalse, zip_longest
|
|
8
|
+
import numpy
|
|
9
|
+
import math
|
|
10
|
+
import warnings
|
|
11
|
+
import itertools
|
|
12
|
+
|
|
13
|
+
from digichem.misc.text import andjoin
|
|
14
|
+
from digichem.exception.base import Result_unavailable_error
|
|
15
|
+
from digichem.result import Result_container
|
|
16
|
+
from digichem.result import Result_object
|
|
17
|
+
from digichem.result.base import Floatable_mixin
|
|
18
|
+
import digichem.log
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Excited_state_list(Result_container):
|
|
22
|
+
"""
|
|
23
|
+
Class for representing a group of excited states.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
def __init__(self, *args, **kwargs):
|
|
27
|
+
super().__init__(*args, **kwargs)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def singlet_triplet_energy(self):
|
|
31
|
+
"""
|
|
32
|
+
Get ΔE st; the energy difference between the T1 and S1 excited states.
|
|
33
|
+
|
|
34
|
+
The returned value is positive if S1 is higher in energy than T1 (the usual case), negative otherwise.
|
|
35
|
+
|
|
36
|
+
:return: The singlet-triplet splitting energy (in eV).
|
|
37
|
+
"""
|
|
38
|
+
# Get our two states of interest.
|
|
39
|
+
S1 = self.get_state("S(1)")
|
|
40
|
+
T1 = self.get_state("T(1)")
|
|
41
|
+
# Calculate their difference.))
|
|
42
|
+
return float(S1) - float(T1)
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
def multiplicity_strings(self):
|
|
46
|
+
"""
|
|
47
|
+
Get a string describing the different multiplicities of the excited states of this list.
|
|
48
|
+
"""
|
|
49
|
+
group = self.group()
|
|
50
|
+
mults = []
|
|
51
|
+
for excited_states in group.values():
|
|
52
|
+
mults.append(excited_states[0].multiplicity_string)
|
|
53
|
+
|
|
54
|
+
return andjoin(mults)
|
|
55
|
+
|
|
56
|
+
def difference(self, state1, state2):
|
|
57
|
+
"""
|
|
58
|
+
Get the difference in energy between the states by given labels.
|
|
59
|
+
|
|
60
|
+
The returned energy difference will always be positive.
|
|
61
|
+
|
|
62
|
+
:param state1: State symbol of the first state.
|
|
63
|
+
:param state2: State symbol of the second state.
|
|
64
|
+
"""
|
|
65
|
+
states = (self.get_state(state_symbol = state1).energy, self.get_state(state_symbol = state2).energy)
|
|
66
|
+
return max(states) - min(states)
|
|
67
|
+
|
|
68
|
+
def find(self, criteria = None, *, state_symbol = None, level = None, mult_level = None):
|
|
69
|
+
"""
|
|
70
|
+
Retrieve a particular excited state from its state symbol (S(1), T(1) etc.).
|
|
71
|
+
|
|
72
|
+
For multiplicities from 1 -> 4, single capital letters are used ('S', 'D', 'T' or 'Q' respectively). For higher multiplicities, the integer representation is used ('5', '6', '7' and so on).
|
|
73
|
+
The multiplicity level follows in brackets, eg ('S(1)') refers to the first (lowest energy) singlet state.
|
|
74
|
+
|
|
75
|
+
See Excited_state.state_symbol() for a full description of possible symbols.
|
|
76
|
+
|
|
77
|
+
:raises ValueError: If the requested symbol could not be found in this list.
|
|
78
|
+
:param criteria: Automatically determine which criteria to search by.
|
|
79
|
+
:param state_symbol: The symbol (a string) to retrieve.
|
|
80
|
+
:param level: The level (an int or string that looks like an int) to retrieve.
|
|
81
|
+
:param mult_level: The multiplicity and multiplicity level (as a tuple, eg '(1,1)' for S(1), '(3,2)' for T(2)) to retrieve.
|
|
82
|
+
:return: The requested excited state object.
|
|
83
|
+
"""
|
|
84
|
+
if criteria is not None:
|
|
85
|
+
if isinstance(criteria, tuple):
|
|
86
|
+
mult_level = criteria
|
|
87
|
+
elif criteria.isdigit() or isinstance(criteria, int):
|
|
88
|
+
level = int(criteria)
|
|
89
|
+
else:
|
|
90
|
+
state_symbol = criteria
|
|
91
|
+
|
|
92
|
+
# Now get our search func.
|
|
93
|
+
if state_symbol is not None:
|
|
94
|
+
filter_func = lambda state: state.state_symbol != state_symbol
|
|
95
|
+
elif level is not None:
|
|
96
|
+
filter_func = lambda state: state.level != level
|
|
97
|
+
elif mult_level is not None:
|
|
98
|
+
filter_func = lambda state: state.multiplicity != mult_level[0] or state.multiplicity_level != mult_level[1]
|
|
99
|
+
else:
|
|
100
|
+
raise ValueError("Missing criteria to search by; specify one of 'criteria', 'state_symbol', 'level' or 'mult_level'")
|
|
101
|
+
|
|
102
|
+
try:
|
|
103
|
+
return next(filterfalse(filter_func, self))
|
|
104
|
+
except Exception:
|
|
105
|
+
# Determine what we searched by for better error reporting.
|
|
106
|
+
if state_symbol is not None:
|
|
107
|
+
criteria_string = "symbol = '{}'".format(state_symbol)
|
|
108
|
+
|
|
109
|
+
elif level is not None:
|
|
110
|
+
criteria_string = "level = '{}'".format(level)
|
|
111
|
+
|
|
112
|
+
else:
|
|
113
|
+
criteria_string = "mult_level = '{}'".format(mult_level)
|
|
114
|
+
|
|
115
|
+
raise Result_unavailable_error("Excited state", "could not find excited state with {}".format(criteria_string)) from None
|
|
116
|
+
|
|
117
|
+
def get_state(self, *args, **kwargs):
|
|
118
|
+
warnings.warn("get_state() is deprecated use find() instead", DeprecationWarning)
|
|
119
|
+
return self.find(*args, **kwargs)
|
|
120
|
+
|
|
121
|
+
def group(self):
|
|
122
|
+
"""
|
|
123
|
+
Group the excited states in this list by multiplicity.
|
|
124
|
+
|
|
125
|
+
:return: A dictionary of grouped excited states. Each key will correspond to a multiplicity (1, 2, 3 etc) and each value will be an Excited_state_list of states with that multiplicity.
|
|
126
|
+
"""
|
|
127
|
+
# Dictionary of grouped states.
|
|
128
|
+
grouped_excited_states = {}
|
|
129
|
+
|
|
130
|
+
for excited_state in self:
|
|
131
|
+
# Group each ES by multiplicity.
|
|
132
|
+
try:
|
|
133
|
+
# Try and append to our list.
|
|
134
|
+
grouped_excited_states[excited_state.multiplicity].append(excited_state)
|
|
135
|
+
except KeyError:
|
|
136
|
+
# No list exists yet.
|
|
137
|
+
grouped_excited_states[excited_state.multiplicity] = type(self)([excited_state])
|
|
138
|
+
|
|
139
|
+
# Sorting hack for old version of python that didn't technically support sorted dicts (although the sort order was secretly maintained).
|
|
140
|
+
# Just make a new dict that is sorted from the start:
|
|
141
|
+
sorted_group = {}
|
|
142
|
+
for mult in sorted(grouped_excited_states):
|
|
143
|
+
sorted_group[mult] = grouped_excited_states[mult]
|
|
144
|
+
|
|
145
|
+
return sorted_group
|
|
146
|
+
|
|
147
|
+
def group_pairs(self):
|
|
148
|
+
"""
|
|
149
|
+
Return all the unique pair combinations of the different multiplicities of this list.
|
|
150
|
+
|
|
151
|
+
:returns: A two membered tuple, where the first element is a list of pairs of multiplicities [(1, 2), (1, 3), (2, 3)] etc, and the second is a grouped dictionary of multiplicites (see group()).
|
|
152
|
+
"""
|
|
153
|
+
group = self.group()
|
|
154
|
+
return (list(itertools.combinations(group, 2)), group)
|
|
155
|
+
|
|
156
|
+
@property
|
|
157
|
+
def num_singlets(self):
|
|
158
|
+
"""
|
|
159
|
+
The number of singlet excited states in this list.
|
|
160
|
+
"""
|
|
161
|
+
grouped_states = self.group()
|
|
162
|
+
return len(grouped_states[1]) if 1 in grouped_states else 0
|
|
163
|
+
|
|
164
|
+
@property
|
|
165
|
+
def num_triplets(self):
|
|
166
|
+
"""
|
|
167
|
+
The number of triplet excited states in this list.
|
|
168
|
+
"""
|
|
169
|
+
grouped_states = self.group()
|
|
170
|
+
return len(grouped_states[3]) if 3 in grouped_states else 0
|
|
171
|
+
|
|
172
|
+
@classmethod
|
|
173
|
+
def from_parser(self, parser):
|
|
174
|
+
"""
|
|
175
|
+
Create an Excited_state_list object from an output file parser.
|
|
176
|
+
|
|
177
|
+
:param parser: An output file parser.
|
|
178
|
+
:return: The populated Excited_state_list object.
|
|
179
|
+
"""
|
|
180
|
+
return self(Excited_state.list_from_parser(parser))
|
|
181
|
+
|
|
182
|
+
def assign_levels(self):
|
|
183
|
+
"""
|
|
184
|
+
(Re)assign total and multiplicity levels of the excited states in this list.
|
|
185
|
+
|
|
186
|
+
The contents of this list will be modified in place.
|
|
187
|
+
"""
|
|
188
|
+
# A dictionary of multiplicities that we've seen so far.
|
|
189
|
+
multiplicities = {}
|
|
190
|
+
total_level = 0
|
|
191
|
+
|
|
192
|
+
for state in self:
|
|
193
|
+
# (try) and add this state's multiplicity to our dict (if we get a key error that just means it's the first time we've seen this mult).
|
|
194
|
+
try:
|
|
195
|
+
multiplicities[state.multiplicity] += 1
|
|
196
|
+
except KeyError:
|
|
197
|
+
# First time we've seen this mult, set to 1.
|
|
198
|
+
multiplicities[state.multiplicity] = 1
|
|
199
|
+
|
|
200
|
+
# Increment total level.
|
|
201
|
+
total_level += 1
|
|
202
|
+
|
|
203
|
+
# Set mult and total level.
|
|
204
|
+
state.multiplicity_level = multiplicities[state.multiplicity]
|
|
205
|
+
state.level = total_level
|
|
206
|
+
|
|
207
|
+
@classmethod
|
|
208
|
+
def merge(self, *multiple_lists, **kwargs):
|
|
209
|
+
"""
|
|
210
|
+
Merge multiple lists of of the same type into a single, ordered list.
|
|
211
|
+
|
|
212
|
+
Note that this method will return a new list object, but will modify the contained objects (eg, object.level) in place.
|
|
213
|
+
Inheriting classes may safely override this method.
|
|
214
|
+
"""
|
|
215
|
+
# A dictionary where each key is a multiplcity and each value is a list of excited states with that mult.
|
|
216
|
+
multiplicities = {}
|
|
217
|
+
for excited_states in multiple_lists:
|
|
218
|
+
group = excited_states.group()
|
|
219
|
+
for multiplicity in group:
|
|
220
|
+
if multiplicity not in multiplicities:
|
|
221
|
+
# Firt time we've seen this mult, add.
|
|
222
|
+
multiplicities[multiplicity] = group[multiplicity]
|
|
223
|
+
|
|
224
|
+
else:
|
|
225
|
+
# Already got this type of excited states.
|
|
226
|
+
warnings.warn("Attempting to merge excited states of multiplicity '{}' but this multiplicity has already been provided by an earlier result, ignoring".format(multiplicity))
|
|
227
|
+
|
|
228
|
+
merged = self(itertools.chain(*multiplicities.values()), **kwargs)
|
|
229
|
+
merged.sort()
|
|
230
|
+
merged.assign_levels()
|
|
231
|
+
return merged
|
|
232
|
+
|
|
233
|
+
def generate_for_dump(self):
|
|
234
|
+
"""
|
|
235
|
+
Method used to get a dictionary used to generate on-demand values for dumping.
|
|
236
|
+
|
|
237
|
+
This functionality is useful for hiding expense properties from the normal dump process, while still exposing them when specifically requested.
|
|
238
|
+
|
|
239
|
+
Each key in the returned dict is the name of a dumpable item, each value is a function to call with digichem_options as its only param.
|
|
240
|
+
"""
|
|
241
|
+
return {"spectrum": self.generate_spectrum}
|
|
242
|
+
|
|
243
|
+
def generate_spectrum(self, digichem_options):
|
|
244
|
+
"""
|
|
245
|
+
Abstract function that is called to generate an on-demand value for dumping.
|
|
246
|
+
|
|
247
|
+
This functionality is useful for hiding expensive properties from the normal dump process, while still exposing them when specifically requested.
|
|
248
|
+
|
|
249
|
+
:param key: The key being requested.
|
|
250
|
+
:param digichem_options: Digichem options being used to dump.
|
|
251
|
+
"""
|
|
252
|
+
from digichem.result.spectroscopy import Spectroscopy_graph, Absorption_emission_graph
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
# Get spectrum data.
|
|
256
|
+
# For excited states, we dump two spectra. One in nm, one in eV (which have different scaling).
|
|
257
|
+
# TODO: It's weird that these spectra are only available in dumped format, there should be some property/function on the class that also returns them...
|
|
258
|
+
spectrum_nm = Absorption_emission_graph.from_excited_states(
|
|
259
|
+
self,
|
|
260
|
+
digichem_options['absorption_spectrum']['fwhm'],
|
|
261
|
+
digichem_options['absorption_spectrum']['gaussian_resolution'],
|
|
262
|
+
digichem_options['absorption_spectrum']['gaussian_cutoff'],
|
|
263
|
+
use_jacobian = digichem_options['absorption_spectrum']['use_jacobian']
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
spectrum_ev = Spectroscopy_graph([(excited_state.energy, excited_state.oscillator_strength) for excited_state in self], digichem_options['absorption_spectrum']['fwhm'], digichem_options['absorption_spectrum']['gaussian_resolution'], digichem_options['absorption_spectrum']['gaussian_cutoff'])
|
|
268
|
+
|
|
269
|
+
try:
|
|
270
|
+
spectrum_nm_data = spectrum_nm.plot_cumulative_gaussian()
|
|
271
|
+
y_units = "arb. unit" if digichem_options['absorption_spectrum']['use_jacobian'] else "oscillator_strength"
|
|
272
|
+
|
|
273
|
+
spectrum_nm_data = [{"x":{"value": float(x), "units": "nm"}, "y": {"value":float(y), "units": y_units}} for x,y in spectrum_nm_data]
|
|
274
|
+
spectrum_nm_peaks = [{"x":{"value": float(x), "units": "nm"}, "y": {"value":float(y), "units": y_units}} for x, y in spectrum_nm.peaks()]
|
|
275
|
+
|
|
276
|
+
except Exception:
|
|
277
|
+
spectrum_nm_data = []
|
|
278
|
+
spectrum_nm_peaks = []
|
|
279
|
+
|
|
280
|
+
try:
|
|
281
|
+
spectrum_ev_data = spectrum_ev.plot_cumulative_gaussian()
|
|
282
|
+
|
|
283
|
+
spectrum_ev_data = [{"x":{"value": float(x), "units": "eV"}, "y": {"value":float(y), "units": "oscillator_strength"}} for x,y in spectrum_ev_data]
|
|
284
|
+
spectrum_ev_peaks = [{"x":{"value": float(x), "units": "eV"}, "y": {"value":float(y), "units": "oscillator_strength"}} for x, y in spectrum_ev.peaks()]
|
|
285
|
+
|
|
286
|
+
except Exception:
|
|
287
|
+
spectrum_ev_data = []
|
|
288
|
+
spectrum_ev_peaks = []
|
|
289
|
+
|
|
290
|
+
return {
|
|
291
|
+
"nm": {
|
|
292
|
+
"values": spectrum_nm_data,
|
|
293
|
+
"peaks": spectrum_nm_peaks
|
|
294
|
+
},
|
|
295
|
+
"ev": {
|
|
296
|
+
"values": spectrum_ev_data,
|
|
297
|
+
"peaks": spectrum_ev_peaks
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
def dump(self, digichem_options):
|
|
302
|
+
dump_dict = {
|
|
303
|
+
"values": super().dump(digichem_options),
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
# Add extra properties.
|
|
307
|
+
mult_pairs, mults = self.group_pairs()
|
|
308
|
+
|
|
309
|
+
# Number of states of each multiplicity.
|
|
310
|
+
for mult, states in mults.items():
|
|
311
|
+
dump_dict['num_{}'.format(Energy_state.multiplicity_number_to_string(mult))] = len(states)
|
|
312
|
+
|
|
313
|
+
# DeST and other values.
|
|
314
|
+
for mult_pair in mult_pairs:
|
|
315
|
+
state1 = mults[mult_pair[0]][0]
|
|
316
|
+
state2 = mults[mult_pair[1]][0]
|
|
317
|
+
dump_dict['dE({}{})'.format(state1.multiplicity_symbol, state2.multiplicity_symbol)] = {
|
|
318
|
+
"value": float(state1.energy - state2.energy),
|
|
319
|
+
"units": "eV"
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
return dump_dict
|
|
323
|
+
|
|
324
|
+
@classmethod
|
|
325
|
+
def from_dump(self, data, result_set, options):
|
|
326
|
+
"""
|
|
327
|
+
Get a list of instances of this class from its dumped representation.
|
|
328
|
+
|
|
329
|
+
:param data: The data to parse.
|
|
330
|
+
:param result_set: The partially constructed result set which is being populated.
|
|
331
|
+
"""
|
|
332
|
+
return self(Excited_state.list_from_dump(data['values'], result_set, options))
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
class Excited_state_transition(Result_object):
|
|
336
|
+
"""
|
|
337
|
+
Class that represents a transition that contributes to a particular excited state.
|
|
338
|
+
"""
|
|
339
|
+
|
|
340
|
+
def __init__(self, level, starting_mo, ending_mo, coefficient):
|
|
341
|
+
"""
|
|
342
|
+
Constructor for excited state transitions.
|
|
343
|
+
|
|
344
|
+
:param level: The 'level' of this transition. The most significant (highest probability) transition has level 1.
|
|
345
|
+
:param starting_mo: The Molecular_orbital object from which this transition begins.
|
|
346
|
+
:param ending_mo: The Molecular_orbital object to which the transition ends.
|
|
347
|
+
:param coefficient: The coefficient of this orbital. Square to get the probability.
|
|
348
|
+
"""
|
|
349
|
+
self.level = level
|
|
350
|
+
self.starting_mo = starting_mo
|
|
351
|
+
self.ending_mo = ending_mo
|
|
352
|
+
self.coefficient = coefficient
|
|
353
|
+
|
|
354
|
+
@property
|
|
355
|
+
def probability(self):
|
|
356
|
+
"""
|
|
357
|
+
The probability of this transition.
|
|
358
|
+
"""
|
|
359
|
+
return self.coefficient **2
|
|
360
|
+
|
|
361
|
+
def dump(self, digichem_options):
|
|
362
|
+
"""
|
|
363
|
+
Get a representation of this result object in primitive format.
|
|
364
|
+
"""
|
|
365
|
+
return {
|
|
366
|
+
"index": self.level,
|
|
367
|
+
"start": {
|
|
368
|
+
"spin": self.starting_mo.spin_type,
|
|
369
|
+
"index": self.starting_mo.level,
|
|
370
|
+
"label": self.starting_mo.label
|
|
371
|
+
},
|
|
372
|
+
"end": {
|
|
373
|
+
"spin": self.ending_mo.spin_type,
|
|
374
|
+
"index": self.ending_mo.level,
|
|
375
|
+
"label": self.ending_mo.label
|
|
376
|
+
},
|
|
377
|
+
"coefficient": float(self.coefficient),
|
|
378
|
+
"probability": float(self.probability **2)
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
@classmethod
|
|
382
|
+
def list_from_parser(self, parser):
|
|
383
|
+
"""
|
|
384
|
+
Create a list of excited state transitions from an output file parser.
|
|
385
|
+
|
|
386
|
+
:param parser: An output file parser.
|
|
387
|
+
:param alpha_mo_list: A Molecular_orbital_list object of the MOs of this system.
|
|
388
|
+
:param beta_mo_list: A Molecular_orbital_list object of the beta MOs of this system. This can be left as null for restricted calcs.
|
|
389
|
+
:return: A list of Excited_state_transition objects.
|
|
390
|
+
"""
|
|
391
|
+
try:
|
|
392
|
+
# Create a tuple of our MOs (helps us later).
|
|
393
|
+
MOs = (parser.results.orbitals, parser.results.beta_orbitals)
|
|
394
|
+
|
|
395
|
+
transitions_list = []
|
|
396
|
+
|
|
397
|
+
# etsecs is a list of list, the outer list corresponds to each excited state, the inner list contains actual transitions.
|
|
398
|
+
for excited_state_transitions in parser.data.etsecs:
|
|
399
|
+
|
|
400
|
+
# We'll first create an intermediate list of keyword dicts which we'll then sort.
|
|
401
|
+
data_list = [
|
|
402
|
+
{'starting_mo': MOs[starting_mo_AB][starting_mo_index], 'ending_mo': MOs[ending_mo_AB][ending_mo_index], 'coefficient': coefficient}
|
|
403
|
+
for (starting_mo_index, starting_mo_AB), (ending_mo_index, ending_mo_AB), coefficient
|
|
404
|
+
in excited_state_transitions
|
|
405
|
+
]
|
|
406
|
+
|
|
407
|
+
# Sort by probability/coefficient.
|
|
408
|
+
data_list.sort(key=lambda keywords: math.fabs(keywords['coefficient']), reverse=True)
|
|
409
|
+
|
|
410
|
+
# Now get a list objects and append to our big list.
|
|
411
|
+
transitions_list.append(
|
|
412
|
+
[self(index+1, keywords['starting_mo'], keywords['ending_mo'], keywords['coefficient']) for index, keywords in enumerate(data_list)]
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
# All done.
|
|
416
|
+
return transitions_list
|
|
417
|
+
|
|
418
|
+
except IndexError:
|
|
419
|
+
# Probably because one (or both) of our given mo_lists is empty (or too short).
|
|
420
|
+
raise TypeError("Unable to construct excited state transition; transition is to/from an orbital that is not available")
|
|
421
|
+
except AttributeError:
|
|
422
|
+
# No data.
|
|
423
|
+
return []
|
|
424
|
+
|
|
425
|
+
@classmethod
|
|
426
|
+
def list_from_dump(self, data, result_set, options):
|
|
427
|
+
"""
|
|
428
|
+
Get a list of instances of this class from its dumped representation.
|
|
429
|
+
|
|
430
|
+
:param data: The data to parse.
|
|
431
|
+
:param result_set: The partially constructed result set which is being populated.
|
|
432
|
+
"""
|
|
433
|
+
trans = []
|
|
434
|
+
for tran_dict in data:
|
|
435
|
+
# Get our start and end MOs.
|
|
436
|
+
orbitals = {}
|
|
437
|
+
for key in ("start", "end"):
|
|
438
|
+
if tran_dict[key]['spin'] in ("none", "alpha"):
|
|
439
|
+
orbitals[key] = result_set.orbitals[tran_dict[key]['index'] -1]
|
|
440
|
+
|
|
441
|
+
else:
|
|
442
|
+
orbitals[key] = result_set.beta_orbitals[tran_dict[key]['index'] -1]
|
|
443
|
+
|
|
444
|
+
trans.append(self(tran_dict['index'], orbitals['start'], orbitals['end'], tran_dict['coefficient']))
|
|
445
|
+
|
|
446
|
+
return trans
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
class Energy_state(Result_object, Floatable_mixin):
|
|
450
|
+
"""
|
|
451
|
+
Class for representing different energy states of the same system.
|
|
452
|
+
"""
|
|
453
|
+
|
|
454
|
+
# Colour categories.
|
|
455
|
+
colors = [
|
|
456
|
+
{"max": 400, "name": "Ultraviolet"},
|
|
457
|
+
{"max": 420, "name": "Violet"},
|
|
458
|
+
{"max": 470, "name": "Blue"},
|
|
459
|
+
{"max": 505, "name": "Cyan"},
|
|
460
|
+
{"max": 555, "name": "Green"},
|
|
461
|
+
{"max": 595, "name": "Yellow"},
|
|
462
|
+
{"max": 625, "name": "Orange"},
|
|
463
|
+
{"max": 740, "name": "Red"},
|
|
464
|
+
{"max": float("inf"), "name": "Infrared"}
|
|
465
|
+
]
|
|
466
|
+
|
|
467
|
+
def __init__(self, level, multiplicity, multiplicity_level, energy):
|
|
468
|
+
"""
|
|
469
|
+
Constructor for Energy_state objects.
|
|
470
|
+
|
|
471
|
+
:param level: The ordered (by energy) index of this energy state, where 0 is the GS and 1 is the lowest excited state.
|
|
472
|
+
:param multiplicity_level: the ordered (by energy) index of this energy state in terms of states that share the same multiplicity.
|
|
473
|
+
:param multiplicity: The multiplicity of this state as a number (eg, 1 for singlet, 2 for doublet). Fractional multiplicities are also accepted.
|
|
474
|
+
:param energy: The energy of this state in eV. Whether this value is absolute or relative to another state depends on the implementing class.
|
|
475
|
+
"""
|
|
476
|
+
self.level = level
|
|
477
|
+
self.multiplicity = round(multiplicity)
|
|
478
|
+
# 'True' multiplicity is unrounded (do something smarter)
|
|
479
|
+
self.true_multiplicity = multiplicity
|
|
480
|
+
self.multiplicity_level = multiplicity_level
|
|
481
|
+
self.energy = energy
|
|
482
|
+
|
|
483
|
+
@property
|
|
484
|
+
def multiplicity(self):
|
|
485
|
+
"""
|
|
486
|
+
"""
|
|
487
|
+
return self._multiplicity if self._multiplicity is not None else 0
|
|
488
|
+
|
|
489
|
+
@multiplicity.setter
|
|
490
|
+
def multiplicity(self, value):
|
|
491
|
+
"""
|
|
492
|
+
"""
|
|
493
|
+
self._multiplicity = value
|
|
494
|
+
|
|
495
|
+
def __float__(self):
|
|
496
|
+
"""
|
|
497
|
+
Float of this class.
|
|
498
|
+
"""
|
|
499
|
+
return float(self.energy)
|
|
500
|
+
|
|
501
|
+
@classmethod
|
|
502
|
+
def multiplicity_number_to_string(self, multiplicity):
|
|
503
|
+
if multiplicity == 1:
|
|
504
|
+
return "singlet"
|
|
505
|
+
elif multiplicity == 2:
|
|
506
|
+
return "doublet"
|
|
507
|
+
elif multiplicity == 3:
|
|
508
|
+
return "triplet"
|
|
509
|
+
elif multiplicity == 4:
|
|
510
|
+
return"quartet"
|
|
511
|
+
elif multiplicity is None or multiplicity == 0:
|
|
512
|
+
return "no multiplicity"
|
|
513
|
+
elif multiplicity % 1 == 0:
|
|
514
|
+
# Multiplicity is an integer, so return as a stringy whole number.
|
|
515
|
+
return str(int(multiplicity))
|
|
516
|
+
else:
|
|
517
|
+
return str(multiplicity)
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
@property
|
|
521
|
+
def multiplicity_string(self):
|
|
522
|
+
return self.multiplicity_number_to_string(self.multiplicity)
|
|
523
|
+
|
|
524
|
+
@property
|
|
525
|
+
def multiplicity_symbol(self):
|
|
526
|
+
multiplicity = self.multiplicity
|
|
527
|
+
|
|
528
|
+
# Get a shorthand symbol if we can.
|
|
529
|
+
if multiplicity == 1:
|
|
530
|
+
return "S"
|
|
531
|
+
elif multiplicity == 2:
|
|
532
|
+
return "D"
|
|
533
|
+
elif multiplicity == 3:
|
|
534
|
+
return "T"
|
|
535
|
+
elif multiplicity == 4:
|
|
536
|
+
return "Q"
|
|
537
|
+
elif multiplicity == 0:
|
|
538
|
+
return "?"
|
|
539
|
+
elif multiplicity % 1 == 0:
|
|
540
|
+
# Multiplicity is an integer, so return as a stringy whole number.
|
|
541
|
+
return str(int(multiplicity))
|
|
542
|
+
else:
|
|
543
|
+
return str(multiplicity)
|
|
544
|
+
|
|
545
|
+
@property
|
|
546
|
+
def state_symbol(self):
|
|
547
|
+
"""
|
|
548
|
+
A short hand notation to identify this excited state.
|
|
549
|
+
|
|
550
|
+
If the multiplicity is well defined (singlet, doublet, triplet etc), the symbol starts with an appropriate letter (S, D, T etc), otherwise a numeric multiplicity is used. The symbol ends with an integer in brackets, indicating the excited state's level.
|
|
551
|
+
eg, S(1) is the first singlet excited state, S(2) is the second and so on.
|
|
552
|
+
"""
|
|
553
|
+
return "{}({})".format(self.multiplicity_symbol, self.multiplicity_level)
|
|
554
|
+
|
|
555
|
+
def dump(self, digichem_options):
|
|
556
|
+
"""
|
|
557
|
+
Get a representation of this result object in primitive format.
|
|
558
|
+
"""
|
|
559
|
+
return {
|
|
560
|
+
"index": self.level,
|
|
561
|
+
"symbol": self.state_symbol,
|
|
562
|
+
"multiplicity": self.multiplicity,
|
|
563
|
+
"multiplicity_index": self.multiplicity_level,
|
|
564
|
+
"energy": {
|
|
565
|
+
"value": float(self.energy),
|
|
566
|
+
"units": "eV"
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
class Excited_state(Energy_state):
|
|
572
|
+
"""
|
|
573
|
+
Class for representing an excited state.
|
|
574
|
+
"""
|
|
575
|
+
|
|
576
|
+
def __init__(self, level, multiplicity, multiplicity_level, symmetry, energy, oscillator_strength, transitions, transition_dipole_moment = None):
|
|
577
|
+
"""
|
|
578
|
+
Constructor for excited state objects.
|
|
579
|
+
|
|
580
|
+
:param level: The 'level' of this excited state (essentially an index), where the lowest state has a level of 1, increasing by 1 for each higher state.
|
|
581
|
+
:param multiplicity: The multiplicity of this excited state (as an integer or float).
|
|
582
|
+
:param multiplicity_level: The 'level' of this state within the excited states that have the same multiplicity.
|
|
583
|
+
:param symmetry: The symmetry of this excited state; a complicated term that contains our multiplicity among other things.
|
|
584
|
+
:param energy: The energy of this excited state (in eV).
|
|
585
|
+
:param oscillator_strength: The oscillator strength of this transition.
|
|
586
|
+
:param transitions: The singly excited transitions which make up this transition.
|
|
587
|
+
:param transition_dipole_moment: Optional transition dipole moment of the excited state.
|
|
588
|
+
"""
|
|
589
|
+
super().__init__(level, multiplicity, multiplicity_level, energy)
|
|
590
|
+
self.symmetry = symmetry
|
|
591
|
+
# Oscillator strength is a dimensionless float that describes the probability of the transition from the reference state (normally ground) to this excited state.
|
|
592
|
+
self.oscillator_strength = oscillator_strength
|
|
593
|
+
# The transitions which contribute to this state.
|
|
594
|
+
self.transitions = transitions
|
|
595
|
+
|
|
596
|
+
# If we were given a TDM, set its excited state to ourself.
|
|
597
|
+
if transition_dipole_moment is not None:
|
|
598
|
+
transition_dipole_moment.set_excited_state(self)
|
|
599
|
+
|
|
600
|
+
self.transition_dipole_moment = transition_dipole_moment
|
|
601
|
+
|
|
602
|
+
@classmethod
|
|
603
|
+
def get_multiplicity_from_symmetry(self, symmetry_string):
|
|
604
|
+
"""
|
|
605
|
+
Get the multiplicity of of an excited state from its symmetry.
|
|
606
|
+
|
|
607
|
+
See multiplicity() for a more detailed description of the format of multiplicity strings.
|
|
608
|
+
:param symmetry_string: The symmetry string.
|
|
609
|
+
:return: The multiplicity as a number (possibly an int, possibly a float).
|
|
610
|
+
"""
|
|
611
|
+
# Split the symmetry string on the dash (-) character.
|
|
612
|
+
multiplicity_string = (symmetry_string.split('-', 1))[0]
|
|
613
|
+
# Convert to a number if we have a string.
|
|
614
|
+
if multiplicity_string == "Singlet":
|
|
615
|
+
return 1
|
|
616
|
+
elif multiplicity_string == "Doublet":
|
|
617
|
+
return 2
|
|
618
|
+
elif multiplicity_string == "Triplet":
|
|
619
|
+
return 3
|
|
620
|
+
elif multiplicity_string == "Quartet":
|
|
621
|
+
return 4
|
|
622
|
+
elif multiplicity_string == "???":
|
|
623
|
+
return None
|
|
624
|
+
else:
|
|
625
|
+
# Try and cast to float.
|
|
626
|
+
# Float multiplicities don't make sense in the real world, but are possible results from calculations.
|
|
627
|
+
return float(multiplicity_string)
|
|
628
|
+
|
|
629
|
+
@property
|
|
630
|
+
def wavelength(self):
|
|
631
|
+
"""
|
|
632
|
+
The wavelength that corresponds to the energy of this excited state (in nm).
|
|
633
|
+
|
|
634
|
+
:raises Result_unavailable_error: If the energy of this state is 0.
|
|
635
|
+
"""
|
|
636
|
+
try:
|
|
637
|
+
# λ = (c * h) / e
|
|
638
|
+
return self.energy_to_wavelength(self.energy)
|
|
639
|
+
except FloatingPointError:
|
|
640
|
+
# Our energy is zero.
|
|
641
|
+
raise Result_unavailable_error('excited state wavelength', "excited state '{}' energy is 0 eV".format(self.state_symbol))
|
|
642
|
+
|
|
643
|
+
@property
|
|
644
|
+
def joules(self):
|
|
645
|
+
"""
|
|
646
|
+
The energy of this excited state in Joules.
|
|
647
|
+
"""
|
|
648
|
+
return self.energy * 1.602176634e-19
|
|
649
|
+
|
|
650
|
+
@property
|
|
651
|
+
def color(self):
|
|
652
|
+
"""
|
|
653
|
+
The 'color' that corresponds to the energy of this excited state (as a string).
|
|
654
|
+
"""
|
|
655
|
+
# Go through our color presets and see which one we match.
|
|
656
|
+
for color in self.colors:
|
|
657
|
+
if self.wavelength < color["max"]:
|
|
658
|
+
# Good match.
|
|
659
|
+
return color["name"]
|
|
660
|
+
return "???"
|
|
661
|
+
|
|
662
|
+
@property
|
|
663
|
+
def CIE_XYZ(self):
|
|
664
|
+
"""
|
|
665
|
+
The CIE XYZ tristimulus values of the 'color' that corresponds to the energy of this excited state (as a numpy array).
|
|
666
|
+
"""
|
|
667
|
+
import colour
|
|
668
|
+
try:
|
|
669
|
+
return colour.wavelength_to_XYZ(self.wavelength)
|
|
670
|
+
except ValueError:
|
|
671
|
+
# Wavelength is out of our colour range, so we can't see it.
|
|
672
|
+
return numpy.zeros(3)
|
|
673
|
+
|
|
674
|
+
@property
|
|
675
|
+
def CIE_xy(self):
|
|
676
|
+
"""
|
|
677
|
+
The CIE xy chromaticity coordinates of the 'color' that corresponds to the energy of this excited state.
|
|
678
|
+
"""
|
|
679
|
+
import colour
|
|
680
|
+
try:
|
|
681
|
+
return colour.XYZ_to_xy(self.CIE_XYZ)
|
|
682
|
+
except Exception:
|
|
683
|
+
return numpy.zeros(2)
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
@property
|
|
687
|
+
def rgb(self):
|
|
688
|
+
"""
|
|
689
|
+
The RGB values of the 'color' that corresponds to the energy of this excited state (as a list of [r, g, b] from 0 -> 255).
|
|
690
|
+
"""
|
|
691
|
+
return self.xyz_to_rgb(self.CIE_XYZ)
|
|
692
|
+
|
|
693
|
+
@classmethod
|
|
694
|
+
def xyz_to_rgb(self, XYZ):
|
|
695
|
+
import colour
|
|
696
|
+
rgb = [numpy.clip(clr, 0, math.inf) for clr in colour.XYZ_to_sRGB(XYZ)]
|
|
697
|
+
|
|
698
|
+
# Now we normalise if one of our values exceeds 1.
|
|
699
|
+
if max(rgb) > 1:
|
|
700
|
+
rgb = [clr / max(rgb) for clr in rgb]
|
|
701
|
+
|
|
702
|
+
# Now convert to 0 -> 255 and return.
|
|
703
|
+
return [int(clr * 255) for clr in rgb]
|
|
704
|
+
|
|
705
|
+
def dump(self, digichem_options):
|
|
706
|
+
"""
|
|
707
|
+
Get a representation of this result object in primitive format.
|
|
708
|
+
"""
|
|
709
|
+
dump_dict = super().dump(digichem_options)
|
|
710
|
+
dump_dict.update({
|
|
711
|
+
"wavelength": {
|
|
712
|
+
"value": float(self.wavelength),
|
|
713
|
+
"units": "nm"
|
|
714
|
+
},
|
|
715
|
+
"colour": self.color,
|
|
716
|
+
"cie": {
|
|
717
|
+
"x": float(self.CIE_xy[0]),
|
|
718
|
+
"y": float(self.CIE_xy[1]),
|
|
719
|
+
},
|
|
720
|
+
"symmetry": self.symmetry,
|
|
721
|
+
"oscillator_strength": float(self.oscillator_strength) if self.oscillator_strength is not None else None,
|
|
722
|
+
"tdm": self.transition_dipole_moment.dump(digichem_options) if self.transition_dipole_moment is not None else None,
|
|
723
|
+
"transitions": [tran.dump(digichem_options) for tran in self.transitions],
|
|
724
|
+
})
|
|
725
|
+
return dump_dict
|
|
726
|
+
|
|
727
|
+
@classmethod
|
|
728
|
+
def list_from_parser(self, parser):
|
|
729
|
+
"""
|
|
730
|
+
Create a list of Excited_state objects from an output file parser.
|
|
731
|
+
|
|
732
|
+
:param parser: An output file parser.
|
|
733
|
+
:return: A list of Excited_state objects in the same order as given in cclib.
|
|
734
|
+
"""
|
|
735
|
+
# List of excited states.
|
|
736
|
+
excited_states = []
|
|
737
|
+
|
|
738
|
+
# Assemble cclib's various arrays into a single list.
|
|
739
|
+
# If we're missing etoscs, that's ok.
|
|
740
|
+
etoscsc = getattr(parser.data, "etoscs", [])
|
|
741
|
+
|
|
742
|
+
try:
|
|
743
|
+
excited_states_data = list(zip_longest(parser.data.etsyms, parser.data.etenergies, etoscsc, fillvalue = 0.0))
|
|
744
|
+
|
|
745
|
+
except AttributeError:
|
|
746
|
+
if not hasattr(parser.data, "etsyms") and not hasattr(parser.data, "etenergies"):
|
|
747
|
+
return []
|
|
748
|
+
|
|
749
|
+
elif not hasattr(parser.data, "etsyms"):
|
|
750
|
+
digichem.log.get_logger().warning("Unable to fully parse excited states because only energies are available, missing symmetries")
|
|
751
|
+
return []
|
|
752
|
+
|
|
753
|
+
elif not hasattr(parser.data, "etenergies"):
|
|
754
|
+
digichem.log.get_logger().warning("Unable to fully parse excited states because only symmetries are available, missing energies")
|
|
755
|
+
return []
|
|
756
|
+
|
|
757
|
+
else:
|
|
758
|
+
raise
|
|
759
|
+
|
|
760
|
+
# First get our transitions.
|
|
761
|
+
transitions = Excited_state_transition.list_from_parser(parser)
|
|
762
|
+
|
|
763
|
+
# Loop through our data.
|
|
764
|
+
for index, (symmetry, energy, oscillator_strength) in enumerate(excited_states_data):
|
|
765
|
+
# Relevant transition dipole moment.
|
|
766
|
+
try:
|
|
767
|
+
tdm = parser.results.transition_dipole_moments[index]
|
|
768
|
+
except IndexError:
|
|
769
|
+
tdm = None
|
|
770
|
+
|
|
771
|
+
# Get and append our object.
|
|
772
|
+
# We'll set level and mult level once we've got all our objects, so just use None for now.
|
|
773
|
+
excited_states.append(
|
|
774
|
+
self(
|
|
775
|
+
level = None,
|
|
776
|
+
multiplicity = Excited_state.get_multiplicity_from_symmetry(symmetry),
|
|
777
|
+
multiplicity_level = None,
|
|
778
|
+
symmetry = symmetry,
|
|
779
|
+
energy = self.wavenumbers_to_energy(energy),
|
|
780
|
+
oscillator_strength = oscillator_strength,
|
|
781
|
+
transitions = transitions[index] if len(transitions) != 0 else [],
|
|
782
|
+
transition_dipole_moment = tdm
|
|
783
|
+
)
|
|
784
|
+
)
|
|
785
|
+
|
|
786
|
+
# Now assign total and multiplicity levels which we skipped earlier.
|
|
787
|
+
Excited_state_list.assign_levels(excited_states)
|
|
788
|
+
|
|
789
|
+
# All done, return our list.
|
|
790
|
+
return excited_states
|
|
791
|
+
|
|
792
|
+
@classmethod
|
|
793
|
+
def list_from_dump(self, data, result_set, options):
|
|
794
|
+
"""
|
|
795
|
+
Get a list of instances of this class from its dumped representation.
|
|
796
|
+
|
|
797
|
+
:param data: The data to parse.
|
|
798
|
+
:param result_set: The partially constructed result set which is being populated.
|
|
799
|
+
"""
|
|
800
|
+
states = []
|
|
801
|
+
for es_dict in data:
|
|
802
|
+
# Get our tdm (if available).
|
|
803
|
+
if es_dict['tdm'] is not None:
|
|
804
|
+
tdm = result_set.transition_dipole_moments[es_dict['index']-1]
|
|
805
|
+
|
|
806
|
+
else:
|
|
807
|
+
tdm = None
|
|
808
|
+
|
|
809
|
+
states.append(self(
|
|
810
|
+
es_dict['index'],
|
|
811
|
+
es_dict['multiplicity'],
|
|
812
|
+
es_dict['multiplicity_index'],
|
|
813
|
+
es_dict['symmetry'],
|
|
814
|
+
es_dict['energy']['value'],
|
|
815
|
+
es_dict['oscillator_strength'],
|
|
816
|
+
Excited_state_transition.list_from_dump(es_dict['transitions'], result_set, options),
|
|
817
|
+
tdm
|
|
818
|
+
))
|
|
819
|
+
|
|
820
|
+
return states
|
|
821
|
+
|