10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-11-03 20:54:00 +01:00

Added Input_full_ci.ml

This commit is contained in:
Anthony Scemama 2014-10-21 23:32:47 +02:00
parent 64022d88d7
commit ede29e4284
9 changed files with 141 additions and 11 deletions

View File

@ -10,5 +10,6 @@ include Input_cis;;
include Input_cisd_sc2;; include Input_cisd_sc2;;
include Input_determinants;; include Input_determinants;;
include Input_electrons;; include Input_electrons;;
include Input_full_ci;;

View File

@ -3,7 +3,17 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Ao_basis : sig module Ao_basis : sig
type t type t =
{ ao_basis : string ;
ao_num : AO_number.t ;
ao_prim_num : Strictly_positive_int.t array;
ao_prim_num_max : Strictly_positive_int.t;
ao_nucl : Nucl_number.t array;
ao_power : Symmetry.Xyz.t array;
ao_coef : float array;
ao_expo : Positive_float.t array;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct

View File

@ -3,7 +3,16 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Bielec_integrals : sig module Bielec_integrals : sig
type t type t =
{ read_ao_integrals : bool;
read_mo_integrals : bool;
write_ao_integrals : bool;
write_mo_integrals : bool;
threshold_ao : Positive_float.t;
threshold_mo : Positive_float.t;
direct : bool;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct

View File

@ -3,7 +3,13 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Bitmasks : sig module Bitmasks : sig
type t type t =
{ n_int : N_int_number.t;
bit_kind : Bit_kind.t;
n_mask_gen : Strictly_positive_int.t;
generators : int64 array;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct
@ -12,10 +18,6 @@ end = struct
bit_kind : Bit_kind.t; bit_kind : Bit_kind.t;
n_mask_gen : Strictly_positive_int.t; n_mask_gen : Strictly_positive_int.t;
generators : int64 array; generators : int64 array;
(*
n_mask_ref : Strictly_positive_int.t;
reference : int64 array;
*)
} }
;; ;;

View File

@ -3,7 +3,15 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Cis_dressed : sig module Cis_dressed : sig
type t type t =
{ n_state_cis : Strictly_positive_int.t;
n_core_cis : Positive_int.t;
n_act_cis : Positive_int.t;
mp2_dressing : bool;
standard_doubles : bool;
en_2_2 : bool;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct

View File

@ -3,7 +3,12 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Cisd_sc2 : sig module Cisd_sc2 : sig
type t type t =
{ n_det_max_cisd_sc2 : Strictly_positive_int.t;
pt2_max : Positive_float.t;
do_pt2_end : bool;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct

View File

@ -3,7 +3,23 @@ open Qputils;;
open Core.Std;; open Core.Std;;
module Determinants : sig module Determinants : sig
type t type t =
{ n_int : N_int_number.t;
bit_kind : Bit_kind.t;
mo_label : Non_empty_string.t;
n_det : Det_number.t;
n_states : States_number.t;
n_states_diag : States_number.t;
n_det_max_jacobi : Det_number.t;
threshold_generators : Positive_float.t;
threshold_selectors : Positive_float.t;
read_wf : bool;
expected_s2 : Positive_float.t;
s2_eig : bool;
psi_coef : Det_coef.t array;
psi_det : Determinant.t array;
}
;;
val read : unit -> t val read : unit -> t
val to_string : t -> string val to_string : t -> string
end = struct end = struct

72
ocaml/Input_full_ci.ml Normal file
View File

@ -0,0 +1,72 @@
open Qptypes;;
open Qputils;;
open Core.Std;;
module Full_ci : sig
type t =
{ n_det_max_fci : Strictly_positive_int.t;
pt2_max : Positive_float.t;
do_pt2_end : bool;
}
;;
val read : unit -> t
val to_string : t -> string
end = struct
type t =
{ n_det_max_fci : Strictly_positive_int.t;
pt2_max : Positive_float.t;
do_pt2_end : bool;
}
;;
let get_default = Qpackage.get_ezfio_default "full_ci";;
let read_n_det_max_fci () =
if not (Ezfio.has_full_ci_n_det_max_fci ()) then
get_default "n_det_max_fci"
|> Int.of_string
|> Ezfio.set_full_ci_n_det_max_fci
;
Ezfio.get_full_ci_n_det_max_fci ()
|> Strictly_positive_int.of_int
;;
let read_pt2_max () =
if not (Ezfio.has_full_ci_pt2_max ()) then
get_default "pt2_max"
|> Float.of_string
|> Ezfio.set_full_ci_pt2_max
;
Ezfio.get_full_ci_pt2_max ()
|> Positive_float.of_float
;;
let read_do_pt2_end () =
if not (Ezfio.has_full_ci_do_pt2_end ()) then
get_default "do_pt2_end"
|> Bool.of_string
|> Ezfio.set_full_ci_do_pt2_end
;
Ezfio.get_full_ci_do_pt2_end ()
;;
let read () =
{ n_det_max_fci = read_n_det_max_fci ();
pt2_max = read_pt2_max ();
do_pt2_end = read_do_pt2_end ();
}
;;
let to_string b =
Printf.sprintf "
n_det_max_fci = %s
pt2_max = %s
do_pt2_end = %s
"
(Strictly_positive_int.to_string b.n_det_max_fci)
(Positive_float.to_string b.pt2_max)
(Bool.to_string b.do_pt2_end)
end

View File

@ -47,4 +47,11 @@ let test_electrons () =
print_endline (Input.Electrons.to_string b); print_endline (Input.Electrons.to_string b);
;; ;;
test_electrons();; let test_fci () =
Ezfio.set_file "F2.ezfio" ;
let b = Input.Full_ci.read ()
in
print_endline (Input.Full_ci.to_string b);
;;
test_fci();;