def add_xyz_rxns_from_file(filename): """Add reactions from a file with lines in the format: name XX.YY>>ZZ""" with open(filename, 'r') as rxn_file: for line in rxn_file: name, rxn_str = line.split() reac_names, prod_names = rxn_str.split('>>') reacs = [ ade.Reactant(os.path.join(data_path, f'{name}.xyz')) for name in reac_names.split('.') ] prods = [ ade.Product(os.path.join(data_path, f'{name}.xyz')) for name in prod_names.split('.') ] rxn = ade.Reaction(*reacs, *prods, name=name) reactions.append(rxn) return None
import autode as ade ade.Config.n_cores = 8 reactant = ade.Reactant(name='3,4-dimethylhexa-1,5-diene', smiles='C=C[C@H](C)[C@@H](C)C=C') product = ade.Product(name='octa-2,6-diene', smiles='C/C=C/CC/C=C/C') reaction = ade.Reaction(reactant, product, name='cope_rearrangement') reaction.calculate_reaction_profile()
import autode as ade ade.Config.n_cores = 8 ade.Config.ORCA.keywords.set_opt_basis_set('ma-def2-SVP') ade.Config.ORCA.keywords.sp.basis_set = 'ma-def2-TZVP' methoxide = ade.Reactant(name='methoxide', smiles='C[O-]') propyl_chloride = ade.Reactant(name='propyl_chloride', smiles='CCCCl') chloride = ade.Product(name='Cl-', smiles='[Cl-]') propene = ade.Product(name='propene', smiles='CC=C') methanol = ade.Product(name='methanol', smiles='CO') reaction = ade.Reaction(methoxide, propyl_chloride, chloride, propene, methanol, name='E2', solvent_name='water') reaction.calculate_reaction_profile()
import autode as ade reac = ade.Reactant('claisen_r.xyz') prod = ade.Product('claisen_p.xyz') # Create an 8 image nudged elastic band with intermediate images interpolated # from the final points, thus they must be structurally similar neb = ade.neb.CINEB(initial_species=reac, final_species=prod, num=8) # minimise with XTB neb.calculate(method=ade.methods.XTB(), n_cores=4) # print the geometry of the peak species peak_species = neb.get_species_saddle_point() peak_species.print_xyz_file(filename='peak.xyz')
import autode as ade ade.Config.n_cores = 8 ade.Config.hcode = 'g09' # Use Gaussian09 as the high-level method # For hydroxide to be not too reactive requires diffuse functions; set all the ade.Config.G09.keywords.set_opt_basis_set('6-31+G(d)') ade.Config.G09.keywords.sp.basis_set = '6-311+G(d,p)' # Set up the first step in the hydrolysis of the ester, attack of OH- to get a # tetrahedral intermediate r1 = ade.Reactant(name='ester', smiles='CC(OC)=O') r2 = ade.Reactant(name='hydroxide', smiles='[OH-]') tet_int = ade.Product(name='tet_intermediate', smiles='CC([O-])(OC)O') step1 = ade.Reaction(r1, r2, tet_int, solvent_name='water') # Second step is collapse of the tetrahedral intermediate to the acid and # methoxide tet_int = ade.Reactant(name='tet_intermediate', smiles='CC([O-])(OC)O') p1 = ade.Product(name='acid', smiles='CC(O)=O') p2 = ade.Product(name='methodixe', smiles='[O-]C') step2 = ade.Reaction(tet_int, p1, p2, solvent_name='water') # Calculate the reactions in sequence, so the conformers of the tetrahedral # intermediate do not need to be found again reaction = ade.MultiStepReaction(step1, step2) reaction.calculate_reaction_profile()
import autode as ade import numpy as np ade.Config.n_cores = 4 reac = ade.Reactant('DA_r.xyz') prod = ade.Product('DA_p.xyz') pes = ade.pes.PES2d(reac, prod, r1s=np.linspace(1.45, 3.0, 10), r1_idxs=(0, 5), r2s=np.linspace(1.45, 3.0, 10), r2_idxs=(3, 4)) pes.calculate(name='da_surface', method=ade.methods.XTB(), keywords=ade.OptKeywords([])) # Save the matrix of energies (Ha) over the grid np.savetxt('da_surface.txt', pes.energies()) # and print the 2D surface pes.print_plot()
import autode as ade ade.Config.n_cores = 8 flouride = ade.Reactant(name='F-', smiles='[F-]') methyl_chloride = ade.Reactant(name='CH3Cl', smiles='ClC') chloride = ade.Product(name='Cl-', smiles='[Cl-]') methyl_flouride = ade.Product(name='CH3F', smiles='CF') reaction = ade.Reaction(flouride, methyl_chloride, chloride, methyl_flouride, name='sn2', solvent_name='water') reaction.calculate_reaction_profile()