10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Accelerated EZFIO in ocaml. === UPDATE EZFIO to 1.1.9 ===

This commit is contained in:
Anthony Scemama 2014-11-03 17:37:16 +01:00
parent 57b3a7702b
commit aa682e3311
6 changed files with 33 additions and 34 deletions

View File

@ -46,29 +46,29 @@ end = struct
;;
let read_ao_prim_num () =
(Ezfio.get_ao_basis_ao_prim_num () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_ao_basis_ao_prim_num ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:AO_prim_number.of_int
;;
let read_ao_prim_num_max () =
(Ezfio.get_ao_basis_ao_prim_num () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_ao_basis_ao_prim_num ()
|> Ezfio.flattened_ezfio
|> Array.fold ~f:(fun x y -> if x>y then x else y) ~init:0
|> AO_prim_number.of_int
;;
let read_ao_nucl () =
let nmax = Nucl_number.get_max () in
(Ezfio.get_ao_basis_ao_nucl () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_ao_basis_ao_nucl ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:(fun x-> Nucl_number.of_int ~max:nmax x)
;;
let read_ao_power () =
let x = Ezfio.get_ao_basis_ao_power () in
let dim = x.Ezfio.dim.(0) in
let data = Ezfio.flattened_ezfio_data x.Ezfio.data in
let data = Ezfio.flattened_ezfio x in
let result = Array.init dim ~f:(fun x -> "") in
for i=1 to dim
do
@ -83,14 +83,14 @@ end = struct
;;
let read_ao_coef () =
(Ezfio.get_ao_basis_ao_coef () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_ao_basis_ao_coef ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:AO_coef.of_float
;;
let read_ao_expo () =
(Ezfio.get_ao_basis_ao_expo () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_ao_basis_ao_expo ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:AO_expo.of_float
;;

View File

@ -72,8 +72,8 @@ end = struct
in
Ezfio.set_bitmasks_generators generators
end;
(Ezfio.get_bitmasks_generators ()).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_bitmasks_generators ()
|> Ezfio.flattened_ezfio
;;
let read () =

View File

@ -169,8 +169,8 @@ end = struct
Ezfio.ezfio_array_of_list ~rank:1 ~dim:[| 1 |] ~data:[1.]
|> Ezfio.set_determinants_psi_coef
;
(Ezfio.get_determinants_psi_coef ()).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_determinants_psi_coef ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:Det_coef.of_float
;;
@ -192,7 +192,7 @@ end = struct
(Bitlist.to_int64_list det_b) )
in
Ezfio.ezfio_array_of_list ~rank:3 ~dim:[| N_int_number.to_int n_int ; 2 ; 1 |] ~data:data
|> Ezfio.set_determinants_psi_det
|> Ezfio.set_determinants_psi_det ;
end ;
(*
let rec transform accu1 accu2 n_rest = function
@ -217,7 +217,7 @@ end = struct
let n_int = N_int_number.to_int n_int in
let psi_det_array = Ezfio.get_determinants_psi_det () in
let dim = psi_det_array.Ezfio.dim
and data = Ezfio.flattened_ezfio_data psi_det_array.Ezfio.data
and data = Ezfio.flattened_ezfio psi_det_array
in
assert (n_int = dim.(0));
assert (dim.(1) = 2);

View File

@ -51,14 +51,13 @@ end = struct
~dim:[| mo_tot_num |] ~data:data
|> Ezfio.set_mo_basis_mo_occ
end;
(Ezfio.get_mo_basis_mo_occ () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_occ () )
|> Array.map ~f:MO_occ.of_float
;;
let read_mo_coef () =
let a = (Ezfio.get_mo_basis_mo_coef () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
let a = Ezfio.get_mo_basis_mo_coef ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:MO_coef.of_float
in
let mo_tot_num = read_mo_tot_num () |> MO_number.to_int in

View File

@ -31,22 +31,22 @@ end = struct
;;
let read_nucl_label () =
(Ezfio.get_nuclei_nucl_label ()).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_nuclei_nucl_label ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:Element.of_string
;;
let read_nucl_charge () =
(Ezfio.get_nuclei_nucl_charge () ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_nuclei_nucl_charge ()
|> Ezfio.flattened_ezfio
|> Array.map ~f:Charge.of_float
;;
let read_nucl_coord () =
let nucl_num = Nucl_number.to_int (read_nucl_num ()) in
let raw_data =
(Ezfio.get_nuclei_nucl_coord() ).Ezfio.data
|> Ezfio.flattened_ezfio_data
Ezfio.get_nuclei_nucl_coord()
|> Ezfio.flattened_ezfio
in
let zero = Point3d.of_string Units.Bohr "0. 0. 0." in
let result = Array.create nucl_num zero in

View File

@ -52,8 +52,8 @@ let run_i ~action ezfio_filename =
let compute_charge () =
let input = Input.Electrons.read () in
let nucl_charge = Ezfio.((get_nuclei_nucl_charge ()).data)
|> Ezfio.flattened_ezfio_data |> Array.map ~f:(Float.to_int)
let nucl_charge = Ezfio.get_nuclei_nucl_charge ()
|> Ezfio.flattened_ezfio |> Array.map ~f:(Float.to_int)
and n_alpha = input.Input.Electrons.elec_alpha_num
|> Elec_alpha_number.to_int
and n_beta = input.Input.Electrons.elec_beta_num
@ -71,14 +71,14 @@ let run_i ~action ezfio_filename =
let create_molecule () =
let nucl_num = Ezfio.get_nuclei_nucl_num ()
and nucl_charge = Ezfio.((get_nuclei_nucl_charge ()).data)
|> Ezfio.flattened_ezfio_data
and nucl_coord = Ezfio.((get_nuclei_nucl_coord ()).data )
|> Ezfio.flattened_ezfio_data
and nucl_charge = Ezfio.get_nuclei_nucl_charge ()
|> Ezfio.flattened_ezfio
and nucl_coord = Ezfio.get_nuclei_nucl_coord ()
|> Ezfio.flattened_ezfio
in
let nucl_label =
if (Ezfio.has_nuclei_nucl_label ()) then
Ezfio.((get_nuclei_nucl_label ()).data) |> Ezfio.flattened_ezfio_data
Ezfio.get_nuclei_nucl_label () |> Ezfio.flattened_ezfio
else
Array.map ~f:(fun x-> x
|> Charge.of_float