Skip to content

Commit

Permalink
Added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom committed May 19, 2020
1 parent 2e01915 commit 5062c2f
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 116 deletions.
116 changes: 1 addition & 115 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ autode/conformers/cconf_gen.c

autode/solvent/csolvent.c

examples/

doc/_build/
.DS_Store

Expand All @@ -35,119 +33,7 @@ tests/htmlcov/

htmlcov/

tests/data/pes2d/SN2_PES_const_opt_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_0-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_1-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_2-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_3-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_4-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_5-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_6-6_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-0_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-1_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-2_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-3_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-4_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-5_xtb.xyz

tests/data/pes2d/SN2_PES_scan_7-6_xtb.xyz
tests/data/pes2d/*.xyz

tests/data/template_ts_guess_constrained_opt_ll_xtb.xyz

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Broadly, **autodE** is invoked by first setting appropriate parameters in config
Then, initialising _Reactant_ and _Product_ objects, generating a _Reaction_ object from those and invoking a method
e.g. _locate_transtion_state()_ or _calculate_reaction_profile()_. For example, the 1,2 hydrogen shift in a propyl radical

```
```python
from autode import *
Config.n_cores = 8

Expand Down
28 changes: 28 additions & 0 deletions examples/addition_elimination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from autode import *
from autode.molecule import product_to_reactant

Config.n_cores = 8

# For hydroxide to be not too reactive in solution requires diffuse functions
Config.ORCA.keywords.low_opt = ['PBE0', 'D3BJ', 'LooseOpt', 'ma-def2-SVP']
Config.ORCA.keywords.hess = ['PBE0', 'D3BJ', 'Freq', 'ma-def2-SVP']
Config.ORCA.keywords.opt = ['PBE0', 'D3BJ', 'LooseOpt', 'ma-def2-SVP']

# Set up the first step in the hydrolysis of the ester, attack of OH- to get a tetrahedral intermediate
r1 = Reactant(name='ester', smiles='CC(OC)=O')
r2 = Reactant(name='hydroxide', smiles='[OH-]')
tet_int = Product(name='tet_intermediate', smiles='CC([O-])(OC)O')

step1 = Reaction(r1, r2, tet_int, solvent_name='water')

# Second step is collapse of the tetrahedral intermediate to the acid and methoxide
tet_int = product_to_reactant(tet_int)
p1 = Product(name='acid', smiles='CC(O)=O')
p2 = Product(name='methodixe', smiles='[O-]C')

step2 = 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 = MultiStepReaction(step1, step2)
reaction.calculate_reaction_profile()
9 changes: 9 additions & 0 deletions examples/carbonyl_addition.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from autode import Reactant, Product, Reaction, Config
Config.n_cores = 4

r1 = Reactant(smiles='CC(C)=O', name='acetone')
r2 = Reactant(smiles='[C-]#N', name='cn-')
p = Product(smiles='CC([O-])(C#N)C', name='prod')

reaction = Reaction(r1, r2, p, solvent_name='water')
reaction.calculate_reaction_profile()
9 changes: 9 additions & 0 deletions examples/cope_rearrangement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from autode import *

Config.n_cores = 8

reactant = Reactant(name='3,4-dimethylhexa-1,5-diene', smiles='C=C[C@H](C)[C@@H](C)C=C')
product = Product(name='octa-2,6-diene', smiles='C/C=C/CC/C=C/C')

reaction = Reaction(reactant, product, name='cope_rearrangement')
reaction.calculate_reaction_profile()
10 changes: 10 additions & 0 deletions examples/diels_alder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from autode import *

Config.n_cores = 2

butadiene = Reactant(name='butadiene', smiles='C=CC=C')
ethene = Reactant(name='ethene', smiles='C=C')
cyclohexene = Product(name='cyclohexene', smiles='C1C=CCCC1')

reaction = Reaction(butadiene, ethene, cyclohexene, name='diels_alder')
reaction.calculate_reaction_profile()
13 changes: 13 additions & 0 deletions examples/elimination.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from autode import *

Config.n_cores = 2

methoxide = Reactant(name='methoxide', smiles='C[O-]')
propyl_chloride = Reactant(name='propyl_chloride', smiles='CCCCl')
chloride = Product(name='Cl-', smiles='[Cl-]')
propene = Product(name='propene', smiles='CC=C')
methanol = Product(name='methanol', smiles='CO')

reaction = Reaction(methoxide, propyl_chloride, chloride, propene, methanol,
name='elimination', solvent_name='water')
reaction.calculate_reaction_profile()
11 changes: 11 additions & 0 deletions examples/sn2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from autode import *

Config.n_cores = 2

flouride = Reactant(name='F-', smiles='[F-]')
methyl_chloride = Reactant(name='CH3Cl', smiles='ClC')
chloride = Product(name='Cl-', smiles='[Cl-]')
methyl_flouride = Product(name='CH3F', smiles='CF')

reaction = Reaction(flouride, methyl_chloride, chloride, methyl_flouride, name='sn2', solvent_name='water')
reaction.calculate_reaction_profile()

0 comments on commit 5062c2f

Please sign in to comment.