import os res = VibTools.SNFResults(outname='snf_h2o/snf.out', restartname='snf_h2o/restart', coordfile='snf_h2o/coord') res.read() # use the normal modes in the following (no localization) modes = res.modes # Define the grid ngrid = 16 amp = 14 grid = vib.Grid(res.mol, modes) grid.generate_grids(ngrid, amp) # Read in anharmonic 1-mode potentials v1 = vib.Potential(grid, order=1) v1.read_np(os.path.join('potentials', 'V1_g16.npy')) # Read in anharmonic 1-mode dipole moments dm1 = vib.Dipole(grid) dm1.read_np(os.path.join('potentials', 'Dm1_g16.npy')) # Read in anharmonic 2-mode potentials v2 = vib.Potential(grid, order=2)
import Vibrations as vib print vib.Misc.fancy_box('Example 1:') print 'Use of existing grids and potentials.' print print ' Data taken from: http://pes-database.theochem.uni-stuttgart.de/surfaces/index.php' print ' By Guntram Rauhut and co-workers' # Create an empty grid grid = vib.Grid() # Read in an existing grid grid.read_np('grids.npy') # Create 1-mode potentials v1 = vib.Potential(grid, order=1) # Read in 1-mode potentials v1.read_np('1D.npy') v2 = vib.Potential(grid, order=2) v2.read_np('2D.npy') # Perform VSCF with 2-mode potentials VSCF = vib.VSCF2D(v1, v2) VSCF.solve_singles() # VCI part # Initialize a VCI object with the VSCF groundstate wavefunction and the # potentials VCI = vib.VCI(VSCF.get_groundstate_wfn(), v1, v2)
# using VibTools (LocVib package) res = VibTools.SNFResults() res.read() # Now localize modes in separate subsets subsets = [[0, 4], [4, 8], [8, 12]] localmodes, cmat = localize_subsets(res.modes, subsets) # Define the grid ngrid = 16 amp = 14 grid = vib.Grid(res.mol, localmodes) grid.generate_grids(ngrid, amp) # Generate harmonic 1-mode potentials v1 = vib.Potential(grid, order=1) v1.generate_harmonic(cmat=cmat) # Generate harmonic 1-mode dipole moments dmh = vib.Dipole(grid) dmh.generate_harmonic(res) # Generate harmonic 2-mode potentials v2 = vib.Potential(grid, order=2)
def __init__(self, dirname): f = open(dirname + '/grid_params') lines = f.readlines() f.close() whichmodes = None localized = None if os.path.isfile(dirname + '/whichmodes'): whichmodes = [] f = open(dirname + '/whichmodes') lines2 = f.readlines() f.close for l in lines2: for el in l.split(): whichmodes.append(int(el)) grid_params = lines[0].split() self.ngrid = int(grid_params[0]) self.amp = int(grid_params[1]) res = VibTools.SNFResults(outname=dirname + '/snf.out', restartname=dirname + '/restart', coordfile=dirname + '/coord') res.read() self.freqs = res.modes.freqs self.ints = res.get_ir_intensity() modes = res.modes if whichmodes is not None: self.freqs = res.modes.freqs[whichmodes] self.ints = res.get_ir_intensity( modes=res.modes.get_subset(whichmodes)) modes = res.modes.get_subset(whichmodes) self.grid = vib.Grid(res.mol, modes) self.grid.generate_grids(self.ngrid, self.amp) self.v1 = vib.Potential(self.grid, 1) self.v1.read_np(dirname + '/v1.npy') self.v1_harm = vib.Potential(self.grid, 1) self.v1_harm.generate_harmonic() self.dm1_harm = vib.Dipole(self.grid, 1) self.dm1_harm.generate_harmonic(res) self.v2 = vib.Potential(self.grid, 2) self.v2.read_np(dirname + '/v2.npy') self.dm1 = vib.Dipole(self.grid, 1) self.dm1.read_np(dirname + '/dm1.npy') self.dm2 = vib.Dipole(self.grid, 2) self.dm2.read_np(dirname + '/dm2.npy') self.diagonal_eigv = np.load(dirname + '/diagonal_eigv.npy') self.vscf_singles_energies = np.load(dirname + '/vscf_singles.npy') self.vci1 = np.load(dirname + '/vci1.npy') self.vci2 = np.load(dirname + '/vci2.npy') self.vci3 = np.load(dirname + '/vci3.npy') self.vci4 = np.load(dirname + '/vci4.npy') self.vci1_int = np.load(dirname + '/vci1_int.npy')