output = self._load_scan_specs('S', get_after_letter_spec=True) return int(output[0][0]) def load_negative_frequency(self): """ Return the negative frequency from a transition state frequency calculation in cm^-1. """ frequency = None frequencies = [] with open(self.path, 'r') as f: line = f.readline() while line != '': # Read vibrational frequencies if 'Frequencies --' in line: frequencies.extend(line.split()[2:]) line = f.readline() frequencies = [float(freq) for freq in frequencies] frequencies.sort() try: frequency = [freq for freq in frequencies if freq < 0][0] except IndexError: raise LogError( f'Unable to find imaginary frequency in Gaussian output file {self.path}' ) return frequency register_ess_adapter("GaussianLog", GaussianLog)
while line != '': # Read vibrational modes if 'Mode Eigenvalue(AU) Frequency(cm-1)' in line: line = f.readline() # example: # 'Mode Eigenvalue(AU) Frequency(cm-1) Intensity(km/mol) Vib.Temp(K) ZPE(AU) ...' # ' 1 0.0331810528 170.5666870932i 52.2294230772 245.3982965841 0.0003885795 ...' frequency = -1 * float(line.split()[2][:-1]) # remove 'i' break f.readline() if frequency is None: raise LogError( f'Unable to find imaginary frequency in TeraChem output file {self.path}.' ) return frequency def load_scan_pivot_atoms(self): """Not implemented for TeraChem""" raise NotImplementedError( 'The load_scan_pivot_atoms method is not implemented for TeraChem Logs' ) def load_scan_frozen_atoms(self): """Not implemented for TeraChem""" raise NotImplementedError( 'The load_scan_frozen_atoms method is not implemented for TeraChem Logs' ) register_ess_adapter("TeraChemLog", TeraChemLog)
angle = np.arange(0.0, 2 * math.pi + 0.00001, 2 * math.pi / (len(v_list) - 1), np.float64) return v_list, angle def load_negative_frequency(self): """ Return the imaginary frequency from a transition state frequency calculation in cm^-1. """ frequency = 0 with open(self.path, 'r') as f: for line in f: # Read imaginary frequency if ' Frequency:' in line: frequency = float((line.split()[1])) break # Make sure the frequency is imaginary: if frequency < 0: return frequency else: raise LogError('Unable to find imaginary frequency in QChem output file {0}.'.format(self.path)) def load_scan_pivot_atoms(self): """Not implemented for QChem""" raise NotImplementedError('The load_scan_pivot_atoms method is not implemented for QChem Logs') def load_scan_frozen_atoms(self): """Not implemented for QChem""" raise NotImplementedError('The load_scan_frozen_atoms method is not implemented for QChem Logs') register_ess_adapter("QChemLog", QChemLog)
def get_D1_diagnostic(self): """ Returns the D1 diagnostic from output log. If multiple occurrences exist, returns the last occurrence """ with open(self.path) as f: log = f.readlines() for line in reversed(log): if 'D1 diagnostic: ' in line: items = line.split() return float(items[-1]) raise LogError( 'Unable to find D1 diagnostic in energy file: {0}'.format( self.path)) def load_scan_pivot_atoms(self): """Not implemented for Molpro""" raise NotImplementedError( 'The load_scan_pivot_atoms method is not implemented for Molpro Logs' ) def load_scan_frozen_atoms(self): """Not implemented for Molpro""" raise NotImplementedError( 'The load_scan_frozen_atoms method is not implemented for Molpro Logs' ) register_ess_adapter("MolproLog", MolproLog)
def load_scan_pivot_atoms(self): """Not implemented for Orca""" raise NotImplementedError( 'The load_scan_pivot_atoms method is not implemented for Orca Logs' ) def load_scan_frozen_atoms(self): """Not implemented for Orca""" raise NotImplementedError( 'The load_scan_frozen_atoms method is not implemented for Orca Logs' ) def get_T1_diagnostic(self): """ Returns the T1 diagnostic from output log. If multiple occurrences exist, returns the last occurrence """ with open(self.path) as f: log = f.readlines() for line in reversed(log): if 'T1 diagnostic ' in line: items = line.split() return float(items[-1]) raise LogError( 'Unable to find T1 diagnostic in energy file: {}'.format( self.path)) register_ess_adapter("OrcaLog", OrcaLog)