diff --git a/data/ezfio_defaults/.gitignore b/data/ezfio_defaults/.gitignore new file mode 100644 index 00000000..f88730c3 --- /dev/null +++ b/data/ezfio_defaults/.gitignore @@ -0,0 +1 @@ +*ezfio_interface_default \ No newline at end of file diff --git a/data/ezfio_defaults/bi_integrals.ezfio_default b/data/ezfio_defaults/bi_integrals.ezfio_default deleted file mode 100644 index 7cdf7a9b..00000000 --- a/data/ezfio_defaults/bi_integrals.ezfio_default +++ /dev/null @@ -1,9 +0,0 @@ -bielec_integrals - read_ao_integrals False - read_mo_integrals False - write_ao_integrals False - write_mo_integrals False - threshold_ao 1.e-15 - threshold_mo 1.e-15 - direct False - diff --git a/data/ezfio_defaults/cisd_sc2.ezfio_default b/data/ezfio_defaults/cisd_sc2.ezfio_default deleted file mode 100644 index 624ac35d..00000000 --- a/data/ezfio_defaults/cisd_sc2.ezfio_default +++ /dev/null @@ -1,5 +0,0 @@ -cisd_sc2_selected - n_det_max_cisd_sc2 10000 - pt2_max 1.e-4 - do_pt2_end True - diff --git a/ocaml/Input.ml b/ocaml/Input.ml index 62de42f8..49ac3152 100644 --- a/ocaml/Input.ml +++ b/ocaml/Input.ml @@ -4,9 +4,8 @@ open Core.Std;; include Input_ao_basis;; -include Input_bi_integrals;; +include Input_bielec_integrals;; include Input_bitmasks;; -include Input_cisd_sc2;; include Input_cisd_sc2_selected;; include Input_determinants;; include Input_electrons;; diff --git a/ocaml/Input_cisd_sc2.ml b/ocaml/Input_cisd_sc2.ml deleted file mode 100644 index ed046d79..00000000 --- a/ocaml/Input_cisd_sc2.ml +++ /dev/null @@ -1,127 +0,0 @@ -open Qptypes;; -open Qputils;; -open Core.Std;; - -module Cisd_sc2 : sig - type t = - { n_det_max_cisd_sc2 : Det_number_max.t; - pt2_max : PT2_energy.t; - do_pt2_end : bool; - } with sexp - ;; - val read : unit -> t option - val write : t -> unit - val to_string : t -> string - val to_rst : t -> Rst_string.t - val of_rst : Rst_string.t -> t option -end = struct - type t = - { n_det_max_cisd_sc2 : Det_number_max.t; - pt2_max : PT2_energy.t; - do_pt2_end : bool; - } with sexp - ;; - - let get_default = Qpackage.get_ezfio_default "cisd_sc2_selected";; - - let read_n_det_max_cisd_sc2 () = - if not (Ezfio.has_cisd_sc2_selected_n_det_max_cisd_sc2 ()) then - get_default "n_det_max_cisd_sc2" - |> Int.of_string - |> Ezfio.set_cisd_sc2_selected_n_det_max_cisd_sc2 - ; - Ezfio.get_cisd_sc2_selected_n_det_max_cisd_sc2 () - |> Det_number_max.of_int - ;; - - let write_n_det_max_cisd_sc2 n = - Det_number_max.to_int n - |> Ezfio.set_cisd_sc2_selected_n_det_max_cisd_sc2 - ;; - - - let read_pt2_max () = - if not (Ezfio.has_cisd_sc2_selected_pt2_max ()) then - get_default "pt2_max" - |> Float.of_string - |> Ezfio.set_cisd_sc2_selected_pt2_max - ; - Ezfio.get_cisd_sc2_selected_pt2_max () - |> PT2_energy.of_float - ;; - - let write_pt2_max p = - PT2_energy.to_float p - |> Ezfio.set_cisd_sc2_selected_pt2_max - ;; - - - let read_do_pt2_end () = - if not (Ezfio.has_cisd_sc2_selected_do_pt2_end ()) then - get_default "do_pt2_end" - |> Bool.of_string - |> Ezfio.set_cisd_sc2_selected_do_pt2_end - ; - Ezfio.get_cisd_sc2_selected_do_pt2_end () - ;; - - let write_do_pt2_end = - Ezfio.set_cisd_sc2_selected_do_pt2_end - ;; - - - let read () = - Some - { n_det_max_cisd_sc2 = read_n_det_max_cisd_sc2 (); - pt2_max = read_pt2_max (); - do_pt2_end = read_do_pt2_end (); - } - ;; - - let write { n_det_max_cisd_sc2 ; - pt2_max ; - do_pt2_end ; - } = - write_n_det_max_cisd_sc2 n_det_max_cisd_sc2; - write_pt2_max pt2_max; - write_do_pt2_end do_pt2_end; - ;; - - let to_string b = - Printf.sprintf " -n_det_max_cisd_sc2 = %s -pt2_max = %s -do_pt2_end = %s -" - (Det_number_max.to_string b.n_det_max_cisd_sc2) - (PT2_energy.to_string b.pt2_max) - (Bool.to_string b.do_pt2_end) - ;; - - let to_rst b = - Printf.sprintf " -Stop when the `n_det` > `n_det_max_cisd_sc2` :: - - n_det_max_cisd_sc2 = %s - -Stop when -E(PT2) < `pt2_max` :: - - pt2_max = %s - -Compute E(PT2) at the end :: - - do_pt2_end = %s - -" - (Det_number_max.to_string b.n_det_max_cisd_sc2) - (PT2_energy.to_string b.pt2_max) - (Bool.to_string b.do_pt2_end) - |> Rst_string.of_string - ;; - - include Generic_input_of_rst;; - let of_rst = of_rst t_of_sexp;; - -end - - diff --git a/ocaml/qp_edit.ml b/ocaml/qp_edit.ml index c60db6e2..df7635e0 100644 --- a/ocaml/qp_edit.ml +++ b/ocaml/qp_edit.ml @@ -12,7 +12,6 @@ open Core.Std;; type keyword = | Ao_basis | Bielec_integrals -| Cisd_sc2 | Cisd_sc2_selected | Determinants | Electrons @@ -24,16 +23,15 @@ type keyword = let keyword_to_string = function -| Ao_basis -> "AO basis" -| Bielec_integrals -> "Two electron integrals" -| Cisd_sc2 -> "CISD (SC)^2" -| Cisd_sc2_selected -> "CISD (SC)^2 selected" -| Determinants -> "Determinants" -| Electrons -> "Electrons" -| Full_ci -> "Selected Full-CI" -| Hartree_fock -> "Hartree-Fock" -| Mo_basis -> "MO basis" -| Nuclei -> "Molecule" +| Ao_basis -> "AO basis" +| Bielec_integrals -> "Two electron integrals" +| Cisd_sc2_selected -> "CISD (SC)^2" +| Determinants -> "Determinants" +| Electrons -> "Electrons" +| Full_ci -> "Selected Full-CI" +| Hartree_fock -> "Hartree-Fock" +| Mo_basis -> "MO basis" +| Nuclei -> "Molecule" ;; @@ -80,8 +78,6 @@ let get s = f Mo_basis.(read, to_rst) | Electrons -> f Electrons.(read, to_rst) - | Cisd_sc2 -> - f Cisd_sc2.(read, to_rst) | Cisd_sc2_selected -> f Cisd_sc2_selected.(read, to_rst) | Nuclei -> @@ -132,7 +128,6 @@ let set str s = | Hartree_fock -> write Hartree_fock.(of_rst, write) s | Full_ci -> write Full_ci.(of_rst, write) s | Electrons -> write Electrons.(of_rst, write) s - | Cisd_sc2 -> write Cisd_sc2.(of_rst, write) s | Cisd_sc2_selected -> write Cisd_sc2_selected.(of_rst, write) s | Bielec_integrals -> write Bielec_integrals.(of_rst, write) s | Determinants -> write Determinants.(of_rst, write) s @@ -183,7 +178,6 @@ let run check_only ezfio_filename = Electrons ; Bielec_integrals ; Hartree_fock ; - Cisd_sc2 ; Cisd_sc2_selected ; Full_ci ; Mo_basis; diff --git a/ocaml/qptypes_generator.ml b/ocaml/qptypes_generator.ml index f5a62356..633727f8 100644 --- a/ocaml/qptypes_generator.ml +++ b/ocaml/qptypes_generator.ml @@ -161,8 +161,36 @@ end = struct | \"hcore\" -> HCore | _ -> failwith (\"Wrong Guess type : \"^s) +end + +module Disk_access : sig + type t with sexp + val to_string : t -> string + val of_string : string -> t +end = struct + type t = + | Read + | Write + | None + with sexp + + let to_string = function + | Read -> \"Read\" + | Write -> \"Write\" + | None -> \"None\" + let of_string s = + let s = + String.lowercase s + in + match s with + | \"read\" -> Read + | \"write\" -> Write + | \"none\" -> None + | _ -> failwith (\"Wrong IO type : \"^s) + end " + ;; let template = format_of_string " diff --git a/ocaml/test_input.ml b/ocaml/test_input.ml index d7e0c9d3..956fd745 100644 --- a/ocaml/test_input.ml +++ b/ocaml/test_input.ml @@ -61,13 +61,13 @@ let test_dets () = let test_cisd_sc2 () = Ezfio.set_file "F2.ezfio" ; - let b = match Input.Cisd_sc2.read () with + let b = match Input.Cisd_sc2_selected.read () with | Some x -> x | None -> assert false in - print_endline (Input.Cisd_sc2.to_string b); - let rst = Input.Cisd_sc2.to_rst b in - let b2 = match Input.Cisd_sc2.of_rst rst with + print_endline (Input.Cisd_sc2_selected.to_string b); + let rst = Input.Cisd_sc2_selected.to_rst b in + let b2 = match Input.Cisd_sc2_selected.of_rst rst with | Some x -> x | None -> assert false in diff --git a/scripts/ezfio_interface/convert_ezfio.sh b/scripts/ezfio_interface/convert_ezfio.sh old mode 100644 new mode 100755 index 71b68fcc..ec0ab770 --- a/scripts/ezfio_interface/convert_ezfio.sh +++ b/scripts/ezfio_interface/convert_ezfio.sh @@ -1,5 +1,27 @@ #!/bin/bash # Convert a old ezfio file (with option.irp.f ezfio_default) # into a new EZFIO.cfg type -mv $1/Hartree_Fock $1/hartree_fock -mv $1/hartree_Fock/thresh_SCF $1/hartree_fock/thresh_scf + +# Hartree Fock +# Changin the case, don't know if is needed or not +mv $1/Hartree_Fock $1/hartree_fock 2> /dev/null + +mv $1/hartree_Fock/thresh_SCF $1/hartree_fock/thresh_scf 2> /dev/null + +# BiInts +mv $1/bi_integrals $1/bielect_integrals 2> /dev/null + +if [ -f $1/bielect_integrals/read_ao_integrals ]; then + if [ `cat $1/bielect_integrals/read_ao_integrals` -eq "True" ] + then + echo "Read" > $1/bielect_integrals/disk_access_ao_integrals + + elif [ `cat bielect_integrals/write_ao_integrals` -eq "True" ] + then + echo "Write" > $1/bielect_integrals/disk_access_ao_integrals + + else + echo "None" > $1/bielect_integrals/disk_access_ao_integrals + + fi +fi \ No newline at end of file diff --git a/scripts/ezfio_interface/ei_handler.py b/scripts/ezfio_interface/ei_handler.py index bdb52244..95a3e38c 100755 --- a/scripts/ezfio_interface/ei_handler.py +++ b/scripts/ezfio_interface/ei_handler.py @@ -105,8 +105,6 @@ def get_type_dict(): fancy_type['logical'] = Type(None, "bool", "logical") fancy_type['bool'] = Type(None, "bool", "logical") - fancy_type['MO_guess'] = Type("MO_guess", "string", "character*(32)") - fancy_type['character*(32)'] = Type(None, "string", "character*(32)") fancy_type['character*(60)'] = Type(None, "string", "character*(60)") fancy_type['character*(256)'] = Type(None, "string", "character*(256)") @@ -121,16 +119,34 @@ def get_type_dict(): "logical": "logical", "string": "character*32"} - # Read and parse qptype + # Read and parse qptype generate src = qpackage_root + "/ocaml/qptypes_generator.ml" with open(src, "r") as f: - l = [i for i in f.read().splitlines() if i.strip().startswith("*")] + r = f.read() + + # Generate + l_gen = [i for i in r.splitlines() if i.strip().startswith("*")] + + # Untouch + b = r.find('let untouched = "') + e = r.find(';;', b) + + l_un = [i for i in r[b:e].splitlines() if i.strip().startswith("module")] + + # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # + # q p _ t y p e s _ g e n e r a t e # + # ~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~ # # Read the fancy_type, the ocaml. and convert the ocam to the fortran - for i in l: + for i in l_gen + l_un: str_fancy_type = i.split()[1].strip() str_ocaml_type = i.split()[3] - str_fortran_type = ocaml_to_fortran[str_ocaml_type] + + if str_ocaml_type != 'sig': + str_fortran_type = ocaml_to_fortran[str_ocaml_type] + else: + str_fortran_type = 'character*(32)' + str_ocaml_type = 'string' fancy_type[str_fancy_type] = Type(str_fancy_type, str_ocaml_type, @@ -277,7 +293,7 @@ def create_ezfio_provider(dict_ezfio_cfg): ez_p.set_ezfio_name(dict_info['ezfio_name']) ez_p.set_output("output_%s" % dict_info['ezfio_dir']) - dict_code_provider[provider_name] = str(ez_p) + dict_code_provider[provider_name] = str(ez_p) + "\n" return dict_code_provider @@ -307,7 +323,7 @@ def save_ezfio_provider(path_head, dict_code_provider): output = "\n".join(l_output) if output != old_output: - with open(path, "w") as f: + with open(path, "w+") as f: f.write(output) @@ -366,7 +382,8 @@ def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"): for provider_name, provider_info in sorted(dict_ezfio_cfg.iteritems()): # Get the value from dict - name_raw = provider_name.lower() + name_raw = provider_info["ezfio_name"].lower() + fortran_type_raw = provider_info["type"].fortran if "size" in provider_info and not provider_info["size"] == "1": @@ -423,7 +440,7 @@ def save_ezfio_config(module_lower, str_ezfio_config): f.close() if str_ezfio_config != old_output: - with open(path, "w") as f: + with open(path, "w+") as f: f.write(str_ezfio_config) @@ -452,7 +469,7 @@ def save_ezfio_default(module_lower, str_ezfio_default): f.close() if str_ezfio_default != old_output: - with open(path, "w") as f: + with open(path, "w+") as f: f.write(str_ezfio_default) @@ -464,17 +481,17 @@ def create_ocaml_input(dict_ezfio_cfg,module_lower): from ezfio_generate_ocaml import EZFIO_ocaml - l_provider = [] + l_ezfio_name = [] l_type = [] l_doc = [] for k, v in dict_ezfio_cfg.iteritems(): if v['interface'] == "input": - l_provider.append(k) + l_ezfio_name.append(v['ezfio_name']) l_type.append(v["type"]) l_doc.append(v["doc"]) - e_glob = EZFIO_ocaml(l_provider=l_provider, + e_glob = EZFIO_ocaml(l_ezfio_name=l_ezfio_name, l_type=l_type, l_doc=l_doc) @@ -505,7 +522,7 @@ def create_ocaml_input(dict_ezfio_cfg,module_lower): template += [e_glob.create_type()] template += ['', - ' let get_default = Qpackage.get_ezfio_default "full_ci";;', + ' let get_default = Qpackage.get_ezfio_default "{0}";;'.format(module_lower), ''] template += ['(* =~=~=~=~=~=~==~=~=~=~=~=~ *)', @@ -565,7 +582,7 @@ def save_ocaml_input(module_lower, str_ocaml_input): f.close() if str_ocaml_input != old_output: - with open(path, "w") as f: + with open(path, "w+") as f: f.write(str_ocaml_input) diff --git a/scripts/ezfio_interface/ezfio_generate_ocaml.py b/scripts/ezfio_interface/ezfio_generate_ocaml.py index 4590f9b9..21da15b7 100755 --- a/scripts/ezfio_interface/ezfio_generate_ocaml.py +++ b/scripts/ezfio_interface/ezfio_generate_ocaml.py @@ -135,7 +135,7 @@ class EZFIO_ocaml(object): def create_type(self): ''' You need to instantiate the EZFIO_ocaml with this keyword argument - l_provider = [provider_name, ...] + l_ezfio_name = [provider_name, ...] l_type = [Named_tuple(fancy_type, ocaml_type, fortrant_type), ...] Return the type template @@ -145,7 +145,7 @@ class EZFIO_ocaml(object): # C h e c k i n g # # ~#~#~#~#~#~#~#~ # - self.check_if_init(["l_provider", "l_type"], + self.check_if_init(["l_ezfio_name", "l_type"], sys._getframe().f_code.co_name) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~# # @@ -156,7 +156,7 @@ class EZFIO_ocaml(object): "type t = ", " {"] - for p, t in zip(self.l_provider, self.l_type): + for p, t in zip(self.l_ezfio_name, self.l_type): if t.fancy: l_template += [" {0:<30} : {1}.t;".format(p, t.fancy)] @@ -174,7 +174,7 @@ class EZFIO_ocaml(object): def create_read_global(self): ''' You need to instantiate the EZFIO_ocaml with this keyword argument - l_provider = [provider_name, ...] + l_ezfio_name = [ezfio_name, ...] Return the read_global template ''' @@ -182,7 +182,7 @@ class EZFIO_ocaml(object): # C h e c k i n g # # ~#~#~#~#~#~#~#~ # - self.check_if_init(["l_provider"], + self.check_if_init(["l_ezfio_name"], sys._getframe().f_code.co_name) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~# # @@ -195,7 +195,7 @@ class EZFIO_ocaml(object): " {"] l_template += [" {0:<30} = read_{0} ();".format(p) - for p in self.l_provider] + for p in self.l_ezfio_name] l_template += [" }", ";;"] @@ -208,7 +208,7 @@ class EZFIO_ocaml(object): def create_write_global(self): ''' You need to instantiate the EZFIO_ocaml with this keyword argument - l_provider = [provider_name, ...] + l_ezfio_name = [provider_name, ...] Return the type template ''' @@ -216,7 +216,7 @@ class EZFIO_ocaml(object): # C h e c k i n g # # ~#~#~#~#~#~#~#~ # - self.check_if_init(["l_provider"], + self.check_if_init(["l_ezfio_name"], sys._getframe().f_code.co_name) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~# # @@ -225,9 +225,9 @@ class EZFIO_ocaml(object): l_template = ["(* Write all *)", "let write{ "] - l_template += [" {0};".format(p) for p in self.l_provider] + l_template += [" {0};".format(p) for p in self.l_ezfio_name] l_template += [" } ="] - l_template += [" write_{0:<30} {0};".format(p) for p in self.l_provider] + l_template += [" write_{0:<30} {0};".format(p) for p in self.l_ezfio_name] l_template += [";;"] # ~#~#~#~#~#~ # @@ -238,7 +238,7 @@ class EZFIO_ocaml(object): def create_to_string(self): ''' You need to instantiate the EZFIO_ocaml with this keyword argument - l_provider = [provider_name, ...] + l_ezfio_name = [provider_name, ...] l_type = [Named_tuple(fancy_type, ocaml_type, fortrant_type), ...] Return the type template @@ -247,7 +247,7 @@ class EZFIO_ocaml(object): # C h e c k i n g # # ~#~#~#~#~#~#~#~ # - self.check_if_init(["l_provider", "l_type"], + self.check_if_init(["l_ezfio_name", "l_type"], sys._getframe().f_code.co_name) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~# # @@ -258,10 +258,10 @@ class EZFIO_ocaml(object): 'let to_string b =', ' Printf.sprintf "'] - l_template += ["{0} = %s".format(p) for p in self.l_provider] + l_template += ["{0} = %s".format(p) for p in self.l_ezfio_name] l_template += ['"'] - for p, t in zip(self.l_provider, self.l_type): + for p, t in zip(self.l_ezfio_name, self.l_type): if t.fancy: str_ = t.fancy @@ -280,7 +280,7 @@ class EZFIO_ocaml(object): def create_to_rst(self): ''' You need to instantiate the EZFIO_ocaml with this keyword argument - l_provider = [provider_name, ...] + l_ezfio_name = [provider_name, ...] l_type = [Named_tuple(fancy_type, ocaml_type, fortrant_type), ...] Return the type template @@ -289,7 +289,7 @@ class EZFIO_ocaml(object): # C h e c k i n g # # ~#~#~#~#~#~#~#~ # - self.check_if_init(["l_provider", "l_type", "l_doc"], + self.check_if_init(["l_ezfio_name", "l_type", "l_doc"], sys._getframe().f_code.co_name) # ~#~#~#~#~#~#~#~#~#~#~#~#~#~# # @@ -300,7 +300,7 @@ class EZFIO_ocaml(object): 'let to_rst b =', ' Printf.sprintf "'] - for p, d in zip(self.l_provider, self.l_doc): + for p, d in zip(self.l_ezfio_name, self.l_doc): l_template += ["{0} ::".format(d), "", @@ -308,7 +308,7 @@ class EZFIO_ocaml(object): ""] l_template += ['"'] - for p, t in zip(self.l_provider, self.l_type): + for p, t in zip(self.l_ezfio_name, self.l_type): if t.fancy: str_ = t.fancy diff --git a/scripts/ezfio_interface/ezfio_generate_provider.py b/scripts/ezfio_interface/ezfio_generate_provider.py index 21dc8450..af4fcd6a 100755 --- a/scripts/ezfio_interface/ezfio_generate_provider.py +++ b/scripts/ezfio_interface/ezfio_generate_provider.py @@ -8,6 +8,7 @@ Creates the provider of a variable that has to be fetched from the EZFIO file. """ +import sys class EZFIO_Provider(object): @@ -27,9 +28,7 @@ BEGIN_PROVIDER [ %(type)s, %(name)s ] print *, '%(ezfio_dir)s/%(ezfio_name)s not found in EZFIO file' stop 1 endif - %(write)s - END_PROVIDER """.strip() @@ -58,9 +57,12 @@ END_PROVIDER output = self.output name = self.name - l_write = [" call write_time(%(output)s)", + l_write = ["", + " call write_time(%(output)s)", " call %(write)s(%(output)s, %(name)s, &", - " '%(name)s')"] + " '%(name)s')", + ""] + self.write = "\n".join(l_write) % locals() def set_type(self, t): diff --git a/src/BiInts/bi_integrals.ezfio_config b/src/BiInts/bi_integrals.ezfio_config deleted file mode 100644 index e780dce8..00000000 --- a/src/BiInts/bi_integrals.ezfio_config +++ /dev/null @@ -1,9 +0,0 @@ -bielec_integrals - read_ao_integrals logical - read_mo_integrals logical - write_ao_integrals logical - write_mo_integrals logical - threshold_ao double precision - threshold_mo double precision - direct logical - diff --git a/src/BiInts/options.irp.f b/src/BiInts/options.irp.f deleted file mode 100644 index 3a54fd19..00000000 --- a/src/BiInts/options.irp.f +++ /dev/null @@ -1,46 +0,0 @@ -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "logical" ) -T.set_name ( "do_direct_integrals" ) -T.set_doc ( "If true, compute integrals on the fly" ) -T.set_ezfio_dir ( "bielec_integrals" ) -T.set_ezfio_name( "direct" ) -T.set_output ( "output_biints" ) -print T - -T.set_type ( "logical" ) -T.set_name ( "write_mo_integrals" ) -T.set_doc ( "If true, write MO integrals in EZFIO" ) -T.set_ezfio_name( "write_mo_integrals" ) -print T - -T.set_name ( "write_ao_integrals" ) -T.set_doc ( "If true, write AO integrals in EZFIO" ) -T.set_ezfio_name( "write_ao_integrals" ) -print T - -T.set_name ( "read_mo_integrals" ) -T.set_doc ( "If true, read MO integrals in EZFIO" ) -T.set_ezfio_name( "read_mo_integrals" ) -print T - -T.set_name ( "read_ao_integrals" ) -T.set_doc ( "If true, read AO integrals in EZFIO" ) -T.set_ezfio_name( "read_ao_integrals" ) -print T - -T.set_type ( "double precision" ) -T.set_name ( "ao_integrals_threshold" ) -T.set_doc ( "If < ao_integrals_threshold, = 0" ) -T.set_ezfio_name( "threshold_ao" ) -print T - -T.set_name ( "mo_integrals_threshold" ) -T.set_doc ( "If < mo_integrals_threshold, = 0" ) -T.set_ezfio_name( "threshold_mo" ) -print T - -END_SHELL - - diff --git a/src/BiInts/ASSUMPTIONS.rst b/src/Bielec_integrals/ASSUMPTIONS.rst similarity index 100% rename from src/BiInts/ASSUMPTIONS.rst rename to src/Bielec_integrals/ASSUMPTIONS.rst diff --git a/src/Bielec_integrals/EZFIO.cfg b/src/Bielec_integrals/EZFIO.cfg new file mode 100644 index 00000000..bd1d774a --- /dev/null +++ b/src/Bielec_integrals/EZFIO.cfg @@ -0,0 +1,32 @@ +[do_direct_integrals] +type: logical +doc: Compute integrals on the fly +interface: input +default: False +ezfio_name: direct + +[disk_access_mo_integrals] +type: Disk_access +doc: Write, Read, None for MO integrals from disk (EZFIO folder) +interface: input +default: None + +[disk_access_ao_integrals] +type: Disk_access +doc: Write or Read or None for AO integrals from disk (EZFIO folder) +interface: input +default: None + +[ao_integrals_threshold] +type: Threshold +doc: If < ao_integrals_threshold then is null +interface: input +default: 1.e-15 +ezfio_name: threshold_ao + +[mo_integrals_threshold] +type: Threshold +doc: If < ao_integrals_threshold then is null +interface: input +default: 1.e-15 +ezfio_name: threshold_mo \ No newline at end of file diff --git a/src/BiInts/Makefile b/src/Bielec_integrals/Makefile similarity index 100% rename from src/BiInts/Makefile rename to src/Bielec_integrals/Makefile diff --git a/src/BiInts/NEEDED_MODULES b/src/Bielec_integrals/NEEDED_MODULES similarity index 100% rename from src/BiInts/NEEDED_MODULES rename to src/Bielec_integrals/NEEDED_MODULES diff --git a/src/BiInts/README.rst b/src/Bielec_integrals/README.rst similarity index 100% rename from src/BiInts/README.rst rename to src/Bielec_integrals/README.rst diff --git a/src/BiInts/ao_bi_integrals.irp.f b/src/Bielec_integrals/ao_bi_integrals.irp.f similarity index 97% rename from src/BiInts/ao_bi_integrals.irp.f rename to src/Bielec_integrals/ao_bi_integrals.irp.f index 67fc0a1b..0da76021 100644 --- a/src/BiInts/ao_bi_integrals.irp.f +++ b/src/Bielec_integrals/ao_bi_integrals.irp.f @@ -319,13 +319,6 @@ subroutine compute_ao_bielec_integrals(j,k,l,sze,buffer_value) end - - - - - - - BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] implicit none use map_module @@ -356,7 +349,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] integer :: load_ao_integrals print*,'Reading the AO integrals' if (load_ao_integrals(trim(ezfio_filename)//'/work/ao_integrals.bin') == 0) then - write(output_BiInts,*) 'AO integrals provided' + write(output_bielec_integrals,*) 'AO integrals provided' ao_bielec_integrals_in_map = .True. return endif @@ -374,7 +367,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] PROVIDE progress_bar call omp_init_lock(lock) lmax = ao_num*(ao_num+1)/2 - write(output_BiInts,*) 'Providing the AO integrals' + write(output_bielec_integrals,*) 'Providing the AO integrals' call wall_time(wall_0) call wall_time(wall_1) call cpu_time(cpu_1) @@ -385,7 +378,7 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ] !$OMP DEFAULT(NONE) & !$OMP SHARED (ao_num, jl_pairs, ao_integrals_map,thresh, & !$OMP cpu_1,wall_1,lock, lmax,n_centers,ao_nucl, & - !$OMP ao_overlap_abs,ao_overlap,output_BiInts,abort_here, & + !$OMP ao_overlap_abs,ao_overlap,output_bielec_integrals,abort_here, & !$OMP wall_0,progress_bar,progress_value) allocate(buffer_i(size_buffer)) @@ -452,7 +445,7 @@ IRP_ENDIF if (thread_num == 0) then if (wall_2 - wall_0 > 1.d0) then wall_0 = wall_2 - write(output_BiInts,*) 100.*float(kk)/float(lmax), '% in ', & + write(output_bielec_integrals,*) 100.*float(kk)/float(lmax), '% in ', & wall_2-wall_1, 's', map_mb(ao_integrals_map) ,'MB' progress_value = dble(map_mb(ao_integrals_map)) endif @@ -469,21 +462,21 @@ IRP_ENDIF stop 'Aborting in AO integrals calculation' endif IRP_IF COARRAY - write(output_BiInts,*) 'Communicating the map' + write(output_bielec_integrals,*) 'Communicating the map' call communicate_ao_integrals() IRP_ENDIF COARRAY - write(output_BiInts,*) 'Sorting the map' + write(output_bielec_integrals,*) 'Sorting the map' call map_sort(ao_integrals_map) call cpu_time(cpu_2) call wall_time(wall_2) integer(map_size_kind) :: get_ao_map_size, ao_map_size ao_map_size = get_ao_map_size() - write(output_BiInts,*) 'AO integrals provided:' - write(output_BiInts,*) ' Size of AO map : ', map_mb(ao_integrals_map) ,'MB' - write(output_BiInts,*) ' Number of AO integrals :', ao_map_size - write(output_BiInts,*) ' cpu time :',cpu_2 - cpu_1, 's' - write(output_BiInts,*) ' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1+tiny(1.d0)), ' )' + write(output_bielec_integrals,*) 'AO integrals provided:' + write(output_bielec_integrals,*) ' Size of AO map : ', map_mb(ao_integrals_map) ,'MB' + write(output_bielec_integrals,*) ' Number of AO integrals :', ao_map_size + write(output_bielec_integrals,*) ' cpu time :',cpu_2 - cpu_1, 's' + write(output_bielec_integrals,*) ' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1+tiny(1.d0)), ' )' ao_bielec_integrals_in_map = .True. if (write_ao_integrals) then diff --git a/src/BiInts/gauss_legendre.irp.f b/src/Bielec_integrals/gauss_legendre.irp.f similarity index 100% rename from src/BiInts/gauss_legendre.irp.f rename to src/Bielec_integrals/gauss_legendre.irp.f diff --git a/src/BiInts/map_integrals.irp.f b/src/Bielec_integrals/map_integrals.irp.f similarity index 99% rename from src/BiInts/map_integrals.irp.f rename to src/Bielec_integrals/map_integrals.irp.f index ae50207e..1426288a 100644 --- a/src/BiInts/map_integrals.irp.f +++ b/src/Bielec_integrals/map_integrals.irp.f @@ -13,7 +13,7 @@ BEGIN_PROVIDER [ type(map_type), ao_integrals_map ] call bielec_integrals_index(ao_num,ao_num,ao_num,ao_num,key_max) sze = key_max call map_init(ao_integrals_map,sze) - write(output_BiInts,*) 'AO map initialized' + write(output_bielec_integrals,*) 'AO map initialized' END_PROVIDER subroutine bielec_integrals_index(i,j,k,l,i1) @@ -244,7 +244,7 @@ BEGIN_PROVIDER [ type(map_type), mo_integrals_map ] call bielec_integrals_index(mo_tot_num,mo_tot_num,mo_tot_num,mo_tot_num,key_max) sze = key_max call map_init(mo_integrals_map,sze) - write(output_BiInts,*) 'MO map initialized' + write(output_bielec_integrals,*) 'MO map initialized' END_PROVIDER subroutine insert_into_ao_integrals_map(n_integrals, & diff --git a/src/BiInts/mo_bi_integrals.irp.f b/src/Bielec_integrals/mo_bi_integrals.irp.f similarity index 94% rename from src/BiInts/mo_bi_integrals.irp.f rename to src/Bielec_integrals/mo_bi_integrals.irp.f index 54d274c7..5adc980b 100644 --- a/src/BiInts/mo_bi_integrals.irp.f +++ b/src/Bielec_integrals/mo_bi_integrals.irp.f @@ -31,7 +31,7 @@ BEGIN_PROVIDER [ logical, mo_bielec_integrals_in_map ] integer :: load_mo_integrals print*,'Reading the MO integrals' if (load_mo_integrals(trim(ezfio_filename)//'/work/mo_integrals.bin') == 0) then - write(output_BiInts,*) 'MO integrals provided' + write(output_bielec_integrals,*) 'MO integrals provided' return endif endif @@ -84,8 +84,8 @@ subroutine add_integrals_to_map(mask_ijkl) call bitstring_to_list( mask_ijkl(1,4), list_ijkl(1,4), n_l, N_int ) size_buffer = min(ao_num*ao_num*ao_num,16000000) - write(output_BiInts,*) 'Providing the molecular integrals ' - write(output_BiInts,*) 'Buffers : ', 8.*(mo_tot_num_align*(n_j)*(n_k+1) + mo_tot_num_align +& + write(output_bielec_integrals,*) 'Providing the molecular integrals ' + write(output_bielec_integrals,*) 'Buffers : ', 8.*(mo_tot_num_align*(n_j)*(n_k+1) + mo_tot_num_align +& ao_num+ao_num*ao_num+ size_buffer*3)/(1024*1024), 'MB / core' call wall_time(wall_1) @@ -99,7 +99,7 @@ subroutine add_integrals_to_map(mask_ijkl) !$OMP wall_0,thread_num) & !$OMP DEFAULT(NONE) & !$OMP SHARED(size_buffer,ao_num,mo_tot_num,n_i,n_j,n_k,n_l,mo_tot_num_align,& - !$OMP mo_coef_transp,output_BiInts, & + !$OMP mo_coef_transp,output_bielec_integrals, & !$OMP mo_coef_transp_is_built, list_ijkl, & !$OMP mo_coef_is_built, wall_1, abort_here, & !$OMP mo_coef,mo_integrals_threshold,ao_integrals_map,mo_integrals_map,progress_bar,progress_value) @@ -272,7 +272,7 @@ IRP_ENDIF if (thread_num == 0) then if (wall_2 - wall_0 > 1.d0) then wall_0 = wall_2 - write(output_BiInts,*) 100.*float(l1)/float(ao_num), '% in ', & + write(output_bielec_integrals,*) 100.*float(l1)/float(ao_num), '% in ', & wall_2-wall_1, 's', map_mb(mo_integrals_map) ,'MB' progress_value = dble(map_mb(mo_integrals_map)) @@ -291,7 +291,7 @@ IRP_ENDIF stop 'Aborting in MO integrals calculation' endif IRP_IF COARRAY - write(output_BiInts,*) 'Communicating the map' + write(output_bielec_integrals,*) 'Communicating the map' call communicate_mo_integrals() IRP_ENDIF call map_unique(mo_integrals_map) @@ -304,11 +304,11 @@ IRP_ENDIF deallocate(list_ijkl) - write(output_BiInts,*)'Molecular integrals provided:' - write(output_BiInts,*)' Size of MO map ', map_mb(mo_integrals_map) ,'MB' - write(output_BiInts,*)' Number of MO integrals: ', mo_map_size - write(output_BiInts,*)' cpu time :',cpu_2 - cpu_1, 's' - write(output_BiInts,*)' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1), ')' + write(output_bielec_integrals,*)'Molecular integrals provided:' + write(output_bielec_integrals,*)' Size of MO map ', map_mb(mo_integrals_map) ,'MB' + write(output_bielec_integrals,*)' Number of MO integrals: ', mo_map_size + write(output_bielec_integrals,*)' cpu time :',cpu_2 - cpu_1, 's' + write(output_bielec_integrals,*)' wall time :',wall_2 - wall_1, 's ( x ', (cpu_2-cpu_1)/(wall_2-wall_1), ')' if (write_mo_integrals) then call dump_mo_integrals(trim(ezfio_filename)//'/work/mo_integrals.bin') diff --git a/src/Bielec_integrals/read_write.irp.f b/src/Bielec_integrals/read_write.irp.f new file mode 100644 index 00000000..6319641b --- /dev/null +++ b/src/Bielec_integrals/read_write.irp.f @@ -0,0 +1,41 @@ +BEGIN_PROVIDER [ logical, read_ao_integrals ] +&BEGIN_PROVIDER [ logical, read_mo_integrals ] +&BEGIN_PROVIDER [ logical, write_ao_integrals ] +&BEGIN_PROVIDER [ logical, write_mo_integrals ] + + BEGIN_DOC +! One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals + END_DOC +implicit none + + if (disk_access_ao_integrals.EQ.'Read') then + read_ao_integrals = .True. + write_ao_integrals = .False. + + else if (disk_access_ao_integrals.EQ.'Write') then + read_ao_integrals = .False. + write_ao_integrals = .True. + + else if (disk_access_ao_integrals.EQ.'None') then + read_ao_integrals = .False. + write_ao_integrals = .False. + + else if (disk_access_mo_integrals.EQ.'Read') then + read_mo_integrals = .True. + write_mo_integrals = .False. + + else if (disk_access_mo_integrals.EQ.'Write') then + read_mo_integrals = .False. + write_mo_integrals = .True. + + else if (disk_access_mo_integrals.EQ.'None') then + read_mo_integrals = .False. + write_mo_integrals = .False. + + else + print *, 'bielec_integrals/disk_acces not of a the good type' + stop "1" + + endif + +END_PROVIDER diff --git a/src/CAS_SD_selected/NEEDED_MODULES b/src/CAS_SD_selected/NEEDED_MODULES index 7d7c112f..cbf44be7 100644 --- a/src/CAS_SD_selected/NEEDED_MODULES +++ b/src/CAS_SD_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/CID/NEEDED_MODULES b/src/CID/NEEDED_MODULES index 3832d4c1..ac8e21ab 100644 --- a/src/CID/NEEDED_MODULES +++ b/src/CID/NEEDED_MODULES @@ -1,3 +1,3 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CID_SC2_selected/NEEDED_MODULES b/src/CID_SC2_selected/NEEDED_MODULES index d7bca283..42d83610 100644 --- a/src/CID_SC2_selected/NEEDED_MODULES +++ b/src/CID_SC2_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask CISD CISD_selected Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD CISD_selected Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CID_selected/NEEDED_MODULES b/src/CID_selected/NEEDED_MODULES index 56946f0e..b27ab85e 100644 --- a/src/CID_selected/NEEDED_MODULES +++ b/src/CID_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CIS/NEEDED_MODULES b/src/CIS/NEEDED_MODULES index 847ba574..010e60f5 100644 --- a/src/CIS/NEEDED_MODULES +++ b/src/CIS/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CISD/NEEDED_MODULES b/src/CISD/NEEDED_MODULES index 847ba574..010e60f5 100644 --- a/src/CISD/NEEDED_MODULES +++ b/src/CISD/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CISD_SC2_selected/NEEDED_MODULES b/src/CISD_SC2_selected/NEEDED_MODULES index d7bca283..42d83610 100644 --- a/src/CISD_SC2_selected/NEEDED_MODULES +++ b/src/CISD_SC2_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask CISD CISD_selected Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD CISD_selected Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f index fb7de4cf..1c4b2ed0 100644 --- a/src/CISD_SC2_selected/cisd_sc2_selection.irp.f +++ b/src/CISD_SC2_selected/cisd_sc2_selection.irp.f @@ -68,6 +68,7 @@ program cisd_sc2_selected touch N_det psi_det psi_coef davidson_threshold davidson_criterion call diagonalize_CI_SC2 pt2 = 0.d0 + if(do_pt2_end)then threshold_selectors = 1.d0 call H_apply_PT2(pt2, norm_pert, H_pert_diag, N_st) diff --git a/src/CISD_selected/NEEDED_MODULES b/src/CISD_selected/NEEDED_MODULES index 56946f0e..b27ab85e 100644 --- a/src/CISD_selected/NEEDED_MODULES +++ b/src/CISD_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/DDCI_selected/NEEDED_MODULES b/src/DDCI_selected/NEEDED_MODULES index 7d7c112f..cbf44be7 100644 --- a/src/DDCI_selected/NEEDED_MODULES +++ b/src/DDCI_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/Dets/NEEDED_MODULES b/src/Dets/NEEDED_MODULES index 163bdf10..824c75ed 100644 --- a/src/Dets/NEEDED_MODULES +++ b/src/Dets/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/FCIdump/NEEDED_MODULES b/src/FCIdump/NEEDED_MODULES index 26097b8b..7f2f0ca8 100644 --- a/src/FCIdump/NEEDED_MODULES +++ b/src/FCIdump/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Full_CI/NEEDED_MODULES b/src/Full_CI/NEEDED_MODULES index f2bb9ba7..5e074d3c 100644 --- a/src/Full_CI/NEEDED_MODULES +++ b/src/Full_CI/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/Generators_CAS/NEEDED_MODULES b/src/Generators_CAS/NEEDED_MODULES index 26097b8b..7f2f0ca8 100644 --- a/src/Generators_CAS/NEEDED_MODULES +++ b/src/Generators_CAS/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_full/NEEDED_MODULES b/src/Generators_full/NEEDED_MODULES index 3f5f6001..7d973bce 100644 --- a/src/Generators_full/NEEDED_MODULES +++ b/src/Generators_full/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_restart/NEEDED_MODULES b/src/Generators_restart/NEEDED_MODULES index 26097b8b..7f2f0ca8 100644 --- a/src/Generators_restart/NEEDED_MODULES +++ b/src/Generators_restart/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Hartree_Fock/EZFIO.cfg b/src/Hartree_Fock/EZFIO.cfg index 87f1a878..e2b0ea5a 100644 --- a/src/Hartree_Fock/EZFIO.cfg +++ b/src/Hartree_Fock/EZFIO.cfg @@ -19,4 +19,4 @@ default: Huckel [energy] type: double precision doc: Calculated HF energy -interface: output \ No newline at end of file +interface: output diff --git a/src/Hartree_Fock/NEEDED_MODULES b/src/Hartree_Fock/NEEDED_MODULES index 4ebba314..8f7f21c6 100644 --- a/src/Hartree_Fock/NEEDED_MODULES +++ b/src/Hartree_Fock/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Electrons Ezfio_files MonoInts MOGuess MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Electrons Ezfio_files MonoInts MOGuess MOs Nuclei Output Utils diff --git a/src/MP2/NEEDED_MODULES b/src/MP2/NEEDED_MODULES index 98fbcc58..076746d1 100644 --- a/src/MP2/NEEDED_MODULES +++ b/src/MP2/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/NEEDED_MODULES b/src/NEEDED_MODULES index 3df2ab88..f71f28fd 100644 --- a/src/NEEDED_MODULES +++ b/src/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask CID CID_SC2_selected CID_selected CIS CISD CISD_selected CISD_SC2_selected Dets Electrons Ezfio_files Full_CI Generators_full Hartree_Fock MOGuess MonoInts MOs MP2 Nuclei Output Selectors_full Utils Molden FCIdump Generators_CAS CAS_SD_selected DDCI_selected +AOs Bielec_integrals Bitmask CID CID_SC2_selected CID_selected CIS CISD CISD_selected CISD_SC2_selected Dets Electrons Ezfio_files Full_CI Generators_full Hartree_Fock MOGuess MonoInts MOs MP2 Nuclei Output Selectors_full Utils Molden FCIdump Generators_CAS CAS_SD_selected DDCI_selected diff --git a/src/Perturbation/NEEDED_MODULES b/src/Perturbation/NEEDED_MODULES index 4f7ab529..4fa6ff4b 100644 --- a/src/Perturbation/NEEDED_MODULES +++ b/src/Perturbation/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Properties Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Properties Utils diff --git a/src/Properties/NEEDED_MODULES b/src/Properties/NEEDED_MODULES index 8cf33c90..9095dbdf 100644 --- a/src/Properties/NEEDED_MODULES +++ b/src/Properties/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Selectors_full/NEEDED_MODULES b/src/Selectors_full/NEEDED_MODULES index 3f5f6001..7d973bce 100644 --- a/src/Selectors_full/NEEDED_MODULES +++ b/src/Selectors_full/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils diff --git a/src/Selectors_no_sorted/NEEDED_MODULES b/src/Selectors_no_sorted/NEEDED_MODULES index 26097b8b..7f2f0ca8 100644 --- a/src/Selectors_no_sorted/NEEDED_MODULES +++ b/src/Selectors_no_sorted/NEEDED_MODULES @@ -1 +1 @@ -AOs BiInts Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/tests/unit_test/unit_test.py b/tests/unit_test/unit_test.py index 8e00d4c3..eb9b1e79 100755 --- a/tests/unit_test/unit_test.py +++ b/tests/unit_test/unit_test.py @@ -17,7 +17,7 @@ from collections import defaultdict # O p t # # ~#~#~ # -precision = 1.e-8 +precision = 5.e-8 # A test get a geo file and a basis file. # A global dict containt the result for this test @@ -31,7 +31,10 @@ precision = 1.e-8 global has_hf_alredy has_hf_alredy = False -def init_folder(geo, basis, mult=1): +global filename_check + + +def init_folder(geo, basis, mult=1, ezfio_name=None): ''' Take a geo in arg (aka a existing geo.xyz in test/) And create the geo.ezfio with the adeguate basis and multipliciti @@ -41,18 +44,112 @@ def init_folder(geo, basis, mult=1): cmd = "cp {0}/tests/{1}.xyz .".format(qpackage_root, geo) subprocess.check_call([cmd], shell=True) - cmd = "qp_create_ezfio_from_xyz -b {0} -m {1} {2}.xyz".format(basis, - mult, - geo) - subprocess.check_call([cmd], shell=True) + if not ezfio_name: + ezfio_name = geo + + cmd = "qp_create_ezfio_from_xyz -b {0} -m {1} {2}.xyz -o {3}.ezfio" + subprocess.check_call([cmd.format(basis, mult, geo, ezfio_name)], + shell=True) def get_error_message(l_exepected, l_cur): - l_msg = ["Need {0} get {1}".format(i,j) for i,j in zip(l_exepected,l_cur)] + l_msg = ["Need {0} get {1} error is {2}".format(i, j, abs(i - j)) + for i, j in zip(l_exepected, l_cur)] return "\n".join(l_msg) -def run_hf(geo, basis): +# _ +# / |_ _ _ | o ._ ._ _|_ +# \_ | | (/_ (_ |< | | | |_) |_| |_ +# | + +def check_disk_acess(geo, basis, mult=1): + + import uuid + filename = str(uuid.uuid4()) + + # ~#~#~#~ # + # I n i t # + # ~#~#~#~ # + + init_folder(geo, basis, mult, ezfio_name=filename) + ezfio.set_file("{0}.ezfio".format(filename)) + + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + # S e t _ p a r a m e t e r # + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + + # Test 1 + ezfio.bielec_integrals_disk_access_ao_integrals = "Write" + cmd = "qp_edit -c {0}.ezfio".format(filename) + subprocess.check_call([cmd], shell=True) + + # Test 2 + ezfio.bielec_integrals_disk_access_ao_integrals = "IculeAcess" + cmd = "qp_edit -c {0}.ezfio".format(filename) + + try: + subprocess.check_call([cmd], shell=True) + return_code = False + except subprocess.CalledProcessError: + return_code = True + + # ~#~#~#~#~#~#~#~ # + # F i n a l i z e # + # ~#~#~#~#~#~#~#~ # + + if return_code: + subprocess.call(["rm -R {0}.ezfio".format(filename)], shell=True) + return return_code + + +def check_mo_guess(geo, basis, mult=1): + + import uuid + filename = str(uuid.uuid4()) + + # ~#~#~#~ # + # I n i t # + # ~#~#~#~ # + + init_folder(geo, basis, mult, ezfio_name=filename) + ezfio.set_file("{0}.ezfio".format(filename)) + + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + # S e t _ p a r a m e t e r # + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + + # Test 1 + ezfio.hartree_fock_mo_guess_type = "Huckel" + cmd = "qp_edit -c {0}.ezfio".format(filename) + subprocess.check_call([cmd], shell=True) + + # Test 2 + ezfio.hartree_fock_mo_guess_type = "IculeGuess" + cmd = "qp_edit -c {0}.ezfio".format(filename) + + try: + subprocess.check_call([cmd], shell=True) + return_code = False + except subprocess.CalledProcessError: + return_code = True + + # ~#~#~#~#~#~#~#~ # + # F i n a l i z e # + # ~#~#~#~#~#~#~#~ # + + if return_code: + subprocess.call(["rm -R {0}.ezfio".format(filename)], shell=True) + return return_code + + +# _ +# / |_ _ _ | _. | _ _ +# \_ | | (/_ (_ |< \/ (_| | |_| (/_ _> +# + + +def run_hf(geo, basis, mult=1): """ Run a simle by default hf EZFIO path = geo.ezfio @@ -76,12 +173,18 @@ def run_hf(geo, basis): # I n i t # # ~#~#~#~ # - init_folder(geo, basis) + init_folder(geo, basis, mult) ezfio.set_file("{0}.ezfio".format(geo)) # ~#~#~#~#~#~#~#~#~#~#~#~#~ # # S e t _ p a r a m e t e r # # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + ezfio.bielec_integrals_direct = False + ezfio.bielec_integrals_threshold_ao = 1.e-15 + ezfio.bielec_integrals_disk_access_ao_integrals = "None" + + ezfio.bielec_integrals_threshold_mo = 1.e-15 + ezfio.bielec_integrals_disk_access_mo_integrals = "None" ezfio.hartree_fock_mo_guess_type = "Huckel" ezfio.hartree_fock_thresh_scf = 1.e-10 @@ -164,18 +267,43 @@ def run_full_ci_10k_pt2_end(geo, basis): [cur_var, cur_pt2])) -def run_big_test(geo, basis): +def hf_then_10k_test(geo, basis): if not has_hf_alredy: run_hf(geo, basis) - run_full_ci_10k_pt2_end(geo, basis) - return True + try: + run_full_ci_10k_pt2_end(geo, basis) + return_code = True + except: + return_code = False + + # ~#~#~#~#~#~#~#~ # + # F i n a l i z e # + # ~#~#~#~#~#~#~#~ # + + if return_code: + subprocess.call(["rm -R {0}.ezfio".format(geo)], shell=True) + return return_code -class SimplisticTest(unittest.TestCase): +# ___ +# | _ _ _|_ +# | (/_ _> |_ +# +class ValueTest(unittest.TestCase): def test_full_ci_10k_pt2_end(self): - self.assertTrue(run_big_test("methane", "sto-3g")) + self.assertTrue(hf_then_10k_test("methane", "sto-3g")) + + +class InputTest(unittest.TestCase): + + def test_check_disk_acess(self): + self.assertTrue(check_disk_acess("methane", "un-ccemd-ref")) + + def test_check_mo_guess(self): + self.assertTrue(check_mo_guess("methane", "maug-cc-pVDZ")) + if __name__ == '__main__': unittest.main()