CSC Spring School 2018
Orca 4.0 & Gabedit
Michael Patzschke Institute for Resource Ecology HZDR
14.03.2018
Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de HZDR: Aerial View
Photo: Jürgen-M. Schulter / dresden-luftfoto.de
Page 2 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Non-university public research in Germany • Research organizations • co-funded by Federal government & Federal state governments
• 18 independent research centers • co-funded by Federal government (90%) & Federal state governments (10%)
• Budget (2013): ~3.6 billion € (>30%: third party funding) • ~ 36,000 employees (~12,200 scientists) • Program-oriented research: Energy, Earth and Environment, Health, Aeronautics, Space and Transport, Key Technologies, plus Structure of Matter
Page 3 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Outline Research at HZDR 1,000 HZDR employees conduct research in the sectors Energy, Health and Matter.
• How can energy and resources be utilized in an efficient, safe, and sustainable way? • How can malignant tumors be more precisely visualized, characterized, and more effectively treated? • How do matter and materials behave under the influence of strong fields and in smallest dimensions?
• 8 institutes & 1 dept. of research technology
Page 4 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de OutlineResearch at the Institute of Resource Ecology
… protect humans and the environment from hazards caused by pollutants resulting from technical processes that produce energy and raw materials.
• Ecological risks of radioactive and non-radioactive metals in the context of nuclear waste disposal, the production of energy in nuclear power plants and in processes along the value chain of metalliferous raw materials • Topics: • Long-lived radionuclides in disposal sites and biological systems • Nuclear Reactor Safety • Particle-mediated transport in geosystems • Basic actinide-chemistry research
Page 5 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Input File Distribution
• Updated today • All orca inputs from the slides are available and checked to run with orca 4.0 • Important changes in basis set nomenclature from version 3.0 • For gabedit versions prior to 2.5.0 the following changes have to be made manually • Please replace: DEF2-SVP/J DEF2/J For RIDFT, RIJONX and RIJCOSX ZORA DEF2-SVP ZORA ZORA-DEF2-SVP For elements up to Kr ZORA DEF2-TZVPP ZORA SARC-ZORA-TZVPP For elements heavier than Kr ECP{def2-SVP} def2-ECP All ECP{} deprecated • Please keep: DEF2-SVP/C For MP2, DLPNO-CCSD(T) … • Please use: DEF2-SVP/JK For NEVPT2 with RIJCOSX or RIJK SARC/J For RIDFT with SARC basis
Page 6 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de The Codes
• Orca – general purpose QC code – Free (download from http://cec.mpg.de/forum/) – Developed by F.Neese et al. in C++ – Precompiled binaries (no sources) • Gabedit – Free (download from https://sites.google.com/site/allouchear/Home/gabedit/download) – Developed by A.-R. Allouche – Sources and Binaries available • Both codes available for Mac, Linux & Windows – Good combination for research & teaching
Page 7 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Learning Outcome
• Draw and import molecular structure • Pre-optimization • Creating input files using the GUI • Writing simple input files • Comparing QC methods (quality and timing) • Running constraint optimizations • Relativistic effect • Visualizing results
Page 8 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Gabedit
• Assuming you have the gabedit executable in your $PATH • Please open a terminal: mkdir qc_lab cd qc_lab gabedit • Have a look around • Open the structure editor
Page 9 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Editing Structures
• Press the pen tool to add atoms • Press the periodic-table button to change the atom (C is standard) • Press the button below that to toggle adding hydrogens • Pre-optimizing self-drawn structures – Important for speedup of real calculations – Avoid for transition metals, lanthanides & actinides – Two methods available: MM or semiempirical calculations • Press “M” button or right-click in drawing window – Choose “Molecular Mechanics” “Optimization”
Page 10 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Editing Structures – Further Points
• Fragments can be used to draw structures • Parts of the molecule can be selected • Atoms and parts of the molecule can be removed • And moved
• Structural parameters can be measured and changed • Measurements can be shown or removed
• For Semi-empirical methods: – Interface to Mopac, Orca & Firefly
Page 11 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Drawing Formaldehyde
• Please try to draw formaldehyde – “Menu-Edit-Delete Molecule” – Add Carbon – Choose Oxygen from periodic table – Replace one hydrogen – Click on the bond to make double bond – Pre optimize using MM
• The result should look like this
• Close the drawing window (“Menu-Close”) (saving possible – not necessary here)
Page 12 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Setting up an Orca calculation
• Gabedit generates input for different QC codes • Choose Orca from the top menu
• The pop-up menu lets you set up the calculation • Change “Job Type” to “Equilibrium Structure Search” • Change “Type of method” to “Meta-GGA and hybrid meta GGA's” • Change “Method” to “TPSS” • Change “Type” to “def2 Ahlrichs basis sets”
Page 13 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Setting up an Orca calculation
• “Basis” will change, leave that choice
• Press “Ok”
Page 14 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Orca Input Files
• Inspect the generated input file # Lines are comments ! Lines contain keywords % Lines start key blocks end lines end key blocks * starts and ends the geometry block • Comments can be inserted like this: ! Opt # this will be ignored # TPSS
• The “output” block is added by gabedit for visualisation, but not necessary
• The “geom” block is wrong (more later) Please remove it!
Page 15 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Running Orca
• Input files can be saved (“File” menu)
• QC codes can be run by Gabedit – Set up run commands in “Settings”-“Preferences” on the “Commands” tab
– Press cogwheels to start a job – Choose “Orca” – Press “Ok” – Click on “NoName.out” tab to see the output
Page 16 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Interlude
• Congratulations, you have hopefully just run your Orca calculation • A few considerations: – Gabedit is useful for drawing simple structures many alternatives exist (have a look at Avogadro) – Good to remember basic input file structure – Excellent for visualizing results – The input file can be changed in gabedit – A simple text editor might be easier to use ... • We will visualize the results • Then an editor will be used to set up some more advanced calculations
Page 17 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Looking at Results
• During a run you can – Look at the output file – Update it – Look at geometry convergence – Visualize MO's & Densities from the first step of the calculation – Get data from remote calculations
• After the calculation has finished, press the visualize button
Page 18 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Visualizing Orbitals
• In the visualization window click “M” or right-click • Choose “Orbitals” from the menu • Choose “Orca output file” • Read the “NoName.out” file • An MO selection should appear – Select an orbital – The right part shows its participating AO’s – Change cut-off value here – Click “Ok”
Page 19 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Visualising Orbitals
• Orbitals are calculated in a cube – Select position here – Select size here – Select quality here – Standard choices are ok – Press “Ok”
• After the calculation is finished you can – Change the iso-value – 0.1 should be a good choice – Get a proposition for a certain size – Press “Ok”
Page 20 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Other Things to Visualise
• Take a few moments to look around the menu (“M” or right-click”)
• Geometry optimizations can be visualized from the .trj files • Choose “Animation” and load the .trj file • Press “Play”
• A movie can be made for presentation purposes (using ImageMagick)
Page 21 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Orca Input Help
• Have the orca manual ready (827 pages including theory...) Actually a rather useful textbook as well
• Have a look at https://sites.google.com/site/orcainputlibrary/home – a very good input library
• Under http://cec.mpg.de/forum/ you can join the forum – Very active, fast help – Please read the manual and consult the forum before complaining!
Page 22 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de More Advanced Calculations
• Close gabedit (Press “File”-“Exit” from the main window) • Open your input file using your favourite editor • Edit it to look like this: !Opt TPSS Def2-SV(P) • Change the functional * xyz 0 1 C -1.182146 -0.191818 -11.887076 – For a list see next page H -1.567738 0.546391 -12.590258 H -1.864597 -0.714867 -11.217165 • Change the basis set O 0.022990 -0.429026 -11.844415 – For a list see further down * • Save the input file under a new name • Start orca by issuing at the prompt: “orca filename.inp > filename.out &”
Page 23 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Orca – List of DFT functionals
• Available functionals • Double hybrids are available (MP2 calculation will be performed!) • DFT tries to use the RI approach automatically (NORI to witch of) • Dispersion correction with keyword D3 • Orca 4.0 adds the following range- separated functionals: wB97 , wB97X, B97X , wB97X-D3 , CAM-B3LYP , LC-BLYP
Page 24 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Basis Sets in Orca
• Many different basis sets available some examples: – Ahlrich's good for DFT – Dunning's good for CC – Basis set can be changed for an element: %basis newgto Element "def2-TZVPP” # Specifying the basis set on "Element” end end
• Or for a specific atom in the geometry section: H 0.0 0.0 1.0 newgto "def2-TZVP" end
• To try MP2 use the following line: !Opt RI-MP2 def2-TZVPP def2/J def2-TZVPP/C TightSCF RIJCOSX
• For test purposes here you might want to replace TZVPP by SVP
Page 25 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de RI for HF and Hybrid DFT Nelec Nelec Nelec • Energy expression in WF theory: E = V + h + (J K ) nn i ij ij i=1 i=1 j>i X X X
EDFT = TS[⇢]+Ene[⇢]+J[⇢]+EXC[⇢] • Energy expression in DFT: E [⇢]=(T [⇢] T [⇢]) + (E [⇢] J[⇢]) XC S ee • Both contain a coulomb part (J) and an exchange part (K) • Approximative treatments for these exist for pure functionals (no exact exchange) simple RI is used • For HF three approximation exist: 1. RI for J and K – hard to get to high accuracy 2. RI for J exact treatment for K good for large molecules as K scales linearily 3. Special approximative treatment for J and K • All three need auxiliary basis sets and have different names 1. Do not use! 2. RIJONX with “basis-set”/J 3. RIJCOSX with “basis-set”/J
Page 26 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Your Task – Just an Idea
• Make a small table for the C-O bond length of formaldehyde and computational timings using two or three different methods and two or three different basis sets • Run calculations, fill in the table and compare with experimental data
SVP TZVPP QZVPP Exp r(CO) = r(CO) = r(CO) = BP86 t = t = t = r(CO) = r(CO) = r(CO) = TPSS t = t = t = r(CO) = r(CO) = r(CO) = r(CO) = PBE0 t = t = t = 120.5 pm r(CO) = r(CO) = r(CO) = HF t = t = t = r(CO) = r(CO) = r(CO) = MP2 t = t = t =
Page 27 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Remarks on the Task
• The table is a suggestion only • To run HF simply do: ! Opt def2-SVP
• MP2 TZVPP took 30 s on my laptop • MP2 QZVPP should be feasible • If you want to have fun, try: !Opt def2-TZVPP def2/J def2-TZVPP/C TightSCF RIJCOSX !DLPNO-CCSD(T) NumGrad %maxcore 2000
– This does a numerical CCSD(T) optimisation – Needs a lot of memory – Useful for optimising certain structural parameters (constraint search)
Page 28 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Geometry Specification • Defining charge and multiplicity – first line of geometry block: * int 0 1 first word = form of geometry data (xyz, int or gzmt) first number = charge, second number = multiplicity (1 for singlet, 2 for doublet) • or reading an external file with: * xyzfile 1 2 filename.xyz • One can add dummies (DA), ghosts (Mg:), point charges (Qn.nn) (furthermore isotopes, emebedding potentials and fragments)
• Orca does not use symmetry to speed up calculations – Symmetry can be used to classify MO’s – To do this, add the keyword “UseSym”
• To run orca in parallel add the keyword “PalN” where N is the number of cores • Alternatively use the block: %pal nprocs 4 # any number (posi ve integer) end • Do not use more than 16 cores • Start orca with the full path to the executable, even if the directory is in your $PATH
Page 29 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Properties: IR & Thermochemistry
• Vibrational frequencies are available for HF, MP2, GGA and hybrid GGA functionals through: !Opt Freq • Speedup through much memory, give per core with the extra line: %maxcore 1000 • For all other methods numerical frequencies possible: !Opt NumFreq • Using at least ’TightSCF’ is recommended for frequency runs • Thermochemistry for different temperatures with: %freq Temp 290, 295, 300 end • Many other properties available – electronic absorption, – NMR – ESR
Page 30 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Solvent Effects
• Solvent effects on structures and frequencies through CPCM • CPCM or SMD, – in command line for CPCM: ! CPCM(solvent) – Or in case you need COSMO: ! CPCMC(solvent) – As input block for SMD: ! CPCM(solvent %cpcm smd true solvent “solvent” end
• SMD (solvent model density) is recommended • A list of available solvents (179 different solvents) can be found on the manual pages 680-681
Page 31 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Relativity
• Two ways to include scalar relativistic effects (SO only in multi-reference calc.): • For elements heavier than Kr one can include ECP’s with: ! BP def2-SVP def2/J def2-ECP printbasis where printbasis prints the basis, in order to check that ECP and basis set fit (this is not so important in orca 4.0 as ECP and basis are defined in two steps) • Other choices for ECP exist for example def-SD or SDD for actinides (see manual pp.31) • All electron ZORA or DKH2 calculations: ! BP86 ZORA ZORA-def2-SVP def2/J TIGHTSCF printbasis ! BP86 DKH2 DKH-def2-SVP def2/J TIGHTSCF printbasis • For SARC basis sets the auxilliary J sets are called SARC/J • Defining a special basis set requires: U 0.0 0.0 1.0 newgto ”SARC-ZORA-TZVP" end Useful for combining SARC with ZORA-def2 basis sets • If there is no auxilliary basis you can create one with the command AutoAux
Page 32 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de ECP’s for Actinides
• Problem: The Stuttgart ECP’s for actinides have !def2-TZVPP ECP{def2-TZVPP} !NoIter PrintBasis been removed starting from version 4.0 %scf guess=hcore end • ECP’s and basis sets can be read in * xyz 2 1 • Basis set is in turbomole format, U 0.0 0.0 0.0 O 0.0 0.0 1.8 ECP is in gaussian format O 0.0 0.0 -1.8 • This is confusing – but there is a solution *
• In orca 3.x.x run a calculation ! B3LYP RIJCOSX TightSCF def2-SVP autoaux with the following input: %basis NewGTO U (use the elements you need…) S 3 1 12098.0820000000 0.0288416845 • Copy the ecp and basis set 2 1833.7573000000 0.2180092033 3 351.6863200000 0.8395192276 and use in orca 4 input: S 1 1 104.3142600000 1.0000000000 • Use autoaux for auxillary basis-sets S 3 1 60.9058220000 0.0933850481 2 35.5150860000 -0.4593840999 3 20.8912270000 1.3555082796
Page 33 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Relativity and RI
• For ZORA and DKH calculation special care has to be taken to increase the integration accuracy in approximative schemes • For RIJCOSX GridXn has to be changed ! ZORA B3LYP ZORA-def2-SVP SARC/J • For RIJONX not needed ! TightSCF RIJCOSX GridX9 Opt • For many applications special grids in DFT are needed for %Method heavy atoms SpecialGridAtoms 92 SpecialGridIntAcc 10 • If ommited this will happen: End
* xyz 2 1 U 0.0 0.0 0.0 newgto "SARC-ZORA-TZVPP" end O 0.0 0.0 1.8 O 0.0 0.0 -1.8 *
Page 34 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Constraints %geom Constraints { B 0 1 1.25 C } { A 2 0 3 120.0 C } • Useful for optimisations end end • Freeze parts of the molecule during optimisation: Constraining bond distances : { B N1 N2 value C } Constraining bond angles : { A N1 N2 N1 value C } Constraining dihedral angles : { D N1 N2 N3 N4 value C } Constraining cartesian coordinates : { C N1 C }
• Wildcards to freeze all bonds/angles/torsions to certain atoms • Giving no value takes that value from the geometry section
• Just optimize hydrogens (useful for crystal structures):
%geom op mizehydrogens true end
Page 35 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Hydrogen Optimisation
• A simple example ! TPSS KeepDens PrintBasis Def2-SV(P) Opt • One hydrogen is moved %geom op mizehydrogens true end * xyz 0 1 C -1.137634 0.702379 0.000000 C -1.137634 -0.702379 0.000000 N 0.000002 -1.415106 0.000000 C 1.137633 -0.702378 0.000000 C 1.137633 0.702380 0.000000 N -0.000001 1.415106 0.000000 H -2.180421 1.269265 0.000000 H -2.080418 -1.269269 0.000000 H 2.080422 -1.269260 0.000000 H 2.080419 1.269264 0.000000 *
Page 36 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Constrained Scans
• Scan energy along bond expansion, optimise all steps:
! RKS BP SV(P) TightSCF Opt %geom Scan B 0 1 = 1.35, 1.10, 12 # scan C-O distance end end * int 0 1 C 0 0 0 0.0000 0.000 0.00 O 1 0 0 1.3500 0.000 0.00 H 1 2 0 1.1075 122.016 0.00 H 1 2 3 1.1075 122.016 180.00 * • Took 1,5 min on my laptop • File filename.allxyz contains optimized geometries for all steps • File filename.relaxscanact.dat contains energy data (visualize with e.g. gnuplot)
Page 37 Member of the Helmholtz Association Dr. Michael Patzschke I Institute for Resource Ecology I www.hzdr.de Static vs. Dynamic Correlation