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

Working on HF

This commit is contained in:
Anthony Scemama 2018-02-21 17:06:24 +01:00
parent 0455da3b46
commit 5fd94119f6
5 changed files with 23 additions and 4 deletions

View File

@ -143,7 +143,8 @@ let of_basis basis =
try Zmap.find cls key try Zmap.find cls key
with Not_found -> failwith "Bug in kinetic integrals" with Not_found -> failwith "Bug in kinetic integrals"
in in
result.{i_c,j_c} <- value result.{i_c,j_c} <- value;
result.{j_c,i_c} <- value;
) (Contracted_shell.powers shell.(i)); ) (Contracted_shell.powers shell.(i));
) (Contracted_shell.powers shell.(j)) ) (Contracted_shell.powers shell.(j))
done; done;

View File

@ -83,6 +83,7 @@ let of_basis_nuclei basis nuclei =
Zmap.find cls key Zmap.find cls key
in in
eni_array.{j_c,i_c} <- value; eni_array.{j_c,i_c} <- value;
eni_array.{i_c,j_c} <- value;
) (Contracted_shell.powers shell.(j)) ) (Contracted_shell.powers shell.(j))
) (Contracted_shell.powers shell.(i)); ) (Contracted_shell.powers shell.(i));
done; done;

View File

@ -116,7 +116,8 @@ let of_basis basis =
try Zmap.find cls key try Zmap.find cls key
with Not_found -> failwith "Bug in overlap integrals" with Not_found -> failwith "Bug in overlap integrals"
in in
result.{i_c,j_c} <- value result.{i_c,j_c} <- value;
result.{j_c,i_c} <- value;
) (Contracted_shell.powers shell.(i)); ) (Contracted_shell.powers shell.(i));
) (Contracted_shell.powers shell.(j)) ) (Contracted_shell.powers shell.(j))
done; done;
@ -143,3 +144,6 @@ let to_file ~filename overlap =
done; done;
close_out oc close_out oc

View File

@ -2,6 +2,7 @@ type t = {
basis : Basis.t; basis : Basis.t;
nuclei : Nuclei.t; nuclei : Nuclei.t;
overlap : Overlap.t lazy_t; overlap : Overlap.t lazy_t;
overlap_ortho : Orthonormalization.t lazy_t;
eN_ints : NucInt.t lazy_t; eN_ints : NucInt.t lazy_t;
kin_ints : KinInt.t lazy_t; kin_ints : KinInt.t lazy_t;
ee_ints : ERI.t lazy_t; ee_ints : ERI.t lazy_t;
@ -9,9 +10,12 @@ type t = {
} }
let make ~nuclei ~basis = let make ~nuclei ~basis =
let overlap =
lazy (Overlap.of_basis basis)
in
{ {
basis ; nuclei ; basis ; nuclei ; overlap ;
overlap = lazy (Overlap.of_basis basis); overlap_ortho = lazy (Orthonormalization.make (Lazy.force overlap));
eN_ints = lazy (NucInt.of_basis_nuclei basis nuclei); eN_ints = lazy (NucInt.of_basis_nuclei basis nuclei);
kin_ints = lazy (KinInt.of_basis basis); kin_ints = lazy (KinInt.of_basis basis);
ee_ints = lazy (ERI.of_basis basis); ee_ints = lazy (ERI.of_basis basis);

View File

@ -3,6 +3,7 @@ external erf_float : float -> float = "erf_float_bytecode" "erf_float" [@@unboxe
external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc] external erfc_float : float -> float = "erfc_float_bytecode" "erfc_float" [@@unboxed] [@@noalloc]
external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc] external gamma_float : float -> float = "gamma_float_bytecode" "gamma_float" [@@unboxed] [@@noalloc]
open Lacaml.D
open Constants open Constants
let factmax = 150 let factmax = 150
@ -152,3 +153,11 @@ let array_sum a =
let array_product a = let array_product a =
Array.fold_left ( *. ) 0. a Array.fold_left ( *. ) 0. a
let diagonalize_symm h =
let v = lacpy h in
let w = Vec.create (Mat.dim1 h) in
let result =
syevd ~vectors:true ~w v
in
v, result