qcheff.operators.dense_operator¶
Module Contents¶
Classes¶
A dense matrix operator. |
API¶
- class DenseOperator¶
Bases:
qcheff.operators.operator_base.OperatorMatrixA dense matrix operator.
Parameters
op : qcheff_array The dense matrix operator. backend_module : ModuleType, optional The backend module of the operator. Defaults to the module of the input operator.
Attributes
op : qcheff_array The dense matrix operator. backend_module : ModuleType The backend module of the operator.
- op: qcheff.operators.operator_base.qcheff_dense_array¶
None
- backend_module: types.ModuleType¶
‘field(…)’
- save(filename: str) None¶
Save the operator to a file.
Parameters
filename : str The filename to save to.
- classmethod load(filename: str) qcheff.operators.dense_operator.DenseOperator¶
Load an operator from a file.
Parameters
filename : str The filename to load from.
Returns
op : DenseOperator The loaded operator.
Raises
FileNotFoundError If the file does not exist.
- to(backend: str) None¶
Convert the operator to a different backend.
Parameters
backend : str The backend to convert to.
Raises
ValueError If the conversion is not supported.
- diagonals() qcheff.operators.operator_base.qcheff_dense_array¶
Return the diagonal elements of the operator.
Returns
diagonals : qcheff_dense_array The diagonal elements of the operator.
- couplings() qcheff.operators.operator_base.qcheff_dense_array¶
Return the upper triangular elements of the operator.
Returns
couplings : qcheff_dense_array The upper triangular elements of the operator.