Skip to content

Commit 68ff9e6

Browse files
authored
Adds More Unit Tests (#60)
* adds_tests * adds more tests
1 parent cb72f64 commit 68ff9e6

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

tests/cxx/integration_tests/driver/scf_driver.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,23 @@ TEMPLATE_LIST_TEST_CASE("SCFDriver", "", test_scf::float_types) {
2626
tensorwrapper::shape::Smooth shape_corr{};
2727
auto pcorr = make_contiguous<float_type>(shape_corr);
2828

29+
SECTION("He") {
30+
auto he = test_scf::make_he<simde::type::chemical_system>();
31+
auto aos = test_scf::he_aos().ao_basis_set();
32+
33+
// Correct energy is validated against Psi4
34+
pcorr.set_elem({}, float_type{-2.8077839566141960});
35+
simde::type::tensor corr(shape_corr, std::move(pcorr));
36+
const auto e = mm.template run_as<pt>("SCF Driver", aos, he);
37+
REQUIRE(approximately_equal(corr, e, 1E-6));
38+
}
39+
2940
SECTION("H2") {
3041
auto h2 = test_scf::make_h2<simde::type::chemical_system>();
3142
auto aos = test_scf::h2_aos().ao_basis_set();
3243

3344
SECTION("SCF") {
45+
// Correct energy is validated against Psi4
3446
pcorr.set_elem({}, float_type{-1.1167592336});
3547
simde::type::tensor corr(shape_corr, std::move(pcorr));
3648
const auto e = mm.template run_as<pt>("SCF Driver", aos, h2);
@@ -56,6 +68,7 @@ TEMPLATE_LIST_TEST_CASE("SCFDriver", "", test_scf::float_types) {
5668
}
5769

5870
SECTION("H2 Dimer") {
71+
// Correct energy is validated against Psi4
5972
simde::type::nucleus h0("H", 1ul, 1836.15, 0.0, 0.0, 0.0);
6073
simde::type::nucleus h1("H", 1ul, 1836.15, 0.0, 0.0, 1.39839);
6174
simde::type::nucleus h2("H", 1ul, 1836.15, 0.0, 0.0, 4.39839);
@@ -70,4 +83,27 @@ TEMPLATE_LIST_TEST_CASE("SCFDriver", "", test_scf::float_types) {
7083
simde::type::tensor corr(shape_corr, std::move(pcorr));
7184
REQUIRE(approximately_equal(corr, e, 1E-6));
7285
}
86+
87+
SECTION("Water") {
88+
using atom_t = simde::type::atom;
89+
using molecule_t = simde::type::molecule;
90+
const auto a2b = 1.8897259886; // Angstroms to bohrs
91+
const auto H_mass = 1822.877; // Hydrogen mass in atomic units
92+
const auto O_mass = 29166.037; // Oxygen mass in atomic units
93+
atom_t H0("H", 1ul, H_mass, -1.958940 * a2b, -0.032063 * a2b,
94+
0.725554 * a2b);
95+
atom_t H1("H", 1ul, H_mass, -0.607485 * a2b, 0.010955 * a2b,
96+
0.056172 * a2b);
97+
atom_t O0("O", 8ul, O_mass, -1.538963 * a2b, 0.004548 * a2b,
98+
-0.117331 * a2b);
99+
molecule_t water{H0, H1, O0};
100+
auto aos =
101+
mm.template run_as<simde::MolecularBasisSet>("STO-3G", water);
102+
103+
simde::type::chemical_system water_cs(water);
104+
auto e = mm.template run_as<pt>("SCF Driver", aos, water_cs);
105+
pcorr.set_elem({}, float_type{-74.9602586404361944});
106+
simde::type::tensor corr(shape_corr, std::move(pcorr));
107+
REQUIRE(approximately_equal(corr, e, 1E-6));
108+
}
73109
}

0 commit comments

Comments
 (0)