### AQME Command Line Examples Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/1-Strychnine/Inputs/Instructions.txt Access detailed command-line examples for AQME, including end-to-end workflows. ```bash For the command lines version, visit: https://aqme.readthedocs.io/en/latest/Examples/examples_commandline/end_to_end/example_1.html ``` -------------------------------- ### Install AQME using Conda and Upgrade with Pip Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Alternative installation method for AQME using conda, followed by an upgrade with pip. This can be faster if pip installation is slow. ```shell conda install -y -c conda-forge aqme pip install aqme --upgrade ``` -------------------------------- ### Gaussian Input File Example (NBO) Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/gaussian.md Example of a Gaussian input file with NBO instructions included after the geometry section. ```none %nprocshared=8 %mem=16GB # pop=(nbo6read,savenbos) wb97xd/def2svp ethane_conf_1_wb97xd-nbo 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 $nbo bndidx $end ``` -------------------------------- ### Run End-to-End Example 1 Notebook Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/1-Strychnine/Inputs/Instructions.txt Execute all cells in the end-to-end-example-1.ipynb Jupyter Notebook to see AQME in action. ```python Run all the cells from the end-to-end-example-1.ipynb Jupyter Notebook ``` -------------------------------- ### SDF File Content Example Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/gaussian.md This is an example of the content of an SDF file, which contains molecular structure and connectivity information. AQME can parse this format to generate quantum chemistry input files. ```none OpenBabel12082212193D 8 7 0 0 0 0 0 0 0 0999 V2000 0.9537 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0 2.4658 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 -1.0113 -0.4254 H 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 -0.7375 -0.7247 H 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 0.1223 0.9395 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 -0.2233 -1.0799 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 -0.8385 0.5843 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 0.9103 0.2850 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 1 3 1 0 0 0 0 1 4 1 0 0 0 0 1 5 1 0 0 0 0 2 6 1 0 0 0 0 2 7 1 0 0 0 0 2 8 1 0 0 0 0 M END $$$$ ``` -------------------------------- ### Install AQME and OpenBabel Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install the AQME package and OpenBabel using pip and conda respectively. Ensure your conda environment is activated. ```shell pip install aqme conda install -y -c conda-forge openbabel=3.1.1 ``` -------------------------------- ### Install AQME Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/note.md Install the AQME package using pip within your activated conda environment. ```bash pip install aqme ``` -------------------------------- ### Install OpenBabel Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/note.md Install OpenBabel version 3.1.1 using conda. This is a required dependency for AQME. ```bash conda install -y -c conda-forge openbabel=3.1.1 ``` -------------------------------- ### Gaussian Input File with NBO instructions Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/gaussian.md Example of a Gaussian input file generated by AQME with NBO instructions appended after the geometry section, using the --qm_end parameter. ```none %nprocshared=8 %mem=16GB # pop=(nbo6read,savenbos) wb97xd/def2svp ethane_conf_1_wb97xd-nbo 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 $nbo bndidx $end ``` -------------------------------- ### Gaussian Input File Example (gen) Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/gaussian.md Example of a Gaussian input file generated without ECP, specifying basis sets for different atom types. ```none %nprocshared=8 %mem=16GB # wb97xd/gen scrf=(smd,solvent=acetonitrile) ethane_conf_1_wb97xd-gen 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 H 0 6-31G* **** C 0 def2svp **** ``` -------------------------------- ### Gaussian Input File Example (genECP) Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/gaussian.md Example of a Gaussian input file generated with genECP, including basis sets and ECP specifications. ```none %nprocshared=8 %mem=16GB # wb97xd/genecp scrf=(smd,solvent=acetonitrile) ethane_conf_1_wb97xd-genecp 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 H 0 6-31G* **** C 0 def2svp **** ``` -------------------------------- ### SDF File Content Example Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/orca.md An example of an SDF file content, representing the 3D coordinates and connectivity of a molecule (Ethane in this case). ```none OpenBabel12082212193D 8 7 0 0 0 0 0 0 0 0999 V2000 0.9537 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0 2.4658 -0.0505 -0.0702 C 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 -1.0113 -0.4254 H 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 0.7375 -0.7247 H 0 0 0 0 0 0 0 0 0 0 0 0 0.5694 0.1223 0.9395 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 -0.2233 -1.0799 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 -0.8385 0.5843 H 0 0 0 0 0 0 0 0 0 0 0 0 2.8501 0.9103 0.2850 H 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 0 0 0 1 3 1 0 0 0 0 1 4 1 0 0 0 0 1 5 1 0 0 0 0 2 6 1 0 0 0 0 2 7 1 0 0 0 0 2 8 1 0 0 0 0 M END $$$$ ``` -------------------------------- ### Import AQME and Python Modules Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/2-Diels_Alder_Reaction/Inputs/end-to-end-example-2.ipynb Imports necessary modules from AQME and other Python libraries for the workflow. Ensure these libraries are installed. ```python import os, glob, subprocess import shutil from pathlib import Path from aqme.csearch import csearch from aqme.qprep import qprep from aqme.qcorr import qcorr from rdkit import Chem import pandas as pd ``` -------------------------------- ### Run Pytest Tests Source: https://github.com/jvalegre/aqme/blob/master/docs/Misc/tests.md Navigate to the project's source code directory and execute pytest with verbose output. Ensure pytest is installed. ```shell cd path/to/aqme/source/code pytest -v ``` -------------------------------- ### Gaussian Input File with gen Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/gaussian.md Example of a Gaussian input file generated by AQME when using the gen option, which omits ECP sections. ```none %nprocshared=8 %mem=16GB # wb97xd/gen scrf=(smd,solvent=acetonitrile) ethane_conf_1_wb97xd-gen 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 H 0 6-31G* **** C 0 def2svp **** ``` -------------------------------- ### Create and Activate Conda Environment Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Create a new conda environment named 'aqme' with Python 3.12 and activate it. This is the first step before installing AQME. ```shell conda create -n aqme python=3.12 conda activate aqme ``` -------------------------------- ### Generated ORCA Input File Content Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/orca.md This is an example of the ORCA input file generated by AQME, including QM settings, CPCM solvent model, and molecular coordinates. ```none # ethane_conf_1_m06-basic %maxcore 16000 %pal nprocs 8 end ! m06 def2qzvpp %cpcm smd true SMDsolvent "CH2Cl2" end * xyz 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 * ``` -------------------------------- ### Gaussian Input File with genecp Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/gaussian.md Example of a Gaussian input file generated by AQME when using the genecp option, including ECP basis sets for specific atoms. ```none %nprocshared=8 %mem=16GB # wb97xd/genecp scrf=(smd,solvent=acetonitrile) ethane_conf_1_wb97xd-genecp 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 H 0 6-31G* **** C 0 def2svp **** C 0 def2svp ``` -------------------------------- ### QPREP ORCA Input File Generation Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/CSEARCH_CMIN_conformer_generation/CSEARCH_RDKit_organics.ipynb Generate ORCA input files using QPREP by specifying 'orca' as the program. Customize QM input keywords, memory, and processors as needed. This example shows how to define multi-line ORCA input. ```python # Only need to change the qm_input and program options. # Multiple lines are allowed. For example, this is the input file of a TS calculation: ORCA_input = 'BP86 def2-SVP def2/J\n' ORCA_input += '%geom\n' ORCA_input += 'Calc_Hess true\n' ORCA_input += 'Recalc_Hess 5\n' ORCA_input += 'end' qprep(destination=com_path,files=sdf_rdkit_files,program='orca', qm_input=ORCA_input,mem='4GB',nprocs=8) ``` -------------------------------- ### Prepare QM Input Files with QPREP Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/QPREP_generating_input_files/QPREP_ORCA_Gaussian_SPC_benchmark.ipynb Use this script to prepare QM input files for Gaussian and ORCA. Specify multiple levels of theory and programs by appending to the 'lot_suffix_program' list. Ensure log files are in the specified directory. ```python import os from aqme.qprep import qprep # folder with input log files and their names (*.log to include all the log files in the folder) log_files = os.getcwd()+'/log_files/*.log' # specify a list of lists with level of theory, suffix and program used to generate input files # 1) Three levels of theory for Gaussian calculations lot_suffix_program = [['wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)','wb97xd','gaussian']] lot_suffix_program.append(['m062x/def2qzvpp emp=gd3 scrf=(smd,solvent=acetonitrile)','m062x','gaussian']) lot_suffix_program.append(['b3lyp/6-31G*','b3lyp','gaussian']) # 2) A DLPNO example for ORCA calculations ORCA_SP = 'Extrapolate(2/3,cc) def2/J def2-tzvpp/C DLPNO-CCSD(T) NormalPNO TightSCF RIJCOSX GridX7\n' ORCA_SP += '%cpcm\n' ORCA_SP += 'smd true\n' ORCA_SP += 'SMDsolvent "CH2Cl2"\n' ORCA_SP += 'end\n' ORCA_SP += '%method\n' ORCA_SP += 'Grid 3\n' ORCA_SP += 'FinalGrid 5\n' ORCA_SP += 'end\n' ORCA_SP += '%scf maxiter 500\n' ORCA_SP += 'end\n' ORCA_SP += '% mdci\n' ORCA_SP += 'Density None\n' ORCA_SP += 'end\n' ORCA_SP += '% elprop\n' ORCA_SP += 'Dipole False\n' ORCA_SP += 'end' lot_suffix_program.append([ORCA_SP,'DLPNO','orca']) # run the QPREP module, with: # 1) Names of the files to get atoms and coordinates (files=log_files) # 2) Keyword line(s) used in the inputs (qm_input=level[0]) # 3) Suffix to add to the file names (suffix=level[1]) # 4) Program for the input file format (program=level[2]) # 5) Memory to use in the calculations (mem='4GB') # 6) Processors to use in the calcs (nprocs=2) for level in lot_suffix_program: print(f'o Creating input files with suffix "{level[1]}" \n') qprep(files=log_files, qm_input=level[0], suffix=level[1], program=level[2], mem='4GB', nprocs=2) ``` -------------------------------- ### Prepare Gaussian Input Files with NBO Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/QPREP_generating_input_files/QPREP_adding_NBO_final_line.ipynb Use the qprep module to create Gaussian input files. Specify input JSON files, the final QM line, QM input keywords, a suffix for output files, the program, memory, and number of processors. ```python # do an NBO calc with a final line after coords (requiring Wyberg bond orders) import os from aqme.qprep import qprep # folder with input json files and their names (*.json to include all the json files in the folder) json_files = os.getcwd()+'/json_files/*.json' # run the QPREP module, with: # 1) Names of the files to get atoms and coordinates (files=json_files) # 2) Final line after the coordinates section (qm_end='$nbo bndidx $end') # 3) Keyword line(s) used in the inputs (qm_input='wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)') # 4) Suffix to add to the file names (suffix='wb97xd-nbo') # 5) Program for the input file format (program='gaussian') # 6) Memory to use in the calculations (mem='16GB') # 7) Processors to use in the calcs (nprocs=8) print(f'o Creating input files with suffix "wb97xd-nbo" ') qprep(files=json_files, qm_end='$nbo bndidx $end', qm_input='pop=(nbo6read,savenbos) wb97xd/def2svp', suffix='wb97xd-nbo', program='gaussian', mem='16GB', nprocs=8) ``` -------------------------------- ### Navigate to Directory Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/note.md Change the current directory to the location where you want to run AQME and where your input files are located. This is done using the 'cd' command. ```bash cd C:/Users/test_aqme ``` -------------------------------- ### Install CREST for xTB/CREST Requirements Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install the CREST package version 2.12 from conda-forge. This is required if you plan to use CREST functionalities. ```shell conda install -y -c conda-forge crest=2.12 ``` -------------------------------- ### Prepare ORCA Input Files for Single-Point Energy Calculations Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/2-Diels_Alder_Reaction/Inputs/end-to-end-example-2.ipynb Sets up the environment and specifies parameters for generating ORCA input files for single-point energy calculations. This step targets log files from previous successful QM calculations. ```python program = 'orca' mem='16GB' nprocs=8 qm_files = os.getcwd()+'/QCALC/success/*.log' # LOG files from Steps 6 and 8 destination = os.getcwd()+'/SP' # folder where the ORCA output files are generated ``` -------------------------------- ### Install xTB for xTB/CREST Requirements Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install the xTB package version 6.7.1 from conda-forge. This is required if you plan to use xTB functionalities. ```shell conda install -y -c conda-forge xtb=6.7.1 ``` -------------------------------- ### QPREP - Gaussian input file generation Source: https://context7.com/jvalegre/aqme/llms.txt Prepare input files for Gaussian calculations from SDF files. Specify the QM input method, memory, and number of processors. ```bash python -m aqme --qprep --program gaussian --qm_input "B3LYP/6-31G* opt freq" \ --files "*.sdf" --mem 16GB --nprocs 8 ``` -------------------------------- ### Create Gaussian Input Files with QPREP Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/1-Strychnine/Inputs/Jupyter-Notebook/end-to-end-example-1.ipynb Generates Gaussian input files for geometry optimization and frequency calculations. Requires specifying the quantum chemistry method, memory, and number of processors. ```python program = 'gaussian' qm_input = 'B3LYP/6-31+G(d,p) opt freq' mem='24GB' nprocs=12 sdf_rdkit_files = f'{sdf_path}/*.sdf' # SDF files from Step 2 com_path = f'{os.getcwd()}/{name}_com_files' # folder where the COM files are generated qprep(destination=com_path,files=sdf_rdkit_files,program=program, qm_input=qm_input,mem=mem,nprocs=nprocs) ``` -------------------------------- ### Prepare and Run GoodVibes Analysis Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/end_to_end/example_2.md This script prepares input files for GoodVibes analysis by copying relevant files to a new directory and then executes GoodVibes with specified parameters. Ensure that `qm_files` and `orca_files` are defined and point to the correct file paths. The `pes.yaml` file should be present in the parent directory. ```python import glob import shutil import os from pathlib import Path # Assuming qm_files and orca_files are defined elsewhere # Example: qm_files = 'path/to/optimization/files/*.log' # Example: orca_files = 'path/to/spc/files/*.log' opt_files = glob.glob(qm_files) spc_files = glob.glob(orca_files) all_files = opt_files + spc_files w_dir_main = Path(os.getcwd()) GV_folder = w_dir_main.joinpath('GoodVibes_analysis') GV_folder.mkdir(exist_ok=True, parents=True) for file in all_files: shutil.copy(file, GV_folder) # run GoodVibes os.chdir(GV_folder) command = 'python -m goodvibes --xyz --pes ../pes.yaml --graph ../pes.yaml -c 1 --spc DLPNO *.log' subprocess.run(command.split()) os.chdir(w_dir_main) ``` -------------------------------- ### Install PyTorch and TorchANI for CMIN with ANI Models Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install PyTorch, TorchVision, and TorchANI using pip. These packages are necessary for CMIN when utilizing ANI models. ```shell pip install torch torchvision torchani ``` -------------------------------- ### Prepare Gaussian Input Files with QPREP Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/end_to_end/example_1.md Generates Gaussian input files for geometry optimization and frequency calculations using QPREP. Requires SDF files from CSEARCH and specifies QM input parameters, memory, and processors. ```python program = 'gaussian' vim_input = 'B3LYP/6-31+G(d,p) opt freq' mem='24GB' nprocs=12 # SDF files from Step 2 sdf_rdkit_files = f'{sdf_path}/*.sdf' # folder where the COM files are generated com_path = f'{os.getcwd()}/{name}_com-files' qprep(destination=com_path, files=sdf_rdkit_files, program=program, qm_input=qm_input, mem=mem, nprocs=nprocs) ``` -------------------------------- ### Install ASE for CMIN with ANI Models Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install the ASE (Atomic Simulation Environment) package using pip. This is a prerequisite for using CMIN with ANI models. ```shell pip install ase ``` -------------------------------- ### Generate Input Files using AQME qprep Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/benchmark.md Iterate through defined calculations and use the `aqme.qprep.qprep` function to generate input files for each specified method and program. This function requires the list of log files, QM input details, suffix, program name, memory allocation, and number of processors. ```python calculations = [inp_1,inp_2,inp_3,inp_4] for qm_inp,suf,prog in calculations: print(f'o Creating input files with suffix "{suf}" ') qprep(files=log_files, qm_input=qm_inp, suffix=suf, program=prog, mem='4GB', nprocs=2) ``` -------------------------------- ### End-to-End Workflow - Step 3: Gaussian input preparation Source: https://context7.com/jvalegre/aqme/llms.txt Prepare input files for Gaussian DFT calculations from SDF files. Specify the destination directory, QM input method, memory, number of processors, and checkpoint file usage. ```python qprep( destination=w_dir / 'QPREP', files=cmin_files, program='gaussian', qm_input='wB97XD/def2-SVP opt freq', mem='16GB', nprocs=8, chk=True ) ``` -------------------------------- ### Resolve libgfortran Issues for xTB/CREST Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/setup.md Install a specific version of libgfortran to resolve potential optimization issues with xTB and CREST. This command should be run after installing xTB and CREST. ```shell conda install conda-forge::libgfortran=14.2.0 ``` -------------------------------- ### Activate Conda Environment Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/note.md Activate the 'aqme' conda environment before installing or running AQME. This ensures that AQME and its dependencies are used. ```bash conda activate aqme ``` -------------------------------- ### Generate Basic ORCA Input Files Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/orca.md Use the `qprep` function to generate ORCA input files from a list of SDF files, specifying calculation parameters, a suffix, the QM program, memory, and number of processors. ```python qprep(files=sdf_files, qm_input=ORCA_SP, suffix='m06-basic', program='orca', mem='16GB', nprocs=8) ``` -------------------------------- ### QPREP - ORCA input file generation Source: https://context7.com/jvalegre/aqme/llms.txt Prepare input files for ORCA calculations from XYZ files. Specify the QM input method. ```bash python -m aqme --qprep --program orca --qm_input "BP86 def2-SVP" --files "*.xyz" ``` -------------------------------- ### Create Conda Environment Source: https://github.com/jvalegre/aqme/blob/master/docs/Quickstart/note.md Use this command to create a new conda environment named 'aqme' with Python 3.12. This is a prerequisite for installing AQME. ```bash conda create -n aqme python=3.12 ``` -------------------------------- ### Run QCORR with Input File Type and Folder Specification Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/correction_qm_output.md This command extends the basic QCORR analysis by specifying the extension of initial input files (`--isom_type`) and the folder where these files are located (`--isom_inputs`). ```shell python -m aqme --qcorr --files "calculations/*.log" --isom_type com --isom_inputs folder ``` -------------------------------- ### Prepare Gaussian QM Input Files Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/QPREP_generating_input_files/QPREP_Changing_charge_and_mult.ipynb Use this snippet to generate Gaussian input files from SDF structures. Specify charge, multiplicity, QM keywords, output suffix, memory, and processor count. Ensure SDF files are located in the specified directory. ```python # calculate reduction potential from sdf files import os from aqme.qprep import qprep # folder with input sdf files and their names (*.sdf to include all the sdf files in the folder) sdf_files = os.getcwd()+'/sdf_files/*.sdf' # run the QPREP module, with: # 1) Names of the files to get atoms and coordinates (files=sdf_files) # 2) Set charge for the input files (charge=-1) # 3) Set multiplicity for the input files (mult=2) # 4) Keyword line(s) used in the inputs (qm_input='wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)') # 5) Suffix to add to the file names (suffix='wb97xd-reduced') # 6) Program for the input file format (program='gaussian') # 7) Memory to use in the calculations (mem='16GB') # 8) Processors to use in the calcs (nprocs=8) print(f'o Creating input files with suffix "wb97xd-reduced" ') qprep(files=sdf_files, charge=-1, mult=2, qm_input='wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)', suffix='wb97xd-reduced', program='gaussian', mem='16GB', nprocs=8) ``` -------------------------------- ### Prepare Files for GoodVibes Analysis Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/End-to-end_Workflows/2-Diels_Alder_Reaction/Inputs/end-to-end-example-2.ipynb Collects output files from ORCA single-point energy calculations and optimization steps, copies them into a dedicated directory for GoodVibes analysis, and sets up the working directory. ```python orca_files = os.getcwd()+'/SP/*.out' # folder where the OUT files from Step 10 are generated # copy all the Gaussian LOG files and the ORCA OUT files into a new folder called GoodVibes_analysis (necessary to apply SPC corrections) opt_files = glob.glob(qm_files) spc_files = glob.glob(orca_files) all_files = opt_files + spc_files w_dir_main = Path(os.getcwd()) GV_folder = w_dir_main.joinpath('GoodVibes_analysis') GV_folder.mkdir(exist_ok=True, parents=True) for file in all_files: shutil.copy(file, GV_folder) ``` -------------------------------- ### Generated ORCA Input File Content Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/orca.md Example content of a generated ORCA input file for a single point calculation with specified parameters. ```none # ethane_conf_1_m06-basic %maxcore 16000 %pal nprocs 8 end ! m06 def2qzvpp %cpcm smd true SMDsolvent "CH2Cl2" end * xyz 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 * ``` -------------------------------- ### Run CSEARCH with RDKit Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/end_to_end/example_3.md Execute RDKit conformer sampling using the AQME command-line interface. This step processes an input CSV file and generates conformers within a specified energy window. ```shell python -m aqme --csearch --program rdkit --input solubility.csv --ewin_csearch 1 ``` -------------------------------- ### Generate Gaussian Input Files for Intermediates Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/end_to_end/example_2.md This Python code prepares Gaussian input files for intermediates, reagents, and products using `qprep`. It uses a different quantum chemistry input string optimized for these species. ```python sdf_INT_files = glob.glob('CSEARCH/D*.sdf') + glob.glob('CSEARCH/P*.sdf') # COM files for intermediates, reagents and products qm_input_INT = 'B3LYP/def2tzvp opt freq=noraman' qprep(files=sdf_INT_files, program=program, qm_input=qm_input_INT, mem=mem, nprocs=nprocs) ``` -------------------------------- ### Execute GNN Script Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/end_to_end/example_3.md Run the gnn.py script to obtain results for the solubility prediction model. Ensure gnn.py and gnn_functions.py are in the same directory and all dependencies are installed. ```shell python gnn.py ``` -------------------------------- ### Import AQME Modules Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/benchmark.md Import necessary modules from the AQME library for preparing quantum chemistry inputs. ```python from pathlib import Path from aqme.qprep import qprep ``` -------------------------------- ### Generate Gaussian Input Files with QPREP Source: https://github.com/jvalegre/aqme/blob/master/Example_workflows/CSEARCH_CMIN_conformer_generation/CMIN_ANI_organics.ipynb Employ QPREP to create Gaussian input files from SDF files refined by CMIN. Configure QM program, keywords, memory, and number of processors for the Gaussian calculations. ```python import os, glob from pathlib import Path from aqme.csearch import csearch from aqme.qprep import qprep from aqme.cmin import cmin # set SDF filenames and directory where the new com files will be created com_path = w_dir_main.joinpath(f'ani_com_files') sdf_cmin_files = glob.glob(f'{sdf_cmin_path}/quinine_rdkit_ani.sdf') # run QPREP input files generator, with: # 1) PATH to create the new SDF files (destination=com_path) # 2) Files to convert (files=sdf_cmin_files) # 3) QM program for the input (program='gaussian') # 4) Keyword line for the Gaussian inputs (qm_input='wb97xd/6-31+G* opt freq') # 5) Memory to use in the calculations (mem='24GB') # 6) Processors to use in the calcs (nprocs=8) qprep(destination=com_path,files=sdf_cmin_files,program='gaussian', qm_input='wb97xd/6-31+G* opt freq',mem='24GB',nprocs=8) ``` -------------------------------- ### Run PySCF Calculation with AQME Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/pyscf.md Use this script to automate PySCF calculations by reading molecular data from JSON files. Ensure PySCF and AQME are installed and configured. ```python import os from aqme.utils import cclib_atoms_coords import json import glob # read json files initial_dir = os.getcwd() w_dir_main = os.getcwd()+'/QCORR_1/successful_QM_outputs/json_files' os.chdir(w_dir_main) json_files = glob.glob('*.json') # run the PySCF calculations for file in json_files: with open(file) as json_file: cclib_data = json.load(json_file) atom_types,cartesians = cclib_atoms_coords(cclib_data) coord_input = '' for i,atom in enumerate(atom_types): if i != 0: coord_input += ' ' coord_input += atom+' ' for j,cart in enumerate(cartesians[i]): coord_input += str(cart) if j != 2: coord_input += ' ' else: if i != len(atom_types)-1: coord_input += ';' charge = cclib_data['properties']['charge'] mult = cclib_data['properties']['multiplicity'] spin = mult-1 basis = 'ccpvdz' # creates mol object for the calculations mol = gto.M(atom=coord_input, basis=basis, charge=charge, spin=spin) mol.output = f'./{file.split(".")[0]}.log' mol.verbose = 3 mol.build() # runs the PySCF calculation if spin == 0: energy = mol.RKS().run(chkfile = 'expt0.chk', _numint = dm21.NeuralNumInt(dm21.Functional.DM21), conv_tol = 1E-6, conv_tol_grad = 1E-3) else: energy = mol.UKS().run(chkfile = 'expt0.chk', _numint = dm21.NeuralNumInt(dm21.Functional.DM21), conv_tol = 1E-6, conv_tol_grad = 1E-3) # print results in the LOG file specified in mol.output energy.dump_scf_summary() energy.analyze() energy.spin_square() os.chdir(initial_dir) ``` -------------------------------- ### Import necessary modules Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/correction_qm_output.md Import the Path module for file system operations and the qcorr function from the aqme.qcorr module. ```python from pathlib import Path from aqme.qcorr import qcorr ``` -------------------------------- ### Create Gaussian Input Files with QPREP Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/end_to_end/example_1.md Utilize QPREP to generate Gaussian input files for geometry optimization and frequency calculations. Specify the destination, input SDF files, QM method, memory, and number of processors. ```shell python -m aqme --qprep --destination Strychnine_com_files --files "Strychnine_sdf_files/*.sdf" --program gaussian --qm_input "B3LYP/6-31+G(d,p) opt freq" --mem 24GB --nprocs 12 ``` -------------------------------- ### Generate Gaussian Inputs from SDF Files Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/gaussian.md Use the `--qprep` flag to generate Gaussian input files from SDF files. Specify input files using `--files` with shell wildcards enclosed in quotes. Define calculation details with `--qm_input`, append a suffix with `--suffix`, and set resources with `--mem` and `--nprocs`. ```shell python -m aqme --qprep --files "sdf_files/*.sdf" --qm_input "wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)" --suffix wb97xd-basic --program gaussian --mem 16GB --nprocs 8 ``` ```none %nprocshared=8 %mem=16GB # wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile) ethane_conf_1_wb97xd-basic 0 1 C 0.95370000 -0.05050000 -0.07020000 C 2.46580000 -0.05050000 -0.07020000 H 0.56940000 -1.01130000 -0.42540000 H 0.56940000 0.73750000 -0.72470000 H 0.56940000 0.12230000 0.93950000 H 2.85010000 -0.22330000 -1.07990000 H 2.85010000 -0.83850000 0.58430000 H 2.85010000 0.91030000 0.28500000 ``` -------------------------------- ### Define Constraints for SN2 Reaction Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/conformer_search/noncovalent_TS.md Define distance and angle constraints for the SN2 transition state. These constraints guide the conformer generation process to focus on specific geometric arrangements. ```python F = 1 C = 2 Cl = 3 constraints_dist = [[F,C,1.8],[C,Cl,1.8]] constraints_angle = [[F,C,Cl,180]] ``` -------------------------------- ### Get List of SDF Files Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/conformer_search/organic_molecule.md Retrieves a list of all SDF files within a specified directory, useful when the exact file name is unknown or multiple files need processing. ```python sdf_files = sdf_path.glob('*.sdf') ``` -------------------------------- ### Generate Basic Gaussian Input Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/QM_input_generation/gaussian.md Generate a Gaussian input file from SDF files using specified QM input parameters, memory, and processors. The output will be in a QCALC folder. ```python qprep(files=sdf_files, qm_input='wb97xd/def2qzvpp scrf=(smd,solvent=acetonitrile)', suffix='wb97xd-basic', program='gaussian', mem='16GB', nprocs=8) ``` -------------------------------- ### Generate ORCA Input with Charge and Multiplicity Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/QM_input_generation/orca.md Specify the charge and multiplicity for the ORCA calculation using the --charge and --mult flags. This example generates input for a triplet state. ```shell python -m aqme --qprep --program orca --charge 0 --mult 3 --suffix "m06-triplet" --files "sdf_files/*.sdf" --nprocs 8 --mem 16GB --qm_input "m06 def2qzvpp %cpcm smd true SMDsolvent \"CH2Cl2\" end" ``` -------------------------------- ### Import RDKit and aqme csearch Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_python/conformer_search/noncovalent_TS.md Import the necessary packages from RDKit and the aqme.csearch module for conformer generation. ```python from rdkit import Chem from aqme.csearch import csearch ``` -------------------------------- ### Generate Gaussian Input for Transition States Source: https://github.com/jvalegre/aqme/blob/master/docs/Examples/examples_commandline/end_to_end/example_2.md Prepares Gaussian input files for transition states using QPREP. Specify the program, memory, number of processors, input files, and QM input parameters. ```shell python -m aqme --qprep --program gaussian --mem 32GB --nprocs 16 --files "CSEARCH/TS*crest.sdf" --qm_input "B3LYP/def2tzvp opt=(ts,calcfc,noeigen,maxstep=5) freq=noraman" ```