This commit is contained in:
Anthony Scemama 2020-05-05 00:29:00 +02:00
parent 0094b36c86
commit 520e4fc1c4
9 changed files with 61 additions and 49 deletions

View File

@ -1,5 +1,7 @@
EXCLUDE_QUERY_DIR B _build/
B _build/** B _build/**
S . S .
S ./** S ./**
FLG -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs FLG -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs
PKG str unix bigarray lacaml alcotest zarith getopt

1
Basis/.merlin Normal file
View File

@ -0,0 +1 @@
REC

View File

@ -28,58 +28,66 @@ let f12_ints t = Lazy.force t.f12_ints
let f12_over_r12_ints t = Lazy.force t.f12_over_r12_ints let f12_over_r12_ints t = Lazy.force t.f12_over_r12_ints
let cartesian t = t.cartesian let cartesian t = t.cartesian
module Am = AngularMomentum
module Cs = ContractedShell module Cs = ContractedShell
let values t point = let values t point =
let result = Vec.create (Basis.size t.basis) in let result = Vec.create (Basis.size t.basis) in
Array.iter (fun shell -> Array.iter (fun shell ->
Cs.values shell point Cs.values shell point
|> Array.iteri |> Array.iteri
(fun i_c value -> (fun i_c value ->
let i = Cs.index shell + i_c + 1 in let i = Cs.index shell + i_c + 1 in
result.{i} <- value) result.{i} <- value)
) (Basis.contracted_shells t.basis); ) (Basis.contracted_shells t.basis);
result result
let make ~cartesian ~basis ?f12 nuclei = let make ~cartesian ~basis ?f12 nuclei =
let overlap =
lazy (
Overlap.of_basis basis
) in
let ortho =
lazy (
Orthonormalization.make ~cartesian ~basis (Lazy.force overlap)
) in
let overlap = lazy ( let eN_ints =
Overlap.of_basis basis lazy (
) in NucInt.of_basis_nuclei ~basis nuclei
) in
let ortho = lazy ( let kin_ints =
Orthonormalization.make ~cartesian ~basis (Lazy.force overlap) lazy (
) in KinInt.of_basis basis
) in
let eN_ints = lazy ( let ee_ints =
NucInt.of_basis_nuclei ~basis nuclei lazy (
) in ERI.of_basis basis
) in
let kin_ints = lazy ( let ee_lr_ints =
KinInt.of_basis basis lazy (
) in ERI_lr.of_basis basis
) in
let ee_ints = lazy ( let f12_ints =
ERI.of_basis basis lazy (
) in F12.of_basis basis
) in
let ee_lr_ints = lazy ( let f12_over_r12_ints =
ERI_lr.of_basis basis lazy (
) in ScreenedERI.of_basis basis
) in
let f12_ints = lazy ( let multipole =
F12.of_basis basis lazy (
) in Multipole.of_basis basis
) in
let f12_over_r12_ints = lazy (
ScreenedERI.of_basis basis
) in
let multipole = lazy (
Multipole.of_basis basis
) in
{ basis ; overlap ; multipole ; ortho ; eN_ints ; kin_ints ; ee_ints ; { basis ; overlap ; multipole ; ortho ; eN_ints ; kin_ints ; ee_ints ;
ee_lr_ints ; f12_ints ; f12_over_r12_ints ; cartesian ; ee_lr_ints ; f12_ints ; f12_over_r12_ints ; cartesian ;
@ -100,7 +108,7 @@ let test_case name t =
) )
in in
let check_eri title a r = let check_eri a r =
let f { ERI.i_r1 ; j_r2 ; k_r1 ; l_r2 ; value } = let f { ERI.i_r1 ; j_r2 ; k_r1 ; l_r2 ; value } =
(i_r1, (j_r2, (k_r1, (l_r2, value)))) (i_r1, (j_r2, (k_r1, (l_r2, value))))
in in
@ -109,7 +117,7 @@ let test_case name t =
Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-10))))))) "ERI" a r Alcotest.(check (list (pair int (pair int (pair int (pair int (float 1.e-10))))))) "ERI" a r
in in
let check_eri_lr title a r = let check_eri_lr a r =
let f { ERI_lr.i_r1 ; j_r2 ; k_r1 ; l_r2 ; value } = let f { ERI_lr.i_r1 ; j_r2 ; k_r1 ; l_r2 ; value } =
(i_r1, (j_r2, (k_r1, (l_r2, value)))) (i_r1, (j_r2, (k_r1, (l_r2, value))))
in in
@ -155,7 +163,7 @@ let test_case name t =
let ee_ints = let ee_ints =
Lazy.force t.ee_ints Lazy.force t.ee_ints
in in
check_eri "ee_ints" ee_ints reference check_eri ee_ints reference
; ;
in in
@ -167,7 +175,7 @@ let test_case name t =
let ee_lr_ints = let ee_lr_ints =
Lazy.force t.ee_lr_ints Lazy.force t.ee_lr_ints
in in
check_eri_lr "ee_lr_ints" ee_lr_ints reference check_eri_lr ee_lr_ints reference
in in
[ [
@ -177,7 +185,3 @@ let test_case name t =
"ee_ints", `Quick, test_ee_ints; "ee_ints", `Quick, test_ee_ints;
"ee_lr_ints", `Quick, test_ee_lr_ints; "ee_lr_ints", `Quick, test_ee_lr_ints;
] ]

View File

@ -18,7 +18,7 @@ module T = struct
let mu_erf = let mu_erf =
match z.mu_erf with match z.mu_erf with
| Some x -> x | Some x -> x
| None -> 0.5 (*TODO invalid_arg "mu_erf is None"*) | None -> 0.5 (* TODO invalid_arg "mu_erf is None" *)
in in
let m = mu_erf *. mu_erf in let m = mu_erf *. mu_erf in
let expo_pq_inv = z.expo_p_inv +. z.expo_q_inv in let expo_pq_inv = z.expo_p_inv +. z.expo_q_inv in

1
CI/.merlin Normal file
View File

@ -0,0 +1 @@
REC

1
MOBasis/.merlin Normal file
View File

@ -0,0 +1 @@
REC

1
Nuclei/.merlin Normal file
View File

@ -0,0 +1 @@
REC

1
Perturbation/.merlin Normal file
View File

@ -0,0 +1 @@
REC

View File

@ -26,6 +26,7 @@ val create : size:int -> ?temp_dir:string -> [< `Dense | `Sparse ] -> t
*) *)
(** {2 Accessors} *) (** {2 Accessors} *)
val get_chem : t -> int -> int -> int -> int -> float val get_chem : t -> int -> int -> int -> int -> float
(** Get an integral using the Chemist's convention {% $(ij|kl)$ %}. *) (** Get an integral using the Chemist's convention {% $(ij|kl)$ %}. *)