Exemplo n.º 1
0
def calc_productAndTS(name):
    smiles = 'C1' + name + 'C1'
    mol = rdkitTools.smiles2plams(smiles)
    mol.properties.smiles = smiles
    product = dftb(templates.geometry.overlay(settings),
                   mol,
                   job_name=name + "_product")

    constraint1 = "dist 1 2"
    constraint2 = "dist 4 5"

    sv1 = startvalue[name[0]]
    sv2 = startvalue[name[2]]

    # scan input
    if name[0] == name[2]:
        # symmetric molecule
        scan = {
            'constraint': [constraint1, constraint2],
            'surface': {
                'nsteps': 4,
                'start': [sv1, sv2],
                'stepsize': [0.1, 0.1]
            }
        }
    else:
        scan = {
            'constraint': constraint1,
            'surface': {
                'nsteps': 4,
                'start': sv1,
                'stepsize': 0.1
            },
            'scan': {
                'constraint': constraint2,
                'surface': {
                    'nsteps': 4,
                    'start': sv2,
                    'stepsize': 0.1
                }
            }
        }

    # PES = gathered (promised) result objects for each point in the scan
    PES = PES_scan(dftb,
                   settings,
                   product.molecule,
                   scan,
                   job_name=name + "_PESscan")

    # get the object presenting the molecule with the maximum energy calculated from the scan
    apprTS = select_max(PES, 'energy')

    # perform the TS optimization using the default TS template
    TS = dftb(templates.ts.overlay(settings),
              apprTS.molecule,
              job_name=name + "_TS")
    return product, TS
Exemplo n.º 2
0
                        'start': sv1,
                        'stepsize': 0.1
                    },
                    'scan': {
                        'constraint': constraint2,
                        'surface': {
                            'nsteps': 4,
                            'start': sv2,
                            'stepsize': 0.1
                        }
                    }
                }

            # returns a set of results object containing the output of
            # each point in the scan
            LT = PES_scan(dftb, settings, product, scan)

            # Gets the object presenting the molecule
            # with the maximum energy calculated from the scan
            apprTS = select_max(LT, 'energy')

            # Run the TS optimization, using the default TS template
            TS = dftb(templates.ts.overlay(settings), apprTS.molecule)

            # Actual execution of the jobs
            reactives = [E_reactant, E_product, TS]
            E_reactant, E_product, TS = run(gather(*reactives), n_processes=1)

            # Retrieve the molecular coordinates
            mol = TS.molecule
            d1 = bond_distance(mol.atoms[0].coords, mol.atoms[1].coords)
Exemplo n.º 3
0
constraint1 = "dist 1 5"
constraint2 = "dist 3 4"

# scan input
scan = {
    'constraint': [constraint1, constraint2],
    'surface': {
        'nsteps': 6,
        'start': [2.3, 2.3],
        'stepsize': [0.1, 0.1]
    }
}

# returns a set of results object containing the output of
# each point in the scan
lt = PES_scan([dftb, adf], settings, cnc, scan)

# Gets the object presenting the molecule
# with the maximum energy calculated from the scan
apprTS = select_max(lt, "energy")

appr_hess = dftb(templates.freq.overlay(settings), apprTS.molecule)

t = Settings()
t.specific.adf.geometry.inithess = appr_hess.archive.path

# Run the TS optimization with ADF, using initial hessian from DFTB freq calculation
ts = run(adf(templates.ts.overlay(settings).overlay(t), appr_hess.molecule),
         n_processes=1)

# Retrieve the molecular coordinates