-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
250 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
test_linux_x86-64: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Packages | ||
run: sudo apt install -y libboost-dev libeigen3-dev | ||
|
||
- name: Build Libint | ||
run: ./script/libint.sh | ||
|
||
- name: Configure Acorn | ||
run: cmake -B build -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=g++ | ||
|
||
- name: Build Acorn | ||
run: | | ||
export CPLUS_INCLUDE_PATH="$PWD/libint/install/include:$CPLUS_INCLUDE_PATH" | ||
export LIBRARY_PATH="$PWD/libint/install/lib:$LIBRARY_PATH" | ||
cmake --build build --parallel 2 | ||
- name: Run Tests | ||
working-directory: build | ||
run: ctest --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
add_test(NAME water_0-1_mini_rhf_energy COMMAND ${PROJECT_SOURCE_DIR}/bin/test/test_rhf water sto-3g) | ||
set_tests_properties(water_0-1_mini_rhf_energy PROPERTIES PASS_REGULAR_EXPRESSION "-74.96590119") | ||
|
||
add_test(NAME water_0-1_mini_mp2_energy COMMAND ${PROJECT_SOURCE_DIR}/bin/test/test_mp2 water sto-3g) | ||
set_tests_properties(water_0-1_mini_mp2_energy PROPERTIES PASS_REGULAR_EXPRESSION "-75.00485492") | ||
|
||
add_test(NAME water_0-1_mini_fci_energy COMMAND ${PROJECT_SOURCE_DIR}/bin/test/test_fci water sto-3g) | ||
set_tests_properties(water_0-1_mini_fci_energy PROPERTIES PASS_REGULAR_EXPRESSION "-75.02041033") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "acorn.h" | ||
|
||
int main(int argc, char** argv) { | ||
// get executable path for the executable to run from anywhere | ||
auto path = std::filesystem::weakly_canonical(argv[0]).parent_path(); | ||
|
||
// create the molecule stream | ||
std::ifstream mstream(path / "../molecule/water.xyz"); | ||
|
||
// create the molecule and integral container | ||
System system(mstream, "sto-3g"); Integrals ints(true); | ||
|
||
// calculate all the atomic integrals | ||
ints.S = Integral::Overlap(system); ints.T = Integral::Kinetic(system); | ||
ints.V = Integral::Nuclear(system); ints.J = Integral::Coulomb(system); | ||
|
||
// run the restricted Hartree-Fock calculation | ||
Result res = RestrictedHartreeFock().run(system, ints, {}, false); | ||
|
||
// transform the one electron integrals to the MS basis | ||
ints.Tms = Transform::SingleSpin(ints.T, res.rhf.C); | ||
ints.Vms = Transform::SingleSpin(ints.V, res.rhf.C); | ||
|
||
// transform the coulomb integrals to the MS basis | ||
ints.Jms = Transform::CoulombSpin(ints.J, res.rhf.C); | ||
|
||
// perform the FCI calculation | ||
res = RestrictedConfigurationInteraction().run(system, ints, res, false); | ||
|
||
// print the total energy | ||
std::printf("%.8f\n", res.Etot); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "acorn.h" | ||
|
||
int main(int argc, char** argv) { | ||
// get executable path for the executable to run from anywhere | ||
auto path = std::filesystem::weakly_canonical(argv[0]).parent_path(); | ||
|
||
// create the molecule stream | ||
std::ifstream mstream(path / "../molecule/water.xyz"); | ||
|
||
// create the molecule and integral container | ||
System system(mstream, "sto-3g"); Integrals ints(true); | ||
|
||
// calculate all the atomic integrals | ||
ints.S = Integral::Overlap(system); ints.T = Integral::Kinetic(system); | ||
ints.V = Integral::Nuclear(system); ints.J = Integral::Coulomb(system); | ||
|
||
// run the restricted Hartree-Fock calculation | ||
Result res = RestrictedHartreeFock().run(system, ints, {}, false); | ||
|
||
// transform the coulomb integrals to the MO basis | ||
ints.Jmo = Transform::Coulomb(ints.J, res.rhf.C); | ||
|
||
// perform the MP2 calculation | ||
res = RestrictedMollerPlesset().run(system, ints, res, false); | ||
|
||
// print the total energy | ||
std::printf("%.8f\n", res.Etot); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "../bin/acorn.h" | ||
|
||
int main(int argc, char** argv) { | ||
// throw an error if the number of arguments is incorrect | ||
if (argc != 3) throw std::runtime_error("INCORRECT NUMBER OF ARGUMENTS"); | ||
|
||
// get executable path for the executable to run from anywhere | ||
auto path = std::filesystem::weakly_canonical(argv[0]).parent_path(); | ||
|
||
// create the molecule stream | ||
std::ifstream mstream(path / "../../example/molecule" / (argv[1] + std::string(".xyz"))); | ||
|
||
// create the molecule and integral container | ||
System system(mstream, argv[2]); Integrals ints(true); | ||
|
||
// calculate all the atomic integrals | ||
ints.S = Integral::Overlap(system); ints.T = Integral::Kinetic(system); | ||
ints.V = Integral::Nuclear(system); ints.J = Integral::Coulomb(system); | ||
|
||
// run the restricted Hartree-Fock calculation | ||
Result res = RestrictedHartreeFock().run(system, ints, {}, false); | ||
|
||
// transform the one electron integrals to the MS basis | ||
ints.Tms = Transform::SingleSpin(ints.T, res.rhf.C); | ||
ints.Vms = Transform::SingleSpin(ints.V, res.rhf.C); | ||
|
||
// transform the coulomb integrals to the MS basis | ||
ints.Jms = Transform::CoulombSpin(ints.J, res.rhf.C); | ||
|
||
// perform the FCI calculation | ||
res = RestrictedConfigurationInteraction().run(system, ints, res, false); | ||
|
||
// print the total energy | ||
std::printf("%.8f\n", res.Etot); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "../bin/acorn.h" | ||
|
||
int main(int argc, char** argv) { | ||
// throw an error if the number of arguments is incorrect | ||
if (argc != 3) throw std::runtime_error("INCORRECT NUMBER OF ARGUMENTS"); | ||
|
||
// get executable path for the executable to run from anywhere | ||
auto path = std::filesystem::weakly_canonical(argv[0]).parent_path(); | ||
|
||
// create the molecule stream | ||
std::ifstream mstream(path / "../../example/molecule" / (argv[1] + std::string(".xyz"))); | ||
|
||
// create the molecule and integral container | ||
System system(mstream, argv[2]); Integrals ints(true); | ||
|
||
// calculate all the atomic integrals | ||
ints.S = Integral::Overlap(system); ints.T = Integral::Kinetic(system); | ||
ints.V = Integral::Nuclear(system); ints.J = Integral::Coulomb(system); | ||
|
||
// run the restricted Hartree-Fock calculation | ||
Result res = RestrictedHartreeFock().run(system, ints, {}, false); | ||
|
||
// transform the coulomb integrals to the MO basis | ||
ints.Jmo = Transform::Coulomb(ints.J, res.rhf.C); | ||
|
||
// perform the MP2 calculation | ||
res = RestrictedMollerPlesset().run(system, ints, res, false); | ||
|
||
// print the total energy | ||
std::printf("%.8f\n", res.Etot); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "../bin/acorn.h" | ||
|
||
int main(int argc, char** argv) { | ||
// throw an error if the number of arguments is incorrect | ||
if (argc != 3) throw std::runtime_error("INCORRECT NUMBER OF ARGUMENTS"); | ||
|
||
// get executable path for the executable to run from anywhere | ||
auto path = std::filesystem::weakly_canonical(argv[0]).parent_path(); | ||
|
||
// create the molecule stream | ||
std::ifstream mstream(path / "../../example/molecule" / (argv[1] + std::string(".xyz"))); | ||
|
||
// create the molecule and integral container | ||
System system(mstream, argv[2]); Integrals ints(true); | ||
|
||
// calculate all the atomic integrals | ||
ints.S = Integral::Overlap(system); ints.T = Integral::Kinetic(system); | ||
ints.V = Integral::Nuclear(system); ints.J = Integral::Coulomb(system); | ||
|
||
// run the restricted Hartree-Fock calculation | ||
Result res = RestrictedHartreeFock().run(system, ints, {}, false); | ||
|
||
// print the total energy | ||
std::printf("%.8f\n", res.Etot); | ||
} |