expand_psivars

psi4.driver.p4util.expand_psivars(pvdefs, verbose=None)[source]

From rules on building QCVariables from others, set new variables to P::e if all the contributors are available.

Parameters:
  • pvdefs (Dict[str, Dict[str, Union[List[str], Callable]]]) – Dictionary with keys with names of QCVariables to be created and values with dictionary of two keys: ‘args’, the QCVariables that contribute to the key and ‘func’, a function (or lambda) to combine them.

  • verbose (Optional[int]) – Control print level. If unspecified (None), value taken from PRINT. Status printing when verbose > 2.

Examples

>>> pv1 = dict()
>>> pv1['SAPT CCD DISP'] = {'func': lambda x: x[0] * x[1] + x[2] + x[3] + x[4],
                            'args': ['SAPT EXCHSCAL', 'SAPT EXCH-DISP20 ENERGY', 'SAPT DISP2(CCD) ENERGY',
                                 'SAPT DISP22(S)(CCD) ENERGY', 'SAPT EST.DISP22(T)(CCD) ENERGY']}
>>> pv1['SAPT0 ELST ENERGY'] = {'func': sum, 'args': ['SAPT ELST10,R ENERGY']}
>>> expand_psivars(pv1)