ITADN
GQCG/GQCP/Issues

Coulomb and Exchange matrix python bindings

#1091OpenThiboVE 创建于 2025-10-10
PythonC++incremental
T
ThiboVEcommented
**What is missing** Currently GQCPy has no way of accessing the Coulomb and Exchange matrices of a HF method **Solution** Implement the python bindings: In [GQCP/gqcpy/include/interfaces.hpp](https://github.com/GQCG/GQCP/blob/develop/gqcpy/include/interfaces.hpp#L1221), add ```C .def( "calculateScalarBasisDirectMatrix", &Type::calculateScalarBasisDirectMatrix, py::arg("density_matrix"), py::arg("hamiltonian"), "Return the Coulomb matrix") .def( "calculateScalarBasisExchangeMatrix", &Type::calculateScalarBasisExchangeMatrix, py::arg("density_matrix"), py::arg("hamiltonian"), "Return the Exchange matrix") ``` To the "bindQCModelHartreeFockInterface" class This directly implements the bindings for all HF methods. To make this work, however, the RHF implementation in C++ needs to be changed. J and K are calculated directly in the "calculateScalarBasisFockMatrix" function, while they need to be put into their own function.
1 条评论