Conversation
…microsoft/qdk-chemistry into feature_RL_Hamiltonian_refactor
… of hamiltonian containers
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
|
The density fitting is checked against DFMP2 correlation energy from Psi4. This is done in the ctest in test_hamiltonian.cpp: HamiltonianIntegrationTest.DensityFittedRestrictedO2MP2. However, the same is not achievable in pytest, because the function exposed to python is MP2Calculator.run(ansatz); which returns MP2 total energy. The total energy uses a reconstructed reference energy from the DensityFittedHamiltonian, providing a different SCF energy than the 4 center SCF energy. |
cpp/include/qdk/chemistry/data/hamiltonian_containers/density_fitted.hpp
Outdated
Show resolved
Hide resolved
cpp/include/qdk/chemistry/data/hamiltonian_containers/density_fitted.hpp
Outdated
Show resolved
Hide resolved
cpp/include/qdk/chemistry/data/hamiltonian_containers/density_fitted.hpp
Outdated
Show resolved
Hide resolved
cpp/include/qdk/chemistry/data/hamiltonian_containers/density_fitted.hpp
Show resolved
Hide resolved
cpp/include/qdk/chemistry/data/hamiltonian_containers/density_fitted.hpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/data/hamiltonian_containers/density_fitted.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/data/hamiltonian_containers/density_fitted.cpp
Outdated
Show resolved
Hide resolved
|
|
||
| namespace qcs = qdk::chemistry::scf; | ||
|
|
||
| namespace detail_df { |
There was a problem hiding this comment.
I would just call this detail, no need to differentiate between them.
There was a problem hiding this comment.
To be combined into util functions and shared among all HamiltonianCreators.
| auto scf_config = std::make_unique<qcs::SCFConfig>(); | ||
|
|
||
| // Create Integral Instance | ||
| auto eri = qcs::ERIMultiplexer::create(*internal_basis_set, *scf_config, 0.0); |
There was a problem hiding this comment.
To form the inactive fock properly (with the same rep as the ERIs), this should be a DF fock builder.
There was a problem hiding this comment.
More changed to be done. Don't resolve yet. Even though right now it's changed to be numerically correct (hopefully)
Density fitted hamiltonian is provided for post SCF calculations.
DensityFittedHamiltonianContaineris created for density fitted Hamiltonian in the MO space. The three center integrals are stored in memory, and unless get_two_body_integrals() are called, the 4 center integrals are never calculated or stored. If a user wants to obtain the three-center integrals,Hamiltonian.get_container().get_three_center_integrals()must be called, otherwiseHamiltonian.get_container().get_two_body_integrals()andHamiltonian.get_two_body_integrals()will give the constructed 4 center integrals. The 3 center integrals are stored in a matrix of sizen_aux * n_geminal, wheren_geminalisn_orb * n_orb, andn_auxis the number of auxiliary basis functions.microsoft::DensityFittedHamiltonianConstructoris created as a derived class ofalgorithm::HamiltonanConstructor. It can be created byHamiltonianConstructorFactory, then uponrun()createsHamiltoniancorresponding toDensityFittedHamiltonianContainer. Therun()function requires orbital and auxiliary basis set as parameters. Therun()function does not break the API for other Hamiltonian Constructors.ctestfor various Hamiltonian Containers (data) are done withTEST_P, which runs the same tests for each container. The integrated test for constructing the DF Hamiltonian is DFMP2, where normal MP2 used integrals reconstructed from DF Hamiltonian to obtain correlation energy, and the result is compared with Psi4.