schrodinger.application.matsci.anharmonic module¶
Utilities for the anharmonic corrections workflow.
Copyright Schrodinger, LLC. All rights reserved.
- class schrodinger.application.matsci.anharmonic.SeqData(start, step, n_points)¶
Bases:
tuple
- n_points¶
Alias for field number 2
- start¶
Alias for field number 0
- step¶
Alias for field number 1
- schrodinger.application.matsci.anharmonic.get_seq_data(options, flag)¶
Return a sequence data for the given flag.
- Parameters
options (argparse.Namespace) – the options
flag (str) – the flag
- Return type
- Returns
the sequence data
- schrodinger.application.matsci.anharmonic.evaluate_f(x, deriv_idx, coeffs)¶
Evaluate the nth derivative of a polynomial described by the given coefficients.
- Parameters
x (float) – the point at which to evaluate
deriv_idx (int) – indicates what derivative of the polynomial to evaluate, 0 is the polynomial itself, 1 is the first derivative, etc.
coeffs (tuple) – the coefficents of the polynomial, for a mth order polynomial must be of lenth m + 1
- Return type
float
- Returns
the evaluated value
- schrodinger.application.matsci.anharmonic.angular_freq_to_freq(angular_freq)¶
Convert the given angular frequency to frequency.
- Parameters
angular_freq (float) – the angular frequency in s**-1
- Return type
float
- Returns
the frequency in cm**-1
- schrodinger.application.matsci.anharmonic.freq_to_angular_freq(freq)¶
Convert the given frequency to angular frequency.
- Parameters
freq (float) – the frequency in cm**-1
- Return type
float
- Returns
the angular frequency in s**-1
- schrodinger.application.matsci.anharmonic.plotter(x_min, x_max, x_e_min, x_e_max, x_step, y_func, file_name, title, y_label, x_values=None)¶
Plot the given function.
- Parameters
x_min (float) – the minimum value on the x-axis
x_max (float) – the maximum value on the x-axis
x_e_min (float) – the minimum value on the extended x-axis
x_e_max (float) – the maximum value on the extended x-axis
x_step (float) – the step size to use on the x-axis
y_func (function) – the function to use to obtain y-axis values
file_name (str) – the file name used to write the plot image
title (str) – the title for the plot image
y_label (str) – the y-axis label for the plot image
x_values (list or None) – if not None then contains x values for points to show in the plot
- schrodinger.application.matsci.anharmonic.get_normal_modes(jagout, max_i_freq=- inf)¶
Return the normal modes from the given JaguarOutput.
- Parameters
jagout (schrodinger.application.jaguar.output.JaguarOutput) – the Jaguar output object
max_i_freq (float) – tolerate small imaginary frequencies less than this value in wavenumbers (cm^-1)
- Return type
list
- Returns
contains pair tuples, (normal mode index (1-based), schrodinger.application.jaguar.results.NormalMode)
- schrodinger.application.matsci.anharmonic.check_imaginary_frequencies(jag_out, jag_in, max_i_freq=0)¶
Check imaginary frequencies.
- Parameters
jag_out (JaguarOutput) – the Jaguar output object
jag_in (JaguarInput) – the Jaguar input object
max_i_freq (float) – tolerate small imaginary frequencies less than this value in wavenumbers (cm^-1)
- Raises
AnharmonicException – if there is an issue
- schrodinger.application.matsci.anharmonic.get_st_jaguar_output(jagout_file_name, allow_new_dummies=False)¶
Return a structure from the given Jaguar output file.
- Parameters
jagout_file_name (str) – the name of a Jaguar output file
allow_new_dummies (bool) – whether to allow mmjag’s lewis structure build to possibly add new dummy atoms
- Return type
- Returns
the structure
- exception schrodinger.application.matsci.anharmonic.AnharmonicException¶
Bases:
Exception
- class schrodinger.application.matsci.anharmonic.AnharmonicPotentials(st=None, jagout_file_name=None, jagrin_file_name=None, max_freq=300, factor_data=None, jaguar_kwargs={'basis': 'LACVP**', 'dftname': 'B3LYP', 'igeopt': 1, 'molchg': 0, 'multip': 1}, temperature_data=None, pressure_data=None, max_i_freq=0, plot=False, process_no_anharmonicities=False, tpp=1, logger=None, robust=False)¶
Bases:
object
- __init__(st=None, jagout_file_name=None, jagrin_file_name=None, max_freq=300, factor_data=None, jaguar_kwargs={'basis': 'LACVP**', 'dftname': 'B3LYP', 'igeopt': 1, 'molchg': 0, 'multip': 1}, temperature_data=None, pressure_data=None, max_i_freq=0, plot=False, process_no_anharmonicities=False, tpp=1, logger=None, robust=False)¶
Create an instance.
- Parameters
st (
schrodinger.structure.Structure
or None) – a structure for which to calculate anharmonic potentials or None if using Jaguar frequency files directlyjagout_file_name (str or None) – the name of a Jaguar frequency output file for which to calculate anharmonic potentials or None if using an input structure
jagrin_file_name (str or None) – the name of a Jaguar freqency restart input file for which to calculate anharmonic potentials or None if using an input structure
max_freq (float) – anharmonic potentials are created for normal modes with harmonic frequencies less than this value in wavenumbers (cm^-1)
factor_data (SeqData or None) – unitless factor data for factors that multiply a normal mode displacement, if None then the defaults are used, the number of points is in the positive direction only, excluding zero and the negative direction, for example using a value of 4 in turn means 2 * 4 + 1 = 9 points total
jaguar_kwargs (dict) – Jaguar &gen section keyword arguments, used only if the anharmonic potentials are being calculated from an input structure rather than directly from Jaguar frequency files
temperature_data (SeqData or None) – temperature data in K, if None then the defaults are used
pressure_data (SeqData or None) – pressure data in atm, if None then the defaults are used
max_i_freq (float) – tolerate small imaginary frequencies less than this value in wavenumbers (cm^-1)
plot (bool) – if True then return plots of the potentials and particle densities
process_no_anharmonicities (bool) – if True then do not exit with an error if the given max_freq results in zero normal modes to be treated anharmonically
tpp (int) – the threads-per-process to use for running Jaguar calculations
logger (logging.Logger or None) – output logger or None if there isn’t one
robust (bool) – If True, use the robust Jaguar driver to run Jaguar jobs. If False, use Jaguar directly.
- getJaguarJob(base_name, input_name)¶
Get the job to run Jaguar with the given job base name and input name. The job will run either Jaguar directly or the robust Jaguar driver based on the current robust setting.
- Parameters
base_name (str) – The base name of this job
input_name (str) – The name of the input file
- Return type
jobutils.RobustSubmissionJob
- Returns
The job (suitable for JobDJ that will run Jaguar
- runFrequencyJob()¶
Run a Jaguar frequency job on the input structure.
- Raises
AnharmonicException – if there is an issue
- static getFactors(factor_data)¶
Return the factors.
- Parameters
factor_data (SeqData) – unitless factor data for factors that multiply a normal mode displacement, the number of points is in the positive direction only, excluding zero and the negative direction, for example using a value of 4 in turn means 2 * 4 + 1 = 9 points total
- Return type
tuple
- Returns
the factors
- getExtendedFactors()¶
Return the extended factors.
- Return type
tuple
- Returns
the extended factors
- runSinglePointJobs()¶
Run the Jaguar single point jobs from which to calculate the anharmonic potentials.
- Raises
AnharmonicException – if there is an issue
- collectEnergies()¶
Update self.potentials with the Jaguar single point energies.
- Raises
AnharmonicException – if there is an issue
- getEnergies(idx)¶
Return the energies (Hartree) used to build the potential for the given normal mode.
- Parameters
idx (int) – the normal mode index, 1-based
- Raises
AnharmonicException – if there is an issue
- Return type
list
- Returns
the energies
- collectFits()¶
Update self.potentials with the anharmonic fit data.
- Raises
AnharmonicException – if there is an issue
- evaluate_f(idx, factor, deriv_idx, convert_to_si=False)¶
Evaluate the nth derivative of the anharmonic potential for the given normal mode index.
- Parameters
idx (int) – the normal mode index, 1-based
factor (float) – the point at which to evaluate
deriv_idx (int) – indicates what derivative of the polynomial to evaluate, 0 is the polynomial itself, 1 is the first derivative, etc.
convert_to_si (bool) – if True convert the returned value from units of H/Ang.**deriv_idx to J/m**deriv_idx
- Raises
AnharmonicException – if there is an issue
- Return type
float
- Returns
the evaluated value in units of H/Ang.**deriv_idx or if convert_to_si is True in units of J/m**deriv_idx
- getReducedMass1(idx)¶
Return the reduced mass of the given normal mode using the Jaguar definition.
- Parameters
idx (int) – the normal mode index, 1-based
- Return type
float
- Returns
the reduced mass in kg
- getReducedMass2(idx)¶
Return the reduced mass of the given normal mode using the definition in the publications followed in this module.
- Parameters
idx (int) – the normal mode index, 1-based
- Return type
float
- Returns
the reduced mass in kg
- getReducedMass(idx)¶
Return the reduced mass of the given normal mode.
- Parameters
idx (int) – the normal mode index, 1-based
- Return type
float
- Returns
the reduced mass in kg
- collectAnharmonicFrequencies()¶
Update self.potentials with the anharmonic frequencies in wavenumbers (cm^-1).
- Raises
AnharmonicException – if there is an issue
- plotPotentials()¶
Plot the potentials.
- logCoefficientsTable()¶
Log coefficients table.
- logFrequencyTable()¶
Log frequency table.
- run()¶
Calculate the anharmonic potentials.
- class schrodinger.application.matsci.anharmonic.AnharmonicPartitionFunction(st=None, jagout_file_name=None, jagrin_file_name=None, max_freq=300, factor_data=None, jaguar_kwargs={'basis': 'LACVP**', 'dftname': 'B3LYP', 'igeopt': 1, 'molchg': 0, 'multip': 1}, temperature_data=None, pressure_data=None, max_i_freq=0, plot=False, process_no_anharmonicities=False, tpp=1, logger=None, robust=False)¶
Bases:
schrodinger.application.matsci.anharmonic.AnharmonicPotentials
- static getBeta(temperature)¶
Return beta.
- Parameters
temperature (float) – the temperature in K
- Return type
float
- Returns
beta in 1/J
- getClassicalParticleDensity(idx, temperature, factor)¶
For the given normal mode return the classical particle density evaluated at the given factor.
- Parameters
idx (int) – the normal mode index, 1-based
temperature (float) – the temperature in K
factor (float) – the point at which to evaluate
- Return type
float
- Returns
the classical particle density in 1/Ang.
- getCorrectionParticleDensity(idx, temperature, factor)¶
For the given normal mode return the particle density multiplicative correction evaluated at the given factor.
- Parameters
idx (int) – the normal mode index, 1-based
temperature (float) – the temperature in K
factor (float) – the point at which to evaluate
- Return type
float
- Returns
the particle density multiplicative correction (unitless)
- getParticleDensity(idx, temperature, factor)¶
For the given normal mode return the particle density evaluated at the given factor.
- Parameters
idx (int) – the normal mode index, 1-based
temperature (float) – the temperature in K
factor (float) – the point at which to evaluate
- Return type
float
- Returns
the particle density in 1/Ang.
- plotParticleDensity(idx, temperature)¶
For the given normal mode plot the particle density.
- Parameters
idx (int) – the normal mode index, 1-based
temperature (float) – the temperature in K
- checkCorrectionParticleDensity(idx, temperature)¶
For the given normal mode check the particle density multiplicative correction.
- Parameters
idx (int) – the normal mode index, 1-based
temperature (float) – the temperature in K
- Raises
AnharmonicException – if there is an issue
- getAnharmonicVibPartitionFunctions(temperature)¶
Return the ln of the anharmonic vibrational partition functions.
- Parameters
temperature (float) – the temperature in K
- Return type
dict
- Returns
keys are normal mode indices, 1-based, values are ln of the anharmonic vibrational partition functions
- getHarmonicVibPartitionFunctions(temperature)¶
Return the ln of the harmonic vibrational partition functions.
- Parameters
temperature (float) – the temperature in K
- Return type
dict
- Returns
keys are normal mode indices, 1-based, values are ln of the harmonic vibrational partition functions
- static getVibPartitionFunction(lnz_a_vibs, lnz_h_vibs)¶
Return the ln of the vibrational partition function.
- Return type
float
- Returns
the ln of the vibrational partition function
- logLnQTable(temperature, lnz_a_vibs, lnz_h_vibs)¶
Log lnQ table.
- Parameters
temperature (float) – the temperature in K
- setDivergencies()¶
Set divergencies.
- run()¶
Calculate the anharmonic partition function.
- class schrodinger.application.matsci.anharmonic.AnharmonicThermochemicalProperties(st=None, jagout_file_name=None, jagrin_file_name=None, max_freq=300, factor_data=None, jaguar_kwargs={'basis': 'LACVP**', 'dftname': 'B3LYP', 'igeopt': 1, 'molchg': 0, 'multip': 1}, temperature_data=None, pressure_data=None, max_i_freq=0, plot=False, process_no_anharmonicities=False, tpp=1, logger=None, robust=False)¶
Bases:
schrodinger.application.matsci.anharmonic.AnharmonicPartitionFunction
- getVibrationalTemperature(idx)¶
Return the vibrational temperature of the given normal mode.
- Parameters
idx (int) – the normal mode index, 1-based
- Return type
float
- Returns
the vibrational temperature in K
- getInternalEnergy(thermo)¶
Return the internal energy.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- Return type
float
- Returns
the internal energy in kcal/mol
- getZeroPointEnergy()¶
Return the zero point energy.
- Return type
float
- Returns
the zero point energy in kcal/mol
- getHeatCapacity(thermo)¶
Return the heat capacity.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- Return type
float
- Returns
the heat capacity in cal/(mol * K)
- getEntropy(thermo)¶
Return the entropy.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- Return type
float
- Returns
the entropy in cal/(mol * K)
- getEnthalpy(thermo)¶
Return the enthalpy.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- Return type
float
- Returns
the enthalpy in kcal/mol
- getGibbsFreeEnergy(thermo)¶
Return the Gibbs free energy.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- Return type
float
- Returns
the Gibbs free energy in kcal/mol
- logZeroPointEnergy()¶
Log zero point energy.
- logPropertyTable(thermo)¶
Log property table.
- Parameters
thermo (schrodinger.application.jaguar.results.ThermoCollection) – the thermo object
- run()¶
Calculate the anharmonic thermochemical properties.