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 orMatrix
storage maps.val (
Union
[Matrix
,ndarray
,float
]) – Scalar or array to be stored in key. Ifndarray
and data key does not naturally fit in 2D Matrix (often charge and multipole QCVariables), it will be reshaped, as allndarray
are 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: