Working on Nuc

This commit is contained in:
Anthony Scemama 2018-02-05 23:31:46 +01:00
parent 6b83e80572
commit db46395e4e
3 changed files with 12 additions and 13 deletions

View File

@ -25,8 +25,8 @@ let zero_m ~maxm ~expo_pq_inv ~norm_pq_sq =
(** Compute all the integrals of a contracted class *) (** Compute all the integrals of a contracted class *)
let contracted_class_shell_pair shell_p nucl_coord : float Zmap.t = let contracted_class_shell_pair shell_p geometry: float Zmap.t =
OneElectronRR.contracted_class_shell_pair ~zero_m shell_p nucl_coord OneElectronRR.contracted_class_shell_pair ~zero_m shell_p geometry
let cutoff2 = cutoff *. cutoff let cutoff2 = cutoff *. cutoff
@ -46,7 +46,7 @@ let index i j k l =
(** Write all integrals to a file with the <ij|kl> convention *) (** Write all integrals to a file with the <ij|kl> convention *)
let to_file ~filename basis nucl_coord = let to_file ~filename basis geometry =
let to_int_tuple x = let to_int_tuple x =
let open Zkey in let open Zkey in
match to_int_tuple Kind_3 x with 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 *) (* Compute all the integrals of the class *)
let cls = let cls =
contracted_class_shell_pair shell_p nucl_coord contracted_class_shell_pair shell_p geometry
in in
(* Write the data in the output file *) (* Write the data in the output file *)

View File

@ -123,7 +123,7 @@ let hvrr_one_e
(** Computes all the one-electron integrals of the contracted shell pair *) (** 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 let shell_a = shell_p.(0).Shell_pair.shell_a
and shell_b = shell_p.(0).Shell_pair.shell_b 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) Coordinate.(center_ab |- shell_a.Contracted_shell.center)
in 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 = let center_pc =
Coordinate.(shell_p.(ab).Shell_pair.center |- nucl_coord.(c) ) Coordinate.(shell_p.(ab).Shell_pair.center |- nucl_coord )
in in
let norm_pq_sq = let norm_pq_sq =
Coordinate.dot center_pc center_pc 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 = let integral =
zero_m_array.(0) zero_m_array.(0)
in 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 map = Zmap.create (2*maxm) in
let norm_coef_scale = norm_coef_scale_p 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) (center_ab, center_pa, center_pc)
map map
in in
contracted_class.(i) <- contracted_class.(i) +. coef_prod *. integral contracted_class.(i) <- contracted_class.(i) -. coef_prod *. integral *. charge
) )
done done
end end

View File

@ -31,10 +31,7 @@ let run ~out =
Overlap.to_file ~filename:(out_file^".overlap") basis Overlap.to_file ~filename:(out_file^".overlap") basis
ERI.to_file ~filename:(out_file^".eri") basis ERI.to_file ~filename:(out_file^".eri") basis
*) *)
let nucl_coord = NucInt.to_file ~filename:(out_file^".nuc") basis nuclei
Array.map (fun (_,c) -> c) nuclei
in
NucInt.to_file ~filename:(out_file^".nuc") basis nucl_coord
let () = let () =