pyGSM Notes

pyGSM Notes

Reference:

GitHub repo from the developer (https://zimmermangroup.github.io/pyGSM/)

Personal notes on using pyGSM.


Installation

Install pyGSM

Follow README.md on GitHub.

git clone https://github.com/ZimmermanGroup/pyGSM.git
conda create -n gsm_env
source activate gsm_env
python setup.py install --prefix ~/.local

Install xtb

For some reason if xtb is not installed the program will abort.
Install xtb by:

conda install -c conda-forge xtb-python

Usages

References
Examples from the wiki page
Some use case related issues:
https://github.com/ZimmermanGroup/pyGSM/issues/22
https://github.com/ZimmermanGroup/pyGSM/issues/9
A gsm --help information is attached at the end

  • Make input geometry
    For DE-GSM, Place the geometry of reactant and product in a row in a xyz file.
    Note that the order of atom should be same in these geometries.

  • Configure environmental resources

    export MKL_NUM_THREADS=###
    export OMP_NUM_THREADS=###
    export OMP_STACKSIZE=###G

    replace those ### with actual numbers
    The are also flags like

    -mp_cores
    -nproc
  • Configure pyGSM in the command line
    Example:

    gsm -xyzfile scratch/initial0001.xyz  \
    -mode DE_GSM \
    -num_nodes 15 \
    -package xTB_lot > TS-5-simp-gsm.log 2>&1

    Frequent using options:

    • xyzfile
      indicate the path of the input geometry
    • package
      Somehow Gaussian is not supported in pyGSM. xTB_lot is a good choice for fast searching for TS.
    • mode
      the type of the calculation
    • lot_inp_file
      if the package is not xTB. A file that indicate the level of theory will be needed.
    • num_nodes
      This is the nnodes in the old GSM. Indicate how many nodes is used in the GSM method.
    • restart_file
      The file used for restart the job. Not sure the specific protocol for using this. also there are 2 flags with just lower and upper case difference. This is confusing. In the old GSM, just use the original stringfile.xyz and state RESTART in the job config and run the job.
    • max_gsm_iters
      Default:100. Sometimes the GSM job reaches the iter limit and exit without converging. It’s useful to set it to a larger number like 1000.

Options for xTB-GSM

  • multiplicity
  • charge
  • xTB_Hamiltonian
  • xTB_electronic_temperature
  • RESTRAINT_FILE

Result

The result will be reported as opt_converged_000.xyz and the bottom of the log file.

Misc

The output of gsm --help

usage: gsm [-h] -xyzfile XYZFILE [-isomers ISOMERS] -mode
{DE_GSM,SE_GSM,SE_Cross} [-only_drive]
[-package {QChem,Orca,Molpro,PyTC,TeraChemCloud,OpenMM,DFTB,TeraChem,BAGEL,xTB_lot,ase}]
[-lot_inp_file LOT_INP_FILE] [-ID ID] [-num_nodes NUM_NODES]
[-pes_type {PES,Avg_PES,Penalty_PES}]
[-adiabatic_index [ADIABATIC_INDEX ...]]
[-multiplicity [MULTIPLICITY ...]] [-FORCE_FILE FORCE_FILE]
[-RESTRAINT_FILE RESTRAINT_FILE] [-optimizer OPTIMIZER]
[-opt_print_level OPT_PRINT_LEVEL]
[-gsm_print_level GSM_PRINT_LEVEL]
[-xTB_Hamiltonian {GFN2-xTB,GFN1-xTB}] [-xTB_accuracy XTB_ACCURACY]
[-xTB_electronic_temperature XTB_ELECTRONIC_TEMPERATURE]
[-xyz_output_format XYZ_OUTPUT_FORMAT] [-solvent SOLVENT]
[-linesearch {NoLineSearch,backtrack}]
[-coordinate_type {TRIC,DLC,HDLC}] [-ADD_NODE_TOL ADD_NODE_TOL]
[-DQMAG_MAX DQMAG_MAX] [-BDIST_RATIO BDIST_RATIO]
[-CONV_TOL CONV_TOL] [-growth_direction {0,1,2}]
[-reactant_geom_fixed] [-product_geom_fixed] [-nproc NPROC]
[-charge CHARGE] [-max_gsm_iters MAX_GSM_ITERS]
[-max_opt_steps MAX_OPT_STEPS] [-only_climb] [-no_climb]
[-optimize_mesx] [-optimize_meci] [-restart_file RESTART_FILE]
[- MP_CORES] [-dont_analyze_ICs]
[-hybrid_coord_idx_file HYBRID_COORD_IDX_FILE]
[-frozen_coord_idx_file FROZEN_COORD_IDX_FILE]
[-conv_Ediff CONV_EDIFF] [-conv_dE CONV_DE] [-conv_gmax CONV_GMAX]
[-DMAX DMAX] [-sigma SIGMA] [-prim_idx_file PRIM_IDX_FILE]
[-reparametrize] [-interp_method INTERP_METHOD]
[-bonds_file BONDS_FILE] [-start_climb_immediately]
[--ase-class ASE_CLASS] [--ase-kwargs ASE_KWARGS]

Reaction path transition state and photochemistry tool

optional arguments:
-h, --help show this help message and exit
-xyzfile XYZFILE XYZ file containing reactant and, if DE-GSM, product.
-isomers ISOMERS driving coordinate file
-mode {DE_GSM,SE_GSM,SE_Cross}
GSM Type (default: DE_GSM)
-only_drive
-package {QChem,Orca,Molpro,PyTC,TeraChemCloud,OpenMM,DFTB,TeraChem,BAGEL,xTB_lot,ase}
Electronic structure theory package (default: QChem)
-lot_inp_file LOT_INP_FILE
external file to specify calculation e.g.
qstart,gstart,etc. Highly package specific.
-ID ID string identification number (default: 0)
-num_nodes NUM_NODES number of nodes for string (defaults: 9 DE-GSM, 20 SE-
GSM)
-pes_type {PES,Avg_PES,Penalty_PES}
Potential energy surface (default: PES)
-adiabatic_index [ADIABATIC_INDEX ...]
Adiabatic index (default: [0])
-multiplicity [MULTIPLICITY ...]
Multiplicity (default: [1])
-FORCE_FILE FORCE_FILE
Constant force between atoms in AU,e.g.
[(1,2,0.1214)]. Negative is tensile, positive is
compresive
-RESTRAINT_FILE RESTRAINT_FILE
Harmonic translational restraints
-optimizer OPTIMIZER The optimizer object. (default: eigenvector_follow
Recommend LBFGS for large molecules >1000 atoms)
-opt_print_level OPT_PRINT_LEVEL
Printout for optimization. 2 prints everything in opt.
-gsm_print_level GSM_PRINT_LEVEL
Printout for gsm. 1 prints ?
-xTB_Hamiltonian {GFN2-xTB,GFN1-xTB}
xTB hamiltonian
-xTB_accuracy XTB_ACCURACY
xTB accuracy
-xTB_electronic_temperature XTB_ELECTRONIC_TEMPERATURE
xTB electronic temperature
-xyz_output_format XYZ_OUTPUT_FORMAT
Format of the produced XYZ files
-solvent SOLVENT Solvent to use (xTB calculations only)
-linesearch {NoLineSearch,backtrack}
default: NoLineSearch
-coordinate_type {TRIC,DLC,HDLC}
Coordinate system (default TRIC)
-ADD_NODE_TOL ADD_NODE_TOL
Convergence tolerance for adding new node (default:
0.01)
-DQMAG_MAX DQMAG_MAX Maximum step size in single-ended mode (default: 0.8)
-BDIST_RATIO BDIST_RATIO
Reaction completion convergence in SE modes (default:
0.5)
-CONV_TOL CONV_TOL Convergence tolerance for optimizing nodes (default:
0.0005)
-growth_direction {0,1,2}
Direction adding new nodes (default: 0)
-reactant_geom_fixed Fix reactant geometry i.e. do not pre-optimize
-product_geom_fixed Fix product geometry i.e. do not pre-optimize
-nproc NPROC Processors for calculation. Python will detect
OMP_NUM_THREADS, only use this if you want to force
the number of processors
-charge CHARGE Total system charge (default: 0)
-max_gsm_iters MAX_GSM_ITERS
The maximum number of GSM cycles (default: 100)
-max_opt_steps MAX_OPT_STEPS
The maximum number of node optimizations per GSM cycle
(defaults: 3 DE-GSM, 20 SE-GSM)
-only_climb Only use climbing image to optimize TS
-no_climb Don't climb to the TS
-optimize_mesx optimize to the MESX
-optimize_meci optimize to the MECI
-restart_file RESTART_FILE
restart file
-mp_cores MP_CORES Use python multiprocessing to parallelize jobs on a
single compute node. Set OMP_NUM_THREADS, ncpus
accordingly.
-dont_analyze_ICs Don't post-print the internal coordinates primitives
and values
-hybrid_coord_idx_file HYBRID_COORD_IDX_FILE
A filename containing a list of indices to use in
hybrid coordinates. 0-Based indexed
-frozen_coord_idx_file FROZEN_COORD_IDX_FILE
A filename containing a list of indices to be frozen.
0-Based indexed
-conv_Ediff CONV_EDIFF
Energy difference convergence of optimization.
-conv_dE CONV_DE State difference energy convergence
-conv_gmax CONV_GMAX Max grad rms threshold
-DMAX DMAX
-sigma SIGMA The strength of the difference energy penalty in
Penalty_PES
-prim_idx_file PRIM_IDX_FILE
A filename containing a list of indices to define
fragments. 0-Based indexed
-reparametrize Reparametrize restart string equally along path
-interp_method INTERP_METHOD
-bonds_file BONDS_FILE
A file which contains the bond indices (0-based)
-start_climb_immediately
Start climbing immediately when restarting.

ASE:
ASE calculator options

--ase-class ASE_CLASS
ASE calculator import path, eg.
"ase.calculators.lj.LennardJones"
--ase-kwargs ASE_KWARGS
ASE calculator keyword args, as JSON dictionary, eg.
{"param_filename":"path/to/file.xml"}

Example of use:
--------------------------------
gsm -mode DE_GSM -xyzfile yourfile.xyz -package QChem -lot_inp_file qstart -ID 1