variable¶
- psi4.core.variable(key)¶
Return copy of scalar or array QCVariable key from global memory.
- Returns
Scalar variables are returned as floats. Array variables not naturally 2D (like multipoles) are returned as
numpy.ndarray
of natural dimensionality. Other array variables are returned asMatrix
and may have an extra dimension with symmetry information.- Return type
float or numpy.ndarray or Matrix
- Parameters
key (str) –
Example
>>> psi4.gradient("hf/cc-pvdz") >>> psi4.variable("CURRENT ENERGY") -100.00985995185668 >>> psi4.variable("CURRENT DIPOLE") array([ 0. , 0. , -0.83217802]) >>> psi4.variable("CURRENT GRADIENT") <psi4.core.Matrix object at 0x12d884fc0> >>> psi4.variable("CURRENT GRADIENT").np array([[ 6.16297582e-33, 6.16297582e-33, -9.41037138e-02], [-6.16297582e-33, -6.16297582e-33, 9.41037138e-02]])