def unimolecular_elimination_grid(bnd_atoms, ts_zma, brk_name): """ Build forward 2D grid for elimination reaction """ syms = automol.zmatrix.symbols(ts_zma) print('syms', syms) brk_coo, = automol.zmatrix.coordinates(ts_zma)[brk_name] print('brk_coo', brk_coo) print(automol.zmatrix.string(ts_zma)) brk_len_key = tuple(sorted(map(syms.__getitem__, brk_coo))) # interval = 0.2 * phycon.ANG2BOHR # rmin = 1.4 * phycon.ANG2BOHR # rmax = 2.8 * phycon.ANG2BOHR print('Check bad grid') npoints1 = 8 npoints2 = 4 bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: brk_len = bnd.LEN_DCT[brk_len_key] r1min = bnd_len + 0.2 * phycon.ANG2BOHR r1max = bnd_len + 1.4 * phycon.ANG2BOHR r2min = brk_len + 0.2 * phycon.ANG2BOHR r2max = brk_len + 0.8 * phycon.ANG2BOHR grid1 = numpy.linspace(r1min, r1max, npoints1) grid2 = numpy.linspace(r2min, r2max, npoints2) grid = [grid1, grid2] update_guess = False print('grid', grid) # sys.exit() return grid, update_guess
def hydrogen_migration_grid(npoints, bnd_atoms, ts_zma, dist_name): """ Build forward 1D grid for addition reaction """ interval = 0.3 * phycon.ANG2BOHR # get rmax from ts_zma rmax = automol.zmatrix.values(ts_zma)[dist_name] rmin1 = 2.0 * phycon.ANG2BOHR rmin2 = 1.3 * phycon.ANG2BOHR # print('ts_zma:', automol.zmatrix.string(ts_zma)) # print('rmin1, rmin2, rmax:', rmin1, rmin2, rmax) bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: rmin2 = bnd_len + 0.05 * phycon.ANG2BOHR if rmax > rmin1: npoints = math.ceil((rmax - rmin1) / interval) if npoints < 1: grid1 = [] else: grid1 = numpy.linspace(rmax, rmin1, npoints) else: grid1 = [] grid2 = numpy.linspace(rmin1, rmin2, 18) grid = numpy.concatenate((grid1, grid2), axis=None) update_guess = True # print('grids:', grid, grid1, grid2) return grid, update_guess
def ring_forming_scission_grid(npoints, bnd_atoms): """ Build forward WD grid for a ring forming scission reaction """ # the following allows for a 2-d grid search in the initial ts_search # for now try 1-d grid and see if it is effective npoints1 = 7 if npoints is None else npoints # npoints2 = 8 # syms = automol.zmatrix.symbols(ts_zma) # brk_coo, = automol.zmatrix.coordinates(ts_zma)[brk_name] # brk_len_key = tuple(sorted(map(syms.__getitem__, brk_coo))) # brk_len = bnd.LEN_DCT[brk_len_key] bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: r1min = bnd_len + 0.1 * phycon.ANG2BOHR r1max = bnd_len + 0.7 * phycon.ANG2BOHR # r2min = brk_len + 0.1 * phycon.ANG2BOHR # r2max = brk_len + 0.8 * phycon.ANG2BOHR grid1 = numpy.linspace(r1min, r1max, npoints1) # grid2 = numpy.linspace(r2min, r2max, npoints2) grid = grid1 # grid = [grid1, grid2] update_guess = False return grid, update_guess
def addition_bkp_grid(npoints, bnd_atoms): """ Build backward 1D grid for a beta scission reaction """ rmin = 1.6 * phycon.ANG2BOHR rmax = 2.8 * phycon.ANG2BOHR bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: npoints = 14 rmin = bnd_len + 0.1 * phycon.ANG2BOHR rmax = bnd_len + 1.4 * phycon.ANG2BOHR bkp_grid = numpy.linspace(rmin, rmax, npoints) bkp_update_guess = False return bkp_grid, bkp_update_guess
def insertion(npoints, bnd_atoms): """ Build forward 1D grid for insertion reaction """ npoints = 16 rmin = 1.4 * phycon.ANG2BOHR rmax = 2.4 * phycon.ANG2BOHR bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: rmin = bnd_len rmax = bnd_len + 1.4 * phycon.ANG2BOHR grid = numpy.linspace(rmin, rmax, npoints) update_guess = False return grid, update_guess
def hydrogen_abstraction(npoints, bnd_atoms): """ Build forward 1D grid for hydrogen abstraction reaction """ npoints = 8 rmin = 0.7 * phycon.ANG2BOHR rmax = 2.2 * phycon.ANG2BOHR bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: rmin = bnd_len + 0.2 rmax = bnd_len + 1.0 * phycon.ANG2BOHR grid = numpy.linspace(rmin, rmax, npoints) update_guess = False return grid, update_guess
def addition_grid(npoints, bnd_atoms): """ Build forward 1D grid for addition reaction """ npoints = 14 rmin = 1.6 * phycon.ANG2BOHR rmax = 2.8 * phycon.ANG2BOHR bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: rmin = bnd_len + 0.1 * phycon.ANG2BOHR rmax = bnd_len + 1.2 * phycon.ANG2BOHR grid = _geometric_progression(rmin, rmax, npoints, gfact=1.1, rstp=0.05) update_guess = False return grid, update_guess
def beta_scission_grid(npoints, bnd_atoms): """ Build forward 1D grid for a beta scission reaction """ # This logic seems backward - sjk npoints = 8 if npoints is not None else npoints rmin = 1.4 * phycon.ANG2BOHR rmax = 2.0 * phycon.ANG2BOHR bnd_len = bnd.read_len(bnd_atoms) if bnd_len is not None: npoints = 14 rmin = bnd_len + 0.1 * phycon.ANG2BOHR rmax = bnd_len + 0.8 * phycon.ANG2BOHR grid = numpy.linspace(rmin, rmax, npoints) update_guess = False return grid, update_guess