10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-17 08:30:22 +02:00
QCaml/perturbation/test/mp2.ml

39 lines
1.0 KiB
OCaml
Raw Normal View History

2021-01-01 16:39:33 +01:00
(* Tests *)
(* [[file:~/QCaml/perturbation/mp2.org::*Tests][Tests:1]] *)
2020-12-07 13:52:56 +01:00
open Alcotest
open Particles
let wd = Common.Qcaml.root ^ Filename.dir_sep ^ "test"
let tests =
[ "HF Water", `Quick, fun () ->
let nuclei =
wd ^ Filename.dir_sep ^ "water.xyz"
|> Nuclei.of_xyz_file
in
let basis_filename =
wd ^ Filename.dir_sep ^ "cc-pvdz"
in
let ao_basis =
Ao.Basis.of_nuclei_and_basis_filename ~kind:`Gaussian
~cartesian:false ~nuclei basis_filename
in
2021-01-01 16:39:33 +01:00
2020-12-07 13:52:56 +01:00
let simulation = Simulation.make ~nuclei ao_basis in
2021-01-01 16:39:33 +01:00
2020-12-07 13:52:56 +01:00
let hf = Mo.Hartree_fock.make ~guess:`Huckel simulation in
Format.printf "%a" (Mo.Hartree_fock.pp) hf;
2020-12-07 14:12:35 +01:00
check (float 2.e-10) "Energy" (-76.0267987005) (Mo.Hartree_fock.energy hf);
2021-01-01 16:39:33 +01:00
let mo_basis = Mo.Basis.of_hartree_fock hf in
let frozen_core = Mo.Frozen_core.(make Small nuclei) in
let e_mp2 = Perturbation.Mp2.make ~frozen_core mo_basis in
2020-12-07 14:12:35 +01:00
check (float 1.e-9) "MP2" (-0.2016211415) (e_mp2)
2020-12-07 13:52:56 +01:00
]
2021-01-01 16:39:33 +01:00
(* Tests:1 ends here *)