set_variable¶
- psi4.core.set_variable(key, val)¶
Sets scalar or array QCVariable key to val in global memory.
- Parameters:
key (
str) – Case-insensitive key to global double orMatrixstorage maps.val (
Union[Matrix,ndarray,float]) – Scalar or array to be stored in key. Ifndarrayand data key does not naturally fit in 2D Matrix (often charge and multipole QCVariables), it will be reshaped, as allndarrayare stored asMatrix.
- Raises:
ValidationError – If val is a scalar but key already exists as an array variable. Or if val is an array but key already exists as a scalar variable.
- Return type: