def beta_scission_ts_geometry(rxn, rct_geos, max_dist_err=2e-1, log=False): """ geometry for a beta scission transition state :param rxn: a Reaction object :param rct_geos: the reactant geometries """ assert rxn.class_ == ReactionClass.Typ.BETA_SCISSION assert rxn.has_standard_keys() brk_bnd_key, = ts.breaking_bond_keys(rxn.forward_ts_graph) brk_bnd_dist = 1.5 dist_dct = automol.geom.ts.distances(rct_geos, angstrom=True) dist_dct[brk_bnd_key] = brk_bnd_dist gra = ts.reactants_graph(rxn.forward_ts_graph) dist_range_dct = automol.graph.embed.distance_ranges_from_coordinates( gra, dist_dct, angstrom=True) geo_init, = rct_geos relax_ang = False relax_tors = False geo = _geometry_from_info( gra, rct_geos, geo_init, dist_range_dct, relax_ang=relax_ang, relax_tors=relax_tors, max_dist_err=max_dist_err, log=log) return geo
def ring_forming_scission_ts_geometry(rxn, rct_geos, max_dist_err=2e-1, log=False): """ geometry for a ring-forming scission transition state :param rxn: a Reaction object :param rct_geos: the reactant geometries """ assert rxn.class_ == ReactionClass.Typ.RING_FORM_SCISSION assert rxn.has_standard_keys() frm_bnd_key, = ts.forming_bond_keys(rxn.forward_ts_graph) brk_bnd_key, = ts.breaking_bond_keys(rxn.forward_ts_graph) frm_bnd_dist = 2.0 brk_bnd_dist = 1.5 d1234 = 180. dist_dct = automol.geom.ts.distances(rct_geos, angstrom=True) dist_dct[frm_bnd_key] = frm_bnd_dist dist_dct[brk_bnd_key] = brk_bnd_dist # Note that this will not set the angle to exactly 180, because we don't # yet know the 1-3 and 2-4 distances. chain_keys = ring_forming_scission_chain(rxn) key1, key2, key3, key4 = chain_keys[:4] dih_dct = {(key1, key2, key3, key4): (d1234, None)} gra = ts.reactants_graph(rxn.forward_ts_graph) dist_range_dct = automol.graph.embed.distance_ranges_from_coordinates( gra, dist_dct, dih_dct=dih_dct, degree=True, angstrom=True) geo_init, = rct_geos relax_ang = True relax_tors = True geo = _geometry_from_info( gra, rct_geos, geo_init, dist_range_dct, relax_ang=relax_ang, relax_tors=relax_tors, max_dist_err=max_dist_err, log=log) # Rerun the optimization, enforcing planarity on the ring dist_dct = automol.geom.ts.distances([geo], angstrom=True) dist_dct[frm_bnd_key] = frm_bnd_dist dist_dct[brk_bnd_key] = brk_bnd_dist pla_dct = {} for key1, key2, key3, key4 in mit.windowed(chain_keys, 4): pla_dct[(key1, key2, key3, key4)] = (0.0, 0.0) gra = ts.reactants_graph(rxn.forward_ts_graph) dist_range_dct = automol.graph.embed.distance_ranges_from_coordinates( gra, dist_dct, degree=True, angstrom=True) geo = _geometry_from_info( gra, [geo], geo, dist_range_dct, relax_ang=relax_ang, relax_tors=relax_tors, pla_dct=pla_dct, max_dist_err=max_dist_err, log=log) return geo
def breaking_bond_keys(rxn, rev=False): """ Obtain breaking bonds for the reaction. :param rxn: the reaction object :type rxn: Reaction :param rev: parameter to toggle reaction direction :type rev: bool :rtype: frozenset[frozenset[int]] """ if rev: tsg = rxn.backward_ts_graph else: tsg = rxn.forward_ts_graph return ts.breaking_bond_keys(tsg)