10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-07-22 18:57:31 +02:00

Added MD5 key in AOs for check in MOs

This commit is contained in:
Anthony Scemama 2014-12-25 23:53:29 +01:00
parent 177c6722ac
commit e3fff202b8
23 changed files with 84 additions and 40 deletions

View File

@ -279,7 +279,7 @@ S 1
P 1 P 1
1 0.0331000 1.0000000 1 0.0331000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 3 S 3
1 1054.9000000 0.0655410 1 1054.9000000 0.0655410
2 159.1950000 0.3840360 2 159.1950000 0.3840360

View File

@ -314,7 +314,7 @@ S 1
P 1 P 1
1 0.0778369 1.00000000 1 0.0778369 1.00000000
PHOSPHOROUS PHOSPHORUS
S 6 S 6
1 19413.3000000 0.0018516 1 19413.3000000 0.0018516
2 2909.4200000 0.0142062 2 2909.4200000 0.0142062

View File

@ -330,7 +330,7 @@ P 1
D 1 D 1
1 0.4500000 1.0000000 1 0.4500000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 6 S 6
1 19413.3000000 0.0018516 1 19413.3000000 0.0018516
2 2909.4200000 0.0142062 2 2909.4200000 0.0142062

View File

@ -3340,7 +3340,7 @@ G 2
1 0.5188000000 -1.01551992 1 0.5188000000 -1.01551992
2 0.2041000000 1.11150702 2 0.2041000000 1.11150702
PHOSPHOROUS PHOSPHORUS
S 17 S 17
1 296647.5500000000 -0.00027797 1 296647.5500000000 -0.00027797
2 42380.0300000000 -0.00091959 2 42380.0300000000 -0.00091959

View File

@ -1519,7 +1519,7 @@ D 5
4 0.1224809 0.11387560 4 0.1224809 0.11387560
5 0.0489924 -0.98489900 5 0.0489924 -0.98489900
PHOSPHOROUS PHOSPHORUS
S 17 S 17
1 296647.5500000 0.00006562 1 296647.5500000 0.00006562
2 42380.0300000 0.00046254 2 42380.0300000 0.00046254

View File

@ -2056,7 +2056,7 @@ F 4
3 0.1680153 -0.47263890 3 0.1680153 -0.47263890
4 0.0672061 1.1086961 4 0.0672061 1.1086961
PHOSPHOROUS PHOSPHORUS
S 17 S 17
1 296647.5500000 0.00006562 1 296647.5500000 0.00006562
2 42380.0300000 0.00046254 2 42380.0300000 0.00046254

View File

@ -578,7 +578,7 @@ D 1
D 1 D 1
1 0.0823000 1.0000000 1 0.0823000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 11 S 11
1 94840.0000000 0.255509D-03 1 94840.0000000 0.255509D-03
2 14220.0000000 0.198193D-02 2 14220.0000000 0.198193D-02

View File

@ -940,7 +940,7 @@ G 1
G 1 G 1
1 0.2120000 1.0000000 1 0.2120000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 13 S 13
1 615200.0000000 0.247450D-04 1 615200.0000000 0.247450D-04
2 92120.0000000 0.192465D-03 2 92120.0000000 0.192465D-03

View File

@ -750,7 +750,7 @@ F 1
F 1 F 1
1 0.1250000 1.0000000 1 0.1250000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 13 S 13
1 312400.0000000 0.576960D-04 1 312400.0000000 0.576960D-04
2 46800.0000000 0.448296D-03 2 46800.0000000 0.448296D-03

View File

@ -534,7 +534,7 @@ D 1
D 1 D 1
1 5.8060000 1.0000000 1 5.8060000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 11 S 11
1 94840.0000000 0.255509D-03 1 94840.0000000 0.255509D-03
2 14220.0000000 0.198193D-02 2 14220.0000000 0.198193D-02

View File

@ -995,7 +995,7 @@ G 1
G 1 G 1
1 8.5770000 1.0000000 1 8.5770000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 13 S 13
1 615200.0000000 0.247450D-04 1 615200.0000000 0.247450D-04
2 92120.0000000 0.192465D-03 2 92120.0000000 0.192465D-03

View File

@ -745,7 +745,7 @@ F 1
F 1 F 1
1 7.0010000 1.0000000 1 7.0010000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 13 S 13
1 312400.0000000 0.576960D-04 1 312400.0000000 0.576960D-04
2 46800.0000000 0.448296D-03 2 46800.0000000 0.448296D-03

View File

@ -642,7 +642,7 @@ D 1
F 1 F 1
1 0.3360000 1.0000000 1 0.3360000 1.0000000
PHOSPHOROUS PHOSPHORUS
S 13 S 13
1 312400.0000000 0.576960D-04 1 312400.0000000 0.576960D-04
2 46800.0000000 0.448296D-03 2 46800.0000000 0.448296D-03

View File

@ -242,7 +242,7 @@ P 1
P 1 P 1
1 0.10008513762 1.0000000 1 0.10008513762 1.0000000
PHOSPHOROUS PHOSPHORUS
S 5 S 5
1 8002.4795106 0.57503489302E-02 1 8002.4795106 0.57503489302E-02
2 1203.6813590 0.43007628959E-01 2 1203.6813590 0.43007628959E-01

View File

@ -22,7 +22,7 @@ determinants
threshold_generators 0.99 threshold_generators 0.99
threshold_selectors 0.999 threshold_selectors 0.999
read_wf False read_wf False
s2_eig True s2_eig False
full_ci full_ci
n_det_max_fci 10000 n_det_max_fci 10000

View File

@ -92,22 +92,6 @@ end = struct
|> Array.map ~f:AO_expo.of_float |> Array.map ~f:AO_expo.of_float
;; ;;
let read () =
if (Ezfio.has_ao_basis_ao_basis ()) then
Some
{ ao_basis = read_ao_basis ();
ao_num = read_ao_num () ;
ao_prim_num = read_ao_prim_num ();
ao_prim_num_max = read_ao_prim_num_max ();
ao_nucl = read_ao_nucl ();
ao_power = read_ao_power ();
ao_coef = read_ao_coef () ;
ao_expo = read_ao_expo () ;
}
else
None
;;
let to_long_basis b = let to_long_basis b =
let ao_num = AO_number.to_int b.ao_num in let ao_num = AO_number.to_int b.ao_num in
let gto_array = Array.init (AO_number.to_int b.ao_num) let gto_array = Array.init (AO_number.to_int b.ao_num)
@ -137,12 +121,41 @@ end = struct
(Array.to_list gto_array) (Array.to_list gto_array)
(Array.to_list b.ao_nucl) (Array.to_list b.ao_nucl)
;; ;;
let to_basis b = let to_basis b =
to_long_basis b to_long_basis b
|> Long_basis.to_basis |> Long_basis.to_basis
;; ;;
let to_md5 b =
let short_basis = to_basis b in
Basis.to_md5 short_basis
;;
let read () =
if (Ezfio.has_ao_basis_ao_basis ()) then
begin
let result =
{ ao_basis = read_ao_basis ();
ao_num = read_ao_num () ;
ao_prim_num = read_ao_prim_num ();
ao_prim_num_max = read_ao_prim_num_max ();
ao_nucl = read_ao_nucl ();
ao_power = read_ao_power ();
ao_coef = read_ao_coef () ;
ao_expo = read_ao_expo () ;
}
in
to_md5 result
|> MD5.to_string
|> Ezfio.set_ao_basis_ao_md5 ;
Some result
end
else
None
;;
let to_rst b = let to_rst b =
let print_sym = let print_sym =
let l = List.init (Array.length b.ao_power) ~f:( let l = List.init (Array.length b.ao_power) ~f:(
@ -198,11 +211,6 @@ Basis set ::
extract_basis s extract_basis s
;; ;;
let to_md5 b =
let short_basis = to_basis b in
Basis.to_md5 short_basis
;;
let to_string b = let to_string b =
Printf.sprintf " Printf.sprintf "
ao_basis = %s ao_basis = %s

View File

@ -8,6 +8,7 @@ module Mo_basis : sig
mo_label : MO_label.t; mo_label : MO_label.t;
mo_occ : MO_occ.t array; mo_occ : MO_occ.t array;
mo_coef : (MO_coef.t array) array; mo_coef : (MO_coef.t array) array;
ao_md5 : MD5.t;
} with sexp } with sexp
;; ;;
val read : unit -> t option val read : unit -> t option
@ -19,6 +20,7 @@ end = struct
mo_label : MO_label.t; mo_label : MO_label.t;
mo_occ : MO_occ.t array; mo_occ : MO_occ.t array;
mo_coef : (MO_coef.t array) array; mo_coef : (MO_coef.t array) array;
ao_md5 : MD5.t;
} with sexp } with sexp
;; ;;
@ -32,6 +34,26 @@ end = struct
|> MO_label.of_string |> MO_label.of_string
;; ;;
let read_ao_md5 () =
let ao_md5 =
match (Input_ao_basis.Ao_basis.read ()) with
| None -> failwith "Unable to read AO basis"
| Some result -> Input_ao_basis.Ao_basis.to_md5 result
in
let result =
if not (Ezfio.has_mo_basis_ao_md5 ()) then
begin
MD5.to_string ao_md5
|> Ezfio.set_mo_basis_ao_md5
end;
Ezfio.get_mo_basis_ao_md5 ()
|> MD5.of_string
in
if (ao_md5 <> result) then
failwith "The current MOs don't correspond to the current AOs.";
result
;;
let read_mo_tot_num () = let read_mo_tot_num () =
Ezfio.get_mo_basis_mo_tot_num () Ezfio.get_mo_basis_mo_tot_num ()
|> MO_number.of_int |> MO_number.of_int
@ -74,6 +96,7 @@ end = struct
mo_label = read_mo_label () ; mo_label = read_mo_label () ;
mo_occ = read_mo_occ (); mo_occ = read_mo_occ ();
mo_coef = read_mo_coef (); mo_coef = read_mo_coef ();
ao_md5 = read_ao_md5 ();
} }
else else
None None

View File

@ -20,13 +20,13 @@ let to_string = function
;; ;;
let of_string s = let of_string s =
match String.lowercase s with match String.lowercase (String.strip s) with
| "guess" -> Guess | "guess" -> Guess
| "canonical" -> Canonical | "canonical" -> Canonical
| "natural" -> Natural | "natural" -> Natural
| "localized" -> Localized | "localized" -> Localized
| "orthonormalized" -> Orthonormalized | "orthonormalized" -> Orthonormalized
| "none" -> None | "none" -> None
| _ -> failwith "MO_label should be one of: | _ -> (print_endline s ; failwith "MO_label should be one of:
Guess | Orthonormalized | Canonical | Natural | Localized | None." Guess | Orthonormalized | Canonical | Natural | Localized | None.")
;; ;;

View File

@ -159,6 +159,7 @@ let run ezfio_filename =
Hartree_fock ; Hartree_fock ;
Cisd_sc2 ; Cisd_sc2 ;
Full_ci ; Full_ci ;
Mo_basis;
Determinants ; Determinants ;
] ]
in in

View File

@ -7,5 +7,6 @@ ao_basis
ao_prim_num_max integer = maxval(ao_basis_ao_prim_num) ao_prim_num_max integer = maxval(ao_basis_ao_prim_num)
ao_coef double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max) ao_coef double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max)
ao_expo double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max) ao_expo double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max)
ao_md5 character*(32)

View File

@ -159,3 +159,12 @@ BEGIN_PROVIDER [ integer, ao_nucl, (ao_num)]
call ezfio_get_ao_basis_ao_nucl(ao_nucl) call ezfio_get_ao_basis_ao_nucl(ao_nucl)
END_PROVIDER END_PROVIDER
BEGIN_PROVIDER [ character*(32), ao_md5 ]
BEGIN_DOC
! MD5 key characteristic of the AO basis
END_DOC
implicit none
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_md5(ao_md5)
END_PROVIDER

View File

@ -3,4 +3,5 @@ mo_basis
mo_coef double precision (ao_basis_ao_num,mo_basis_mo_tot_num) mo_coef double precision (ao_basis_ao_num,mo_basis_mo_tot_num)
mo_label character*(64) mo_label character*(64)
mo_occ double precision (mo_basis_mo_tot_num) mo_occ double precision (mo_basis_mo_tot_num)
ao_md5 character*(32)

View File

@ -7,6 +7,7 @@ subroutine save_mos
call ezfio_set_mo_basis_mo_tot_num(mo_tot_num) call ezfio_set_mo_basis_mo_tot_num(mo_tot_num)
call ezfio_set_mo_basis_mo_label(mo_label) call ezfio_set_mo_basis_mo_label(mo_label)
call ezfio_set_mo_basis_ao_md5(ao_md5)
allocate ( buffer(ao_num,mo_tot_num) ) allocate ( buffer(ao_num,mo_tot_num) )
buffer = 0.d0 buffer = 0.d0
do j = 1, mo_tot_num do j = 1, mo_tot_num