Psi4Util
import Psi4Util
Psi4Util module provides the following functions:
CalculateSinglePointEnergy, GetAtomPositions, InitializePsi4, JoinMethodNameAndBasisSet, ListPsi4RunParamaters, PerformGeometryOptimization, ProcessPsi4ConstrainTorrionsParameters, ProcessPsi4CubeFilesParameters, ProcessPsi4DDXSolvationParameters, ProcessPsi4OptionsParameters, ProcessPsi4RunParameters, RemoveScratchFiles, RetrieveIsocontourRangeFromCubeFile, RetrieveMinAndMaxValueFromCubeFile, SetupPsi4DDXSolvationOptions, UpdatePsi4OptionsParameters, UpdatePsi4OutputFileUsingPID, UpdatePsi4RunParameters
Calculate single point electronic energy in Hartrees using a specified method and basis set.
Arguments:
Returns:
Retrieve a list of lists containing coordinates of all atoms in the molecule available in Psi4 wave function. By default, the atom positions are returned in Angstroms. The Psi4 default is Bohr.
Arguments:
Returns:
Example(s):
Import Psi4 module and configure it for running Psi4 jobs.
Arguments:
Returns:
Join method name and basis set using a backslash delimiter. An empty basis set specification is ignored.
Arguments:
Returns:
List values for a key set of the following Psi4 runtime parameters: Memory, NumThreads, OutputFile, ScratchDir, DataDir.
Arguments:
Returns:
Perform geometry optimization using a specified method and basis set.
Arguments:
Returns:
Process parameters for Psi4 constrain torsions around rotatable bonds and return a map containing processed parameter names and values.
ParamsOptionValue is a comma delimited list of parameter name and value pairs for generating cube files.
The supported parameter names along with their default and possible values are shown below:
ignoreHydrogens, yes, rotBondsSMARTSMode, NonStrict, rotBondsSMARTSPattern, Auto
Arguments:
Returns:
Process parameters for Psi4 runs and return a map containing processed parameter names and values.
ParamsOptionValue is a comma delimited list of parameter name and value pairs for generating cube files.
The supported parameter names along with their default and possible values are shown below:
GridSpacing, 0.2, GridOverage, 4.0, IsoContourThreshold, 0.85
GridSpacing: Units: Bohr. A higher value reduces the size of the cube files on the disk. This option corresponds to Psi4 option CUBIC_GRID_SPACING.
GridOverage: Units: Bohr.This option corresponds to Psi4 option CUBIC_GRID_OVERAGE.
IsoContourThreshold captures specified percent of the probability density using the least amount of grid points. This option corresponds to Psi4 option CUBEPROP_ISOCONTOUR_THRESHOLD.
Arguments:
Returns:
Process parameters for Psi4 DDX solvation and return a map containing processed parameter names and values.
ParamsOptionValue is a space delimited list of parameter name and value pairs for solvation energy calculatios.
The supported parameter names along with their default and possible values are shown below:
SolvationModel PCM Solvent water solventEpsilon None radiiSet UFF
solvationModel: Solvation model for calculating solvation energy. The corresponding Psi4 option is DDX_MODEL.
solvent: Solvent to use. The corresponding Ps4 option is DDX_SOLVENT.
solventEpsilon: Dielectric constant of the solvent. The corresponding Psi4 option is DDX_SOLVENT_EPSILON.
radiiSet: Radius set for cavity spheres. The corresponding Psi option is DDX_RADII_SET.
Arguments:
Returns:
Process parameters for setting up Psi4 options and return a map containing processed parameter names and values.
ParamsOptionValue is a comma delimited list of Psi4 option name and value pairs for setting global and module options. The names are 'option_name' for global options and 'module_name__option_name' for options local to a module. The specified option names must be valid Psi4 names. No validation is performed.
The specified option name and value pairs are processed and passed to psi4.set_options() as a dictionary. The supported value types are float, integer, boolean, or string. The float value string is converted into a float. The valid values for a boolean string are yes, no, true, false, on, or off.
Arguments:
Returns:
Process parameters for Psi4 runs and return a map containing processed parameter names and values.
ParamsOptionValue a comma delimited list of parameter name and value pairs for configuring Psi4 jobs.
The supported parameter names along with their default and possible values are shown below:
MemoryInGB,1,NumThreads,1,OutputFile,auto,ScratchDir,auto, RemoveOutputFile,yes
Possible values: OutputFile - stdout, quiet, or FileName; OutputFile - DirName; RemoveOutputFile - yes, no, true, or false
These parameters control the runtime behavior of Psi4.
The default for 'OutputFile' is a file name <InFileRoot>_Psi4.out. The PID is appened the output file name during multiprocessing. The 'stdout' value for 'OutputType' sends Psi4 output to stdout. The 'quiet' or 'devnull' value suppresses all Psi4 output.
The default 'Yes' value of 'RemoveOutputFile' option forces the removal of any existing Psi4 before creating new files to append output from multiple Psi4 runs.
The option 'ScratchDir' is a directory path to the location of scratch files. The default value corresponds to Psi4 default. It may be used to override the deafult path.
Arguments:
Returns:
The parameter name and values specified in ParamsOptionValues are validated before returning them in a dictionary.
Remove any leftover scratch files associated with the specified output file. The file specification, <OutfileRoot>.*<PID>.* is used to collect and remove files from the scratch directory. In addition, the file psi.<PID>.clean, in current directory is removed.
Arguments:
Returns:
Retrieve isocontour range values from the cube file. The range values are retrieved from the second line in the cube file after the string 'Isocontour range'.
Arguments:
Returns:
Retrieve minimum and maxmimum grid values from the cube file.
Arguments:
Returns:
Setup Psi4 options for calculating solvation energy using DDX module.
Arguments:
Returns:
Update Psi4 options using psi4.set_options().
Arguments:
Returns:
Append PID to output file name. The PID is automatically retrieved during None value of PID.
Arguments:
Returns:
Update Psi4 runtime parameters. The supported parameter names along with their default values are as follows: MemoryInGB: 1; NumThreads: 1, OutputFile: stdout; ScratchDir: auto; RemoveOutputFile: True.
Arguments:
Returns:
Copyright (C) 2024 Manish Sud. All rights reserved.
The functionality available in this file is implemented using Psi4, an open source quantum chemistry software package.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.