10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-12-22 04:13:33 +01:00

Erf integrals correct, but mu needs to be checked

This commit is contained in:
Anthony Scemama 2020-03-26 19:49:29 +01:00
parent ffcccba188
commit 938935425f
6 changed files with 18 additions and 27 deletions

View File

@ -87,8 +87,7 @@ let test_case name t =
in in
let a = ERI.to_list a |> List.rev_map f |> List.rev in let a = ERI.to_list a |> List.rev_map f |> List.rev in
let r = ERI.to_list r |> List.rev_map f |> List.rev in let r = ERI.to_list r |> List.rev_map f |> List.rev in
Printf.eprintf "test \n%!"; Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-06))))))) "ERI" a r
Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-12))))))) "ERI" a r
in in
let check_eri_lr title a r = let check_eri_lr title a r =
@ -97,7 +96,7 @@ let test_case name t =
in in
let a = ERI_lr.to_list a |> List.rev_map f |> List.rev in let a = ERI_lr.to_list a |> List.rev_map f |> List.rev in
let r = ERI_lr.to_list r |> List.rev_map f |> List.rev in let r = ERI_lr.to_list r |> List.rev_map f |> List.rev in
Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-12))))))) "ERI_lr" a r Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-06))))))) "ERI_lr" a r
in in
let test_overlap () = let test_overlap () =

View File

@ -301,7 +301,7 @@ let rec hvrr_two_e
let contracted_class_shell_pair_couple ~zero_m shell_pair_couple : float Zmap.t = let contracted_class_shell_pair_couple ~zero_m ?mu_erf shell_pair_couple : float Zmap.t =
let maxm = Am.to_int (Cspc.ang_mom shell_pair_couple) in let maxm = Am.to_int (Cspc.ang_mom shell_pair_couple) in
@ -340,12 +340,11 @@ let contracted_class_shell_pair_couple ~zero_m shell_pair_couple : float Zmap.t
let norm_pq_sq = Co.dot center_pq center_pq in let norm_pq_sq = Co.dot center_pq center_pq in
let expo_p_inv = Psp.exponent_inv sp_ab in let expo_p_inv = Psp.exponent_inv sp_ab in
let expo_q_inv = Psp.exponent_inv sp_cd in let expo_q_inv = Psp.exponent_inv sp_cd in
let normalization = Psp.normalization sp_ab *. Psp.normalization sp_cd in let zero = Zp.zero ?mu_erf zero_m in
let zero = Zp.zero zero_m in
let zero_m_array = zero_m let zero_m_array = zero_m
{ zero with { zero with
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ; maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ;
center_pq ; center_pa ; center_qc ; normalization ; center_pq ; center_pa ; center_qc ;
} }
in in
@ -412,7 +411,7 @@ let contracted_class_shell_pair_couple ~zero_m shell_pair_couple : float Zmap.t
let contracted_class_atomic_shell_pair_couple ~zero_m atomic_shell_pair_couple : float Zmap.t = let contracted_class_atomic_shell_pair_couple ~zero_m ?mu_erf atomic_shell_pair_couple : float Zmap.t =
let maxm = Am.to_int (Aspc.ang_mom atomic_shell_pair_couple) in let maxm = Am.to_int (Aspc.ang_mom atomic_shell_pair_couple) in
@ -454,13 +453,12 @@ let contracted_class_atomic_shell_pair_couple ~zero_m atomic_shell_pair_couple :
let center_pa = Psp.center_minus_a sp_ab in let center_pa = Psp.center_minus_a sp_ab in
let norm_pq_sq = Co.dot center_pq center_pq in let norm_pq_sq = Co.dot center_pq center_pq in
let expo_q_inv = Psp.exponent_inv sp_cd in let expo_q_inv = Psp.exponent_inv sp_cd in
let normalization = Psp.normalization sp_ab *. Psp.normalization sp_cd in
let zero = Zp.zero zero_m in let zero = Zp.zero ?mu_erf zero_m in
let zero_m_array = zero_m let zero_m_array = zero_m
{ zero with { zero with
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ; maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ;
center_pq ; center_pa ; center_qc ; normalization ; center_pq ; center_pa ; center_qc ;
} }
in in

View File

@ -24,7 +24,7 @@ let at_least_one_valid arr =
Array.iter (fun x -> if (abs_float x > cutoff) then raise Found) arr ; false Array.iter (fun x -> if (abs_float x > cutoff) then raise Found) arr ; false
with Found -> true with Found -> true
type fou_idx_intermediate = type four_idx_intermediate =
{ {
expo_b : float array; expo_b : float array;
expo_d : float array; expo_d : float array;
@ -577,7 +577,7 @@ let hvrr_two_e_vector (angMom_a, angMom_b, angMom_c, angMom_d)
let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q : float Zmap.t = let contracted_class_shell_pairs ~zero_m ?mu_erf ?schwartz_p ?schwartz_q shell_p shell_q : float Zmap.t =
let sp = Csp.shell_pairs shell_p let sp = Csp.shell_pairs shell_p
and sq = Csp.shell_pairs shell_q and sq = Csp.shell_pairs shell_q
@ -651,16 +651,13 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
let norm_pq_sq = let norm_pq_sq =
Co.dot center_pq center_pq Co.dot center_pq center_pq
in in
let normalization = Psp.normalization sp.(i-1) *.
Psp.normalization sq.(i-1)
in
let zero = Zp.zero zero_m in let zero = Zp.zero ?mu_erf zero_m in
let zero_m_array = let zero_m_array =
zero_m zero_m
{zero with {zero with
expo_p_inv ; expo_q_inv ; norm_pq_sq ; expo_p_inv ; expo_q_inv ; norm_pq_sq ;
center_pq ; center_pa ; center_qc ; normalization ; center_pq ; center_pa ; center_qc ;
} }
in in
zero_m_array.(0) zero_m_array.(0)
@ -786,15 +783,11 @@ let contracted_class_shell_pairs ~zero_m ?schwartz_p ?schwartz_q shell_p shell_q
let norm_pq_sq = let norm_pq_sq =
x *. x +. y *. y +. z *. z x *. x +. y *. y +. z *. z
in in
let normalization = Psp.normalization shell_ab *. let zero = Zp.zero ?mu_erf zero_m in
Psp.normalization shell_cd
in
let zero = Zp.zero zero_m in
zero_m {zero with zero_m {zero with
maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ; maxm ; expo_p_inv ; expo_q_inv ; norm_pq_sq ;
center_pq = Coordinate.make Coordinate.{x ; y ; z} ; center_pq = Coordinate.make Coordinate.{x ; y ; z} ;
center_pa ; center_qc = center_qc_tmp.(cd) ; center_pa ; center_qc = center_qc_tmp.(cd) ;
normalization ;
} }
) sq ) sq
in in

View File

@ -3,7 +3,6 @@ type t =
expo_p_inv : float ; expo_p_inv : float ;
expo_q_inv : float ; expo_q_inv : float ;
norm_pq_sq : float ; norm_pq_sq : float ;
normalization : float ;
maxm : int ; maxm : int ;
center_pq : Coordinate.t ; center_pq : Coordinate.t ;
center_pa : Coordinate.t ; center_pa : Coordinate.t ;
@ -22,8 +21,9 @@ let zero ?f12_factor ?mu_erf zero_m_func =
expo_p_inv = 0.; expo_p_inv = 0.;
expo_q_inv = 0.; expo_q_inv = 0.;
norm_pq_sq = 0.; norm_pq_sq = 0.;
normalization = 0.;
center_pq = Coordinate.zero ; center_pq = Coordinate.zero ;
center_pa = Coordinate.zero ; center_pa = Coordinate.zero ;
center_qc = Coordinate.zero ; center_qc = Coordinate.zero ;
} }

View File

@ -60,6 +60,7 @@ let of_filenames ?(cartesian=false) ?(multiplicity=1) ?(charge=0) ?f12 ?mu_erf ~
let basis = let basis =
Basis.of_nuclei_and_basis_filenames ~nuclei (basis_filename :: aux_basis_filenames) Basis.of_nuclei_and_basis_filenames ~nuclei (basis_filename :: aux_basis_filenames)
in in
lazy (make ?mu_erf ?f12 ~cartesian ~charge ~multiplicity ~nuclei basis) lazy (make ?mu_erf ?f12 ~cartesian ~charge ~multiplicity ~nuclei basis)
|> Parallel.broadcast |> Parallel.broadcast

View File

@ -22,12 +22,12 @@ let () =
(* LiH / cc-pVTZ *) (* LiH / cc-pVTZ *)
let test_integrals_lih = let test_integrals_lih =
let basis_file = "test_files/cc-pvtz" let basis_file = "test_files/cc-pvdz"
and nuclei_file = "test_files/lih.xyz" and nuclei_file = "test_files/lih.xyz"
in in
let simulation_closed_shell = let simulation_closed_shell =
Simulation.of_filenames ~charge:0 ~cartesian:true ~multiplicity:1 ~nuclei:nuclei_file basis_file Simulation.of_filenames ~mu_erf:0.5 ~charge:0 ~cartesian:true ~multiplicity:1 ~nuclei:nuclei_file basis_file
in in
let ao_basis = let ao_basis =