Introduction to Multistage Quantum Mechanical Workflows
Tutorial Created with Software Release: 2024-4
Topics: Catalysis & Reactivity , Energy Capture & Storage , Organic Electronics , Thin Film Processing
Methodology: Molecular Quantum Mechanics
Products Used: Jaguar , MS Maestro
|
13.8 MB |
This tutorial is written for use with a 3-button mouse with a scroll wheel.
Words found in the Glossary of Terms are shown like this: Workspacethe 3D display area in the center of the main window, where molecular structures are displayed
Abstract:
In this tutorial, we will demonstrate the fundamentals of the Quantum Mechanical (QM) Multistage panel. By employing a family of N-substituted tetracene molecules, we will implement a single, automated workflow to pre-optimize each isomer at a relatively cheap level of theory, and then perform a subsequent optimization and compute various properties at a higher level of theory.
Tutorial Content
1. Introduction to Multistage Quantum Mechanical Workflows
Often, running quantum mechanical (QM) calculations requires stringing together several sequential or non-sequential steps that are computed independently. For example, a QM geometry optimization is commonly followed by a single point energy calculation, in which the single point energy calculation takes the geometry from the optimization as input. Relatedly, it is sometimes useful when performing a geometry optimization to first run a pre-optimization at a relatively cheaper level of theory to arrive at a reasonable starting geometry that is then used as an input to subsequent optimization at a higher level of theory. Several properties of the molecule (e.g. vibrational frequencies, orbitals, etc.) are often desired at one or more steps throughout the workflow, see Figure 1 for an example of such a workflow. Using the Materials Science (MS) Suite, these QM calculations can be automated quite efficiently with the QM Multistage Workflow panel.
Figure 1: Example QM Multistage Workflow.
The QM Multistage panel is able to run calculations on either a single system or multiple systems at once. It can be used for traditional quantum mechanical geometry optimizations and single point energies of a single molecule, or for more complex workflows with several molecules simultaneously. To demonstrate the utility of the panel, we will run calculations using this panel on a family of N-substituted tetracene constitutional isomers. These molecules were generated using the Elemental Enumeration panel, see the tutorial here for more information on how to create these systems. We will use the QM Multistage Workflow panel to first optimize the geometry of each isomer at a relatively cheap level of theory. The output geometries will then be used as inputs to another geometry optimization with a more computationally expensive functional and larger basis set to calculate more accurate energies and properties of the systems. We will then analyze the output to compare the relative energies of the isomers.
While this example is meant to be introductory, it should be noted that using the same panel, more complex multistage workflows can be designed, automating steps that otherwise might be performed in a stepwise, independent manner. For example:
- Screening functionals and/or basis sets
- Calculating properties of various excited states
- Performing pre-optimizations with constraints
QM Multistage workflows are beneficial for various materials science applications, ranging from reactivity to optoelectronics. Working through a simple example herein will demonstrate the capabilities of this tool.
For practice with single step workflows before using the multistage tools, visit the Introduction to Geometry Optimizations, Functionals and Basis Sets tutorial for a foundational lesson.
2. Creating Projects and Importing Structures
At the start of the session, change the file path to your chosen Working Directorythe location where files are saved in MS Maestro to make file navigation easier. Each session in MS Maestro begins with a default Scratch Projecta temporary project in which work is not saved, closing a scratch project removes all current work and begins a new scratch project, which is not saved. A MS Maestro project stores all your data and has a .prj extension. A project may contain numerous entries corresponding to imported structures, as well as the output of modeling-related tasks. Once a project is saved, the project is automatically saved each time a change is made.
Structures can be built in MS Maestro or can be imported using File > Import Structures (or drag-and-dropped), and are added to the Entry Lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion and Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data. The Entry Lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion is located to the left of the Workspacethe 3D display area in the center of the main window, where molecular structures are displayed. The Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data can be accessed by Ctrl+T (Cmd+T) or Window > Project Table if you would like to see an expanded view of your project data.
- Double-click the Materials Science icon
- (No icon? See Starting Maestro)
- Go to File > Change Working Directory
- Find your directory, and click Choose
- Pre-generated input and results files are included for running jobs or examining output. Download the zip file here: schrodinger.com/sites/default/files/s3/release/current/Tutorials/zip/qm_multistage.zip
- After downloading the zip file, unzip the contents in your Working Directorythe location where files are saved for ease of access throughout the tutorial
- Go to File > Save Project As
- Change the File name to QM_multistage_tutorial, click Save
- The project is now named
QM_multistage_tutorial.prj
- The project is now named
In this tutorial we will be using a group of molecules that were formed using the Elemental Enumeration panel. If you would like to create these molecules yourself, you can do so by following the Elemental Enumeration tutorial.
- Go to File > Import Structures
- Navigate to where you downloaded the tutorial files and select
starting_structures.maeand click Open- A new entry group containing 21 molecules is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion
3. Setting Up and Running a QM Multistage Workflow
Now, we will run the QM Multistage workflow using the 21 structures that were imported. We will pre-optimize each isomer first at a relatively cheap level of theory, and then perform a subsequent optimization and compute various properties at a higher level of theory. To learn more about running QM simulations watch Getting Going with Materials Science Maestro Video Series: Molecular Quantum Mechanics.
- Select(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries the entire entry group titled starting_structures (21)
- Clicking the entry group will select(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries all of the entries within it
- tetracene_m:N_n:N appears in as the title in the workspacethe 3D display area in the center of the main window, where molecular structures are displayed, (where m and n may vary case-by-base) and all of the entries in the group are selected(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries
- Go to Tasks > Materials > Quantum Mechanics > Molecular Quantum Mechanics > QM Multistage Workflow
- The QM Multistage Workflow panel opens
- For Use structures from, ensure that Project Table (21 selected entries) is chosen
Note: All of the stages and parameters defined in the subsequent steps will apply to all of the input structures, i.e. the panel enables not only multiple QM jobs per molecule but also multiple molecules.
Let’s familiarize ourselves with how the QM Multistage Workflow panel is operated and navigated.
- A stage is the type of calculation that will be run as a component of the workflow:
-
The stages available are Single Point, Optimization, and Transition State
- An additional Analysis stage is available after the first stage
- The individual stage can be named; the default is stage_n
- Stages can be minimized, moved, duplicated and deleted using the stage management buttons,
, respectively
- Once you select a stage, various parameters can be defined for that stage. For example, for a single point calculation, the following tabs are available:
- More information about each of these tabs for each of the stage types can be found in the documentation
- All of the stages in the workflow can be minimized or expanded simultaneously using these two buttons -
- located in the upper right corner of the panel
- Stages and workflows can be managed at the bottom of the panel:
- To add a new stage, click Append Stage
- If you have saved workflows, you can append them using Append Workflow
- You can Append Stages from File if you saved a workflow from a previous project or collaborator
- Once you have set up all of the stages, you can Save as Workflow for future use
- You can manage any created or imported workflows by clicking on Manage Workflows
For a more comprehensive overview, see the help documentation on the panel.
In this example, we will first run a pre-optimization at a relatively cheap level of theory, followed by a second optimization at a higher level of theory using the geometry and Hessian from the first optimization. We will include some standard property calculations in the second stage.
- For the first Stage type, choose Optimization
- The Name can be kept as the default stage_1
- Changing the stage name can help keep track of steps in large workflows
- Maintain the default B3LYP-D3 level of Theory
- Change the Basis set to MIDIXL
- This is a relatively small basis set with only 192 functions for the molecules in this set that is still known to produce good molecular geometries
- You can read more about this basis set in the For Further Reading section
- Go to the SCF tab
Note: In this specific example, the pre-optimization has little effect on the geometries. Nonetheless, this can be beneficial as a time-saving step in cases of molecules with greater conformational freedom.
Note: Hover the mouse over the basis set in the structures list to see the number of associated basis functions
For information and practice with functionals and basis sets in Jaguar, see the Introduction to Geometry Optimizations, Functionals and Basis Sets tutorial.
- In the SCF tab, change the maximum iterations to 100
- Note that in this case, the default number of steps is more than sufficient
- The number of iterations is changed to highlight this parameter, if an optimization fails, the first setting to try changing is the maximum number of allowed iterations
- Go to the Solvation tab
It is practical to include implicit solvation in our calculations for the optimized geometry of the molecules as well as their properties.
- From the drop-down menu, select PCM for the Solvent model
- For more about the PCM model see the For Further Reading section
- Ensure the Solvent is set to water
- Uncheck Use robust convergence
- If this is selected, if the optimization procedure fails a robust convergence protocol is triggered
- The protocol can be expensive, so since this is a quick pre-optimization it will not be selected
- Leave the remaining optimization defaults and click Append Stage
- For the second Stage type, choose Optimization again
- Keep Geometry from stage 1 and Hessian checked, but uncheck Wavefunction
- The geometry and Hessian from the first stage will be used as the starting point for the second stage.
- Wave function is unchecked because the two stages use different basis sets, making it difficult to reuse the previous wave function. This is not an issue with the Hessian.
- Hessians are also more expensive to recalculate than the wave function.
- For Theory, choose M06-2X
- B3LYP-D3 and M06-2X are both good functionals for geometry optimizations, but the systems they perform best on vary, see the For Further Reading section for more details
- For Basis set, choose CC-PVTZ
- This is a triple-zeta basis set, the type of basis set that is considered a minimum to use for highly accurate quantum mechanical result
- This basis set is much larger than the one used in the previous stage with 680 functionals, meaning this calculation will also take longer
- Go to the SCF tab
- In the SCF tab, change the Accuracy level to Accurate
- This setting has to do with the type of pseudospectral grid used in the calculation, see the documentation for more information
- Change the Maximum iterations to 100
- Go to the Solvation tab
- From the drop-down menu, select PCM for the Solvent model
- Ensure the Solvent is set to water
The most common settings are managed by the panel, but it is also possible to add Jaguar keywords manually. In this specific example, it is best practice to add the following keyword:
- Scroll to the bottom of the stage, and in the Additional keywords section, input ncanorb=495
- ncanorb is a Jaguar keyword that can be sure to enforce a consistent set of orbitals
- We use it here because we are using a very large pseudopotential basis set so different number of orbitals can be assigned in different calculations - in order to have consistent relative energies and reuse information from our previous calculation we need a consistent set of orbitals
- Note that the number itself, 495, in this case, was determined by first running the job without this command. For a more thorough explanation of the need for this keyword in this particular example, see the help documentation
Note: An option for a machine learning force field (MLFF) is available as an alternative via an Additional keyword. Additional information regarding MLFF can be found in the help documentation, on our website, or the QM Multistage Workflow panel documentation.
- In the second stage, go to the Properties tab
- Select Vibrational frequencies and Atomic electrostatic potential charges (ESP)
- These properties will be calculated for each molecule
- Check Use robust convergence
- Change the Job name to qm_multi_isomers
This job takes over 14 hours on 21 CPUs. For convenience, pre-generated results are available. To continue the tutorial with the pre-generated results, do not run the job and proceed to Section 5.
If you prefer to run the job yourself, configure your job settings (
). Note that depending on your CPU resources, this job can be run in a highly parallelized fashion. Once set up, click Run.
- Close the QM Multistage Workflow panel
4. Analyzing the QM Multistage Outputs
We will proceed to analyze the results utilizing the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion, project tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data, plotting tools and labeling in the workspacethe 3D display area in the center of the main window, where molecular structures are displayed.
If you ran the job yourself, skip Steps 1 and 2. Otherwise, follow these steps to import the pre-generated results:
- From the main menu, go to File > Import Structures
- Navigate to where you downloaded the tutorial files and Open
qm_multi_isomers-out.maegz- A new group, QM_multi_isomers (42), containing the output from both stages for all 21 molecules is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion
Let’s suppose we are interested in:
- Confirming that the optimizations from Stage 2 are minima via analysis of the frequency calculations
- Comparing the energies of the isomers
- Visualizing the ESP charges
First, it will be useful to create a new group with just the stage 2 outputs.
- In the Entry List, type stage_2 in the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion search (
) function to filter the relevant entries.
- The entries associated with the second stage are filtered
- Select(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries the 21 entries with Shift + Click
- You can confirm you have selected(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries only the entries of interest by reading the Entries information at the bottom of the Entry List:
- You can confirm you have selected(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries only the entries of interest by reading the Entries information at the bottom of the Entry List:
- Right-click on any of the selected(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries entries and click Duplicate > Into New Group
- The Duplicate into New Group panel opens
- For New group title: input Stage 2_Outputs
- For Location of new group: choose At top level > End of table
- Click Duplicate
- A new group is added to the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion titled Stage2_Outputs (21)
- Close the search filter (using the
button next to the search bar)
- The new group is now found at the bottom of the entry lista simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion
We can now confirm that the optimizations have found energy minima by analyzing the lowest frequency from the vibrational analysis. More conveniently, we can analyze the lowest frequency for each molecule simultaneously in the project tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data:
- Open the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data (
)
- Show the Property Tree (
)
- Expand Jaguar > Secondary and check Lowest Frequency (cm-1)
- Lowest Frequency is added as a column in the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data
- You can also directly search for the property using the search bar at the top of the Property Tree panel
A quick scan of the lowest frequencies for the 21 entries in the Stage2_Outputs group demonstrates that the molecules are indeed at their respective minima, indicated by positive values for all frequencies.
We can proceed to compare the relative gas phase energies of the isomers. The default output is in Hartrees. Let’s convert to kcal/mol:
- In the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data, open the Property Calculator (
)
- The Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data Calculator opens
- For Create, name the property Energy kcal/mol
- Click Functions and choose hartrees_to_kcal/mol
- The function appears
- Click Properties and choose Gas Phase Energy
- The property appears
- Insert a closed parenthesis (
)
- Click Execute
- Click OK to the warning about missing data and Close the calculator
- The gas phase energy is converted to kcal/mol and added to the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data in a new column titled Energy kcal/mol
- With the Stage2_Outputs (21) group selected(1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries, right-click on the new Energy kcal/mol column and choose Sort Selected (Ascending)
- The 21 energies are sorted from lowest to highest energy
Note: There is an option in the Tasks menu to run the Jaguar/QSite Energy Converter. After doing so, in the Property Tree under Jaguar > Secondary, there is an option to add Gas Phase Relative Energy (kcal/mol) to the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data, which will give the energies of the conformers relative to the lowest energy species.
We can plot the relative energies for further visualization.
- In the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data, open Manage Plots (
)
- Click Create then select Scatterplot… from the menu that appears
- The Create New Scatterplot window opens
- For X-Axis, choose Entry ID
- For Y-Axis, choose Energy kcal/mol
- The scatter plot is populated with the data
- Hover over a data point to see the 2D visualization of the molecule
Feel free to explore the options to stylize the scatter plot.
- When you are ready, close the Scatter Plot viewer, Manage Plots and the Project Tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data and return to the workspacethe 3D display area in the center of the main window, where molecular structures are displayed
5. Conclusion and References
In this tutorial, we used the QM Multistage Workflow panel to study a sample system of 21 isomers. We used an automated workflow to first geometry optimize each isomer at a relatively cheap level of theory, and subsequently feed the output geometry into another geometry optimization with a more accurate functional and larger basis set to calculate energies and various properties. We then analyzed the output in the project tabledisplays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data and the workspacethe 3D display area in the center of the main window, where molecular structures are displayed. The QM Multistage panel is a straightforward tool for running QM jobs on either a single molecule or a group of molecules at once. It can be used for standard optimizations and single point energy calculations or for more complex workflows with several stages and molecules simultaneously.
For further learning:
For introductory content, focused on navigating the Schrödinger Materials Science interface, an Introduction to Materials Science Maestro tutorial is available. Please visit the materials science training website for access to 70+ tutorials. For scientific inquiries or technical troubleshooting, submit a ticket to our Technical Support Scientists at help@schrodinger.com.
For self-paced, asynchronous, online courses in Materials Science modeling, including access to Schrödinger software, please visit the Schrödinger Online Learning portal on our website.
If you are interested in running Jaguar calculations from the command line, please visit the documentation for example files and guidance.
For some related practice, proceed to explore other relevant tutorials:
- Introduction to Geometry Optimizations, Functionals and Basis Sets
- Calculating Reaction Energetics for Molecular Systems
- Rigid and Relaxed Coordinate Scans
- Locating Transition States: Part 1
- Beta Elimination Reactions
- Band Shape
- Computing Atomic Charges
- Calculating Transition Dipole Moments
- Vibrational Circular Dichroism (VCD)
- pKa Prediction with Macro-pKa
- Machine Learning Force Field
For further reading:
- Introduction to Computational Chemistry, 3rd Edition
- Essentials of Computational Chemistry: Theories and Models, 2nd Edition
- Molecular Modelling: Principles and Applications, 2nd Edition
- Best-Practice DFT Protocols for Basic Molecular Computational Chemistry. DOI:10.1002/anie.202205735
- The MIDI! Basis Set for Quantum Mechanical Calculations of Molecular Geometries and Partial Charges. DOI:10.1007/BF01127507
- Optoelectronics Properties - has further information on the MID!-type basis sets
- Polarizable Continuum Model. DOI:10.1002/wcms.1086
- The M06 suite of density functionals for main group thermochemistry, thermochemical kinetics, noncovalent interactions, excited states, and transition elements: two new functionals and systematic testing of four M06-class functionals and 12 other functionals. DOI:10.1007/s00214-007-0310-x
- See the help documentation
6. Glossary of Terms
Entry List - a simplified view of the Project Table that allows you to perform basic operations such as selection and inclusion
Included - the entry is represented in the Workspace, the circle in the In column is blue
Project Table - displays the contents of a project and is also an interface for performing operations on selected entries, viewing properties, and organizing structures and data
Scratch Project - a temporary project in which work is not saved, closing a scratch project removes all current work and begins a new scratch project
Selected - (1) the atoms are chosen in the Workspace. These atoms are referred to as "the selection" or "the atom selection". Workspace operations are performed on the selected atoms. (2) The entry is chosen in the Entry List (and Project Table) and the row for the entry is highlighted. Project operations are performed on all selected entries
Working Directory - the location where files are saved
Workspace - the 3D display area in the center of the main window, where molecular structures are displayed