From db46395e4eca8e7674546a008ed8d6b2c3268e5b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 5 Feb 2018 23:31:46 +0100 Subject: [PATCH] Working on Nuc --- Basis/NucInt.ml | 8 ++++---- Basis/OneElectronRR.ml | 12 +++++++----- run_integrals.ml | 5 +---- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Basis/NucInt.ml b/Basis/NucInt.ml index dd6d416..b6f490a 100644 --- a/Basis/NucInt.ml +++ b/Basis/NucInt.ml @@ -25,8 +25,8 @@ let zero_m ~maxm ~expo_pq_inv ~norm_pq_sq = (** Compute all the integrals of a contracted class *) -let contracted_class_shell_pair shell_p nucl_coord : float Zmap.t = - OneElectronRR.contracted_class_shell_pair ~zero_m shell_p nucl_coord +let contracted_class_shell_pair shell_p geometry: float Zmap.t = + OneElectronRR.contracted_class_shell_pair ~zero_m shell_p geometry let cutoff2 = cutoff *. cutoff @@ -46,7 +46,7 @@ let index i j k l = (** Write all integrals to a file with the convention *) -let to_file ~filename basis nucl_coord = +let to_file ~filename basis geometry = let to_int_tuple x = let open Zkey in match to_int_tuple Kind_3 x with @@ -87,7 +87,7 @@ let to_file ~filename basis nucl_coord = (* Compute all the integrals of the class *) let cls = - contracted_class_shell_pair shell_p nucl_coord + contracted_class_shell_pair shell_p geometry in (* Write the data in the output file *) diff --git a/Basis/OneElectronRR.ml b/Basis/OneElectronRR.ml index 26ae706..f4e4f66 100644 --- a/Basis/OneElectronRR.ml +++ b/Basis/OneElectronRR.ml @@ -123,7 +123,7 @@ let hvrr_one_e (** Computes all the one-electron integrals of the contracted shell pair *) -let contracted_class_shell_pair ~zero_m shell_p nucl_coord : float Zmap.t = +let contracted_class_shell_pair ~zero_m shell_p geometry : float Zmap.t = let shell_a = shell_p.(0).Shell_pair.shell_a and shell_b = shell_p.(0).Shell_pair.shell_b @@ -169,9 +169,11 @@ let contracted_class_shell_pair ~zero_m shell_p nucl_coord : float Zmap.t = Coordinate.(center_ab |- shell_a.Contracted_shell.center) in - for c=0 to Array.length nucl_coord - 1 do + for c=0 to Array.length geometry - 1 do + let element, nucl_coord = geometry.(c) in + let charge = Element.to_charge element |> Charge.to_float in let center_pc = - Coordinate.(shell_p.(ab).Shell_pair.center |- nucl_coord.(c) ) + Coordinate.(shell_p.(ab).Shell_pair.center |- nucl_coord ) in let norm_pq_sq = Coordinate.dot center_pc center_pc @@ -185,7 +187,7 @@ let contracted_class_shell_pair ~zero_m shell_p nucl_coord : float Zmap.t = let integral = zero_m_array.(0) in - contracted_class.(0) <- contracted_class.(0) +. coef_prod *. integral + contracted_class.(0) <- contracted_class.(0) -. coef_prod *. integral *. charge | _ -> let map = Zmap.create (2*maxm) in let norm_coef_scale = norm_coef_scale_p in @@ -206,7 +208,7 @@ let contracted_class_shell_pair ~zero_m shell_p nucl_coord : float Zmap.t = (center_ab, center_pa, center_pc) map in - contracted_class.(i) <- contracted_class.(i) +. coef_prod *. integral + contracted_class.(i) <- contracted_class.(i) -. coef_prod *. integral *. charge ) done end diff --git a/run_integrals.ml b/run_integrals.ml index 75641cc..545aaca 100644 --- a/run_integrals.ml +++ b/run_integrals.ml @@ -31,10 +31,7 @@ let run ~out = Overlap.to_file ~filename:(out_file^".overlap") basis ERI.to_file ~filename:(out_file^".eri") basis *) - let nucl_coord = - Array.map (fun (_,c) -> c) nuclei - in - NucInt.to_file ~filename:(out_file^".nuc") basis nucl_coord + NucInt.to_file ~filename:(out_file^".nuc") basis nuclei let () =