# Python Driver

## parallel

class `Parallel`

  Parallel is the base class for managing MPI communication

  `AddTask`(name, priority)
  `Begin`()
  `Done`()
  `MakeJob`()
  `Next`()
  `Synch`(local, N)

## roa

`generate_inputs`(name, db)

`grab_psi4_matrix`(outfile, matrix_name, row_tot)

`initialize_database`(database)

`make_gauge_list`(gauge_list)

`roa_stat`(db)

`run_roa`(name, **kwargs)

`synthesize_dip_quad_polar`(db, dip_quad_polar_list)

`synthesize_dipole_polar`(db, dip_polar_list)

`synthesize_opt_rot`(db, opt_rot_list)

## diatomic

## aliases

Module with functions that call upon those in modules `proc`, `driver`, and `wrappers`.

Place in this file quickly defined procedures such as
  - aliases for complex methods
  - simple modifications to existing methods

`fake_file11`(filename='fake_file11.dat')

  Function to print a file filename of the old file11 format.

## gaussian_n

`run_gaussian_2`(name, **kwargs)

## dashparam

Module to hold and distribute the -D dispersion correction parameters.

`dash_server`(func, dashlvl, mode='psi4')

  Function to serve up dispersion correction parameters in whatever form needed. When mode is ‘dftd3’, returns a string suitable for writing to ./dftd3_parameters to calculuate the correction at dashlvl with the default parameters for functional func. When mode is ‘psi4’, returns a tuple of arguments suitable for building a Dispersion object with dashlvl parameters for functional func.

  There are four computational dashlvl choices. ‘d2p4’ calls the -D2 correction within psi4 (hence, faked for mode=’dftd3’). The other three, ‘d2gr’, ‘d3zero’, and ‘d3bj’ call the three dftd3 modes of operation (corresponding to -old, -zero, -bj). Additionally, there are three aliased dashlvl choices since the aliases in dash_alias above are imposed.

## interface_cfour

Module with functions for Psi4/Cfour interface. Portions that require calls to Boost Python psi4 module are here, otherwise in qcdb module. Also calls to qcdb module are here and not elsewhere in driver. Organizationally, this module isolates qcdb code from psi4 code.

`cfour_gradient_list`()

  Form list of Cfour analytic `gradient()` arguments.

`cfour_list`()

  Form list of Cfour `energy()` arguments.

`cfour_psivar_list`()

  Form dictionary of PSI Variables set by Cfour methods.

`write_zmat`(name, dertype)

  Returns string with contents of Cfour ZMAT file as gathered from active molecule, current keyword settings, and cfour {...} block.

## wrappers

Module with functions that call the four main `driver` functions: `driver.energy`, `driver.optimize`, `driver.response`, and `driver.frequency`.

`GetCalcDetails`(methodname)

`auto_fragments`(name, **kwargs)

  Detects fragments if the user does not supply them. Currently only used for the WebMO implementation of SAPT Returns a new fragmented molecule

  usage: auto_fragments(‘’)

`call_function_in_1st_argument`(funcarg, **largs)

  Function to make primary function call to energy(), opt(), etc. with options dictionary largs. Useful when funcarg to call is stored in variable.

`convert`(p, symbol)

`mbe`(name, **kwargs)

  The driver routine for running calculations with the MBE or the GMBE.

  Parameters: | name (string) – `'scf'` || `'ccsd(t)'` || etc. First argument, usually unlabeled. Indicates the computational method to be applied to the molecule. May be any valid argument to `energy()`; however, SAPT is not appropriate.

`new_new_run_calc`(methodname, moleculelist, **kwargs)

`new_run_calc`(methodname, molecule, BeQuiet, **kwargs)

`reconstitute_bracketed_basis`(needarray)

  Function to reform a bracketed basis set string from a sequential series of basis sets (e.g, form ‘cc-pv[q5]z’ from array [cc-pvqz, cc-pv5z]). The basis set array is extracted from the f_basis field of a NEED dictionary in `complete_basis_set()`. Result is used to print a nicely formatted basis set string in the results table.

`return_energy_components`()

`split_menial`(menial)

  Function used by `complete_basis_set()` to separate menial ‘scftot’ into [scf, tot] and ‘mp2corl’ into [mp2, corl].

`tblhead`(tbl_maxrgt, tbl_delimit, ttype)

  Function that prints the header for the changable-width results tables in db(). tbl_maxrgt is the number of reagent columns the table must plan for. tbl_delimit is a string of dashes of the correct length to set off the table. ttype is 1 for tables comparing the computed values to the reference or 2 for simple tabulation and sum of the computed values.

`validate_bracketed_basis`(basisstring)

  Function to transform and validate basis sets for cbs(). A basis set with no paired square brackets is passed through with zeta level 0 (e.g., ‘6-31+G(d,p)’ is returned as [6-31+G(d,p)] and [0]). A basis set with square brackets is checked for sensible sequence and Dunning-ness and returned as separate basis sets (e.g., ‘cc-pV[Q5]Z’ is returned as [cc-pVQZ, cc-pV5Z] and [4, 5]). Note that this function has no communication with the basis set library to check if the basis actually exists. Used by `complete_basis_set()`.

`validate_scheme_args`(functionname, **largs)

  Function called by each extrapolation scheme in `complete_basis_set()`. Checks that all the input arguments are present and suitable so that the scheme function can focus on defining the extrapolation.

## driver

`gradient`(name, **kwargs)

  Function complementary to optimize(). Carries out one gradient pass, deciding analytic or finite difference.

`hessian`(name, **kwargs)

  Function complementary to `frequency()`. Computes force constants, deciding analytic, finite difference of gradients, or finite difference of energies.

`molden`(filename)

  Function to write wavefunction information in molden format to filename

`parse_arbitrary_order`(name)

  Function to parse name string into a method family like CI or MRCC and specific level information like 4 for CISDTQ or MRCCSDTQ.

`parse_cotton_irreps`(irrep)

  Function to return validated Cotton ordering index from string or integer irreducible representation irrep.

## molutil

Module with utility functions that act on molecule objects.

`BFS`(self)

  Perform a breadth-first search (BFS) on the real atoms in molecule, returning an array of atom indices of fragments. Relies upon van der Waals radii and so faulty for close (esp. hydrogen-bonded) fragments. Original code from Michael S. Marshall.

`activate`(mol)

  Function to set molecule object mol as the current active molecule.

`dynamic_variable_bind`(cls)

  Function to dynamically add extra members to the psi4.Molecule class.

`extract_cluster_indexing`(mol, cluster_size=0)

  Function to returns a LIST of all subclusters of the molecule mol of real size cluster_size. If cluster_size = 0, returns all possible combinations of cluster size.

`extract_clusters`(mol, ghost=True, cluster_size=0)

  Function to return all subclusters of the molecule mol of real size cluster_size and all other atoms ghosted if ghost equals true, all other atoms discarded if ghost is false. If cluster_size = 0, returns all possible combinations of cluster size.

`geometry`(geom, name='default')

  Function to create a molecule object of name name from the geometry in string geom.

`new_get_attr`(self, name)

  Function to redefine __getattr__ method of molecule class.

`new_set_attr`(self, name, value)

  Function to redefine __setattr__ method of molecule class.

## proc

`parse_scf_cases`(name)

  Function to parse name string involving SCF family into proper reference option.

`run_adc`(name, **kwargs)

  Function encoding sequence of PSI module calls for an algebraic diagrammatic construction calculation.

  Caution

  Get rid of active molecule lines- should be handled in energy.

`run_bccd`(name, **kwargs)

  Function encoding sequence of PSI module calls for a Brueckner CCD calculation.

`run_bccd_t`(name, **kwargs)

  Function encoding sequence of PSI module calls for a Brueckner CCD(T) calculation.

`run_cc_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a CCSD and CCSD(T) gradient calculation.

`run_cc_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for all CC property calculations.

`run_ccenergy`(name, **kwargs)

  Function encoding sequence of PSI module calls for a CCSD, CC2, and CC3 calculation.

`run_cdccd`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed CCD computation

`run_cdccsd`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed CCSD computation

`run_cdmp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed MP2 computation

`run_cdmp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed MP3 computation

`run_cdomp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed orbital-optimized MP2 computation

`run_cdomp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed orbital-optimized MP3 computation

`run_cepa`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cepa-like calculation.

      >>> energy('cepa(1)')

`run_cepa0`(name, **kwargs)

  Function encoding sequence of PSI module calls for a CEPA (LCCD) computation

`run_cepa0_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a CEPA(0) gradient calculation.

`run_conv_omp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for an orbital-optimized MP2 computation

`run_conv_omp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for OMP2 gradient calculation.

`run_dcft`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density cumulant functional theory calculation.

`run_dcft_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for DCFT gradient calculation.

`run_detcas`(name, **kwargs)

  Function encoding sequence of PSI module calls for determinant-based multireference wavefuncations, namely CASSCF and RASSCF.

`run_detci`(name, **kwargs)

  Function encoding sequence of PSI module calls for a configuration interaction calculation, namely FCI, CIn, MPn, and ZAPTn.

`run_detci_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for a configuration interaction calculation, namely FCI, CIn, MPn, and ZAPTn, computing properties.

`run_dfccd`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP2 computation

`run_dfccd_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted CCD gradient computation

`run_dfccdl`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted CCSD Lambda computation

`run_dfccsd2`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP2 computation

`run_dfccsd_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted CCSD gradient computation

`run_dfccsdl`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted CCSD Lambda computation

`run_dfmp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density-fitted MP2 calculation.

`run_dfmp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a DFMP2 gradient calculation.

`run_dfmp2_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for a DFMP2 property calculation.

`run_dfmp2_select_gradient`(name, **kwargs)

  Function selecting the algorithm for a MP2 gradient call and directing toward the OCC (conv MP2) or the DFMP2 modules.

`run_dfmp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted MP3 computation

`run_dfocc`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP2 computation

`run_dfomp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP2 computation

`run_dfomp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for DF-OMP2 gradient calculation.

`run_dfomp2_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for DF-OMP2 gradient calculation.

`run_dfomp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP3 computation

`run_dft`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density-functional-theory calculation.

`run_dft_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density-functional-theory gradient calculation.

`run_dmrgci`(name, **kwargs)

  Function encoding sequence of PSI module calls for an DMRG calculation.

`run_dmrgscf`(name, **kwargs)

  Function encoding sequence of PSI module calls for an DMRG calculation.

`run_efp`(name, **kwargs)

  Function encoding sequence of module calls for a pure EFP computation (ignore any QM atoms).

`run_eom_cc`(name, **kwargs)

  Function encoding sequence of PSI module calls for an EOM-CC calculation, namely EOM-CC2, EOM-CCSD, and EOM-CC3.

`run_eom_cc_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for an EOM-CCSD gradient calculation.

`run_fisapt`(name, **kwargs)

  Function encoding sequence of PSI module calls for an F/ISAPT0 computation

`run_fnocc`(name, **kwargs)

  Function encoding sequence of PSI module calls for a QCISD(T), CCSD(T), MP2.5, MP3, and MP4 computation.

      >>> energy('fno-ccsd(t)')

`run_fnodfcc`(name, **kwargs)

  Function encoding sequence of PSI module calls for a DF-CCSD(T) computation.

      >>> energy('df-ccsd(t)')

`run_libfock`(name, **kwargs)

  Function encoding sequence of PSI module calls for a calculation through libfock, namely RCPHF, RCIS, RTDHF, RTDA, and RTDDFT.

`run_lmp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for an LMP2 theory calculation.

`run_mcscf`(name, **kwargs)

  Function encoding sequence of PSI module calls for a multiconfigurational self-consistent-field calculation.

`run_mp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP2 calculation.

`run_mp2_5`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP2.5 calculation.

`run_mp2_5_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP3 gradient calculation.

`run_mp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP2 gradient calculation.

`run_mp2_select`(name, **kwargs)

  Function selecting the algorithm for a MP2 energy call and directing toward the OCC (conv MP2) or the DFMP2 modules.

`run_mp2_select_gradient`(name, **kwargs)

  Function selecting the algorithm for a MP2 gradient call and directing toward the OCC (conv MP2) or the DFMP2 modules.

`run_mp2c`(name, **kwargs)

  Function encoding sequence of PSI module calls for a coupled MP2 calculation.

`run_mp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP3 calculation.

`run_mp3_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP3 gradient calculation.

`run_mrcc`(name, **kwargs)

  Function that prepares environment and input files for a calculation calling Kallay’s MRCC code.

`run_ocepa`(name, **kwargs)

  Function encoding sequence of PSI module calls for an orbital-optimized CEPA computation

`run_ocepa_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for OCEPA gradient calculation.

`run_oldmp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a MP2 calculation.

`run_omp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for an orbital-optimized MP2 computation

`run_omp2_5`(name, **kwargs)

  Function encoding sequence of PSI module calls for an orbital-optimized MP2.5 computation

`run_omp2_5_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for OMP2.5 gradient calculation.

`run_omp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for OMP2 gradient calculation.

`run_omp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for an orbital-optimized MP3 computation

`run_omp3_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for OMP3 gradient calculation.

`run_psimrcc`(name, **kwargs)

  Function encoding sequence of PSI module calls for a PSIMRCC computation using a reference from the MCSCF module

`run_psimrcc_scf`(name, **kwargs)

  Function encoding sequence of PSI module calls for a PSIMRCC computation using a reference from the SCF module

`run_qchf`(name, **kwargs)

  Function encoding sequence of PSI module calls for an density-fitted orbital-optimized MP2 computation

`run_rimp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density-fitted MP2 computation

`run_rimp2_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a density-fitted MP2 computation

`run_rimp2_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for a cholesky-decomposed MP2 computation

`run_sapt`(name, **kwargs)

  Function encoding sequence of PSI module calls for a SAPT calculation of any level.

`run_sapt_ct`(name, **kwargs)

  Function encoding sequence of PSI module calls for a charge-transfer SAPT calcuation of any level.

`run_scf`(name, **kwargs)

  Function encoding sequence of PSI module calls for a self-consistent-field theory (HF & DFT) calculation.

`run_scf_gradient`(name, **kwargs)

  Function encoding sequence of PSI module calls for a SCF gradient calculation.

`run_scf_property`(name, **kwargs)

  Function encoding sequence of PSI module calls for SCF calculations. This is a simple alias to `run_scf()` since SCF properties all handled through oeprop.

`run_scs_omp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a spin-component scaled OMP2 computation

`run_scs_omp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for a spin-component scaled OMP3 computation

`run_sos_omp2`(name, **kwargs)

  Function encoding sequence of PSI module calls for a spin-opposite scaled OMP2 computation

`run_sos_omp3`(name, **kwargs)

  Function encoding sequence of PSI module calls for a spin-opposite scaled OMP3 computation

`scf_helper`(name, **kwargs)

  Function serving as helper to SCF, choosing whether to cast up or just run SCF with a standard guess. This preserves previous SCF options set by other procedures (e.g., SAPT output file types for SCF).

## qmmm

Module with classes to integrate MM charges into a QM calculation.

class `Diffuse`(molecule, basisname, ribasisname)
  `fitGeneral`()

    Function to perform a general fit of diffuse charges to wavefunction density.

  `fitScf`()

    Function to run scf and fit a system of diffuse charges to resulting density.

  `populateExtern`(extern)

class `QMMM`
  `addChargeAngstrom`(Q, x, y, z)

    Function to add a point charge of magnitude Q at position (x, y, z) Angstroms.

  `addChargeBohr`(Q, x, y, z)

    Function to add a point charge of magnitude Q at position (x, y, z) Bohr.

  `addDiffuse`(diffuse)

    Function to add a diffuse charge field diffuse.

  `populateExtern`()

    Function to define a charge field external to the molecule through point and diffuse charges.

## pubchem

class `PubChemObj`(cid, mf, iupac)
  `getCartesian`()

    Function to return a string of the atom symbol and XYZ coordinates of the PubChem object.

  `getMoleculeString`()

    Function to obtain a molecule string through getCartesian() or fail.

  `getSDF`()

    Function to return the SDF (structure-data file) of the PubChem object.

  `getXYZFile`()

    Function to obtain preferentially a molecule string through getCartesian() or a query string otherwise.

  `name`()

    Function to return the IUPAC name of the PubChem object.

`getPubChemResults`(name)

  Function to query the PubChem database for molecules matching the input string. Builds a PubChem object if found.

## inputparser

`bad_option_syntax`(line)

  Function to report bad syntax to screen and output file.

`basname`(name)

  Imitates BasisSet.make_filename() without the gbs extension

`check_parentheses_and_brackets`(input_string, exit_on_error)

  Function to check that all parenthesis and brackets in input_string are paired. On that condition, exit_on_error =1, otherwise 0.

`parse_multiline_array`(input_list)

  Function to squash multiline arrays into a single line until all parentheses and brackets are fully paired.

`process_basis_block`(matchobj)

  Function to process match of `basis name? { ... }`.

`process_cfour_command`(matchobj)

  Function to process match of `cfour name? { ... }`.

`process_external_command`(matchobj)

  Function to process match of `external name? { ... }`.

`process_extract_command`(matchobj)

  Function to process match of `extract_subsets`.

`process_from_file_command`(matchobj)

  Function that process a match of `from_file` in molecule block.

`process_input`(raw_input, print_level=1)

  Function to preprocess raw input, the text of the input file, then parse it, validate it for format, and convert it into legitimate Python. raw_input is printed to the output file unless print_level =0. Does a series of regular expression filters, where the matching portion of the input is replaced by the output of the corresponding function (in this module) call. Returns a string concatenating module import lines, a copy of the user’s .psi4rc files, a setting of the scratch directory, a dummy molecule, and the processed raw_input.

`process_literal_blocks`(matchobj)

  Function to process match of `literals_psi4_yo-...`.

`process_memory_command`(matchobj)

  Function to process match of `memory ...`.

`process_molecule_command`(matchobj)

  Function to process match of `molecule name? { ... }`.

`process_multiline_arrays`(inputfile)

  Function to find array inputs that are spread across multiple lines and squash them into a single line.

`process_option`(spaces, module, key, value, line)

  Function to process a line with set or in a set block into global/local domain and keyword/value.

`process_pcm_command`(matchobj)

  Function to process match of `pcm name? { ... }`.

`process_print_command`(matchobj)

  Function to process match of `print` and transform it to `psi4.print_out()`.

`process_pubchem_command`(matchobj)

  Function to process match of `pubchem` in molecule block.

`process_set_command`(matchobj)

  Function to process match of all individual `set (module_list) key {[value_list] or $value or value}`.

`process_set_commands`(matchobj)

  Function to process match of `set name? { ... }`.

`process_word_quotes`(matchobj)

  Function to determine if argument needs wrapping in quotes as string.

`quotify`(string)

  Function to wrap anything that looks like a string in quotes and to remove leading dollar signs from python variables.

## functional

Module to provide lightweight definitions of functionals and SuperFunctionals

`build_b2plyp_superfunctional`(name, npoints, deriv)

`build_b2plypd2gr_superfunctional`(name, npoints, deriv)

`build_b2plypd2p4_superfunctional`(name, npoints, deriv)

`build_b2plypd3bj_superfunctional`(name, npoints, deriv)

`build_b2plypd3zero_superfunctional`(name, npoints, deriv)

`build_b3_x_functional`(name)

`build_b3lyp5_superfunctional`(name, npoints, deriv)

`build_b3lyp5d2gr_superfunctional`(name, npoints, deriv)

`build_b3lyp5d2p4_superfunctional`(name, npoints, deriv)

`build_b3lyp5d3bj_superfunctional`(name, npoints, deriv)

`build_b3lyp5d3zero_superfunctional`(name, npoints, deriv)

`build_b3lyp_superfunctional`(name, npoints, deriv)

`build_b3lypchg_superfunctional`(name, npoints, deriv)

`build_b3lypd1_superfunctional`(name, npoints, deriv)

`build_b3lypd2gr_superfunctional`(name, npoints, deriv)

`build_b3lypd2p4_superfunctional`(name, npoints, deriv)

`build_b3lypd3bj_superfunctional`(name, npoints, deriv)

`build_b3lypd3zero_superfunctional`(name, npoints, deriv)

`build_b88_x_functional`(name)

`build_b970_superfunctional`(name, npoints, deriv)

`build_b971_superfunctional`(name, npoints, deriv)

`build_b972_superfunctional`(name, npoints, deriv)

`build_b97_x_functional`(name)

`build_b97d2gr_superfunctional`(name, npoints, deriv)

`build_b97d2p4_superfunctional`(name, npoints, deriv)

`build_b97d3bj_superfunctional`(name, npoints, deriv)

`build_b97d3zero_superfunctional`(name, npoints, deriv)

`build_blyp_superfunctional`(name, npoints, deriv)

`build_blypd1_superfunctional`(name, npoints, deriv)

`build_blypd2gr_superfunctional`(name, npoints, deriv)

`build_blypd2p4_superfunctional`(name, npoints, deriv)

`build_blypd3bj_superfunctional`(name, npoints, deriv)

`build_blypd3zero_superfunctional`(name, npoints, deriv)

`build_bp86_superfunctional`(name, npoints, deriv)

`build_bp86d1_superfunctional`(name, npoints, deriv)

`build_bp86d2gr_superfunctional`(name, npoints, deriv)

`build_bp86d2p4_superfunctional`(name, npoints, deriv)

`build_bp86d3bj_superfunctional`(name, npoints, deriv)

`build_bp86d3zero_superfunctional`(name, npoints, deriv)

`build_dldf_superfunctional`(name, npoints, deriv)

`build_dldfd09_superfunctional`(name, npoints, deriv)

`build_dldfd_superfunctional`(name, npoints, deriv)

`build_dsd_blyp_superfunctional`(name, npoints, deriv)

`build_dsd_pbep86_superfunctional`(name, npoints, deriv)

`build_dsd_pbepbe_superfunctional`(name, npoints, deriv)

`build_ft97_superfunctional`(name, npoints, deriv)

`build_functional`(alias)

`build_hcth120_superfunctional`(name, npoints, deriv)

`build_hcth120d3bj_superfunctional`(name, npoints, deriv)

`build_hcth120d3zero_superfunctional`(name, npoints, deriv)

`build_hcth147_superfunctional`(name, npoints, deriv)

`build_hcth407_superfunctional`(name, npoints, deriv)

`build_hcth_superfunctional`(name, npoints, deriv)

`build_hfd_superfunctional`(name, npoints, deriv)

`build_m05_2x_superfunctional`(name, npoints, deriv)

`build_m05_2xd3zero_superfunctional`(name, npoints, deriv)

`build_m05_superfunctional`(name, npoints, deriv)

`build_m05d3zero_superfunctional`(name, npoints, deriv)

`build_pbe0_2_superfunctional`(name, npoints, deriv)

`build_pbe0_superfunctional`(name, npoints, deriv)

`build_pbe0d2gr_superfunctional`(name, npoints, deriv)

`build_pbe0d2p4_superfunctional`(name, npoints, deriv)

`build_pbe0d3bj_superfunctional`(name, npoints, deriv)

`build_pbe0d3zero_superfunctional`(name, npoints, deriv)

`build_pbe_superfunctional`(name, npoints, deriv)

`build_pbe_x_functional`(name)

`build_pbed1_superfunctional`(name, npoints, deriv)

`build_pbed2gr_superfunctional`(name, npoints, deriv)

`build_pbed2p4_superfunctional`(name, npoints, deriv)

`build_pbed3bj_superfunctional`(name, npoints, deriv)

`build_pbed3zero_superfunctional`(name, npoints, deriv)

`build_pbesol_x_functional`(name)

`build_primitive_functional`(name)

`build_primitive_superfunctional`(name, npoints, deriv)

`build_pw91_superfunctional`(name, npoints, deriv)

`build_pw91_x_functional`(name)

`build_revpbe_x_functional`(name)

`build_rpbe_x_functional`(name)

`build_s_x_functional`(name)

`build_sogga_superfunctional`(name, npoints, deriv)

`build_sogga_x_functional`(name)

`build_superfunctional`(alias, npoints, deriv)

`build_svwn_superfunctional`(name, npoints, deriv)

`build_vwn3_c_functional`(name)

`build_vwn3rpa_c_functional`(name)

`build_vwn5_c_functional`(name)

`build_vwn5rpa_c_functional`(name)

`build_wb88_x_functional`(name)

`build_wb88_x_superfunctional`(name, npoints, deriv)

`build_wb97_superfunctional`(name, npoints, deriv)

`build_wb97x_2lp_superfunctional`(name, npoints, deriv)

`build_wb97x_2tqz_superfunctional`(name, npoints, deriv)

`build_wb97x_superfunctional`(name, npoints, deriv)

`build_wb97xd_superfunctional`(name, npoints, deriv)

`build_wblyp_superfunctional`(name, npoints, deriv)

`build_wpbe0_superfunctional`(name, npoints, deriv)

`build_wpbe2_superfunctional`(name, npoints, deriv)

`build_wpbe_c_superfunctional`(name, npoints, deriv)

`build_wpbe_superfunctional`(name, npoints, deriv)

`build_wpbe_x_functional`(name)

`build_wpbe_x_superfunctional`(name, npoints, deriv)

`build_wpbesol0_superfunctional`(name, npoints, deriv)

`build_wpbesol_superfunctional`(name, npoints, deriv)

`build_wpbesol_x_functional`(name)

`build_wpbesol_x_superfunctional`(name, npoints, deriv)

`build_wpw92_c_superfunctional`(name, npoints, deriv)

`build_ws_x_functional`(name)

`build_ws_x_superfunctional`(name, npoints, deriv)

`build_wsvwn_superfunctional`(name, npoints, deriv)

`functional_list`()

`superfunctional_list`()

`test_ccl_functional`(functional, ccl_functional)

## mbe_impl

## interactive

`run`()

## frac

`frac_nuke`(mol, **kwargs)

`frac_traverse`(mol, **kwargs)

`ip_fitting`(mol, omega_l, omega_r, **kwargs)

## p4regex

## p4xcpt

Module with non-generic exceptions classes.

exception `CSXError`(msg)

  Error called when CSX generation fails.

exception `PsiException`

  Error class for Psi.

exception `TestComparisonError`(msg)

  Error called when a test case fails due to a failed compare_values() call. Prints error message msg to standard output stream and output file.

exception `ValidationError`(msg)

  Error called for problems with the input file. Prints error message msg to standard output stream and output file.

## wrappers_cfour

Module with functions for Psi4/Cfour interface. Portions that require calls to Boost Python psi4 module are here, otherwise in qcdb module. Also calls to qcdb module are here and not elsewhere in driver. Organizationally, this module isolates qcdb code from psi4 code.

`reap_job_validate`(dir, prefix, item, linkage, keys)

  For a given output file whose path is constructed with dir + ‘/’ + prefix + ‘-‘ + item + ‘.out’, tests that the file exists and has prefix RESULTS lines for each piece of information requested in list keys and that those lines correspond to the appropriate linkage and item. Returns keys along with their scanned values in dict reapings, along with error and success messages in instructions and a boolean isOk indicating whether all keys reaped sucessfully.

`run_cfour_module`(xmod)

`sown_jobs_status`(dir, prefix, zmats, validate_func=None, linkage=None, keys=None)

  Evaluate the output file status of jobs in zmats which should exist at dir + ‘/’ + prefix + ‘-‘ + job + ‘.out’. Returns string with formatted summary of job status and boolean of whether all complete. Return boolean isOk signals whether all zmats have completed and, if validate_func present, are validated.

`vpt2`(name, **kwargs)

  Perform vibrational second-order perturbation computation through Cfour to get anharmonic frequencies. This version uses c4 for the disp and pt2 but gets gradients from p4.

  Parameters: | c4full (boolean) – `'on'` || `'off'` Indicates whether when name indicates a Cfour method and mode indicates a sow/reap approach, sown files are direct ZMAT files and FJOBARC files are expected to reap, so that Cfour only, not Cfour-through-Psi4, is needed for distributed jobs.

  Caution

  Some features are not yet implemented. Buy a developer a coffee.

  - Presently uses all gradients. Could mix in analytic 2nd-derivs.
  - Collect resutls.
  - Manage scratch / subdir better.
  - Untangle CCSD(T) vs CCSD[T] and FJOBARC issue
  - Allow CFOUR_BASIS
  - Consider forcing some tighter convcrit, c4 and p4
  - sow/reap
  - mixed ang/bohr signals
  - error by converting to ang in psi?
  - Expand CURRENT DIPOLE XYZ beyond SCF
  - Remember additional FJOBARC record TOTENER2 if EXCITE .ne. NONE
  - S/R P4grad
  - S/R C4grad
  - C P4grad
  - C C4grad
  - switch C –> S/R with recovery using shelf
  - pure C mode where only need P4 for wrapper

`vpt2_instructions`(stage, dir, zmats)

  Stores all the instructions to the user for running `vpt2()` in sowreap mode. Depending on the stage, Pieces together instruction strings for the appropriate stage individualized by working directory dir and sown inputs zmats information.

`vpt2_reaprun_files`(item, linkage, isSowReap, isC4notP4, isC4fully, zmat, outdir, scrdir, c4scrdir, lowername, kwargs)

  Provided with the particular displacement number item and the associated zmat file with geometry and linkage, returns the FJOBARC contents. Depending on the mode settings of isC4notP4, isSowReap, and isC4fully, either runs (using lowername and kwargs) or reaps contents. outdir is where psi4 was invoked, scrdir is the psi4 scratch directory, and c4scrdir is Cfour scratch directory within.

`vpt2_sow_files`(item, linkage, isC4notP4, isC4fully, zmat, inputSansMol, inputGenbas)

  Provided with the particular displacement number item and the associated zmat file contents and linkage, and common contents inputSansMol, returns contents of input file to be sown.

## interface_dftd3

Module with functions that interface with Grimme’s DFTD3 code.

## qcdb

Module to facilitate quantum chemical computations on chemical databases. Contains Molecule class and physical constants from psi4 suite.

class `Infile`(mem, mol, mtd, der, opt)
  `format_infile_string`()
  `muster_basis_options`()
  `prepare_basis_for_molpro`()

`muster_cdsgroup_options`(name)

`muster_modelchem`(name, dertype, mol)

  Transform calculation method name and derivative level dertype into options for cfour. While deliberately requested pieces, generally CFOUR_DERIV_LEVEL and CFOUR_CALC_LEVEL, are set to complain if contradicted (‘clobber’ set to True), other ‘recommended’ settings, like CFOUR_CC_PROGRAM, can be countermanded by keywords in input file (‘clobber’ set to False). Occasionally, want these pieces to actually overcome keywords in input file (‘superclobber’ set to True).

`prepare_options_for_molpro`(options, proc)

  Function to take the full snapshot of the liboptions object encoded in dictionary options, find the options directable toward Cfour (options[‘CFOUR’][‘CFOUR_**’]) that aren’t default, then write a CFOUR deck with those options. Note that unlike the cfour version, this uses complete options deck.

`psi4_list`()

  Return an array of Psi4 methods with energies.

class `CharacterTable`(*args)

  The CharacterTable class provides a workable character table for all of the non-cubic point groups. While I have tried to match the ordering in Cotton’s book, I don’t guarantee that it is always followed. It shouldn’t matter anyway. Also note that I don’t lump symmetry operations of the same class together. For example, in C3v there are two distinct C3 rotations and 3 distinct reflections, each with a separate character. Thus symop has 6 elements rather than the 3 you’ll find in most published character tables.

  `bits`()

    Returns bitwise representation of symm ops

  `common_init`()

    First parse the point group symbol, this will give us the order of the point group(g), the type of point group (pg), the order of the principle rotation axis (nt), and the number of irreps (nirrep_).

  `complex`()

    Cn, Cnh, Sn, T, and Th point groups have complex representations. This function returns 1 if the point group has a complex representation, 0 otherwise.

  `constructor_bits`(bits)

    This constructor takes the bitswise representation of a point group as input.

  `constructor_schoenflies`(cpg)

    This constructor takes the Schoenflies symbol of a point group as input.

  `gamma`(i)

    Returns the i’th irrep.

  `inverse`(i)

    Returns the index of the symop which is the inverse of symop[i].

  `make_table`()

    This function will generate a character table for the point group. This character table is in the order that symmetry operations are generated, not in Cotton order. If this is a problem, tough. Also generate the transformation matrices. This fills in the irrep and symop arrays

  `ncomp`()

    Returns number of compenents, including degeneracies

  `nirrep`()

    Returns the number of irreps.

  `order`()

    Returns the order of the point group

  `symbol`()

    Returns the Schoenflies symbol for the point group

  `symm_operation`(i)

    Returns the i’th symmetry operation.

  `which_comp`(i)

    Returns which component i is.

  `which_irrep`(i)

    Returns the irrep component i belongs to.

class `IrreducibleRepresentation`(*args)

  The IrreducibleRepresentation class provides information associated with a particular irreducible representation of a point group. This includes the Mulliken symbol for the irrep, the degeneracy of the irrep, the characters which represent the irrep, and the number of translations and rotations in the irrep. The order of the point group is also provided (this is equal to the number of characters in an irrep).

  `character`(i)

    Returns the character for the i’th symmetry operation of the point group.

  `complex`()

    Returns the value of complex_

  `constructor_order_degen_mulliken`(order, d, lab, clab)

    This constructor takes as arguments the order of the point group, the degeneracy d of the irrep, and the Mulliken symbol of the irrep. The Mulliken symbol is copied internally.

  `degeneracy`()

    Returns the degeneracy of the irrep.

  `init`(order, d, lab, clab)

    Initialize the order, degeneracy, and Mulliken symbol of the irrep.

  `nproj`()

    Returns the number of projection operators for the irrep.

  `nrot`()

    Returns the number of rotations associated with the irrep.

  `ntrans`()

    Returns the number of translations associated with the irrep.

  `order`()

    Returns the order of the group.

  `p`(x1, x2, i=None)

    Returns the element (x1, x2) of the i’th representation matrix. Or Returns the character for the x1’th contribution to the x2’th representation matrix.

  `symbol`()

    Returns the Mulliken symbol for the irrep.

  `symbol_ns`()

    Returns the Mulliken symbol for the irrep without special characters.

class `PointGroup`(*args)

  The PointGroup class is really a place holder for a CharacterTable. It contains a string representation of the Schoenflies symbol of a point group, a frame of reference for the symmetry operation transformation matrices, and a point of origin. The origin is not respected by the symmetry operations, so if you want to use a point group with a nonzero origin, first translate all your coordinates to the origin and then set the origin to zero.

  `bits`()

    Returns the bitwise representation of the point group

  static `bits_to_basic_name`(bits)

    From bit representation of point group, returns string of simple (non-directional) Schoenflies symbol.

  static `bits_to_full_name`(bits)
  `char_table`()

    Returns the CharacterTable for this point group.

  `constructor_bits`(bits)

    Using the bitwise representation constructor the point group object.

  `constructor_bits_origin`(bits, origin)

    Using the bitwise representation constructor the point group object.

  `constructor_schoenflies`(s)

    This constructor takes a string containing the Schoenflies symbol of the point group as its only argument.

  `constructor_schoenflies_origin`(s, origin)

    Like the above, but this constructor also takes a point of origin as an argument.

  static `full_name_to_bits`(pg)
  `origin`()

    Returns the origin of the symmetry frame.

  `set_symbol`(sym)

    Sets (or resets) the Schoenflies symbol.

  `symbol`()

    Returns the Schoenflies symbol for this point group.

class `SymRep`(*args)

  The SymRep class provides an n dimensional matrix representation of a symmetry operation, such as a rotation or reflection. The trace of a SymRep can be used as the character for that symmetry operation. d is hardwired to 5x5 since the H irrep in Ih is 5 dimensional.

  `E`()

    Set equal to the identity

  `SymmetryOperation`()

    Cast SymRep to SymmetryOperation

  `c2_x`()

    Set equal to C2 about the x axis

  `c2_y`()

    Set equal to C2 about the y axis

  `c2_z`()

    Set equal to C2 about the z axis

  `constructor_order`(i)

    Initialize order only

  `constructor_symmetryoperation`(so)

    Initialize from 3x3 SymmetryOperation

  `i`()

    Set equal to an inversion

  `operate`(r)

    This operates on this with r (i.e. return r * this)

  `rotation`(theta)

    Set equal to a clockwise rotation by 2pi/n or theta degrees

  `set_dim`(i)

    Set the dimension of d

  `sigma_h`()

    Set equal to reflection in xy plane

  `sigma_xz`()

    Set equal to reflection in xz plane

  `sigma_yz`()

    Set equal to reflection in yz plane

  `trace`()

    returns the trace of the transformation matrix

  `transform`(r)

    This performs the transform r * this * r~

  `unit`()

    Set equal to a unit matrix

  `zero`()

    zero out the symop

class `SymmetryOperation`(*args)

  The SymmetryOperation class provides a 3 by 3 matrix representation of a symmetry operation, such as a rotation or reflection.

  `E`()

    Set equal to E

  `analyze_d`()
  `bit`()

    Get the bit value.

  `c2_x`()

    Set equal to C2 about the x axis

  `c2_y`()

    Set equal to C2 about the y axis

  `c2_z`()

    Set equal to C2 about the z axis

  `constructor_symmetryoperation`(so)
  `i`()

    Set equal to an inversion

  `operate`(r)

    This operates on this with r (i.e. return r * this)

  `rotation`(theta)

    Set equal to a clockwise rotation by 2pi/n or theta degrees

  `sigma_xy`()

    Set equal to reflection in xy plane

  `sigma_xz`()

    Set equal to reflection in xz plane

  `sigma_yz`()

    Set equal to reflection in yz plane

  `trace`()

    returns the trace of the transformation matrix

  `transform`(r)

    This performs the transform r * this * r~

  `transpose`()

    Transpose matrix operation

  `unit`()

    Set equal to a unit matrix

  `zero`()

    zero out the symop

`similar`(bits)

  From bits of a directionalized point group, returns array of bits of all directions.

class `LibmintsMolecule`(psi4molstr=None)

  Class to store the elements, coordinates, fragmentation pattern, charge, multiplicity of a molecule. Largely replicates psi4’s libmints Molecule class, developed by Justin M. Turney and Andy M. Simmonett with incremental improvements by other psi4 developers. Major differences from the C++ class are: no basisset handling, no symmetry, no pubchem, no efp, no discarding dummies. This class translated so that databases can function independently of psi4.

      >>> H2OH2O = qcdb.Molecule("""
          0 1
          O1  -1.551007  -0.114520   0.000000
          H1  -1.934259   0.762503   0.000000
          H2  -0.599677   0.040712   0.000000
          --
          0 1
          X    0.000000   0.000000   0.000000
          O2   1.350625   0.111469   0.000000
          H3   1.680398  -0.373741  -0.758561
          H4   1.680398  -0.373741   0.758561
          no_com
          no_reorient
          units angstrom
          """)

      >>> H2O = qcdb.Molecule.init_with_xyz('h2o.xyz')

  `FullPointGroupList` = ['ATOM', 'C_inf_v', 'D_inf_h', 'C1', 'Cs', 'Ci', 'Cn', 'Cnv', 'Cnh', 'Sn', 'Dn', 'Dnd', 'Dnh', 'Td', 'Oh', 'Ih']
  `Z`(atom)

    Nuclear charge of atom (0-indexed)

        >>> print H2OH2O.Z(4)
        1

  `activate_all_fragments`()

    Sets all fragments in the molecule to be active.

  `add_atom`(Z, x, y, z, label='', mass=0.0, charge=0.0, lineno=-1)

    Add an atom to the molecule Z atomic number x cartesian coordinate y cartesian coordinate z cartesian coordinate symb atomic symbol to use mass mass to use if non standard charge charge to use if non standard lineno line number when taken from a string

  `atom_at_position`(b, tol=0.05)

    Tests to see of an atom is at the passed position b in Bohr with a tolerance tol.

        >>> print H2OH2O.atom_at_position([1.35*(1.0/psi_bohr2angstroms), 0.10*(1.0/psi_bohr2angstroms), 0.0*(1.0/psi_bohr2angstroms)])
        3

  `atom_entry`(atom)

    Returns the CoordEntry for an atom.

  `atom_to_unique`(iatom)

    Converts an atom number to the number of its generating unique atom. The return value is in [0, nunique).

  `atom_to_unique_offset`(iatom)

    Converts an atom number to the offset of this atom in the list of generated atoms. The unique atom itself is allowed offset 0.

  `center_of_mass`()

    Computes center of mass of molecule (does not translate molecule).

        >>> H2OH2O.center_of_mass()
        [-0.12442647346606871, 0.00038657002584110707, 0.0]

  `charge`(atom)

    Returns charge of atom (0-indexed). Related to SAD guess in libmints version.

        >>> print H2OH2O.charge(4)
        1.0

  `charge_specified`()

    Whether the charge was given by the user

        >>> print H2OH2O.charge_specified()
        True

  `clear`()

    Zero it out.

  `clear_basis_all_atoms`()

    Remove all basis information from atoms.

  `clone`()

    Returns new, independent Molecule object.

        >>> dimer = H2OH2O.clone()

  `create_molecule_from_string`(text)

    Given a string text of psi4-style geometry specification (including newlines to separate lines), builds a new molecule. Called from constructor.

  `create_psi4_string_from_molecule`()

    Regenerates a input file molecule specification string from the current state of the Molecule. Contains geometry info, fragmentation, charges and multiplicities, and any frame restriction.

  `deactivate_all_fragments`()

    Sets all fragments in the molecule to be inactive.

  `distance_matrix`()

    Computes a matrix depicting distances between atoms. Prints formatted and returns array.

        >>> H2OH2O.distance_matrix()
                Interatomic Distances (Angstroms)
                          [1]         [2]         [3]         [4]         [5]         [6]
          [1]         0.00000
          [2]         0.95711     0.00000
          [3]         0.96391     1.51726     0.00000
          [4]         2.91042     3.34878     1.95159     0.00000
          [5]         3.32935     3.86422     2.43843     0.95895     0.00000
          [6]         3.32935     3.86422     2.43843     0.95895     1.51712     0.00000

  `equivalent`(iuniq, j)

    Returns the j’th atom equivalent to iuniq.

  `everything`()

    Quick print of class data

  `extract_fragments`(reals, ghosts=[])

    Makes a copy of the molecule, returning a new molecule with only certain fragment atoms present as either ghost or real atoms reals: The list or int of fragments (1-indexed) that should be present in the molecule as real atoms. ghosts: The list or int of fragments (1-indexed) that should be present in the molecule as ghosts. (method name in libmints is extract_subsets. This is different in qcdb because the psi4 input parser tries to process lines with that term, giving rise to Boost:Python type conlicts.) See usage at `extract_fragments()`.

  `extract_subsets`(reals, ghosts=[])

    Wrapper for `extract_fragments()`. See note there. This function can be used as long as not in psi4 input file. Use extract_fragments directly, then.

        >>> H2OH2O.extract_subsets(2)  # monomer B, unCP-corrected
        >>> H2OH2O.extract_subsets(2,1)  # monomer B, CP-corrected
        >>> obj.extract_subsets(1,[2,3])  # monomer A, CP-corrected if obj is tri-molecular complex

  `fZ`(atom)

    Nuclear charge of atom (includes dummies)

        >>> print H2OH2O.fZ(4)
        8

  `fcharge`(atom)

    Returns charge of atom (0-indexed, includes dummies). Related to SAD guess in libmints version.

        >>> print H2OH2O.fcharge(4)
        8.0

  `find_highest_point_group`(tol=1e-08)

    Find the highest D2h point group from Jet and Ed’s code: c1 ci c2 cs d2 c2v c2h d2h. Ignore the user-specified subgroup in this case.

  `find_point_group`(tol=1e-08)

    Find computational molecular point group, user can override this with the “symmetry” keyword. Result is highest D2h subgroup attendant on molecule and allowed by the user.

  `fix_orientation`(_fix=True)

    Fix the orientation at its current frame (method name in libmints is set_orientation_fixed)

  `flabel`(atom)

    Returns the original label of the atom (0-indexed) as given in the input file (C2, H4) (includes dummies)

        >>> print H2OH2O.flabel(4)
        O2

  `fmass`(atom)

    Returns mass of atom (0-indexed, includes dummies)

        >>> print H2OH2O.fmass(4)
        15.9949146196

  `form_symmetry_information`(tol=1e-08)

    Initialize molecular specific symmetry information. Uses the point group object obtain by calling point_group()

  `fsymbol`(atom)

    Returns the cleaned up label of the atom (C2 => C, H4 = H) (includes dummies) (0-indexed)

        >>> print H2OH2O.fsymbol(4)
        O

  `full_geometry`()

    Returns the full (dummies included) geometry in Bohr as a N X 3 array.

        >>> print H2OH2O.full_geometry()
        [[-2.930978460188563, -0.21641143673806384, 0.0], [-3.655219780069251, 1.4409218455037016, 0.0], [-1.1332252981904638, 0.0769345303220403, 0.0], [0.0, 0.0, 0.0], [2.5523113582286716, 0.21064588230662976, 0.0], [3.175492014248769, -0.7062681346308132, -1.4334725450878665], [3.175492014248769, -0.7062681346308132, 1.4334725450878665]]

  `full_pg_n`()

    Return n in Cnv, etc.; If there is no n (e.g. Td) it’s the highest-order rotation axis.

  `full_point_group_with_n`()

    Return point group name such as Cnv or Sn.

  `fx`(atom)

    x position of atom (0-indexed, includes dummies) in Bohr

        >>> print H2OH2O.fx(4)
        2.55231135823

  `fxyz`(atom)

    Returns a Vector3 with x, y, z position of atom (0-indexed) in Bohr (includes dummies)

        >>> print H2OH2O.fxyz(4)
        [2.5523113582286716, 0.21064588230662976, 0.0]

  `fy`(atom)

    y position of atom (0-indexed, includes dummies) in Bohr

        >>> print H2OH2O.fy(4)
        0.210645882307

  `fz`(atom)

    z position of atom (0-indexed, includes dummies) in Bohr

        >>> print H2OH2O.fz(4)
        0.0

  `geometry`()

    Returns the geometry in Bohr as a N X 3 array.

        >>> print H2OH2O.geometry()
        [[-2.930978460188563, -0.21641143673806384, 0.0], [-3.655219780069251, 1.4409218455037016, 0.0], [-1.1332252981904638, 0.0769345303220403, 0.0], [2.5523113582286716, 0.21064588230662976, 0.0], [3.175492014248769, -0.7062681346308132, -1.4334725450878665], [3.175492014248769, -0.7062681346308132, 1.4334725450878665]]

  `get_anchor_atom`(vstr, line)

    Attempts to interpret a string vstr as an atom specifier in a zmatrix. Takes the current line for error message printing. Returns the atom number (adjusted to zero-based counting).

  `get_coord_value`(vstr)

    Attempts to interpret a string as a double, if not it assumes it’s a variable.

  `get_full_point_group`()

    Return point group name such as C3v or S8. (method name in libmints is full_point_group)

  `get_variable`(vstr)

    Checks to see if the variable str is in the list, sets it to val and returns true if it is, and returns false if not.

  `has_inversion`(origin, tol=1e-08)

    Does the molecule have an inversion center at origin

  `has_symmetry_element`(op, tol=1e-08)

    NYI Whether molecule satisfies the vector symmetry operation op. Not used by libmints.

  `has_zmatrix`()

    Gets the presence of any zmatrix entry

        >>> print H2OH2O.has_zmatrix()
        False

  `inertia_tensor`()

    Compute inertia tensor.

        >>> print H2OH2O.inertia_tensor()
        [[8.704574864178731, -8.828375721817082, 0.0], [-8.828375721817082, 280.82861714077666, 0.0], [0.0, 0.0, 281.249500988553]]

  `init_with_checkpoint`(chkpt)

    NYI Pull information from the chkpt object passed (method name in libmints is init_with_chkpt)

  `init_with_io`(psio)

    NYI Pull information from a chkpt object created from psio (method name in libmints is init_with_psio)

  classmethod `init_with_xyz`(xyzfilename)

    Pull information from an XYZ file. No fragment or chg/mult info detected.

        >>> H2O = qcdb.Molecule.init_with_xyz('h2o.xyz')

  `irrep_labels`()

    Returns the irrep labels

  `is_axis`(origin, axis, order, tol=1e-08)

    Is axis an axis of order order with respect to origin?

  `is_linear_planar`(tol=1e-08)

    Is the molecule linear, or planar?

        >>> print H2OH2O.is_linear_planar()
        (False, False)

  `is_plane`(origin, uperp, tol=1e-08)

    Is a plane?

  `is_variable`(vstr)

    Checks to see if the variable str is in the list, returns true if it is, and returns false if not.

        >>> H2OH2O.is_variable('R')
        False

  `label`(atom)

    Returns the original label of the atom (0-indexed) as given in the input file (C2, H4). (0-indexed)

        >>> print H2OH2O.label(4)
        H3

  static `like_world_axis`(axis, worldxaxis, worldyaxis, worldzaxis)

    Returns which worldaxis axis most overlaps with. Inverts axis when indicated.

  `mass`(atom)

    Returns mass of atom (0-indexed)

        >>> print H2OH2O.mass(4)
        1.00782503207

  `max_nequivalent`()

    Returns the maximum number of equivalent atoms.

  `molecular_charge`()

    Gets the molecular charge

        >>> print H2OH2O.molecular_charge()
        -2

  `move_to_com`()

    Moves molecule to center of mass

  `multiplicity`()

    Get the multiplicity (defined as 2Ms + 1)

        >>> print H2OH2O.multiplicity()

  `multiplicity_specified`()

    Whether the multiplicity was given by the user

        >>> print H2OH2O.multiplicity_specified()
        True

  `nactive_fragments`()

    The number of active fragments in the molecule.

        >>> print H2OH2O.nactive_fragments()
        2

  `nallatom`()

    Number of all atoms (includes dummies)

        >>> print H2OH2O.nallatom()
        7

  `name`()

    Get molecule name

        >>> print H2OH2O.name()
        water_dimer

  `natom`()

    Number of atoms

        >>> print H2OH2O.natom()
        6

  `nequivalent`(iuniq)

    Returns the number of atoms equivalent to iuniq.

  `nfragments`()

    The number of fragments in the molecule.

        >>> print H2OH2O.nfragments()
        2

  `nfrozen_core`(depth=False)

    Number of frozen core for molecule given freezing state.

        >>> print H2OH2O.nfrozen_core()
        2

  `nuclear_repulsion_energy`()

    Computes nuclear repulsion energy.

        >>> print H2OH2O.nuclear_repulsion_energy()
        36.6628478528

  `nuclear_repulsion_energy_deriv1`()

    Computes nuclear repulsion energy derivatives

        >>> print H2OH2O.nuclear_repulsion_energy_deriv1()
        [[3.9020946901323774, 2.76201566471991, 0.0], [1.3172905807089021, -2.3486366050337293, 0.0], [-1.8107598525022435, -0.32511212499256564, 0.0], [-1.217656141385739, -2.6120090867576717, 0.0], [-1.0954846384766488, 1.2618710760320282, 2.1130743287465603], [-1.0954846384766488, 1.2618710760320282, -2.1130743287465603]]

  `nuclear_repulsion_energy_deriv2`()

    NYI Computes nuclear repulsion energy second derivatives

  `nunique`()

    Return the number of unique atoms.

  `orientation_fixed`()

    Get whether or not orientation is fixed.

        >>> H2OH2O.orientation_fixed()
        True

  `point_group`()

    Returns the point group (object) if set

  `print_bond_angles`()

    Print the geometrical parameters (bond_angles) of the molecule.

        >>> print H2OH2O.print_bond_angles()
        Bond Angles (degrees)
        Angle 2-1-3:  104.337
        Angle 2-1-4:  109.152
        Angle 2-1-5:  117.387
        ...

  `print_dihedrals`()

    Print the geometrical parameters (dihedrals) of the molecule.

        >>> print H2OH2O.print_dihedrals()
        Dihedral Angles (Degrees)
        Dihedral 1-2-3-4:  180.000
        Dihedral 1-2-3-5:  133.511
        Dihedral 1-2-3-6:  133.511
        ...

  `print_distances`()

    Print the geometrical parameters (distances) of the molecule. suspect libmints version actually prints Bohr.

        >>> print H2OH2O.print_distances()
        Interatomic Distances (Angstroms)
        Distance 1 to 2 0.957
        Distance 1 to 3 0.964
        Distance 1 to 4 2.910
        ...

  `print_full`()

    Print full atom list. Same as `print_out()` only displays dummy atoms.

  `print_in_input_format`()

    Print the molecule in the same format that the user provided.

  `print_out`()

    Print the molecule. (method name in libmints is print)

        >>> H2OH2O.print_out()
        Geometry (in Angstrom), charge = -2, multiplicity = 3:
           Center              X                  Y                   Z
        ------------   -----------------  -----------------  -----------------
               O         -1.551007000000    -0.114520000000     0.000000000000
               H         -1.934259000000     0.762503000000     0.000000000000
               H         -0.599677000000     0.040712000000     0.000000000000
               O          1.350625000000     0.111469000000     0.000000000000
               H          1.680398000000    -0.373741000000    -0.758561000000
               H          1.680398000000    -0.373741000000     0.758561000000

  `print_out_in_angstrom`()

    Print the molecule in Angstroms. Same as `print_out()` only always in Angstroms. (method name in libmints is print_in_angstrom)

  `print_out_in_bohr`()

    Print the molecule in Bohr. Same as `print_out()` only in Bohr. (method name in libmints is print_in_bohr)

  `print_out_of_planes`()

    Print the geometrical parameters (out_of_planes) of the molecule.

        >>> print H2OH2O.print_out_of_planes()
        Out-Of-Plane Angles (Degrees)
        Out-of-plane 1-2-3-4:    0.000
        Out-of-plane 1-2-3-5:   -7.373
        Out-of-plane 1-2-3-6:    7.373
        ...

  `reinterpret_coordentries`()

    Reinterpret the fragments for reals/ghosts and build the atom list.

  `reinterpret_coordentry`(rc)

    Do we reinterpret coordentries during a call to update_geometry? (method name in libmints is set_reinterpret_coordentry)

  `release_symmetry_information`()

    Release symmetry information

  `reset_point_group`(pgname)

    Override symmetry from outside the molecule string

  `rotate`(R)

    Rotates the molecule using rotation matrix R.

        >>> H2OH2O.rotate([[0,-1,0],[-1,0,0],[0,0,1]])

  `rotate_full`(R)

    Rotates the full molecule using rotation matrix R.

        >>> H2OH2O.rotate_full([[0,-1,0],[-1,0,0],[0,0,1]])

  `rotational_constants`(tol=1e-08)

    Compute the rotational constants and return them in wavenumbers

  `rotor_type`(tol=1e-08)

    Returns the rotor type.

        >>> H2OH2O.rotor_type()
        RT_ASYMMETRIC_TOP

  `save_string_xyz`(save_ghosts=True)

    Save a string for a XYZ-style file.

        >>> H2OH2O.save_string_xyz()
        6
        _
         O   -1.551007000000   -0.114520000000    0.000000000000
         H   -1.934259000000    0.762503000000    0.000000000000
         H   -0.599677000000    0.040712000000    0.000000000000
         O    1.350625000000    0.111469000000    0.000000000000
         H    1.680398000000   -0.373741000000   -0.758561000000
         H    1.680398000000   -0.373741000000    0.758561000000

  `save_to_checkpoint`(chkpt, prefix='')

    NYI Save information to checkpoint file (method name in libmints is save_to_chkpt)

  `save_xyz`(filename, save_ghosts=True)

    Save an XYZ file.

        >>> H2OH2O.save_xyz('h2o.xyz')

  `schoenflies_symbol`()

    Returns the Schoenflies symbol

  `set_active_fragment`(fr)

    Tags fragment index fr as composed of real atoms.

  `set_active_fragments`(reals)

    Tags the fragments in array reals as composed of real atoms.

  `set_basis_all_atoms`(name, role='BASIS')

    Assigns basis name to all atoms.

  `set_basis_by_label`(label, name, role='BASIS')

    Assigns basis name to all atoms with label.

  `set_basis_by_number`(number, name, role='BASIS')

    Assigns basis name to atom number number (0-indexed, excludes dummies).

  `set_basis_by_symbol`(symbol, name, role='BASIS')

    Assigns basis name to all symbol atoms.

  `set_com_fixed`(_fix=True)

    NYI Fix the center of mass at its current frame. Not used in libmints so not implemented.

  `set_full_geometry`(geom)

    Sets the full geometry (dummies included), given a N X 3 array of coordinates geom in Bohr.

        >>> H2OH2O.set_full geometry([[1,2,3],[4,5,6],[7,8,9],[0,0,0],[-1,-2,-3],[-4,-5,-6],[-7,-8,-9]])

  `set_full_point_group`(tol=1e-08)

    Determine and set FULL point group. full_pg_n_ is highest order n in Cn. 0 for atoms or infinity.

  `set_geometry`(geom)

    Sets the geometry, given a N X 3 array of coordinates geom in Bohr.

        >>> H2OH2O.set_geometry([[1,2,3],[4,5,6],[7,8,9],[-1,-2,-3],[-4,-5,-6],[-7,-8,-9]])

  `set_ghost_fragment`(fr)

    Tags fragment index fr as composed of ghost atoms.

  `set_ghost_fragments`(ghosts)

    Tags the fragments in array ghosts as composed of ghost atoms.

  `set_has_zmatrix`(tf)

    Sets the presence of any zmatrix entry

        >>> H2OH2O.set_has_zmatrix(True)

  `set_molecular_charge`(charge)

    Sets the molecular charge

        >>> H2OH2O.set_molecular_charge(-2)

  `set_multiplicity`(mult)

    Sets the multiplicity (defined as 2Ms + 1)

        >>> H2OH2O.set_multiplicity(3)

  `set_name`(name)

    Set molecule name

        >>> H2OH2O.set_name('water_dimer')

  `set_point_group`(pg)

    Set the point group to object pg

  `set_shell_by_number`(number, bshash, role='BASIS')

    Assigns BasisSet bshash to atom number number (0-indexed, excludes dummies).

  `set_units`(units)

    Sets the geometry units

        >>> H2OH2O.set_units('Angstom')

  `set_variable`(vstr, val)

    Assigns the value val to the variable labelled string in the list of geometry variables. Also calls update_geometry()

  `sym_label`()

    Returns the symmetry label

  `symbol`(atom)

    Returns the cleaned up label of the atom (C2 => C, H4 = H) (0-indexed)

        >>> print H2OH2O.symbol(4)
        H

  `symmetrize`()

    Force the molecule to have the symmetry specified in pg. This is to handle noise coming in from optking.

  `symmetry_frame`(tol=1e-08)

    Determine symmetry reference frame. If noreorient is not set, this is the rotation matrix applied to the geometry in update_geometry.

        >>> print H2OH2O.symmetry_frame()
        [[1.0, -0.0, 0.0], [0.0, 1.0, 0.0], [0.0, -0.0, 1.0]]

  `symmetry_from_input`()

    Returns the symmetry specified in the input.

        >>> print H2OH2O.symmetry_from_input()
        C1

  `translate`(r)

    Translates molecule by r.

        >>> H2OH2O.translate([1.0, 1.0, 0.0])

  `unique`(iuniq)

    Returns the overall number of the iuniq’th unique atom.

  `units`()

    Gets the geometry units

        >>> print H2OH2O.units()
        Angstrom

  `update_geometry`()

    Updates the geometry, by (re)interpreting the string used to create the molecule, and the current values of the variables. The atoms list is cleared, and then rebuilt by this routine. This function must be called after first instantiation of Molecule.

        >>> H2 = qcdb.Molecule("H\nH 1 0.74\n")
        >>> print H2.natom()
        0
        >>> H2.update_geometry()
        >>> print H2.natom()
        2

  `valid_atom_map`(tol=0.01)

    Check if current geometry fits current point group

  `x`(atom)

    x position of atom (0-indexed) in Bohr

        >>> print H2OH2O.x(4)
        3.17549201425

  `xyz`(atom, posn=None)

    Returns a Vector3 with x, y, z position of atom (0-indexed) in Bohr or coordinate at posn

        >>> print H2OH2O.xyz(4)
        [3.175492014248769, -0.7062681346308132, -1.4334725450878665]

  `y`(atom)

    y position of atom (0-indexed) in Bohr

        >>> print H2OH2O.y(4)
        -0.706268134631

  `z`(atom)

    z position of atom (0-indexed) in Bohr

        >>> print H2OH2O.z(4)
        -1.43347254509

`atom_present_in_geom`(geom, b, tol=1e-08)

  Function used by set_full_point_group() to scan a given geometry and determine if an atom is present at a given location.

`compute_atom_map`(mol)

  Computes atom mappings during symmetry operations. Useful in generating SO information and Cartesian displacement SALCs. param mol Molecule to form mapping matrix from. returns Integer matrix of dimension natoms X nirreps.

`equal_but_for_row_order`(mat, rhs, tol=1e-08)

  Checks matrix equality, but allows rows to be in a different order. @param rhs Matrix to compare to. @returns true if equal, otherwise false.

`matrix_3d_rotation`(mat, axis, phi, Sn)

  For a matrix of 3D vectors (ncol==3), rotate a set of points around an arbitrary axis. Vectors are the rows of the matrix. @param axis Vector3 : axis around which to rotate (need not be normalized) @param phi double : magnitude of rotation in rad @param Sn bool : if true, then also reflect in plane through origin and

  > perpendicular to rotation

  @returns SharedMatrix with rotated points (rows)

`matrix_3d_rotation_Cn`(coord, axis, reflect, tol=1e-08, max_Cn_to_check=-1)

  Find maximum n in Cn around given axis, i.e., the highest-order rotation axis. @param coord Matrix : points to rotate - column dim is 3 @param axis Vector3 : axis around which to rotate, does not need to be normalized @param bool reflect : if true, really look for Sn not Cn @returns n

class `BasisSet`(name, fullname=None, latex=None, citation=None, pdfdatabase=None, comment=None, zeta=None, build=None)

  Specialization of :pyclass:`QCEssential` for basis sets.

class `Error`(name, fullname=None, latex=None, citation=None, pdfdatabase=None, comment=None)

  Specialization of :pyclass:`QCEssential` for measures of error.

class `Method`(name, fullname=None, latex=None, citation=None, pdfdatabase=None, comment=None)

  Specialization of :pyclass:`QCEssential` for quantum chemical methods.

class `QCEssential`(name, fullname=None, latex=None, citation=None, pdfdatabase=None, comment=None)

  Class to link literature and external representation of some aspect of quantum chemistry (basis set, method, etc.) with a shorthand and indexed representation of same.

`conv_float2negexp`(val)

  Returns the least restrictive negative exponent of the power 10 that would achieve the floating point convergence criterium val.

`format_option_for_cfour`(opt, val)

  Function to reformat value val for option opt from python into cfour-speak. Arrays are the primary target.

`prepare_options_for_cfour`(options)

  Function to take the full snapshot of the liboptions object encoded in dictionary options, find the options directable toward Cfour (options[‘CFOUR’][‘CFOUR_**’]) that aren’t default, then write a CFOUR deck with those options.

`prepare_options_for_psi4`(options)

  Function to take the full snapshot of the liboptions object encoded in dictionary options, find the options directable toward Cfour (options[‘CFOUR’][‘CFOUR_**’]) that aren’t default, then write a CFOUR deck with those options. Note that unlike the cfour version, this uses complete options deck.

`reconcile_options`(full, partial)

  Function to take the full snapshot of the liboptions object encoded in dictionary full and reconcile it with proposed options value changes in partial. Overwrites full with partial if option untouched, touches full if full and partial are in agreement, balks if full and partial conflict. Returns full.

`reconcile_options2`(full, partial)

  Function to take the full snapshot of the liboptions object encoded in dictionary full and reconcile it with proposed options value changes in partial. Overwrites full with partial if option untouched, touches full if full and partial are in agreement, balks if full and partial conflict. Returns full. Note: this is surprisingly similar to reconcile_options except that full is essentially empty and lacking in has_changed keys so presence is enough to satisfy has_changed. consider merging once mature.

class `Infile`(mem, mol, mtd, der, opt)
  `format_infile_string`()

`harvest_output`(outtext)

  Function to separate portions of a PSI4 output file outtext.

`muster_cdsgroup_options`()

`muster_modelchem`(name, dertype)

  Transform calculation method name and derivative level dertype into options for cfour. While deliberately requested pieces, generally CFOUR_DERIV_LEVEL and CFOUR_CALC_LEVEL, are set to complain if contradicted (‘clobber’ set to True), other ‘recommended’ settings, like CFOUR_CC_PROGRAM, can be countermanded by keywords in input file (‘clobber’ set to False). Occasionally, want these pieces to actually overcome keywords in input file (‘superclobber’ set to True).

`psi4_list`()

  Return an array of Psi4 methods with energies.

class `DB4`(pythonpath=None, loadfrompickle=False, path=None)
  `define_supermodelchems`()
  `define_supersubsets`()
  `make_pt2_Figure_2`()

    Plot all the graphics needed for the diffuse augmented grey bars plot in Fig. 2 of PT2.

  `make_pt2_Figure_3`()

    Plot all the graphics needed for the calendar grey bars plot in Fig. 3 of PT2.

  `make_pt2_flats`()

    Generate pieces for inclusion into tables for PT2 paper.

class `Database`(dbnamelist, dbse=None, pythonpath=None, loadfrompickle=False, path=None)

  Collection for handling single or multiple qcdb.WrappedDatabase objects. Particularly, unifying modelchem and subset names that when inconsistent across component databases. Also, defining statistics across databases.

      >>> asdf = qcdb.Database(['s22', 'Nbc10', 'hbc6', 'HSG'], 'DB4')
      >>> qwer = qcdb.Database(['s22'])

  `analyze_modelchems`(modelchem, benchmark='default', failoninc=True, verbose=False)

    For each component database, compute and print nicely formatted summary error statistics for each model chemistry in array modelchem versus benchmark for all available subsets.

  `compute_statistics`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False, returnindiv=False)

    Computes summary statistics and, if returnindiv True, individual errors for single model chemistry modelchem versus benchmark over subset sset over all component databases. Particularly, imposes cross-database definitions for sset and modelchem. #Returns error if model chemistries are missing #for any reaction in subset unless failoninc set to False, #whereupon returns partial statistics. Returns dictionary of #statistics labels and values.

  `dbdict` = None

    ordered component Database objects

        >>> print asdf.dbdict
        XXXX

  `dbse` = None

    internal name of database collection

        >>> print asdf.dbse
        'DB4'

  `fancy_mcs`()
  `load_qcdata_byproject`(project, pythonpath=None)

    For each component database, loads qcdb.ReactionDatums from standard location for project :module dbse_project and function load_project. Module search path can be prepended with pythonpath.

  `load_qcdata_hdf5_trusted`(project, path=None)

    For each component database, loads qcdb.ReactionDatums from HDF5 file at path/dbse_project.h5 . If path not given, looks in qcdb/data. This file is written by reap-DB and so has been largely validated.

  `load_subsets`(modname='subsetgenerator', pythonpath=None)

    For each component database, loads subsets from all functions in module modname. Default modname usues standard generators.

  `mcs` = None

    assembly pattern for transspecies modelchems

        >>> print asdf.mcs.keys()
        XXXX

  `plot_all_flats`(modelchem=None, sset='default', xlimit=4.0, saveas=None, relpath=False, graphicsformat=['pdf'])

    Generate pieces for inclusion into tables. Supply list of modelchemistries to plot from modelchem, otherwise defaults to all those available. Can modify subset sset and plotting range xlimit.

    >>>> asdf.plot_all_flats(sset=’tt-5min’, xlimit=4.0)

  `plot_bars`(modelchem, benchmark='default', sset=['default', 'hb', 'mx', 'dd'], failoninc=True, verbose=False, saveas=None, relpath=False, graphicsformat=['pdf'])

    Prepares ‘grey bars’ diagram for each model chemistry in array modelchem versus benchmark over all component databases. A wide bar is plotted with three smaller bars, corresponding to the ‘mae’ summary statistic of the four subsets in sset.

    saveas conveys directory (‘/’) and/or filename for saving the resulting plot. File extension is not accessible, but graphicsformat array requests among ‘png’, ‘pdf’, and ‘eps’ formats. relpath forces paths to saved files to be relative to current directory, rather than absolute paths for returned code and file dictionary.

    Prepares bars diagram instructions and either executes them if matplotlib available (Canopy or Anaconda) or prints them. Returns a dictionary of all saved plot filenames.

    >>>> asdf.plot_bars([‘MP2-CP-adz’, ‘MP2-CP-adtz’], sset=[‘tt-5min’, ‘hb-5min’, ‘mx-5min’, ‘dd-5min’])

  `plot_disthist`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False, xtitle='', saveas=None, relpath=False, graphicsformat=['pdf'])

    Computes individual errors and summary statistics for single model chemistry modelchem versus benchmark over subset sset over all component databases. Computes histogram of errors and gaussian distribution.

    saveas conveys directory (‘/’) and/or filename for saving the resulting plot. File extension is not accessible, but graphicsformat array requests among ‘png’, ‘pdf’, and ‘eps’ formats. relpath forces paths to saved files to be relative to current directory, rather than absolute paths for returned code and file dictionary.

    Prepares disthist diagram instructions and either executes them if matplotlib available (Canopy or Anaconda) or prints them. Returns a dictionary of all saved plot filenames.

  `plot_flat`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False, color='sapt', xlimit=4.0, view=True, saveas=None, relpath=False, graphicsformat=['pdf'])

    Computes individual errors and summary statistics for single model chemistry modelchem versus benchmark over subset sset over all component databases. Thread color can be ‘rgb’ for old coloring, a color name or ‘sapt’ for spectrum coloring.

    saveas conveys directory (‘/’) and/or filename for saving the resulting plot. File extension is not accessible, but graphicsformat array requests among ‘png’, ‘pdf’, and ‘eps’ formats. relpath forces paths to saved files to be relative to current directory, rather than absolute paths for returned code and file dictionary.

    Prepares flat diagram instructions and either executes them if matplotlib available (Canopy or Anaconda) or prints them. Returns a dictionary of all saved plot filenames.

    asdf.plot_flat(‘CCSD-CP-atqzadz’, failoninc=False)

  `plot_modelchems`(modelchem, benchmark='default', mbenchmark=None, sset='default', msset=None, failoninc=True, verbose=False, color='sapt', xlimit=4.0, saveas=None, mousetext=None, mouselink=None, mouseimag=None, mousetitle=None, relpath=False, graphicsformat=['pdf'])

    Computes individual errors and summary statistics over all component databases for each model chemistry in array modelchem versus benchmark over subset sset. mbenchmark and msset are array options (same length as modelchem) that override benchmark and sset, respectively, for non-uniform specification. Thread color can be ‘rgb’ for old coloring, a color name or ‘sapt’ for spectrum coloring.

    saveas conveys directory (‘/’) and/or filename for saving the resulting plot. File extension is not accessible, but graphicsformat array requests among ‘png’, ‘pdf’, and ‘eps’ formats. relpath forces paths to saved files to be relative to current directory, rather than absolute paths for returned code and file dictionary.

    Prepares thread diagram instructions and either executes them if matplotlib available (Canopy or Anaconda) or prints them. Returns a dictionary of all saved plot filenames. If any of mousetext, mouselink, or mouseimag is specified, htmlcode will be returned with an image map of slats to any of text, link, or image, respectively.

  `sset` = None

    subset assembly pattern

        >>> print asdf.sset.keys()
        XXXX

  `table_generic`(mtd, bas, columnplan, rowplan=['bas', 'mtd'], opt=['CP'], err=['mae'], sset=['tt'], benchmark='default', failoninc=True, landscape=False, standalone=True, subjoin=True, plotpath='', theme='', filename=None)

    Prepares dictionary of errors for all combinations of mtd, opt, bas with respect to model chemistry benchmark, mindful of failoninc. Once error dictionary is ready, it and all other arguments are passed along to textables.table_generic.

  `table_merge_abbr`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='smmerge')

    Specialization of table_generic into table with minimal statistics (three S22 and three overall) plus embedded slat diagram as suitable for main paper. A single table is formed in sections by bas with lines mtd within each section.

  `table_merge_suppmat`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='lgmerge')

    Specialization of table_generic into table with as many statistics as will fit (mostly fullcurve and a few 5min) plus embedded slat diagram as suitable for supplementary material. Multiple tables are formed, one for each in bas with lines mtd within each table.

class `Reaction`(name, dbse, indx, tagl=None, latex=None, color='black', comment=None)

class `ReactionDatum`(dbse, rxn, method, mode, basis, value, units='kcal/mol', comment=None)

  Piece of quantum chemical information that describes a qcdb.Reaction object.

  classmethod `library_modelchem`(dbse, rxn, method, mode, basis, value, units='kcal/mol', comment=None)

    Constructor when method and basis are strings corresponding to qcdb.Method and qcdb.BasisSet already defined in methods and bases.

class `Reagent`(name, mol, tagl=None, comment=None)

  Chemical entity only slightly dresed up from qcdb.Molecule.

class `ThreeDatabases`(pythonpath=None)
  `define_supermodelchems`()
  `define_supersubsets`()

class `WrappedDatabase`(dbname, pythonpath=None)

  Wrapper class for raw Psi4 database modules that does some validation of contents, creates member data and accessors for database structures, defines error computation, and handles database subsets. Not to be used directly– see qcdb.Database for handling single or multiple qdcb.WrappedDatabase objects and defining nice statistics, plotting, and table functionalities.

      >>> asdf = qcdb.WrappedDatabase('Nbc10')

  `add_ReactionDatum`(dbse, rxn, method, mode, basis, value, units='kcal/mol', comment=None, overwrite=False)

    Add a new quantum chemical value to rxn by creating a qcdb.ReactionDatum from same arguments as that class’s object-less constructor. rxn may be actual Reaction.name or Reaction.indx.

  `add_Subset`(name, func)

    Define a new subset labeled name by providing a function func that filters self.hrxn.

  `available_modelchems`(union=True)

    Returns all the labels of model chemistries that have been loaded. Either all modelchems that have data for any reaction if union is True or all modelchems that have data for all reactions if union is False.

  `benchmark`()

    Returns the model chemistry label for the database’s benchmark.

  `compute_errors`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False)

    For full database or subset sset, computes raw reaction errors between modelchem and benchmark model chemistries. Returns error if model chemistries are missing for any reaction in subset unless failoninc set to False, whereupon returns partial. Returns dictionary of reaction labels and error forms.

  `compute_statistics`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False, returnindiv=False)

    For full database or subset sset, computes many error statistics between single modelchem and benchmark model chemistries. Returns error if model chemistries are missing for any reaction in subset unless failoninc set to False, whereupon returns partial statistics. Returns dictionary of statistics labels and values.

  `dbse` = None

    internal name of database

        >>> print asdf.dbse
        'NBC1'

  `hrgt` = None

    dict of reagents/geometries

        >>> print asdf.hrgt.keys()
        ['NBC1-BzBz_PD32-0.8-monoA-CP', 'NBC1-BzBz_PD34-0.6-dimer', ... 'NBC1-BzBz_PD34-1.7-dimer']

  `hrxn` = None

    OrderedDict of reactions/members

        >>> print asdf.hrxn.keys()
        ['BzBz_S-3.2', 'BzBz_S-3.3', ...  'BzBz_PD36-2.8', 'BzBz_PD36-3.0']

  static `load_pickled`(dbname, path=None)
  `load_qcdata`(modname, funcname, pythonpath=None, failoninc=True)

    Loads qcdb.ReactionDatums from module modname function funcname. Module search path can be prepended with pythonpath.

  `load_qcdata_byproject`(project, pythonpath=None)

    Loads qcdb.ReactionDatums from standard location for project :module dbse_project and function load_project. Module search path can be prepended with pythonpath.

  `load_qcdata_hdf5_trusted`(project, path=None)

    Loads qcdb.ReactionDatums from HDF5 file at path/dbse_project.h5 . If path not given, looks in qcdb/data. This file is written by reap-DB and so has been largely validated.

  `load_subsets`(modname='subsetgenerator', pythonpath=None)

    Loads subsets from all functions in module modname.

  `plot_iowa`(modelchem, benchmark='default', sset='default', failoninc=True, verbose=False, xlimit=2.0)

    Computes individual errors for single modelchem versus benchmark over subset sset. Coloring green-to-purple with maximum intensity at xlimit. Prepares Iowa plot instructions and either executes them if matplotlib available (Canopy) or prints them.

  `sset` = None

    dict of defined reaction subsets. Note that self.sset[‘default’] contains all the nonredundant information.

        >>> print asdf.sset.keys()
        ['meme', 'mxddpp', '5min', ... 'small']

  `table_generic`(mtd, bas, columnplan, rowplan=['bas', 'mtd'], opt=['CP'], err=['mae'], sset=['default'], benchmark='default', failoninc=True, landscape=False, standalone=True, subjoin=True, plotpath='', theme='', filename=None)

    Prepares dictionary of errors for all combinations of mtd, opt, bas with respect to model chemistry benchmark, mindful of failoninc. Once error dictionary is ready, it and all other arguments are passed along to textables.table_generic.

  `table_simple1`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='smmerge')

    Specialization of table_generic into table with minimal statistics (three S22 and three overall) plus embedded slat diagram as suitable for main paper. A single table is formed in sections by bas with lines mtd within each section.

  `table_simple2`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='smmerge')

    Specialization of table_generic into table with minimal statistics (three S22 and three overall) plus embedded slat diagram as suitable for main paper. A single table is formed in sections by bas with lines mtd within each section.

  `table_simple3`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='smmerge')

    Specialization of table_generic into table with minimal statistics (three S22 and three overall) plus embedded slat diagram as suitable for main paper. A single table is formed in sections by bas with lines mtd within each section.

  `table_simple4`(mtd, bas, opt=['CP'], err=['mae'], benchmark='default', failoninc=True, plotpath='analysis/flats/mplflat_', theme='smmerge')

    Specialization of table_generic into table with minimal statistics (three S22 and three overall) plus embedded slat diagram as suitable for main paper. A single table is formed in sections by bas with lines mtd within each section.

`average_errors`(*args)

  Each item in args should be an error dictionary. Performs average-like operation over all items, which should be error dictionaries, in args. Defined for ME, MAE, STDE, and their relative-error variants. None returned for undefined statistics or when an item is missing.

`format_errors`(err, mode=1)

  From error dictionary err, returns a LaTeX-formatted string, after handling None entries.

`initialize_errors`(e=None, pe=None, pbe=None, extrema=True)

`string_contrast`(ss)

  From an array of strings, ss, returns maximum common prefix string, maximum common suffix string, and array of middles.

Module with commands building `BasisFamily` objects for Pople and other non-Dunning orbital basis sets. Some plausible fitting basis sets are supplied as defaults.

`load_basfam_other`()

Module to define a class `BasisFamily` that associates fitting basis sets to an orbital basis and to provide functions to query appropriate fitting bases for any orbital basis distributed with Psi4.

class `BasisFamily`(ornate, orbital=None)

  Class to associate with an orbital basis name ornate the gbs file names in which the orbital basis orbital (usually the coded form of ornate) and jfit, jkfit, rifit, and dualfit auxiliary bases can be found.

  `add_dualfit`(fit)

    Function to add basis fit as associated helper basis member dualfit to a BasisFamily object.

  `add_jfit`(fit)

    Function to add basis fit as associated fitting basis member jfit to a BasisFamily object.

  `add_jfit_default`(fit)

    Function to add basis fit as associated fitting basis member jdef to a BasisFamily object.

  `add_jkfit`(fit)

    Function to add basis fit as associated fitting basis member jkfit to a BasisFamily object.

  `add_jkfit_default`(fit)

    Function to add basis fit as associated fitting basis member jkdef to a BasisFamily object.

  `add_rifit`(fit)

    Function to add basis fit as associated fitting basis member rifit to a BasisFamily object.

  `add_rifit_default`(fit)

    Function to add basis fit as associated fitting basis member ridef to a BasisFamily object.

  `name`()

    Function to return the ornate name of the orbital basis, e.g., 6-311++G** for 6-311ppgss.

`corresponding_basis`(name, role='BASIS')

  Function to validate if the orbital basis name in coded or ornate form is in Psi4’s standard installed bases list. `None` is returned if the orbital basis is not found.

`load_basis_families`()

  Function to load into the array `basisfamily_list` BasisFamily objects for all Psi4’s standard installed bases.

`print_basis_families`()

  Function to print to the output file a formatted summary of all the BasisFamily objects in `basisfamily_list`, by default all Psi4’s standard installed bases.

`sanitize_basisname`(name)

  Function to return name in coded form, stripped of characters that confuse filenames, characters into lowercase, `+` into `p`, `*` into `s`, and `(`, `)`, & `,` into `_`.

Module to hold and distribute the -D dispersion correction parameters.

`dash_server`(func, dashlvl, mode='psi4')

  Function to serve up dispersion correction parameters in whatever form needed. When mode is ‘dftd3’, returns a string suitable for writing to ./dftd3_parameters to calculuate the correction at dashlvl with the default parameters for functional func. When mode is ‘psi4’, returns a tuple of arguments suitable for building a Dispersion object with dashlvl parameters for functional func.

  There are four computational dashlvl choices. ‘d2p4’ calls the -D2 correction within psi4 (hence, faked for mode=’dftd3’). The other three, ‘d2gr’, ‘d3zero’, and ‘d3bj’ call the three dftd3 modes of operation (corresponding to -old, -zero, -bj). Additionally, there are three aliased dashlvl choices since the aliases in dash_alias above are imposed.

Module (auto-generated from make_dunning.pl script) with commands building `BasisFamily` objects that encode the Dunning basis set orbital definitions in psi4/lib/basis/NOTES and fitting bases designed for those orbital bases.

`load_basfam_dunning`()

`backtransform`(chgeMol, permMol, chgeGrad=None, chgeDip=None)

  Here, chgeMol and chgeGrd need to be turned into the native Cfour orientation embodied by permMol. Currently for vpt2.

`cfour_gradient_list`()

  Return an array of Cfour methods with analytical gradients. Appended to procedures[‘gradient’].

`cfour_list`()

  Return an array of Cfour methods with energies. Appended to procedures[‘energy’].

`cfour_psivar_list`()

  Return a dict with keys of most Cfour methods and values of dicts with the PSI Variables returned by those methods. Used by cbs() wrapper to avoid unnecessary computations in compound methods. Result is appended to `VARH`.

`format_fjobarc`(energy, map, elem, coordinates, gradient, dipole)

  Takes the key results from a gradient computation (energy, element Z list elem, coordinates, gradient, dipole, and atom ordering map) and writes a string fja that exactly mimics the contents of a Cfour FJOBARC file.

`harvest`(p4Mol, c4out, **largs)

  Parses all the pieces of output from Cfour: the stdout in c4out and the contents of various scratch files like GRD stored in their namesake keys in largs. Since all Cfour output uses its own orientation and atom ordering for the given molecule, a qcdb.Molecule p4Mol, if supplied, is used to transform the Cfour output back into consistency with p4Mol.

`harvest_DIPOL`(dipol)

  Parses the contents dipol of the Cfour DIPOL file into a dipol vector.

`harvest_FCM`(fcm)

  Parses the contents fcm of the Cfour FCMFINAL file into a hessian array.

`harvest_GRD`(grd)

  Parses the contents grd of the Cfour GRD file into the gradient array and coordinate information. The coordinate info is converted into a rather dinky Molecule (no charge, multiplicity, or fragment), but this is these coordinates that govern the reading of molecule orientation by Cfour. Return qcdb.Molecule and gradient array.

`harvest_outfile_pass`(outtext)

  Function to read CFOUR output file outtext and parse important quantum chemical information from it in

`harvest_output`(outtext)

  Function to separate portions of a CFOUR output file outtest, divided by xjoda.

`harvest_zmat`(zmat)

  Parses the contents of the Cfour ZMAT file into array and coordinate information. The coordinate info is converted into a rather dinky Molecule (no fragment, but does read charge, mult, unit). Return qcdb.Molecule. Written for findif zmat* where geometry always Cartesian and Bohr.

`jajo2mol`(jajodic)

  Returns a Molecule from entries in dictionary jajodic extracted from JAINDX and JOBARC.

`muster_memory`(mem)

  Transform input mem in MB into psi4-type options for cfour.

`muster_modelchem`(name, dertype)

  Transform calculation method name and derivative level dertype into options for cfour. While deliberately requested pieces, generally CFOUR_DERIV_LEVEL and CFOUR_CALC_LEVEL, are set to complain if contradicted (‘clobber’ set to True), other ‘recommended’ settings, like CFOUR_CC_PROGRAM, can be countermanded by keywords in input file (‘clobber’ set to False). Occasionally, want these pieces to actually overcome keywords in input file (‘superclobber’ set to True).

`muster_psi4options`(opt)

  Translate psi4 keywords opt that have been explicitly set into their Cfour counterparts. Since explicitly set Cfour module keyword values will always be used preferentially to these inferred from psi4, the ‘clobber’ property is set to False.

Elemental masses (most common isotope), symbols, and atomic numbers from psi4.

class `OrientMols`(molPermanent, molChangeable)

  Class to encode a transformation between two molecular coordinate systems. After initializing with two qcdb.Molecule objects at the same geometry in possible different frames and orderings, class can apply the appropriate transformations to coordinate, gradient, Hessian, etc. arrays.

  `create_orientation_from_molecules`(Pmol, Cmol)

    Finds the shift, rotation, axis exchange, axis inversion, and atom remapping necessary to bring the geometry of Cmol into coincidence with the geometry of Pmol. Pmol and Cmol must be `qcdb.Molecule` and represent the same geometry. Presently catches some errors of orientation that Cfour as Cmol should properly fulfill. These are unnecessary restrictions and can be relaxed later.

  `transform_coordinates`(coord)
  `transform_coordinates2`(coord)
  `transform_elementlist`(elem)

    Applies to elem the transformation appropriate to bring a list of atomic numbers in molChangeable orientation into molPermanent orientation. In particular, applies a row exchange to place it in the atom ordering.

  `transform_gradient`(arr)

    Applies to arr the transformation appropriate to bring a gradient in molChangeable orientation into molPermanent orientation. In particular, applies a rotation to place it in the inertial frame, a column exchange and phasing to place it in the axis system, a row exchange to place it in the atom ordering, and a rotation to remove it from the inertial frame.

  `transform_vector`(vec)

    Applies to vec the transformation appropriate to bring a vector in molChangeable orientation into molPermanent orientation. In particular, applies a rotation to place it in the inertial frame, a column exchange and phasing to place it in the axis system, and a rotation to remove it from the inertial frame.

class `Gaussian94BasisSetParser`(forced_puream=None)

  Class for parsing basis sets from a text file in Gaussian 94 format. Translated directly from the Psi4 libmints class written by Justin M. Turney and Andrew C. Simmonett.

  `load_file`(filename, basisname=None)

    Load and return the file to be used by parse. Return only portion of filename pertaining to basisname if specified (for multi-basisset files) otherwise entire file as list of strings.

  `parse`(symbol, dataset)

    Given a string, parse for the basis set needed for atom. * @param symbol atom symbol to look for in dataset * @param dataset data set to look through dataset can be list of lines or a single string which will be converted to list of lines

Class to

class `GaussianShell`(am, nprimitive, oc, c, ec, e, pure, nc, center, start)

  Class with same information as `ShellInfo`. In C++, class uses more efficient data structures, but in Python differences minimal.

  `nprimitive`()

    The number of primitive Gaussians

`INT_CARTINDEX`(am, i, j)

  Computes offset index for cartesian function. #define INT_CARTINDEX(am,i,j) (((i) == (am))? 0 : (((((am) - (i) + 1)*((am) - (i)))>>1) + (am) - (i) - (j)))

`INT_ICART`(a, b, c)

  Given a, b, and c compute a cartesian offset. #define INT_ICART(a, b, c) (((((((a)+(b)+(c)+1)<<1)-(a))*((a)+1))>>1)-(b)-1)

`INT_IPURE`(l, m)

  Given l and m compute a pure function offset. #define INT_IPURE(l, m) ((l)+(m))

`INT_NCART`(am)

  Gives the number of cartesian functions for an angular momentum. define INT_NCART(am) ((am>=0) ? ((((am)+2)*((am)+1))>>1) : 0)

`INT_NFUNC`(pu, am)

  Gives the number of functions for an angular momentum based on pu. #define INT_NFUNC(pu,am) ((pu)?INT_NPURE(am):INT_NCART(am))

`INT_NPURE`(am)

  Gives the number of spherical functions for an angular momentum. #define INT_NPURE(am) (2*(am)+1)

class `ShellInfo`(am, c, e, pure, nc, center, start, pt='Normalized')

  This class has the same behavior as GaussianShell, but implements everything using slower data structures, which are easier to construct. These are used to build the basis set, which builds more efficient pointer-based GaussianShell objects. * @param e An array of exponent values. * @param am Angular momentum. * @param pure Pure spherical harmonics, or Cartesian. * @param c An array of contraction coefficients. * @param nc The atomic center that this shell is located on. Must map

  > back to the correct atom in the owning BasisSet molecule_. Used in integral derivatives for indexing.

  - @param center The x, y, z position of the shell. This is passed to

      reduce the number of calls to the molecule.

  - @param start The starting index of the first function this shell

      provides. Used to provide starting positions in matrices.

  - @param pt Is the shell already normalized?

  `AMCHAR`()

    The character symbol for the angular momentum of the given contraction (upper case)

  `am`()

    The angular momentum of the given contraction

  `amchar`()

    The character symbol for the angular momentum of the given contraction

  `center`()

    Returns the center of the Molecule this shell is on

  `coef`(pi)

    Return coefficient of pi’th primitive

  `coefs`()

    Return coefficient of pi’th primitive and ci’th contraction

  `contraction_normalization`()

    Normalizes an entire contraction set. Applies the normalization to the coefficients * @param gs The contraction set to normalize.

  `copy`(nc=None, c=None)

    Make a copy of the ShellInfo

  `erd_coef`(pi)

    Return ERD normalized coefficient of pi’th primitive

  `erd_normalize_shell`()
  `exp`(prim)

    Returns the exponent of the given primitive

  `exps`()

    Returns the exponent of the given primitive

  `function_index`()

    Basis function index where this shell starts.

  `is_cartesian`()

    Returns true if contraction is Cartesian

  `is_pure`()

    Returns true if contraction is pure

  `ncartesian`()

    Total number of functions if this shell was Cartesian

  `ncenter`()

    Returns the atom number this shell is on. Used by integral derivatives for indexing.

  `nfunction`()

    Total number of basis functions

  `normalize`(l, m, n)

    Normalize the angular momentum component

  `normalize_shell`()

    Handles calling primitive_normalization and contraction_normalization for you.

  `nprimitive`()

    The number of primitive Gaussians

  `original_coef`(pi)

    Return unnormalized coefficient of pi’th primitive

  `original_coefs`()

    Return unnormalized coefficient of pi’th primitive and ci’th contraction

  `primitive_normalization`(p)

    Normalizes a single primitive. @param p The primitive index to normalize. @return Normalization constant to be applied to the primitive.

  `pyprint`(outfile=None)

    Print out the shell

  `set_function_index`(i)

    Set basis function index where this shell starts.

`df`(n)

  Gives the double factorial of i

Stuff stolen from psi. Should import or not as necessary or some better way. Apologies to the coders.

`all_casings`(input_string)

  Function to return a generator of all lettercase permutations of input_string.

`compare_integers`(expected, computed, label)

  Function to compare two integers. Prints `util.success()` when value computed matches value expected. Performs a system exit on failure. Used in input files in the test suite.

`compare_matrices`(expected, computed, digits, label)

  Function to compare two matrices. Prints `util.success()` when elements of matrix computed match elements of matrix expected to number of digits. Performs a system exit on failure to match symmetry structure, dimensions, or element values. Used in input files in the test suite.

`compare_strings`(expected, computed, label)

  Function to compare two strings. Prints `util.success()` when string computed exactly matches string expected. Performs a system exit on failure. Used in input files in the test suite.

`compare_values`(expected, computed, digits, label)

  Function to compare two values. Prints `util.success()` when value computed matches value expected to number of digits (or to digits itself when digits > 1 e.g. digits=0.04). Performs a system exit on failure. Used in input files in the test suite.

`drop_duplicates`(seq)

  Function that given an array seq, returns an array without any duplicate entries. There is no guarantee of which duplicate entry is dropped.

`getattr_ignorecase`(module, attr)

  Function to extract attribute attr from module if attr is available in any possible lettercase permutation. Returns attribute if available, None if not.

`import_ignorecase`(module)

  Function to import module in any possible lettercase permutation. Returns module object if available, None if not.

`query_yes_no`(question, default=True)

  Ask a yes/no question via raw_input() and return their answer.

  question is a string that is presented to the user. default is the presumed answer if the user just hits <Enter>. It must be yes (the default), no or None (meaning an answer is required of the user).

  The return value is one of True or False.

`search_file`(filename, search_path)

  Given an os.pathsep divided search_path, find first occurance of filename. Returns full path to file if found or None if unfound.

Module to largely replicate in python the psi4 libmints CoordValue and CoordEntry classes, which were developed by Justin M. Turney, with incremental improvements by other psi4 developers.

class `CartesianEntry`(entry_number, Z, charge, mass, symbol, label, x, y, z, basis=None, shells=None)

  Class to hold all information about an atom, including its coordinate specification as three Cartesians.

  `clone`()

    Returns new, independent CartesianEntry object

  `compute`()

    Computes the values of the coordinates (in whichever units were inputted), returning them in a Vector

  `everything`()
  `invalidate`()

    Flags the current coordinates as being outdated.

  `print_in_input_format`()

    Prints the updated geometry, in the format provided by the user.

  `print_in_input_format_cfour`()

    Prints the updated geometry, in the format provided by the user. This, for Cfour, not different from regular version.

  `set_coordinates`(x, y, z)

    Given the current set of coordinates, updates the values of this atom’s coordinates and any variables that may depend on it.

  `type`()

    The type of CoordEntry specialization.

class `CoordEntry`(entry_number, Z, charge, mass, symbol, label='', basis=None, shells=None)

  Class to store all the attributes associated with an atom, not the larger Molecule. Specialized into CartesianEntry and ZMatrixEntry.

  `Z`()

    The nuclear charge of the current atom (0 if ghosted).

  static `a`(a1, a2, a3)

    Computes the angle (in rad.) between three sets of coordinates.

  `basisset`(role='BASIS')

    Returns the basis name for the provided type. * @param type Keyword from input file. * @returns the value from input.

  `basissets`()

    Returns basisset to atom map

  `charge`()

    The “atomic charge” of the current atom (for SAD purposes).

  static `d`(a1, a2, a3, a4)

    Computes the dihedral (in rad.) between four sets of coordinates.

  `entry_number`()

    The order in which this appears in the full atom list.

  `everything`()
  `is_computed`()

    Whether the current atom’s coordinates are up-to-date.

  `is_equivalent_to`(other)

    Whether this atom has the same mass and ghost status as atom other. Also compares basis set assignment down to nbf(), has_puream() level with code borrowed from Robert M. Parrish’s SAD guess in Psi4.

  `is_ghosted`()

    Whether the current atom is ghosted or not.

  `label`()

    The atom label.

  `mass`()

    The atomic mass of the current atom.

  static `r`(a1, a2)

    Computes the distance between two sets of coordinates

  `set_basisset`(name, role='BASIS')

    Set the basis for this atom * @param type Keyword from input file, basis, ri_basis, etc. * @param name Value from input file

  `set_ghosted`(gh)

    Flag the atom as either ghost or real.

  `set_shell`(bshash, key='BASIS')

    Set the hash for this atom * @param key Keyword from input file, basis, ri_basis, etc. * @param bshash hash string of one-atom BasisSet

  `shell`(key='BASIS')

    Returns the hash for the provided type. * @param type Keyword from input file. * @returns the hash string for basis.

  `shells`()

    Returns shells sets to atom map

  `symbol`()

    The atomic symbol.

class `CoordValue`(fixed=False, computed=False)

  An abstract class to handle storage of Cartesian coordinate values, which may be defined in terms of other variables through this mechanism, greatly simplifying Z-matrix specification, for example.

  `everything`()
  `fixed`()

    Get whether the coordinate value is fixed or not

  `invalidate`()

    Flag the current value as outdated

  `set_fixed`(fixed)

    Set whether the coordinate value is fixed or not

class `NumberValue`(value, fixed=False)

  Specialization of CoordValue that is simply a number to be stored.

  `clone`()

    Returns new, independent NumberValue object

  `compute`()

    Computes value of coordinate from member data

  `everything`()
  `rset`(val)

    Resets value of coordinate if not fixed

  `type`()

    Gets specialization type of CoordValue

  `variable_to_string`(precision)

    Takes a CoordValue object, and returns a string for printing.

class `VariableValue`(name, geometryVariables, negate=False, fixed=False)

  Specialization of CoordValue, where the current value depends on the list of geometry values stored by the molecule.

  `clone`()

    Returns new, independent VariableValue object

  `compute`()

    Computes value of coordinate from member data

  `everything`()
  `name`()

    Gets the name of the variable

  `negated`()

    Gets whether the coordinate value is actually the negative of the variable value

  `rset`(val)

    Resets value of coordinate if not fixed

  `type`()

    Gets specialization type of CoordValue

  `variable_to_string`(precision)

    Takes a CoordValue object, and returns a string for printing.

class `ZMatrixEntry`(entry_number, Z, charge, mass, symbol, label, rto=None, rval=0, ato=None, aval=0, dto=None, dval=0, basis=None, shells=None)

  Class to hold all information about an atom, including its coordinate specification as any position of ZMatrix.

  `clone`()

    Returns new, independent ZMatrixEntry object.

  `compute`()

    Compute the Cartesian coordinates in Bohr of current atom’s entry.

  `everything`()
  `invalidate`()

    Flags the current coordinates as being outdated

  `print_in_input_format`()

    Prints the updated geometry, in the format provided by the user

  `print_in_input_format_cfour`()

    Prints the updated geometry, in the format provided by the user

  `set_coordinates`(x, y, z)

    Given the current set of coordinates, updates the values of this atom’s coordinates, and any variables that may depend on it.

  `type`()

    The type of CoordEntry specialization.

class `OrderedDict`(*args, **kwds)

  Dictionary that remembers insertion order

  `clear`() → None. Remove all items from od.
  `copy`() → a shallow copy of od
  classmethod `fromkeys`(S[, v]) → New ordered dictionary with keys from S

    and values equal to v (which defaults to None).

  `items`() → list of (key, value) pairs in od
  `iteritems`()

    od.iteritems -> an iterator over the (key, value) items in od

  `iterkeys`() → an iterator over the keys in od
  `itervalues`()

    od.itervalues -> an iterator over the values in od

  `keys`() → list of keys in od
  `pop`(k[, d]) → v, remove specified key and return the corresponding value.

    If key is not found, d is returned if given, otherwise KeyError is raised.

  `popitem`() → (k, v), return and remove a (key, value) pair.

    Pairs are returned in LIFO order if last is true or FIFO order if false.

  `setdefault`(k[, d]) → od.get(k,d), also set od[k]=d if k not in od
  `update`(E, **F) → None. Update od from dict/iterable E and F.

    If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v

  `values`() → list of values in od
  `viewitems`() → a set-like object providing a view on od's items
  `viewkeys`() → a set-like object providing a view on od's keys
  `viewvalues`() → an object providing a view on od's values

class `MolproIn`(mem, mtd, bas, mol, sys, cast)
  `format_basis`()
  `format_global_parameters`()
  `format_infile_string`()

`getrec`(reclabelarray, verbose=False)

  Reads binary files JOBARC and JAINDX and returns contents of each record in reclabelarray.

Module to facilitate quantum chemical computations on chemical databases. Contains Molecule class and physical constants from psi4 suite.

File to

`dictify_database_docstrings`()

`drop_duplicates`(seq)

  Function that given an array or array of arrays seq, returns an array without any duplicate entries. There is no guarantee of which duplicate entry is dropped.

`useful`()

class `PreservingDict`(*args, **kwargs)

  Class to store quantum chemical quantities extracted from output files. Extends the dictionary object to (1) store key as all-caps version of itself and (2) validate value for duplicate values for the same key by testing which has more decimal places and whether value the same within a plausing rounding error. Allows consistency checks when parsing output files without loss of precision.

  `setdefault`(key, value=None)
  `update`(*args, **kwargs)

Module containing functions that, when passed a qcdb.Database instance dbinstance, return an array of reaction names that are a subset of dbinstance.hrxn.keys(). Since the full database is passed in, reactions can be filtered by molecule characteristics, reaction names, existing subsets, etc. The official name of the subset is specified by the function docstring.

`genset_DDn5min`(dbinstance)

  DD-5min

`genset_HBn5min`(dbinstance)

  HB-5min

`genset_MXDDNPn5min`(dbinstance)

  MXDDNP-5min

`genset_MXDDPPn5min`(dbinstance)

  MXDDPP-5min

`genset_MXn5min`(dbinstance)

  MX-5min

`genset_MXuDD`(dbinstance)

  mxdd

class `BasisSet`(*args)

  Basis set container class Reads the basis set from a checkpoint file object. Also reads the molecule from the checkpoint file storing the information in an internal Molecule class which can be accessed using molecule().

  `LIBINT_MAX_AM` = 6
  `add`(b)

    Adds this plus another basis set and returns the result. Equivalent to the ‘+’ operator. Appears defunct.

  `ao_to_shell`(i)

    Given a Cartesian function (AO) number what shell does it correspond to.

  `atom_shell_map`()
  `atomic_basis_set`(center)

    Return a BasisSet object containing all shells at center i (0-index) * Used for Atomic HF computations for SAD Guesses * @param center Atomic center to provide a basis object for. * @returns A new basis set object for the atomic center.

  static `build`(molecule, shells)

    Builder factory method * @param molecule the molecule to build the BasisSet around * @param shells array of atom-numbered GaussianShells to build the BasisSet from * @return BasisSet corresponding to this molecule and set of shells

  `compute_phi`(phi_ao, x, y, z)

    Returns the values of the basis functions at a point

  `concatenate`(b)

    Concatenates two basis sets together into a new basis without reordering anything. Unless you know what you’re doing, you should use the ‘+’ operator instead of this method. Appears defunct.

  classmethod `construct`(parser, mol, role, deffit=None, basstrings=None)

    Returns a new BasisSet object configured from the mol Molecule object for role (generally a Psi4 keyword: BASIS, DF_BASIS_SCF, etc.). Fails utterly if a basis has not been set for role for every atom in mol, unless deffit is set (JFIT, JKFIT, or RIFIT), whereupon empty atoms are assigned to role from the `BasisFamily`. This function is significantly re-worked from its libmints analog.

  `constructor_basisset_center`(bs, center)
    - Creates a new basis set object for an atom, from an existing basis set
    - bs: the basis set to copy data from
    - center: the atom in bs to copy over
  `constructor_role_mol_shellmap`(role, mol, shell_map)

    The most commonly used constructor. Extracts basis set name for role from each atom of mol, looks up basis and role entries in the shell_map dictionary, retrieves the GaussianShell objects and returns the BasisSet.

  `constructor_zero_ao_basis`()

    Constructs a zero AO basis set

  `exp_ao` = [[], [], [], [], [], []]
  `export_for_libmints`(role)

    From complete BasisSet object, returns array where triplets of elements are each unique atom label, the hash of the string shells entry in gbs format and the shells entry in gbs format for that label. This packaging is intended for return to libmints BasisSet::pyconstruct for instantiation of a libmints BasisSet clone of self.

  `function_to_center`(i)

    Given a function what is its atomic center * @param i Function number * @return The atomic center for the i’th function.

  `function_to_shell`(i)

    Given a function number what shell does it correspond to.

  `get_ao_sorted_list`()

    Returns the vector of sorted shell list. Defunct

  `get_ao_sorted_shell`(i)

    Returns the value of the sorted shell list. Defunct

  `has_puream`()

    Spherical harmonics? * @return true if using spherical harmonics

  `initialize_singletons`()

    Initialize singleton values that are shared by all basis set objects.

  `initialized_shared` = False
  `l` = 5
  static `make_filename`(name)

    Converts basis set name to a compatible filename. * @param basisname Basis name * @return Compatible file name.

  `max_am`()

    Maximum angular momentum used in the basis set. * @return Maximum angular momentum.

  `max_function_per_shell`()

    Compute the maximum number of basis functions contained in a shell. * @return The max number of basis functions in a shell.

  `max_nprimitive`()

    Maximum number of primitives in a shell. * Examines each shell and find the shell with the maximum number of primitives returns that * number of primitives. * @return Maximum number of primitives.

  `molecule`()

    Molecule this basis is for. * @return Shared pointer to the molecule for this basis set.

  `name`()

    Returns the name of this basis set

  `nao`()

    Number of atomic orbitals (Cartesian). * @return The number of atomic orbitals (Cartesian orbitals, always).

  `nbf`()

    Number of basis functions (Spherical). * @return The number of basis functions (Spherical, if has_puream() == true).

  `nprimitive`()

    Number of primitives. * @return The total number of primitives in all contractions.

  `nshell`()

    Number of shells. * @return Number of shells.

  `nshell_on_center`(i)

    Return the number of shells on a given center.

  `print_by_level`(out=None, level=2)

    Print basis set information according to the level of detail in print_level * @param out The file stream to use for printing. Defaults to outfile. * @param print_level: < 1: Nothing

    > > 1: Brief summary 2: Summary and contraction details

    > > 2: Full details Defaults to 2

  `print_detail`(out=None, numbersonly=False)

    Prints a detailed PSI3-style summary of the basis (per-atom) * @param out The file stream to use for printing. Defaults to outfile.

  `print_detail_cfour`(out=None)

    Returns a string in CFOUR-style of the basis (per-atom) * Format from http://slater.chemie.uni-mainz.de/cfour/index.php?n=Main.OldFormatOfAnEntryInTheGENBASFile

  `print_summary`(out=None)

    Prints a short string summarizing the basis set * @param out The file stream to use for printing. Defaults to outfile.

  static `pyconstruct`(mol, key, target, fitrole='BASIS', other=None)

    Builds a BasisSet object for mol (either a qcdb.Molecule or a string that can be instantiated into one) from basis set specifications passed in as python functions or as a string that names a basis to be applied to all atoms. Always required is the keyword key and string/function target of the basis to be constructed. For orbital basis sets, key will likely be ‘BASIS’ and, together with target, these arguments suffice.

    > pyconstruct(smol, “BASIS”, basisspec_psi4_yo_631pg_d_p_) pyconstruct(mol, “BASIS”, “6-31+G**”)

    When building an auxiliary basis, key is again the keyword, target is the string or function for the fitting basis (this may also be an empty string). In case the fitting basis isn’t fully specified, also provide a fitrole and the string/function of the orbital basis as other, so that orbital hints can be used to look up a suitable default basis in BasisFamily.

    > pyconstruct(smol, “DF_BASIS_MP2”, basisspec_psi4_yo_ccpvdzri, ‘RIFIT’, basisspec_psi4_yo_631pg_d_p_) pyconstruct(mol, “DF_BASIS_MP2”, “”, “RIFIT”, “6-31+G(d,p)”)

  static `pyconstruct_combined`(mol, keys, targets, fitroles, others)
  `pyprint`(out=None)

    Print the basis set. * @param out The file stream to use for printing. Defaults to outfile.

  `refresh`()

    Refresh internal basis set data. Useful if someone has pushed to shells_. Pushing to shells_ happens in the BasisSetParsers, so the parsers will call refresh(). This function is now defunct.

  `set_name`(name)

    Sets the name of this basis set

  `shell`(si, center=None)

    Return the si’th Gaussian shell on center * @param i Shell number * @return A shared pointer to the GaussianShell object for the i’th shell.

  `shell_on_center`(center, shell)

    Return the overall shell number

  static `shell_sorter_am`(d1, d2)
  static `shell_sorter_ncenter`(d1, d2)
  `shell_to_ao_function`(i)

    Given a shell what is its first AO function * @param i Shell number * @return The function number for the first function for the i’th shell.

  `shell_to_basis_function`(i)

    Given a shell what is its first basis function (spherical) function * @param i Shell number * @return The function number for the first function for the i’th shell.

  `shell_to_center`(i)

    Given a shell what is its atomic center * @param i Shell number * @return The atomic center for the i’th shell.

  static `test_basis_set`(max_am)

    Returns a shell-labeled test basis set object * @param max_am maximum angular momentum to build * @return pair containing shell labels and four-center * test basis for use in benchmarking * See libmints/benchmark.cc for details The libmints version seems not to have been updated along with the classes.

  static `zero_ao_basis_set`()

    Returns an empty basis set object. Returns a BasisSet object that actually has a single s-function at the origin with an exponent of 0.0 and contraction of 1.0. * @return A new empty BasisSet object.

  `zero_so_basis_set`(factory)

    NYI Returns an empty SO basis set object. * Returns an SOBasis object that actually has a single s-function * at the origin with an exponent of 0.0 and contraction of 1.0. * @return A new empty SOBasis object.

File for accessory procedures in the chem module. Credit for the libmints vector3 class to Justin M. Turney and incremental improvements by other psi4 developers.

`add`(v, u)

  Compute sum of vectors v and u.

`cross`(v, u)

  Compute cross product of length 3 vectors v and u.

`determinant`(mat)

  Given 3x3 matrix mat, compute the determinat

`diagonalize3x3symmat`(M)

  Given an real symmetric 3x3 matrix M, compute the eigenvalues

`distance`(v, u)

  Compute the distance between points defined by vectors v and u.

`dot`(v, u)

  Compute dot product of vectors v and u.

`identity`(m)

  Create identity matrix

`matadd`(matrix1, matrix2, fac1=1.0, fac2=1.0)

  Matrix addition

`mscale`(matrix, d)

  Return matrix scaled by scalar d

`mult`(matrix1, matrix2)

  Matrix multiplication

`naivemult`(v, u)

  Compute by-element multiplication of vectors v and u.

`norm`(v)

  Compute the magnitude of vector v.

`normalize`(v)

  Compute normalized vector v.

`perp_unit`(u, v)

  Compute unit vector perpendicular to length 3 vectors u and v.

`rotate`(v, theta, axis)

  Rotate length 3 vector v about axis by theta radians.

`scale`(v, d)

  Compute by-element scale by d of vector v.

`show`(matrix)

  Print out matrix

`sub`(v, u)

  Compute difference of vectors v - u.

`transpose`(matrix)

  Return matrix transpose

`zero`(m, n)

  Create zero matrix

Module with non-generic exceptions classes.

exception `BasisSetFileNotFound`(msg)

exception `BasisSetNotDefined`(msg)

exception `BasisSetNotFound`(msg, silent=False)

exception `FeatureNotImplemented`(msg)

  Error called for functions defined but not yet implemented. Also for functions defined that will never be implemented.

exception `FragmentCountError`(msg)

  Error called molecule has wrong number of fragments for method. Prints error message msg to standard output stream.

exception `IncompleteAtomError`(msg)

  Error raised when not all variables in an atom specification have been defined at compute time. May be a temporary situation so message not printed but appears as traceback when error persists.

exception `ParsingValidationError`(msg)

  Error called for problems with syntax from a QC output file. Prints error message msg to standard output stream.

exception `QcdbException`

  Error class for QCDB.

exception `ValidationError`(msg)

  Error called for problems with syntax input file. Prints error message msg to standard output stream.

class `Molecule`(psi4molstr=None)

  Class to store python extensions to the MoleculeLibmints class. Multiple classes allows separation of libmints and extension methods.

  `BFS`()

    Perform a breadth-first search (BFS) on the real atoms in molecule, returning an array of atom indices of fragments. Relies upon van der Waals radii and so faulty for close (esp. hydrogen-bonded) fragments. Original code from Michael S. Marshall.

  `auto_fragments`()

    Detects fragments in an unfragmented molecule using BFS algorithm. Returns a new Molecule in Cartesian, fixed-geom (no variable values), no dummy-atom format. Any non-default charge and multiplicity assigned to first fragment.

  `center_of_charge`()

    Computes center of charge of molecule (does not translate molecule).

        >>> H2OH2O.center_of_charge()
        [-0.073339893272065401, 0.002959783555632145, 0.0]

  `format_basis_for_cfour`(puream)

    Function to print the BASIS=SPECIAL block for Cfour according to the active atoms in Molecule. Special short basis names are used by Psi4 libmints GENBAS-writer in accordance with Cfour constraints.

  `format_molecule_for_cfour`()

    Function to print Molecule in a form readable by Cfour.

  `format_molecule_for_cfour_old`()

    Function to print Molecule in a form readable by Cfour. This version works as long as zmat is composed entirely of variables, not internal values, while cartesian is all internal values, no variables. Cutting off this line of development because, with getting molecules after passing through libmints Molecule, all zmats with dummies (Cfour’s favorite kind) have already been converted into cartesian. Next step, if this line was pursued would be to shift any zmat internal values to external and any cartesian external values to internal.

  `format_molecule_for_molpro`()
  `format_molecule_for_nwchem`()
  `format_molecule_for_psi4`()

    Returns string of molecule definition block.

  `format_molecule_for_qchem`()
  `inertia_tensor`(masswt=True, zero=1e-14)

    Compute inertia tensor.

        >>> print H2OH2O.inertia_tensor()
        [[8.704574864178731, -8.828375721817082, 0.0], [-8.828375721817082, 280.82861714077666, 0.0], [0.0, 0.0, 281.249500988553]]

  `inertia_tensor_partial`(part, masswt=True, zero=1e-14)

    Compute inertia tensor based on atoms in part.

  `inertial_system`(masswt=True, zero=1e-14)

    Solve inertial system

  `inertial_system_partial`(part, masswt=True, zero=1e-14)

    Solve inertial system based on atoms in part

  classmethod `init_with_xyz`(xyzfilename, no_com=False, no_reorient=False, contentsNotFilename=False)

    Pull information from an XYZ file. No fragment info detected. Bohr/Angstrom pulled from first line if available. Charge, multiplicity, tagline pulled from second line if available. Body accepts atom symbol or atom charge in first column. Arguments no_com and no_reorient can be used to turn off shift and rotation. If xyzfilename is a string of the contents of an XYZ file, rather than the name of a file, set contentsNotFilename to `True`.

        >>> H2O = qcdb.Molecule.init_with_xyz('h2o.xyz')

  `move_to_coc`()

    Moves molecule to center of charge

  `print_ring_planes`(entity1, entity2, entity3=None, entity4=None)

    (reals only, 1-indexed)

  `rotor_type`(tol=1e-08)

    Returns the rotor type.

        >>> H2OH2O.rotor_type()
        RT_ASYMMETRIC_TOP

  `run_dftd3`(func=None, dashlvl=None, dashparam=None, dertype=None)

    Function to call Grimme’s dftd3 program (http://toc.uni-muenster.de/DFTD3/) to compute the -D correction of level dashlvl using parameters for the functional func. The dictionary dashparam can be used to supply a full set of dispersion parameters in the absense of func or to supply individual overrides in the presence of func. Returns energy if dertype is 0, gradient if dertype is 1, else tuple of energy and gradient if dertype unspecified. The dftd3 executable must be independently compiled and found in `PATH` or `PSIPATH`.

  `save_string_xyz`(save_ghosts=True)

    Save a string for a XYZ-style file.

        >>> H2OH2O.save_string_xyz()
        6
        -2 3 water_dimer
         O   -1.551007000000   -0.114520000000    0.000000000000
         H   -1.934259000000    0.762503000000    0.000000000000
         H   -0.599677000000    0.040712000000    0.000000000000
         O    1.350625000000    0.111469000000    0.000000000000
         H    1.680398000000   -0.373741000000   -0.758561000000
         H    1.680398000000   -0.373741000000    0.758561000000

Parent classes for quantum chemistry program input and output file formats.

class `InputFormat`(mem, mtd, bas, mol, sys, cast)
  `corresponding_aux_basis`()

    For Dunning basis sets, returns strings from which auxiliary basis sets and heavy-aug can be constructed. Note that valence/core-valence/etc. is conserved and X-zeta/(X+d)zeta is not, since this is the usual aux basis pattern. augbasis is round up to the nearest aug-cc-pVXZ rootbasis is round down to the nearest cc-pVXZ auxbasis is round up to the nearest cc-pVXZ or aug-cc-pVXZ

class `InputFormat2`(mem, mol, mtd, der, opt)
  `corresponding_aux_basis`()

    For Dunning basis sets, returns strings from which auxiliary basis sets and heavy-aug can be constructed. Note that valence/core-valence/etc. is conserved and X-zeta/(X+d)zeta is not, since this is the usual aux basis pattern. augbasis is round up to the nearest aug-cc-pVXZ rootbasis is round down to the nearest cc-pVXZ auxbasis is round up to the nearest cc-pVXZ or aug-cc-pVXZ

`graphics`(kw)

`label`(kw)

`lmtdbas`(kw)

`table_generic`(dbse, serrors, mtd, bas, columnplan, rowplan=['bas', 'mtd'], opt=['CP'], err=['mae'], sset=['default'], landscape=False, standalone=True, subjoin=True, plotpath='', theme='', filename=None)

  Arrays mtd and bas contain the keys to the qcdb.Method and qcdb.BasisSet objects that span all those that the table may encompass. If method and basis are to be scanned over, the arrays should be in the desired order.

`val`(kw)

Module with matplotlib plotting routines. These are not hooked up to any particular qcdb data structures but can be called with basic arguments.

`bars`(data, title='', saveas=None, relpath=False, graphicsformat=['pdf'])

  Generates a ‘gray-bars’ diagram between model chemistries with error statistics in list data, which is supplied as part of the dictionary for each participating bar/modelchem, along with mc keys in argument data. The plot is labeled with title and each bar with mc key and plotted at a fixed scale to facilitate comparison across projects.

`composition_tile`(db, aa1, aa2)

  Takes dictionary db of label, error pairs and amino acids aa1 and aa2 and returns a square array of all errors for that amino acid pair, buffered by zeros.

`disthist`(data, title='', xtitle='', xmin=None, xmax=None, me=None, stde=None, saveas=None, relpath=False, graphicsformat=['pdf'])

  Saves a plot with name saveas with a histogram representation of the reaction errors in data. Also plots a gaussian distribution with mean me and standard deviation stde. Plot has x-range xmin to xmax, x-axis label xtitle and overall title title.

`expand_saveas`(saveas, def_filename, def_path='/build/psi4-FsTMhA/psi4-0.3/builddir/doc/sphinxman', def_prefix='', relpath=False)

  Analyzes string saveas to see if it contains information on path to save file, name to save file, both or neither (saveas ends in ‘/’ to indicate directory only) (able to expand ‘.’). A full absolute filename is returned, lacking only file extension. Based on analysis of missing parts of saveas, path information from def_path and/or filename information from def_prefix + def_filename is inserted. def_prefix is intended to be something like ‘mplthread_‘ to identify the type of figure.

`flat`(data, color=None, title='', xlimit=4.0, mae=None, mape=None, view=True, saveas=None, relpath=False, graphicsformat=['pdf'])

  Generates a slat diagram between model chemistries with errors in single-item list data, which is supplied as part of the dictionary for each participating reaction, along with dbse and rxn keys in argument data. Limits of plot are xlimit from the zero-line. If color is None, slats are black, if ‘sapt’, colors are taken from sapt_colors module. Summary statistic mae is plotted on the overbound side and relative statistic mape on the underbound side. Saves a file with name title and plots to screen if view.

`iowa`(mcdat, mclbl, title='', xlimit=2.0)

  Saves a plot with (extensionless) name pltfile with an Iowa representation of the modelchems errors in mcdat for BBI/SSI-style labels.

`segment_color`(argcolor, saptcolor)

  Find appropriate color expression between overall color directive argcolor and particular color availibility rxncolor.

`threads`(data, labels, color=None, title='', xlimit=4.0, mae=None, mape=None, mousetext=None, mouselink=None, mouseimag=None, mousetitle=None, saveas=None, relpath=False, graphicsformat=['pdf'])

  Generates a tiered slat diagram between model chemistries with errors (or simply values) in list data, which is supplied as part of the dictionary for each participating reaction, along with dbse and rxn keys in argument data. The plot is labeled with title and each tier with an element of labels and plotted at xlimit from the zero-line. If color is None, slats are black, if ‘sapt’, colors are taken from color key in data [0, 1]. Summary statistics mae are plotted on the overbound side and relative statistics mape on the underbound side. HTML code for mouseover if mousetext or mouselink or mouseimag specified based on recipe of Andrew Dalke from http://www.dalkescientific.com/writings/diary/archive/2005/04/24/interactive_html.html

Module with functions that interface with Grimme’s DFTD3 code.

`run_dftd3`(self, func=None, dashlvl=None, dashparam=None, dertype=None)

  Function to call Grimme’s dftd3 program (http://toc.uni-muenster.de/DFTD3/) to compute the -D correction of level dashlvl using parameters for the functional func. The dictionary dashparam can be used to supply a full set of dispersion parameters in the absense of func or to supply individual overrides in the presence of func. Returns energy if dertype is 0, gradient if dertype is 1, else tuple of energy and gradient if dertype unspecified. The dftd3 executable must be independently compiled and found in `PATH` or `PSIPATH`.

## p4util

Module with commands building `BasisFamily` objects for Pople and other non-Dunning orbital basis sets. Some plausible fitting basis sets are supplied as defaults.

`load_basfam_other`()

Module to define a class `BasisFamily` that associates fitting basis sets to an orbital basis and to provide functions to query appropriate fitting bases for any orbital basis distributed with Psi4.

class `BasisFamily`(ornate, orbital=None, jk=None, ri=None, dual=None)

  Class to associate with an orbital basis name ornate the gbs file names in which the orbital basis orbital (usually the coded form of ornate) and jfit, jkfit, rifit, and dualfit auxiliary bases can be found.

  `add_dualfit`(fit)

    Function to add basis fit as associated helper basis member dualfit to a BasisFamily object.

  `add_jfit`(fit)

    Function to add basis fit as associated fitting basis member jfit to a BasisFamily object.

  `add_jkfit`(fit)

    Function to add basis fit as associated fitting basis member jkfit to a BasisFamily object.

  `add_rifit`(fit)

    Function to add basis fit as associated fitting basis member rifit to a BasisFamily object.

  `name`()

    Function to return the ornate name of the orbital basis, e.g., 6-311++G** for 6-311ppgss.

`corresponding_dualfit`(name)

  Function to return an appropriate DUAL helper basis for the orbital basis name in coded or ornate form. `None` is returned if no fitting basis is defined or if the orbital basis is not found.

`corresponding_jfit`(name)

  Function to return an appropriate J fitting basis for the orbital basis name in coded or ornate form. `None` is returned if no fitting basis is defined or if the orbital basis is not found.

`corresponding_jkfit`(name)

  Function to return an appropriate JK fitting basis for the orbital basis name in coded or ornate form. `None` is returned if no fitting basis is defined or if the orbital basis is not found.

`corresponding_orbital`(name)

  Function to validate if the orbital basis name in coded or ornate form is in Psi4’s standard installed bases list. `None` is returned if the orbital basis is not found.

`corresponding_rifit`(name)

  Function to return an appropriate RI fitting basis for the orbital basis name in coded or ornate form. `None` is returned if no fitting basis is defined or if the orbital basis is not found.

`load_basis_families`()

  Function to load into the array `basisfamily_list` BasisFamily objects for all Psi4’s standard installed bases.

`print_basis_families`()

  Function to print to the output file a formatted summary of all the BasisFamily objects in `basisfamily_list`, by default all Psi4’s standard installed bases.

`sanitize_basisname`(name)

  Function to return name in coded form, stripped of characters that confuse filenames, characters into lowercase, `+` into `p`, `*` into `s`, and `(`, `)`, & `,` into `_`.

Module (auto-generated from make_dunning.pl script) with commands building `BasisFamily` objects that encode the Dunning basis set orbital definitions in psi4/lib/basis/NOTES and fitting bases designed for those orbital bases.

`load_basfam_dunning`()

Module with utility functions for use in input files.

`compare_csx`()

  Function to validate energies in CSX files against PSIvariables. Only active if write_csx flag on.

`compare_cubes`(expected, computed, label)

  Function to compare two cube files. Prints `util.success()` when value computed matches value expected. Performs a system exit on failure. Used in input files in the test suite.

`compare_integers`(expected, computed, label)

  Function to compare two integers. Prints `util.success()` when value computed matches value expected. Performs a system exit on failure. Used in input files in the test suite.

`compare_matrices`(expected, computed, digits, label)

  Function to compare two matrices. Prints `util.success()` when elements of matrix computed match elements of matrix expected to number of digits. Performs a system exit on failure to match symmetry structure, dimensions, or element values. Used in input files in the test suite.

`compare_strings`(expected, computed, label)

  Function to compare two strings. Prints `util.success()` when string computed exactly matches string expected. Performs a system exit on failure. Used in input files in the test suite.

`compare_values`(expected, computed, digits, label)

  Function to compare two values. Prints `util.success()` when value computed matches value expected to number of digits. Performs a system exit on failure. Used in input files in the test suite.

`compare_vectors`(expected, computed, digits, label)

  Function to compare two vectors. Prints `util.success()` when elements of vector computed match elements of vector expected to number of digits. Performs a system exit on failure to match symmetry structure, dimension, or element values. Used in input files in the test suite.

`copy_file_from_scratch`(filename, prefix, namespace, unit, move=False)

  Function to move file out of scratch with correct naming convention.

  Arguments:

  @arg filename full path to target file @arg prefix computation prefix, usually ‘psi’ @arg namespace context namespace, usually molecule name @arg unit unit number, e.g. 32 @arg move copy or move? (default copy)

  Example:

  Assume PID is 12345 and SCRATCH is /scratch/parrish/

  copy_file_to_scratch(‘temp’, ‘psi’, ‘h2o’, 32):
    -cp /scratch/parrish/psi.12345.h2o.32 .temp
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘h2o’, 32):
    -cp /scratch/parrish/psi.12345.h2o.32 /tmp/temp
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘’, 32):
    -cp /scratch/parrish/psi.12345.32 /tmp/temp
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘’, 32, True):
    -mv /scratch/parrish/psi.12345.32 /tmp/temp

`copy_file_to_scratch`(filename, prefix, namespace, unit, move=False)

  Function to move file into scratch with correct naming convention.

  Arguments:

  @arg filename full path to file @arg prefix computation prefix, usually ‘psi’ @arg namespace context namespace, usually molecule name @arg unit unit number, e.g. 32 @arg move copy or move? (default copy)

  Example:

  Assume PID is 12345 and SCRATCH is /scratch/parrish/

  copy_file_to_scratch(‘temp’, ‘psi’, ‘h2o’, 32):
    -cp ./temp /scratch/parrish/psi.12345.h2o.32
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘h2o’, 32):
    -cp /tmp/temp /scratch/parrish/psi.12345.h2o.32
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘’, 32):
    -cp /tmp/temp /scratch/parrish/psi.12345.32
  copy_file_to_scratch(‘/tmp/temp’, ‘psi’, ‘’, 32, True):
    -mv /tmp/temp /scratch/parrish/psi.12345.32

`csx2endict`()

  Grabs the CSX file as a dictionary, encodes translation of PSI variables to XML blocks, gathers all available energies from CSX file into returned dictionary.

`cubefile`(filename='psi4.cube', nptsx=50, nptsy=50, nptsz=50, buffer_size=5.0, prop='density', **kwargs)

`cubeprop`(*args, **kwargs)

  Evaluate properties on a grid and generate cube files.

`getFromDict`(dataDict, mapList)

`get_memory`()

  Function to return the total memory allocation.

`get_num_threads`()

  Function to return the number of threads to parallelize across.

`oeprop`(*args, **kwargs)

`set_memory`(bytes)

  Function to reset the total memory allocation.

`set_num_threads`(nthread)

  Function to reset the number of threads to parallelize across.

`success`(label)

  Function to print a ‘label...PASSED’ line to screen. Used by `util.compare_values()` family when functions pass.

`xml2dict`(filename=None)

  Read XML filename into nested OrderedDict-s. filename defaults to active CSX file.

class `Table`(rows=(), row_label_width=10, row_label_precision=4, cols=(), width=16, precision=10)

  Class defining a flexible Table object for storing data.

  `absolute_to_relative`(Factor=627.5095)

    Function to shift the data of each column of the Table object such that the lowest value is zero. A scaling factor of Factor is applied.

  `copy`()

    Function to return a copy of the Table object.

  `format_label`()

    Function to pad the width of Table object labels.

  `format_values`(values)

    Function to pad the width of Table object data cells.

  `save`(file)

    Function to save string of the Table object to file.

  `scale`(Factor=627.5095)

    Function to apply a scaling factor Factor to the data of the Table object.

`banner`(text, type=1, width=35, strNotOutfile=False)

  Function to print text to output file in a banner of minimum width width and minimum three-line height for type = 1 or one-line height for type = 2. If strNotOutfile is True, function returns string rather than printing it to output file.

`find_approximate_string_matches`(seq1, options, max_distance)

  Function to compute approximate string matches from a list of options.

`levenshtein`(seq1, seq2)

  Function to compute the Levenshtein distance between two strings.

`print_stderr`(stuff)

  Function to print stuff to standard error stream.

`print_stdout`(stuff)

  Function to print stuff to standard output stream.

Module with utility functions used by several Python functions.

`all_casings`(input_string)

  Function to return a generator of all lettercase permutations of input_string.

`drop_duplicates`(seq)

  Function that given an array seq, returns an array without any duplicate entries. There is no guarantee of which duplicate entry is dropped.

`extract_sowreap_from_output`(sowout, quantity, sownum, linkage, allvital=False)

  Function to examine file sowout from a sow/reap distributed job for formatted line with electronic energy information about index sownum to be used for construction of quantity computations as directed by master input file with linkage kwarg. When file sowout is missing or incomplete files, function will either return zero (allvital is `False`) or terminate (allvital is `True`) since some sow/reap procedures can produce meaningful results (database) from an incomplete set of sown files, while others cannot (gradient, hessian).

`format_currentstate_for_input`(func, name, allButMol=False, **kwargs)

  Function to return an input file in preprocessed psithon. Captures memory, molecule, options, function, method, and kwargs. Used to write distributed (sow/reap) input files.

`format_kwargs_for_input`(filename, lmode=1, **kwargs)

  Function to pickle to file filename the options dictionary kwargs. Mode lmode =2 pickles appropriate settings for reap mode. Used to capture Python options information for distributed (sow/reap) input files.

`format_molecule_for_input`(mol, name='')

  Function to return a string of the output of `inputparser.process_input()` applied to the XYZ format of molecule, passed as either fragmented geometry string mol or molecule instance mol. Used to capture molecule information from database modules and for distributed (sow/reap) input files. For the reverse, see `molutil.geometry()`.

`format_options_for_input`()

  Function to return a string of commands to replicate the current state of user-modified options. Used to capture C++ options information for distributed (sow/reap) input files.

  Caution

  Some features are not yet implemented. Buy a developer a coffee.

  - Does not cover local (as opposed to global) options.

`get_psifile`(fileno, pidspace='21064')

  Function to return the full path and filename for psi file fileno (e.g., psi.32) in current namespace pidspace.

`getattr_ignorecase`(module, attr)

  Function to extract attribute attr from module if attr is available in any possible lettercase permutation. Returns attribute if available, None if not.

`import_ignorecase`(module)

  Function to import module in any possible lettercase permutation. Returns module object if available, None if not.

`kwargs_lower`(kwargs)

  Function to rebuild and return kwargs dictionary with all keys made lowercase. Should be called by every function that could be called directly by the user.

`mat2arr`(mat)

  Function to convert psi4.Matrix mat to Python array of arrays. Expects psi4.Matrix to be flat with respect to symmetry.

`prepare_options_for_modules`(changedOnly=False, commandsInsteadDict=False)

  Function to return a string of commands to replicate the current state of user-modified options. Used to capture C++ options information for distributed (sow/reap) input files.

  Caution

  Some features are not yet implemented. Buy a developer a coffee.

  - Need some option to get either all or changed
  - Need some option to either get dict or set string or psimod command list
  - command return doesn’t revoke has_changed setting for unchanged with changedOnly=False

Module to provide mechanism to store and restore option states in driver.

class `OptionState`(option, module=None)

  Class to store the state of a single option. If module given, the option value and has_changed value is stored for global, local to module, and used by module scopes; otherwise (used for BASIS keywords), only global scope is stored. Class can store, print, and restore option values.

      >>> OptionState('SCF_TYPE', 'SCF')

      >>> print(OptionState('DF_BASIS_MP2'))

  `restore`()

class `OptionsState`(*largs)

  Class to contain multiple `OptionsState()` objects. Used in python driver functions to collect several options before altering them, then restoring before function return.

      >>> optstash = OptionsState(
              ['SCF', 'DFT_FUNCTIONAL'],
              ['DF_BASIS_SCF'],
              ['SCF', 'SCF_TYPE'],
              ['SCF', 'REFERENCE'])

      >>> print(optstash)

      >>> optstash.restore()

  `restore`()

## p4const