wailord.io.orca module¶
An ad-hoc treatment of orca output files
This should implement a grammar, but currently consists of a number of utility structures and functions to parse data from the orca output format
Example
See the tests for more
$ poetry run
Some more details.
Todo
Make grammar
Make classes
Test the experiments more
Pass a list of experiments to ignore
Test the ordering of variables
Make classes for the order
Handle split jobs
Propagate exceptions instead of passing the buck with warnings
Setup proper logging
Scrape NIST Web book for spectra, properties https://webbook.nist.gov/cgi/cbook.cgi?ID=C71432&Mask=800#Electronic-Spec
Document more things (e.g. SP -> Single point calculation a.k.a. energy calculation)
Return interesting things
-
wailord.io.orca.
calc_htst
(product, reactant, transition_state, temperature)[source]¶ Calculates the HTST rate constant.
This is calculated as:
\[k^{HTST} =\]rac{∏_{i=1 … N}𝜈ᵢ}{∏_{j=1 … N-1}𝜈ⱼ^‡}e^{ rac{-𝛥E}{k_BT}}
Where * \(𝜈ᵢ\) are the final/initial state vibrational frequencies and
\(𝜈ⱼ^‡\) are the vibrational frequencies at the saddle point
\(𝛥E\) is the difference between the energy of the state and the saddle point \(𝛥E=V_{saddle}-V_{other}\)
It is important to note that the \(k_f\) and \(k_b\) are relative measures and the rate constant is the ratio of the two. In some cases it might be necessary to weigh the results by the magnitude of ‘c’
-
wailord.io.orca.
genEBASet
(rootdir, deci=3, latex=False, full=False, order_basis=['STO-3G', '3-21G', '6-31G', '6-311G', '6-311G*', '6-311G**', '6-311++G**', '6-311++G(2d,2p)', '6-311++G(2df,2pd)', '6-311++G(3df,3pd)'], order_theory=['HF', 'UHF', 'QCISD', 'CCSD', 'QCISD(T)', 'CCSD(T)'])[source]¶ Takes in a Path object, and typically returns bond angles and energies. Optionally returns a TeX table or a full dataset with the filenames and geometries. Depreciate this eventually.
-
wailord.io.orca.
getBA
(dat, x, y, z, indi=[0, 1, 2])[source]¶ Takes in a data frame of xyz coordinates and uses it to generate the plane angle, indices are used such that the first is the relative center
-
wailord.io.orca.
getBL
(dat, x, y, z, indi=[0, 1])[source]¶ Takes in a data frame of xyz coordinates and uses it to calculate the bond length
-
wailord.io.orca.
getRunInfo
(runf)[source]¶ Determines the runtime parameters from the output path
The implementation uses an ordered dictionary to ensure that the path fragments are matched to the correct keys.
Note
This will only work with wailord experiments at the moment
- Parameters
run (
Path
) – Runtime output path- Returns
A simple unordered dictionary of paramters
- Return type
runinf (
dict
)
-
wailord.io.orca.
get_e
(orcaoutdat, basis, system)[source]¶ This takes in an orcaout data frame and spits out the energy
-
class
wailord.io.orca.
inpcart
(atype, x, y, z)¶ Bases:
tuple
-
atype
¶ Alias for field number 0
-
x
¶ Alias for field number 1
-
y
¶ Alias for field number 2
-
z
¶ Alias for field number 3
-
-
class
wailord.io.orca.
orcaExp
(expfolder, deci=3, order_basis=['STO-3G', '3-21G', '6-31G', '6-311G', '6-311G*', '6-311G**', '6-311++G**', '6-311++G(2d,2p)', '6-311++G(2df,2pd)', '6-311++G(3df,3pd)'], order_theory=['HF', 'UHF', 'QCISD', 'CCSD', 'QCISD(T)', 'CCSD(T)'])[source]¶ Bases:
object
The class meant to handle experiments generated with wailord.
The general concept is that this is meant to work with the setup wailord generates. Remember to use df.round() for pretty printing!
-
get_energy_surface
(etype=['Actual Energy', 'SCF Energy'])[source]¶ Populates an energy surface dataframe
This essentially walks over the generated set of files, and fills out calls to the base orcaVis class.
-
get_final_sp_energy
()[source]¶ Returns a datframe of only the final single point energies
Proxies calls to the base orcaVis class over a series of generated files
- Parameters
None –
- Returns
Returns a data frame of final energies
- Return type
pd.DataFrame
-
get_ir_spec
()[source]¶ Returns a datframe of the “ir spectrum”
Proxies calls to the base orcaVis class over a series of generated files
- Parameters
None –
- Returns
Returns a data frame of frequencies
- Return type
pd.DataFrame
-
get_population
(poptype=['Mulliken', 'Loewdin'], /)[source]¶ Populates a population dataframe
This essentially walks over the generated set of files, and fills out calls to the base orcaVis class.
-
get_vib_freq
()[source]¶ Returns a datframe of the vibrational modes
Proxies calls to the base orcaVis class over a series of generated files
- Parameters
None –
- Returns
Returns a data frame of frequencies
- Return type
pd.DataFrame
-
get_vpt2_transitions
()[source]¶ Returns a datframe of the fundamental transitions table
Proxies calls to the base orcaVis class over a series of generated files
- Parameters
None –
- Returns
Returns a data frame of frequencies
- Return type
pd.DataFrame
-
handle_exp
(efol)[source]¶ Populates the internal file variables from the path
- Alert:
This is not meant to be called by the user!!!!
- Parameters
efol (
Path
) – Output path
-
inpconf
¶ Populated by handle_exp
-
orclist
¶ Populated by handle_exp
-
-
class
wailord.io.orca.
orcaVis
(ofile)[source]¶ Bases:
object
The class meant to handle ORCA output files.
Todo
Add a grammar and recursive descent later
-
ir_spec
()[source]¶ Grabs the non-ZPE corrected IR Spectra and the dipole derivatives for intensities
-
mult_energy_surface
(etype=['Actual Energy', 'MDCI', 'MDCI w/o Triples', 'SCF Energy'], npoints=None)[source]¶ Multiple Energy surface dataframe generator
This is a helper function to obtain a dataframe which contains multiple energy surfaces. The implementation leverages the reduce function from functools to merge a list of dataframes generated from the single_energy_surface calls.
- Parameters
etype (str,optional) – The type of calculated energy surface to return. Defaults to [“Actual Energy”, “MDCI”, “MDCI w/o Triples”, “SCF Energy”] but can be any valid subset of the same.
npoints (int,optional) – The number of points over which a scan has taken place. Defaults to the number of evaluations calculated in the output file.
- Returns
Returns a data frame of bond_length and energies
- Return type
pd.DataFrame
-
mult_population_analysis
(poptype=['Mulliken', 'Loewdin'], /)[source]¶ Multiple population analysis dataframe generator
This is a helper function to obtain a dataframe which contains multiple population analysis outputs. The implementation is similar to the energy surface helper.
- Parameters
poptype (str,optional) – The type of calculated energy surface to return.
- Returns
Returns a data frame of population analysis types
- Return type
pd.DataFrame
-
single_energy_surface
(etype='Actual Energy', npoints=None)[source]¶ Single energy surface dataframe generator
For say, QCISD(T), this is essentially the same as a QCISD calculation.
Note
MDCI types are meant to work with single reference correlation methods
- Parameters
etype (str,optional) – The type of calculated energy surface to
Defaults to 'Actual Energy' and can be any of `["Actual Energy" (return.) –
"MDCI" –
w/o Triples" ("MDCI) –
Energy"]` ("SCF) –
npoints (int,optional) – The number of points over which a scan has taken place. Defaults to the number of evaluations calculated in the output file.
- Returns
Returns a data frame of energy surfaces
- Return type
pd.DataFrame
-
single_population_analysis
(poptype='Mulliken', /)[source]¶ Single population analysis dataframe generator
- Parameters
poptype (str,optional) – The type of population analysis to
Defaults to 'Mulliken'. (return.) –
- Returns
Returns a data frame of the population analysis
- Return type
pd.DataFrame
-
class
wailord.io.orca.
orcaout
(final_energy, fGeom, basis, filename, system, spin, theory)¶ Bases:
tuple
-
basis
¶ Alias for field number 2
-
fGeom
¶ Alias for field number 1
-
filename
¶ Alias for field number 3
-
final_energy
¶ Alias for field number 0
-
spin
¶ Alias for field number 5
-
system
¶ Alias for field number 4
-
theory
¶ Alias for field number 6
-