psi4.driver.p4util.plump_qcvar(val, shape_clue, ret='np')[source]

Prepare serialized QCVariable for set_variable() by converting flat arrays into shaped ones and floating strings.

  • val (Union[float, str, List]) – flat (?, ) list or scalar or string, probably from JSON storage.

  • shape_clue (str) – Label that includes (case insensitive) one of the following as a clue to the array’s natural dimensions: ‘gradient’, ‘hessian’

  • ret (str) – {‘np’, ‘psi4’} Whether for arrays to return numpy.ndarray or psi4.core.Matrix.


Reshaped array of type ret with natural dimensions of shape_clue.

Return type:

float or numpy.ndarray or Matrix