10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-07 14:43:41 +01:00
QCaml/Basis/AtomicShellPairCouple.ml

73 lines
2.4 KiB
OCaml
Raw Normal View History

2018-03-22 00:29:14 +01:00
open Util
2018-03-21 19:43:49 +01:00
type t =
{
2019-02-26 12:47:23 +01:00
contracted_shell_pair_couples : ContractedShellPairCouple.t list ;
2018-03-21 19:43:49 +01:00
atomic_shell_pair_p: AtomicShellPair.t ;
atomic_shell_pair_q: AtomicShellPair.t ;
atomic_shell_a : AtomicShell.t ;
atomic_shell_b : AtomicShell.t ;
atomic_shell_c : AtomicShell.t ;
atomic_shell_d : AtomicShell.t ;
2019-02-26 12:47:23 +01:00
ang_mom : AngularMomentum.t ;
2018-03-21 19:43:49 +01:00
}
module Am = AngularMomentum
module Co = Coordinate
module As = AtomicShell
module Asp = AtomicShellPair
module Cspc = ContractedShellPairCouple
let make ?(cutoff=Constants.epsilon) atomic_shell_pair_p atomic_shell_pair_q =
let ang_mom =
Am.(Asp.ang_mom atomic_shell_pair_p + Asp.ang_mom atomic_shell_pair_q)
in
let atomic_shell_a = Asp.atomic_shell_a atomic_shell_pair_p
and atomic_shell_b = Asp.atomic_shell_b atomic_shell_pair_p
and atomic_shell_c = Asp.atomic_shell_a atomic_shell_pair_q
and atomic_shell_d = Asp.atomic_shell_b atomic_shell_pair_q
in
let contracted_shell_pair_couples =
2020-03-26 17:43:11 +01:00
List.concat_map (fun ap_ab ->
2018-03-21 19:43:49 +01:00
List.map (fun ap_cd ->
ContractedShellPairCouple.make ~cutoff ap_ab ap_cd
) (Asp.contracted_shell_pairs atomic_shell_pair_q)
) (Asp.contracted_shell_pairs atomic_shell_pair_p)
2018-03-22 00:29:14 +01:00
|> list_some
2018-03-21 19:43:49 +01:00
in
match contracted_shell_pair_couples with
| [] -> None
| _ -> Some { atomic_shell_pair_p ; atomic_shell_pair_q ; ang_mom ;
atomic_shell_a ; atomic_shell_b ; atomic_shell_c ; atomic_shell_d ;
contracted_shell_pair_couples ;
}
let contracted_shell_pair_couples t = t.contracted_shell_pair_couples
let monocentric t =
Asp.monocentric t.atomic_shell_pair_p && Asp.monocentric t.atomic_shell_pair_q &&
As.center (Asp.atomic_shell_a t.atomic_shell_pair_p) = As.center (Asp.atomic_shell_a t.atomic_shell_pair_q)
let ang_mom t = t.ang_mom
let atomic_shell_pair_p t = t.atomic_shell_pair_p
let atomic_shell_pair_q t = t.atomic_shell_pair_q
let atomic_shell_a t = t.atomic_shell_a
let atomic_shell_b t = t.atomic_shell_b
let atomic_shell_c t = t.atomic_shell_c
let atomic_shell_d t = t.atomic_shell_d
let zkey_array t =
match t.contracted_shell_pair_couples with
| f::_ -> Cspc.zkey_array f
| _ -> invalid_arg "AtomicShellPairCouple.zkey_array"
let norm_scales t =
match t.contracted_shell_pair_couples with
| f::_ -> Cspc.norm_scales f
| _ -> invalid_arg "AtomicShellPairCouple.norm_scales"