diff --git a/install/scripts/install_ocaml.sh b/install/scripts/install_ocaml.sh index cf5ad505..8be20f28 100755 --- a/install/scripts/install_ocaml.sh +++ b/install/scripts/install_ocaml.sh @@ -5,7 +5,7 @@ QP_ROOT=$PWD cd - # Normal installation -PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 zmq ppx_sexp_conv ppx_deriving jbuilder.1.0+beta17" +PACKAGES="core.v0.10.0 cryptokit ocamlfind sexplib.v0.10.0 zmq ppx_sexp_conv ppx_deriving" # Needed for ZeroMQ export C_INCLUDE_PATH="${QP_ROOT}"/include:"${C_INCLUDE_PATH}" @@ -76,8 +76,8 @@ source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true NCPUs=$(cat /proc/cpuinfo | grep -i MHz | wc -l) -${QP_ROOT}/bin/opam install -j ${NCPUs} stdint.0.4.2 -y -q || exit 1 -${QP_ROOT}/bin/opam install -j ${NCPUs} ${PACKAGES} -y -q || exit 1 +${QP_ROOT}/bin/opam install -j ${NCPUs} stdint.0.4.2 -y || exit 1 +echo ${PACKAGES} | xargs ${QP_ROOT}/bin/opam install -j ${NCPUs} -y || exit 1 rm -f ../_build/ocaml.log diff --git a/ocaml/Input_ao_basis.ml b/ocaml/Input_ao_basis.ml index 348ddd7f..f562b573 100644 --- a/ocaml/Input_ao_basis.ml +++ b/ocaml/Input_ao_basis.ml @@ -1,101 +1,38 @@ +(* =~=~ *) +(* Init *) +(* =~=~ *) + open Qptypes;; open Qputils;; open Core;; module Ao_basis : sig - type t = - { ao_basis : AO_basis_name.t; - ao_num : AO_number.t ; - ao_prim_num : AO_prim_number.t array; - ao_prim_num_max : AO_prim_number.t; - ao_nucl : Nucl_number.t array; - ao_power : Symmetry.Xyz.t array; - ao_coef : AO_coef.t array; - ao_expo : AO_expo.t array; - ao_cartesian : bool; - } [@@deriving sexp] - ;; - val read : unit -> t option +(* Generate type *) + type t = + { + disk_access_ao_one_integrals : Disk_access.t; + } [@@deriving sexp] + ;; + val read : unit -> t option + val write : t-> unit val to_string : t -> string - val to_basis : t -> Basis.t - val write : t -> unit - val to_md5 : t -> MD5.t val to_rst : t -> Rst_string.t + val of_rst : Rst_string.t -> t option end = struct - type t = - { ao_basis : AO_basis_name.t; - ao_num : AO_number.t ; - ao_prim_num : AO_prim_number.t array; - ao_prim_num_max : AO_prim_number.t; - ao_nucl : Nucl_number.t array; - ao_power : Symmetry.Xyz.t array; - ao_coef : AO_coef.t array; - ao_expo : AO_expo.t array; - ao_cartesian : bool; - } [@@deriving sexp] - ;; +(* Generate type *) + type t = + { + disk_access_ao_one_integrals : Disk_access.t; + } [@@deriving sexp] + ;; let get_default = Qpackage.get_ezfio_default "ao_basis";; - let read_ao_basis () = - Ezfio.get_ao_basis_ao_basis () - |> AO_basis_name.of_string - ;; - - let read_ao_num () = - Ezfio.get_ao_basis_ao_num () - |> AO_number.of_int - ;; - - let read_ao_prim_num () = - 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.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.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 x in - let result = Array.init dim ~f:(fun x -> "") in - for i=1 to dim - do - if (data.(i-1) > 0) then - result.(i-1) <- result.(i-1)^"x"^(Int.to_string data.(i-1)); - if (data.(dim+i-1) > 0) then - result.(i-1) <- result.(i-1)^"y"^(Int.to_string data.(dim+i-1)); - if (data.(2*dim+i-1) > 0) then - result.(i-1) <- result.(i-1)^"z"^(Int.to_string data.(2*dim+i-1)); - done; - Array.map ~f:Symmetry.Xyz.of_string result - ;; - - let read_ao_coef () = - 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.flattened_ezfio - |> Array.map ~f:AO_expo.of_float - ;; +(* =~=~=~=~=~=~==~=~=~=~=~=~ *) +(* Generate Special Function *) +(* =~=~=~==~=~~=~=~=~=~=~=~=~ *) +(* Read snippet for ao_cartesian *) let read_ao_cartesian () = if not (Ezfio.has_ao_basis_ao_cartesian ()) then get_default "ao_cartesian" @@ -104,191 +41,133 @@ end = struct ; Ezfio.get_ao_basis_ao_cartesian () ;; - - let to_long_basis b = - let ao_num = AO_number.to_int b.ao_num in - let gto_array = Array.init (AO_number.to_int b.ao_num) - ~f:(fun i -> - let s = Symmetry.Xyz.to_symmetry b.ao_power.(i) in - let ao_prim_num = AO_prim_number.to_int b.ao_prim_num.(i) in - let prims = List.init ao_prim_num ~f:(fun j -> - let prim = { GaussianPrimitive.sym = s ; - GaussianPrimitive.expo = b.ao_expo.(ao_num*j+i) - } - in - let coef = b.ao_coef.(ao_num*j+i) in - (prim,coef) - ) in - Gto.of_prim_coef_list prims - ) - in - let rec do_work accu sym gto nucl = - match (sym, gto, nucl) with - | (s::srest, g::grest, n::nrest) -> - do_work ((s,g,n)::accu) srest grest nrest - | ([],[],[]) -> List.rev accu - | _ -> assert false - in - do_work [] - (Array.to_list b.ao_power) - (Array.to_list gto_array) - (Array.to_list b.ao_nucl) - ;; - let to_basis b = - to_long_basis b - |> Long_basis.to_basis - ;; - - let to_md5 b = - let short_basis = to_basis b in - Basis.to_md5 short_basis - ;; - - - - let write_md5 b = - to_md5 b - |> MD5.to_string - |> Ezfio.set_ao_basis_ao_md5 +(* Write snippet for ao_cartesian *) + let write_ao_cartesian = + Ezfio.set_ao_basis_ao_cartesian ;; - let write_ao_basis name = - AO_basis_name.to_string name - |> Ezfio.set_ao_basis_ao_basis +(* Read snippet for ao_prim_num_max *) + let read_ao_prim_num_max () = + if not (Ezfio.has_ao_basis_ao_prim_num_max ()) then + get_default "ao_prim_num_max" + |> Int.of_string + |> Ezfio.set_ao_basis_ao_prim_num_max + ; + Ezfio.get_ao_basis_ao_prim_num_max () + ;; +(* Write snippet for ao_prim_num_max *) + let write_ao_prim_num_max = + Ezfio.set_ao_basis_ao_prim_num_max ;; - let write b = - let { ao_basis ; - ao_num ; - ao_prim_num ; - ao_prim_num_max ; - ao_nucl ; - ao_power ; - ao_coef ; - ao_expo ; - ao_cartesian ; - } = b - in - write_md5 b ; - write_ao_basis ao_basis; +(* Read snippet for disk_access_ao_one_integrals *) + let read_disk_access_ao_one_integrals () = + if not (Ezfio.has_ao_basis_disk_access_ao_one_integrals ()) then + get_default "disk_access_ao_one_integrals" + |> String.of_string + |> Ezfio.set_ao_basis_disk_access_ao_one_integrals + ; + Ezfio.get_ao_basis_disk_access_ao_one_integrals () + |> Disk_access.of_string + ;; +(* Write snippet for disk_access_ao_one_integrals *) + let write_disk_access_ao_one_integrals var = + Disk_access.to_string var + |> Ezfio.set_ao_basis_disk_access_ao_one_integrals ;; - - 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 () ; - ao_cartesian = read_ao_cartesian () ; - } - in - to_md5 result - |> MD5.to_string - |> Ezfio.set_ao_basis_ao_md5 ; - Some result - end - else - None +(* Read snippet for integral_kinetic *) + let read_integral_kinetic () = + if not (Ezfio.has_ao_basis_integral_kinetic ()) then + get_default "integral_kinetic" + |> Float.of_string + |> Ezfio.set_ao_basis_integral_kinetic + ; + Ezfio.get_ao_basis_integral_kinetic () ;; - - - let to_rst b = - let print_sym = - let l = List.init (Array.length b.ao_power) ~f:( - fun i -> ( (i+1),b.ao_nucl.(i),b.ao_power.(i) ) ) in - let rec do_work = function - | [] -> [] - | (i,n,x)::tail -> - (Printf.sprintf " %5d %6d %-8s\n" i (Nucl_number.to_int n) (Symmetry.Xyz.to_string x)):: - (do_work tail) - in do_work l - |> String.concat - in - - let short_basis = to_basis b in - Printf.sprintf " -Name of the AO basis :: - - ao_basis = %s - -Cartesian coordinates (6d,10f,...) :: - - ao_cartesian = %s - -Basis set (read-only) :: - -%s - - -======= ========= =========== - Basis Nucleus Symmetries -======= ========= =========== -%s -======= ========= =========== - -" (AO_basis_name.to_string b.ao_basis) - (Bool.to_string b.ao_cartesian) - (Basis.to_string short_basis - |> String.split ~on:'\n' - |> List.map ~f:(fun x-> " "^x) - |> String.concat ~sep:"\n" - ) print_sym - - |> Rst_string.of_string +(* Write snippet for integral_kinetic *) + let write_integral_kinetic = + Ezfio.set_ao_basis_integral_kinetic ;; - let read_rst s = - let s = Rst_string.to_string s - |> String.split ~on:'\n' - in - let rec extract_basis = function - | [] -> failwith "Error in basis set" - | line :: tail -> - let line = String.strip line in - if line = "Basis set (read-only) ::" then - String.concat tail ~sep:"\n" - else - extract_basis tail - in - extract_basis s +(* Read snippet for integral_nuclear *) + let read_integral_nuclear () = + if not (Ezfio.has_ao_basis_integral_nuclear ()) then + get_default "integral_nuclear" + |> Float.of_string + |> Ezfio.set_ao_basis_integral_nuclear + ; + Ezfio.get_ao_basis_integral_nuclear () + ;; +(* Write snippet for integral_nuclear *) + let write_integral_nuclear = + Ezfio.set_ao_basis_integral_nuclear ;; - let to_string b = - Printf.sprintf " -ao_basis = %s -ao_num = %s -ao_prim_num = %s -ao_prim_num_max = %s -ao_nucl = %s -ao_power = %s -ao_coef = %s -ao_expo = %s -ao_cartesian = %s -md5 = %s -" - (AO_basis_name.to_string b.ao_basis) - (AO_number.to_string b.ao_num) - (b.ao_prim_num |> Array.to_list |> List.map - ~f:(AO_prim_number.to_string) |> String.concat ~sep:", " ) - (AO_prim_number.to_string b.ao_prim_num_max) - (b.ao_nucl |> Array.to_list |> List.map ~f:Nucl_number.to_string |> - String.concat ~sep:", ") - (b.ao_power |> Array.to_list |> List.map ~f:(fun x-> - "("^(Symmetry.Xyz.to_string x)^")" )|> String.concat ~sep:", ") - (b.ao_coef |> Array.to_list |> List.map ~f:AO_coef.to_string - |> String.concat ~sep:", ") - (b.ao_expo |> Array.to_list |> List.map ~f:AO_expo.to_string - |> String.concat ~sep:", ") - (b.ao_cartesian |> Bool.to_string) - (to_md5 b |> MD5.to_string ) - +(* Read snippet for integral_overlap *) + let read_integral_overlap () = + if not (Ezfio.has_ao_basis_integral_overlap ()) then + get_default "integral_overlap" + |> Float.of_string + |> Ezfio.set_ao_basis_integral_overlap + ; + Ezfio.get_ao_basis_integral_overlap () + ;; +(* Write snippet for integral_overlap *) + let write_integral_overlap = + Ezfio.set_ao_basis_integral_overlap ;; -end +(* Read snippet for integral_pseudo *) + let read_integral_pseudo () = + if not (Ezfio.has_ao_basis_integral_pseudo ()) then + get_default "integral_pseudo" + |> Float.of_string + |> Ezfio.set_ao_basis_integral_pseudo + ; + Ezfio.get_ao_basis_integral_pseudo () + ;; +(* Write snippet for integral_pseudo *) + let write_integral_pseudo = + Ezfio.set_ao_basis_integral_pseudo + ;; + +(* =~=~=~=~=~=~=~=~=~=~=~=~ *) +(* Generate Global Function *) +(* =~=~=~=~=~=~=~=~=~=~=~=~ *) + +(* Read all *) + let read() = + Some + { + disk_access_ao_one_integrals = read_disk_access_ao_one_integrals (); + } + ;; +(* Write all *) + let write{ + disk_access_ao_one_integrals; + } = + write_disk_access_ao_one_integrals disk_access_ao_one_integrals; + ;; +(* to_string*) + let to_string b = + Printf.sprintf " + disk_access_ao_one_integrals = %s + " + (Disk_access.to_string b.disk_access_ao_one_integrals) + ;; +(* to_rst*) + let to_rst b = + Printf.sprintf " + Read/Write AO one-electron integrals from/to disk [ Write | Read | None ] :: + + disk_access_ao_one_integrals = %s + + " + (Disk_access.to_string b.disk_access_ao_one_integrals) + |> Rst_string.of_string + ;; + include Generic_input_of_rst;; + let of_rst = of_rst t_of_sexp;; + +end \ No newline at end of file diff --git a/ocaml/Input_mo_basis.ml b/ocaml/Input_mo_basis.ml index c51a7f4a..1bd01427 100644 --- a/ocaml/Input_mo_basis.ml +++ b/ocaml/Input_mo_basis.ml @@ -1,229 +1,131 @@ -open Qptypes -open Qputils -open Core +(* =~=~ *) +(* Init *) +(* =~=~ *) +open Qptypes;; +open Qputils;; +open Core;; module Mo_basis : sig - type t = - { mo_tot_num : MO_number.t ; - mo_label : MO_label.t; - mo_class : MO_class.t array; - mo_occ : MO_occ.t array; - mo_coef : (MO_coef.t array) array; - ao_md5 : MD5.t; - } [@@deriving sexp] - val read : unit -> t option +(* Generate type *) + type t = + { + disk_access_mo_one_integrals : Disk_access.t; + } [@@deriving 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 = - { mo_tot_num : MO_number.t ; - mo_label : MO_label.t; - mo_class : MO_class.t array; - mo_occ : MO_occ.t array; - mo_coef : (MO_coef.t array) array; - ao_md5 : MD5.t; - } [@@deriving sexp] - let get_default = Qpackage.get_ezfio_default "mo_basis" +(* Generate type *) + type t = + { + disk_access_mo_one_integrals : Disk_access.t; + } [@@deriving sexp] + ;; - let read_mo_label () = - if not (Ezfio.has_mo_basis_mo_label ()) then - Ezfio.set_mo_basis_mo_label "None" + let get_default = Qpackage.get_ezfio_default "mo_basis";; + +(* =~=~=~=~=~=~==~=~=~=~=~=~ *) +(* Generate Special Function *) +(* =~=~=~==~=~~=~=~=~=~=~=~=~ *) + +(* Read snippet for disk_access_mo_one_integrals *) + let read_disk_access_mo_one_integrals () = + if not (Ezfio.has_mo_basis_disk_access_mo_one_integrals ()) then + get_default "disk_access_mo_one_integrals" + |> String.of_string + |> Ezfio.set_mo_basis_disk_access_mo_one_integrals ; - Ezfio.get_mo_basis_mo_label () - |> MO_label.of_string + Ezfio.get_mo_basis_disk_access_mo_one_integrals () + |> Disk_access.of_string + ;; +(* Write snippet for disk_access_mo_one_integrals *) + let write_disk_access_mo_one_integrals var = + Disk_access.to_string var + |> Ezfio.set_mo_basis_disk_access_mo_one_integrals + ;; +(* Read snippet for integral_kinetic *) + let read_integral_kinetic () = + if not (Ezfio.has_mo_basis_integral_kinetic ()) then + get_default "integral_kinetic" + |> Float.of_string + |> Ezfio.set_mo_basis_integral_kinetic + ; + Ezfio.get_mo_basis_integral_kinetic () + ;; +(* Write snippet for integral_kinetic *) + let write_integral_kinetic = + Ezfio.set_mo_basis_integral_kinetic + ;; - 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 +(* Read snippet for integral_nuclear *) + let read_integral_nuclear () = + if not (Ezfio.has_mo_basis_integral_nuclear ()) then + get_default "integral_nuclear" + |> Float.of_string + |> Ezfio.set_mo_basis_integral_nuclear + ; + Ezfio.get_mo_basis_integral_nuclear () + ;; +(* Write snippet for integral_nuclear *) + let write_integral_nuclear = + Ezfio.set_mo_basis_integral_nuclear + ;; +(* Read snippet for integral_pseudo *) + let read_integral_pseudo () = + if not (Ezfio.has_mo_basis_integral_pseudo ()) then + get_default "integral_pseudo" + |> Float.of_string + |> Ezfio.set_mo_basis_integral_pseudo + ; + Ezfio.get_mo_basis_integral_pseudo () + ;; +(* Write snippet for integral_pseudo *) + let write_integral_pseudo = + Ezfio.set_mo_basis_integral_pseudo + ;; - let read_mo_tot_num () = - Ezfio.get_mo_basis_mo_tot_num () - |> MO_number.of_int - - - let read_mo_class () = - if not (Ezfio.has_mo_basis_mo_class ()) then - begin - let mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in - let data = - Array.init mo_tot_num ~f:(fun _ -> MO_class.(to_string (Active []))) - |> Array.to_list - in - Ezfio.ezfio_array_of_list ~rank:1 - ~dim:[| mo_tot_num |] ~data:data - |> Ezfio.set_mo_basis_mo_class - end; - Ezfio.flattened_ezfio (Ezfio.get_mo_basis_mo_class () ) - |> Array.map ~f:MO_class.of_string - - - let read_mo_occ () = - if not (Ezfio.has_mo_basis_mo_label ()) then - begin - let elec_alpha_num = Ezfio.get_electrons_elec_alpha_num () - and elec_beta_num = Ezfio.get_electrons_elec_beta_num () - and mo_tot_num = MO_number.to_int (read_mo_tot_num ()) in - let data = Array.init mo_tot_num ~f:(fun i -> - if (i Array.to_list in - Ezfio.ezfio_array_of_list ~rank:1 - ~dim:[| mo_tot_num |] ~data:data - |> Ezfio.set_mo_basis_mo_occ - end; - 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.flattened_ezfio - |> Array.map ~f:MO_coef.of_float - in - let mo_tot_num = read_mo_tot_num () |> MO_number.to_int in - let ao_num = (Array.length a)/mo_tot_num in - Array.init mo_tot_num ~f:(fun j -> - Array.sub ~pos:(j*ao_num) ~len:(ao_num) a - ) - - - let read () = - if (Ezfio.has_mo_basis_mo_tot_num ()) then - Some - { mo_tot_num = read_mo_tot_num (); - mo_label = read_mo_label () ; - mo_class = read_mo_class (); - mo_occ = read_mo_occ (); - mo_coef = read_mo_coef (); - ao_md5 = read_ao_md5 (); - } - else - None - - - let mo_coef_to_string mo_coef = - let ao_num = Array.length mo_coef.(0) - and mo_tot_num = Array.length mo_coef in - let rec print_five imin imax = - match (imax-imin+1) with - | 1 -> - let header = [ Printf.sprintf " #%15d" (imin+1) ; ] in - let new_lines = - List.init ao_num ~f:(fun i -> - Printf.sprintf " %3d %15.10f " (i+1) - (MO_coef.to_float mo_coef.(imin ).(i)) ) - in header @ new_lines - | 2 -> - let header = [ Printf.sprintf " #%15d %15d" (imin+1) (imin+2) ; ] in - let new_lines = - List.init ao_num ~f:(fun i -> - Printf.sprintf " %3d %15.10f %15.10f" (i+1) - (MO_coef.to_float mo_coef.(imin ).(i)) - (MO_coef.to_float mo_coef.(imin+1).(i)) ) - in header @ new_lines - | 3 -> - let header = [ Printf.sprintf " #%15d %15d %15d" - (imin+1) (imin+2) (imin+3); ] in - let new_lines = - List.init ao_num ~f:(fun i -> - Printf.sprintf " %3d %15.10f %15.10f %15.10f" (i+1) - (MO_coef.to_float mo_coef.(imin ).(i)) - (MO_coef.to_float mo_coef.(imin+1).(i)) - (MO_coef.to_float mo_coef.(imin+2).(i)) ) - in header @ new_lines - | 4 -> - let header = [ Printf.sprintf " #%15d %15d %15d %15d" - (imin+1) (imin+2) (imin+3) (imin+4) ; ] in - let new_lines = - List.init ao_num ~f:(fun i -> - Printf.sprintf " %3d %15.10f %15.10f %15.10f %15.10f" (i+1) - (MO_coef.to_float mo_coef.(imin ).(i)) - (MO_coef.to_float mo_coef.(imin+1).(i)) - (MO_coef.to_float mo_coef.(imin+2).(i)) - (MO_coef.to_float mo_coef.(imin+3).(i)) ) - in header @ new_lines - | 5 -> - let header = [ Printf.sprintf " #%15d %15d %15d %15d %15d" - (imin+1) (imin+2) (imin+3) (imin+4) (imin+5) ; ] in - let new_lines = - List.init ao_num ~f:(fun i -> - Printf.sprintf " %3d %15.10f %15.10f %15.10f %15.10f %15.10f" (i+1) - (MO_coef.to_float mo_coef.(imin ).(i)) - (MO_coef.to_float mo_coef.(imin+1).(i)) - (MO_coef.to_float mo_coef.(imin+2).(i)) - (MO_coef.to_float mo_coef.(imin+3).(i)) - (MO_coef.to_float mo_coef.(imin+4).(i)) ) - in header @ new_lines - | _ -> assert false - in - let rec create_list accu i = - if (i+4 < mo_tot_num) then - create_list ( (print_five i (i+3) |> String.concat ~sep:"\n")::accu ) (i+4) - else - (print_five i (mo_tot_num-1) |> String.concat ~sep:"\n")::accu |> List.rev - in - create_list [] 0 |> String.concat ~sep:"\n\n" - - - let to_rst b = - Printf.sprintf " -Label of the molecular orbitals :: - - mo_label = %s - -Total number of MOs :: - - mo_tot_num = %s - -MO coefficients :: - -%s -" - (MO_label.to_string b.mo_label) - (MO_number.to_string b.mo_tot_num) - (mo_coef_to_string b.mo_coef) - |> Rst_string.of_string - - - - let to_string b = - Printf.sprintf " -mo_label = %s -mo_tot_num = \"%s\" -mo_clas = %s -mo_occ = %s -mo_coef = %s -" - (MO_label.to_string b.mo_label) - (MO_number.to_string b.mo_tot_num) - (b.mo_class |> Array.to_list |> List.map - ~f:(MO_class.to_string) |> String.concat ~sep:", " ) - (b.mo_occ |> Array.to_list |> List.map - ~f:(MO_occ.to_string) |> String.concat ~sep:", " ) - (b.mo_coef |> Array.map - ~f:(fun x-> Array.map ~f:MO_coef.to_string x |> String.concat_array - ~sep:"," ) |> - String.concat_array ~sep:"\n" ) - - -end +(* =~=~=~=~=~=~=~=~=~=~=~=~ *) +(* Generate Global Function *) +(* =~=~=~=~=~=~=~=~=~=~=~=~ *) +(* Read all *) + let read() = + Some + { + disk_access_mo_one_integrals = read_disk_access_mo_one_integrals (); + } + ;; +(* Write all *) + let write{ + disk_access_mo_one_integrals; + } = + write_disk_access_mo_one_integrals disk_access_mo_one_integrals; + ;; +(* to_string*) + let to_string b = + Printf.sprintf " + disk_access_mo_one_integrals = %s + " + (Disk_access.to_string b.disk_access_mo_one_integrals) + ;; +(* to_rst*) + let to_rst b = + Printf.sprintf " + Read/Write MO one-electron integrals from/to disk [ Write | Read | None ] :: + + disk_access_mo_one_integrals = %s + + " + (Disk_access.to_string b.disk_access_mo_one_integrals) + |> Rst_string.of_string + ;; + include Generic_input_of_rst;; + let of_rst = of_rst t_of_sexp;; +end \ No newline at end of file diff --git a/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES b/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES index 6fb87e35..f0ef5d67 100644 --- a/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES +++ b/plugins/Hartree_Fock/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Integrals_Bielec MOGuess Bitmask +Integrals_Bielec AO_one_e_integrals MOGuess Bitmask diff --git a/plugins/read_integral/NEEDED_CHILDREN_MODULES b/plugins/read_integral/NEEDED_CHILDREN_MODULES index 566762ba..0c15e599 100644 --- a/plugins/read_integral/NEEDED_CHILDREN_MODULES +++ b/plugins/read_integral/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Integrals_Monoelec Integrals_Bielec Hartree_Fock +AO_one_e_integrals MO_one_e_integrals Integrals_Bielec Hartree_Fock diff --git a/plugins/read_integral/read_integrals_ao.irp.f b/plugins/read_integral/read_integrals_ao.irp.f index 77f2213e..dab342ec 100644 --- a/plugins/read_integral/read_integrals_ao.irp.f +++ b/plugins/read_integral/read_integrals_ao.irp.f @@ -1,7 +1,7 @@ program read_integrals PROVIDE ezfio_filename - call ezfio_set_integrals_monoelec_disk_access_ao_one_integrals("None") + call ezfio_set_ao_one_e_integrals_disk_access_ao_one_integrals("None") call run end @@ -22,41 +22,54 @@ subroutine run integer(key_kind) :: key allocate (A(ao_num,ao_num)) + A = 0.d0 - iunit = getunitandopen('kinetic_ao','r') - do + do read (iunit,*,end=10) i,j, integral A(i,j) = integral - A(j,i) = integral enddo 10 continue close(iunit) - call write_one_e_integrals('ao_kinetic_integral', A, size(A,1), size(A,2)) + call ezfio_set_ao_one_e_integrals_integral_kinetic(A(1:ao_num, 1:ao_num)) + A = 0.d0 + iunit = getunitandopen('overlap_ao','r') + do + read (iunit,*,end=11) i,j, integral + A(i,j) = integral + enddo + 11 continue + close(iunit) + call ezfio_set_ao_one_e_integrals_integral_overlap(A(1:ao_num, 1:ao_num)) + + A = 0.d0 + iunit = getunitandopen('pseudo_ao','r') + do + read (iunit,*,end=14) i,j, integral + A(i,j) = integral + enddo + 14 continue + close(iunit) + call ezfio_set_ao_one_e_integrals_integral_pseudo(A(1:ao_num,1:ao_num)) A = 0.d0 iunit = getunitandopen('nuclear_ao','r') - do + do read (iunit,*,end=12) i,j, integral A(i,j) = integral - A(j,i) = integral enddo 12 continue close(iunit) - call write_one_e_integrals('ao_ne_integral', A, size(A,1), size(A,2)) + call ezfio_set_ao_one_e_integrals_integral_nuclear(A(1:ao_num, 1:ao_num)) - call write_one_e_integrals('ao_pseudo_integral', ao_pseudo_integral,& - size(ao_pseudo_integral,1), size(ao_pseudo_integral,2)) - - - call ezfio_set_integrals_monoelec_disk_access_ao_one_integrals("Read") + call ezfio_set_ao_one_e_integrals_disk_access_ao_one_integrals("Read") allocate(buffer_i(ao_num**4), buffer_values(ao_num**4)) - iunit = getunitandopen('bielec_ao','r') n_integrals=0 - do + buffer_values = 0.d0 + do read (iunit,*,end=13) i,j,k,l, integral n_integrals += 1 call bielec_integrals_index(i, j, k, l, buffer_i(n_integrals) ) @@ -64,7 +77,8 @@ subroutine run enddo 13 continue close(iunit) - + + call insert_into_ao_integrals_map(n_integrals,buffer_i,buffer_values) call map_sort(ao_integrals_map) diff --git a/plugins/read_integral/read_integrals_mo.irp.f b/plugins/read_integral/read_integrals_mo.irp.f index c021941c..593ee20b 100644 --- a/plugins/read_integral/read_integrals_mo.irp.f +++ b/plugins/read_integral/read_integrals_mo.irp.f @@ -11,7 +11,7 @@ program read_integrals integer :: i,j,n PROVIDE ezfio_filename - call ezfio_set_integrals_monoelec_disk_access_mo_one_integrals("None") + call ezfio_set_mo_one_e_integrals_disk_access_mo_one_integrals("None") logical :: has call ezfio_has_mo_basis_mo_tot_num(has) @@ -74,7 +74,7 @@ subroutine run enddo 10 continue close(iunit) - call write_one_e_integrals('mo_kinetic_integral', A, size(A,1), size(A,2)) + call ezfio_set_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) iunit = getunitandopen('nuclear_mo','r') @@ -84,10 +84,10 @@ subroutine run enddo 12 continue close(iunit) - call write_one_e_integrals('mo_ne_integral', A, size(A,1), size(A,2)) + call ezfio_set_mo_one_e_integrals_integral_nuclear(A) + call ezfio_set_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) - call write_one_e_integrals('mo_pseudo_integral', mo_pseudo_integral,& - size(mo_pseudo_integral,1), size(mo_pseudo_integral,2)) + call ezfio_set_mo_one_e_integrals_disk_access_mo_one_integrals("Read") call ezfio_set_integrals_monoelec_disk_access_mo_one_integrals("Read") diff --git a/plugins/read_integral/read_integrals_mo_chocol.irp.f b/plugins/read_integral/read_integrals_mo_chocol.irp.f index 8e5fde8e..c781cccc 100644 --- a/plugins/read_integral/read_integrals_mo_chocol.irp.f +++ b/plugins/read_integral/read_integrals_mo_chocol.irp.f @@ -11,7 +11,7 @@ program read_integrals integer :: i,j,n PROVIDE ezfio_filename - call ezfio_set_integrals_monoelec_disk_access_mo_one_integrals("None") + call ezfio_set_mo_one_e_integrals_disk_access_mo_one_integrals("None") logical :: has call ezfio_has_mo_basis_mo_tot_num(has) @@ -66,7 +66,7 @@ subroutine run enddo 10 continue close(iunit) - call write_one_e_integrals('mo_kinetic_integral', A, size(A,1), size(A,2)) + call ezfio_set_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) iunit = getunitandopen('nuclear_mo','r') @@ -76,11 +76,8 @@ subroutine run enddo 12 continue close(iunit) - call write_one_e_integrals('mo_ne_integral', A, size(A,1), size(A,2)) + call ezfio_set_mo_one_e_integrals_integral_nuclear(A) + call ezfio_set_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) - call write_one_e_integrals('mo_pseudo_integral', mo_pseudo_integral,& - size(mo_pseudo_integral,1), size(mo_pseudo_integral,2)) - - - call ezfio_set_integrals_monoelec_disk_access_mo_one_integrals("Read") + call ezfio_set_mo_one_e_integrals_disk_access_mo_one_integrals("Read") end diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index c142cdb4..9e7e3c04 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -301,7 +301,6 @@ if __name__ == '__main__': # Don't update if we are not in the main repository from is_master_repository import is_master_repository if not is_master_repository: - print >> sys.stderr, 'Not in the master repo' sys.exit(0) path = os.path.join(module_abs, ".gitignore") diff --git a/src/AO_Basis/EZFIO.cfg b/src/AO_Basis/EZFIO.cfg index 81fcffa0..e2e86633 100644 --- a/src/AO_Basis/EZFIO.cfg +++ b/src/AO_Basis/EZFIO.cfg @@ -55,33 +55,3 @@ doc: If true, use AOs in Cartesian coordinates (6d,10f,...) interface: ezfio, provider default: false -[integral_overlap] -type: double precision -doc: Overlap integrals in AO basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio -default: false - -[integral_nuclear] -type: double precision -doc: Nucleus-electron integrals in AO basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio -default: false - -[integral_kinetic] -type: double precision -doc: Kinetic energy integrals in AO basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio -default: false - - -[integral_pseudo] -type: double precision -doc: Pseudopotential integrals in AO basis set -size: (ao_basis.ao_num,ao_basis.ao_num) -interface: ezfio -default: false - - diff --git a/src/AO_one_e_integrals/EZFIO.cfg b/src/AO_one_e_integrals/EZFIO.cfg new file mode 100644 index 00000000..7689ac0c --- /dev/null +++ b/src/AO_one_e_integrals/EZFIO.cfg @@ -0,0 +1,35 @@ +[integral_nuclear] +type: double precision +doc: Nucleus-electron integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[integral_kinetic] +type: double precision +doc: Kinetic energy integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[integral_pseudo] +type: double precision +doc: Pseudopotential integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[integral_overlap] +type: double precision +doc: Overlap integrals in AO basis set +size: (ao_basis.ao_num,ao_basis.ao_num) +interface: ezfio +default: false + +[disk_access_ao_one_integrals] +type: Disk_access +doc: Read/Write AO one-electron integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None + + diff --git a/src/AO_one_e_integrals/NEEDED_CHILDREN_MODULES b/src/AO_one_e_integrals/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..4ed799d7 --- /dev/null +++ b/src/AO_one_e_integrals/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +AO_Basis Pseudo diff --git a/src/AO_one_e_integrals/README.rst b/src/AO_one_e_integrals/README.rst new file mode 100644 index 00000000..0001ebbd --- /dev/null +++ b/src/AO_one_e_integrals/README.rst @@ -0,0 +1,14 @@ +================== +AO_one_e_integrals +================== + +All the one-electron integrals in AO basis are here. + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. diff --git a/src/Integrals_Monoelec/ao_mono_ints.irp.f b/src/AO_one_e_integrals/ao_mono_ints.irp.f similarity index 100% rename from src/Integrals_Monoelec/ao_mono_ints.irp.f rename to src/AO_one_e_integrals/ao_mono_ints.irp.f diff --git a/src/MO_Basis/ao_ortho_canonical.irp.f b/src/AO_one_e_integrals/ao_ortho_canonical.irp.f similarity index 100% rename from src/MO_Basis/ao_ortho_canonical.irp.f rename to src/AO_one_e_integrals/ao_ortho_canonical.irp.f diff --git a/src/AO_Basis/ao_overlap.irp.f b/src/AO_one_e_integrals/ao_overlap.irp.f similarity index 87% rename from src/AO_Basis/ao_overlap.irp.f rename to src/AO_one_e_integrals/ao_overlap.irp.f index 2d169244..b92429bc 100644 --- a/src/AO_Basis/ao_overlap.irp.f +++ b/src/AO_one_e_integrals/ao_overlap.irp.f @@ -1,4 +1,4 @@ - BEGIN_PROVIDER [ double precision, ao_overlap_matrix,(ao_num,ao_num) ] + BEGIN_PROVIDER [ double precision, ao_overlap,(ao_num,ao_num) ] &BEGIN_PROVIDER [ double precision, ao_overlap_x,(ao_num,ao_num) ] &BEGIN_PROVIDER [ double precision, ao_overlap_y,(ao_num,ao_num) ] &BEGIN_PROVIDER [ double precision, ao_overlap_z,(ao_num,ao_num) ] @@ -14,6 +14,15 @@ double precision :: alpha, beta, c double precision :: A_center(3), B_center(3) integer :: power_A(3), power_B(3) + ao_overlap = 0.d0 + ao_overlap_x = 0.d0 + ao_overlap_y = 0.d0 + ao_overlap_z = 0.d0 + if (read_ao_one_integrals) then + call ezfio_get_ao_one_e_integrals_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + print *, 'AO overlap integrals read from disk' + else + dim1=100 !$OMP PARALLEL DO SCHEDULE(GUIDED) & !$OMP DEFAULT(NONE) & @@ -21,7 +30,7 @@ !$OMP overlap_x,overlap_y, overlap_z, overlap, & !$OMP alpha, beta,i,j,c) & !$OMP SHARED(nucl_coord,ao_power,ao_prim_num, & - !$OMP ao_overlap_x,ao_overlap_y,ao_overlap_z,ao_overlap_matrix,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & + !$OMP ao_overlap_x,ao_overlap_y,ao_overlap_z,ao_overlap,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & !$OMP ao_expo_ordered_transp,dim1) do j=1,ao_num A_center(1) = nucl_coord( ao_nucl(j), 1 ) @@ -31,10 +40,6 @@ power_A(2) = ao_power( j, 2 ) power_A(3) = ao_power( j, 3 ) do i= 1,ao_num - ao_overlap_matrix(i,j)= 0.d0 - ao_overlap_x(i,j)= 0.d0 - ao_overlap_y(i,j)= 0.d0 - ao_overlap_z(i,j)= 0.d0 B_center(1) = nucl_coord( ao_nucl(i), 1 ) B_center(2) = nucl_coord( ao_nucl(i), 2 ) B_center(3) = nucl_coord( ao_nucl(i), 3 ) @@ -47,7 +52,7 @@ beta = ao_expo_ordered_transp(l,i) call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) - ao_overlap_matrix(i,j) += c * overlap + ao_overlap(i,j) += c * overlap ao_overlap_x(i,j) += c * overlap_x ao_overlap_y(i,j) += c * overlap_y ao_overlap_z(i,j) += c * overlap_z @@ -56,6 +61,11 @@ enddo enddo !$OMP END PARALLEL DO + endif + if (write_ao_one_integrals) then + call ezfio_set_ao_one_e_integrals_integral_overlap(ao_overlap(1:ao_num, 1:ao_num)) + print *, 'AO overlap integrals written to disk' + endif END_PROVIDER @@ -119,7 +129,7 @@ BEGIN_PROVIDER [ double precision, S_inv,(ao_num,ao_num) ] BEGIN_DOC ! S^-1 END_DOC - call get_pseudo_inverse(ao_overlap_matrix,size(ao_overlap_matrix,1),ao_num,ao_num,S_inv,size(S_inv,1)) + call get_pseudo_inverse(ao_overlap,size(ao_overlap,1),ao_num,ao_num,S_inv,size(S_inv,1)) END_PROVIDER BEGIN_PROVIDER [ double precision, S_half_inv, (AO_num,AO_num) ] @@ -136,7 +146,7 @@ BEGIN_PROVIDER [ double precision, S_half_inv, (AO_num,AO_num) ] integer :: info, i, j, k double precision, parameter :: threshold_overlap_AO_eigenvalues = 1.d-6 - LDA = size(AO_overlap_matrix,1) + LDA = size(AO_overlap,1) LDC = size(S_half_inv,1) allocate( & @@ -145,7 +155,7 @@ BEGIN_PROVIDER [ double precision, S_half_inv, (AO_num,AO_num) ] D(AO_num)) call svd( & - AO_overlap_matrix,LDA, & + AO_overlap,LDA, & U,LDC, & D, & Vt,LDA, & @@ -194,7 +204,7 @@ BEGIN_PROVIDER [ double precision, S_half, (ao_num,ao_num) ] allocate(U(ao_num,ao_num),Vt(ao_num,ao_num),D(ao_num)) - call svd(ao_overlap_matrix,size(ao_overlap_matrix,1),U,size(U,1),D,Vt,size(Vt,1),ao_num,ao_num) + call svd(ao_overlap,size(ao_overlap,1),U,size(U,1),D,Vt,size(Vt,1),ao_num,ao_num) do i=1,ao_num D(i) = dsqrt(D(i)) diff --git a/src/Integrals_Monoelec/kin_ao_ints.irp.f b/src/AO_one_e_integrals/kin_ao_ints.irp.f similarity index 97% rename from src/Integrals_Monoelec/kin_ao_ints.irp.f rename to src/AO_one_e_integrals/kin_ao_ints.irp.f index de980e37..019531be 100644 --- a/src/Integrals_Monoelec/kin_ao_ints.irp.f +++ b/src/AO_one_e_integrals/kin_ao_ints.irp.f @@ -128,7 +128,7 @@ BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num,ao_num)] integer :: i,j,k,l if (read_ao_one_integrals) then - call ezfio_get_ao_basis_integral_kinetic(ao_kinetic_integral) + call ezfio_get_ao_one_e_integrals_integral_kinetic(ao_kinetic_integral) print *, 'AO kinetic integrals read from disk' else !$OMP PARALLEL DO DEFAULT(NONE) & @@ -142,7 +142,7 @@ BEGIN_PROVIDER [double precision, ao_kinetic_integral, (ao_num,ao_num)] !$OMP END PARALLEL DO endif if (write_ao_one_integrals) then - call ezfio_set_ao_basis_integral_kinetic(ao_kinetic_integral) + call ezfio_set_ao_one_e_integrals_integral_kinetic(ao_kinetic_integral) print *, 'AO kinetic integrals written to disk' endif END_PROVIDER diff --git a/src/Integrals_Monoelec/pot_ao_ints.irp.f b/src/AO_one_e_integrals/pot_ao_ints.irp.f similarity index 99% rename from src/Integrals_Monoelec/pot_ao_ints.irp.f rename to src/AO_one_e_integrals/pot_ao_ints.irp.f index 2afd7ebf..27f27096 100644 --- a/src/Integrals_Monoelec/pot_ao_ints.irp.f +++ b/src/AO_one_e_integrals/pot_ao_ints.irp.f @@ -11,7 +11,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] double precision :: overlap_x,overlap_y,overlap_z,overlap,dx,NAI_pol_mult if (read_ao_one_integrals) then - call ezfio_get_ao_basis_integral_nuclear(ao_nucl_elec_integral) + call ezfio_get_ao_one_e_integrals_integral_nuclear(ao_nucl_elec_integral) print *, 'AO N-e integrals read from disk' else @@ -73,7 +73,7 @@ BEGIN_PROVIDER [ double precision, ao_nucl_elec_integral, (ao_num,ao_num)] !$OMP END PARALLEL endif if (write_ao_one_integrals) then - call ezfio_set_ao_basis_integral_nuclear(ao_nucl_elec_integral) + call ezfio_set_ao_one_e_integrals_integral_nuclear(ao_nucl_elec_integral) print *, 'AO N-e integrals written to disk' endif diff --git a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f b/src/AO_one_e_integrals/pot_ao_pseudo_ints.irp.f similarity index 98% rename from src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f rename to src/AO_one_e_integrals/pot_ao_pseudo_ints.irp.f index 252a3e4f..97b3353a 100644 --- a/src/Integrals_Monoelec/pot_ao_pseudo_ints.irp.f +++ b/src/AO_one_e_integrals/pot_ao_pseudo_ints.irp.f @@ -5,7 +5,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num,ao_num)] END_DOC if (read_ao_one_integrals) then - call ezfio_get_ao_basis_integral_pseudo(ao_pseudo_integral) + call ezfio_get_ao_one_e_integrals_integral_pseudo(ao_pseudo_integral) print *, 'AO pseudopotential integrals read from disk' else @@ -21,7 +21,7 @@ BEGIN_PROVIDER [ double precision, ao_pseudo_integral, (ao_num,ao_num)] endif if (write_ao_one_integrals) then - call ezfio_set_ao_basis_integral_pseudo(ao_pseudo_integral) + call ezfio_set_ao_one_e_integrals_integral_pseudo(ao_pseudo_integral) print *, 'AO pseudopotential integrals written to disk' endif diff --git a/src/Integrals_Monoelec/pseudopot.f90 b/src/AO_one_e_integrals/pseudopot.f90 similarity index 100% rename from src/Integrals_Monoelec/pseudopot.f90 rename to src/AO_one_e_integrals/pseudopot.f90 diff --git a/src/AO_one_e_integrals/read_write.irp.f b/src/AO_one_e_integrals/read_write.irp.f new file mode 100644 index 00000000..e0fb75ce --- /dev/null +++ b/src/AO_one_e_integrals/read_write.irp.f @@ -0,0 +1,28 @@ + BEGIN_PROVIDER [ logical, read_ao_one_integrals ] +&BEGIN_PROVIDER [ logical, write_ao_one_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_one_integrals.EQ.'Read') then + read_ao_one_integrals = .True. + write_ao_one_integrals = .False. + + else if (disk_access_ao_one_integrals.EQ.'Write') then + read_ao_one_integrals = .False. + write_ao_one_integrals = .True. + + else if (disk_access_ao_one_integrals.EQ.'None') then + read_ao_one_integrals = .False. + write_ao_one_integrals = .False. + + else + print *, 'bielec_integrals/disk_access_ao_integrals has a wrong type' + stop 1 + + endif + +END_PROVIDER + diff --git a/src/Integrals_Monoelec/spread_dipole_ao.irp.f b/src/AO_one_e_integrals/spread_dipole_ao.irp.f similarity index 100% rename from src/Integrals_Monoelec/spread_dipole_ao.irp.f rename to src/AO_one_e_integrals/spread_dipole_ao.irp.f diff --git a/src/Bitmask/bitmasks.irp.f b/src/Bitmask/bitmasks.irp.f index d5472a25..d121ad25 100644 --- a/src/Bitmask/bitmasks.irp.f +++ b/src/Bitmask/bitmasks.irp.f @@ -46,7 +46,7 @@ BEGIN_PROVIDER [ integer(bit_kind), full_ijkl_bitmask_4, (N_int,4) ] enddo END_PROVIDER - BEGIN_PROVIDER [ integer(bit_kind), core_inact_act_bitmask_4, (N_int,4) ] +BEGIN_PROVIDER [ integer(bit_kind), core_inact_act_bitmask_4, (N_int,4) ] implicit none integer :: i do i=1,N_int diff --git a/src/Determinants/NEEDED_CHILDREN_MODULES b/src/Determinants/NEEDED_CHILDREN_MODULES index 8711010f..49c21b08 100644 --- a/src/Determinants/NEEDED_CHILDREN_MODULES +++ b/src/Determinants/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Integrals_Monoelec Integrals_Bielec +MO_Basis MO_one_e_integrals Integrals_Bielec diff --git a/src/Integrals_Bielec/NEEDED_CHILDREN_MODULES b/src/Integrals_Bielec/NEEDED_CHILDREN_MODULES index 245e3014..9d249718 100644 --- a/src/Integrals_Bielec/NEEDED_CHILDREN_MODULES +++ b/src/Integrals_Bielec/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Pseudo Bitmask ZMQ FourIdx +AO_one_e_integrals MO_one_e_integrals Pseudo Bitmask ZMQ FourIdx AO_Basis MO_Basis diff --git a/src/Integrals_Monoelec/EZFIO.cfg b/src/Integrals_Monoelec/EZFIO.cfg deleted file mode 100644 index 04e49ec1..00000000 --- a/src/Integrals_Monoelec/EZFIO.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[disk_access_mo_one_integrals] -type: Disk_access -doc: Read/Write MO one-electron integrals from/to disk [ Write | Read | None ] -interface: ezfio,provider,ocaml -default: None - -[disk_access_ao_one_integrals] -type: Disk_access -doc: Read/Write AO one-electron integrals from/to disk [ Write | Read | None ] -interface: ezfio,provider,ocaml -default: None - diff --git a/src/Integrals_Monoelec/NEEDED_CHILDREN_MODULES b/src/Integrals_Monoelec/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 1702863b..00000000 --- a/src/Integrals_Monoelec/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -MO_Basis Pseudo diff --git a/src/Integrals_Monoelec/README.rst b/src/Integrals_Monoelec/README.rst deleted file mode 100644 index 9a2ef0c5..00000000 --- a/src/Integrals_Monoelec/README.rst +++ /dev/null @@ -1,332 +0,0 @@ -Needed Modules -============== - -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `MO_Basis `_ -* `Pseudo `_ - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `MO_Basis `_ -* `Pseudo `_ - -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -`ao_deriv2_x `_ - second derivatives matrix elements in the ao basis - .. math:: - .br - {\tt ao_deriv2_x} = \langle \chi_i(x,y,z) \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle - - -`ao_deriv2_y `_ - second derivatives matrix elements in the ao basis - .. math:: - .br - {\tt ao_deriv2_x} = \langle \chi_i(x,y,z) \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle - - -`ao_deriv2_z `_ - second derivatives matrix elements in the ao basis - .. math:: - .br - {\tt ao_deriv2_x} = \langle \chi_i(x,y,z) \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle - - -`ao_deriv_1_x `_ - array of the integrals of AO_i * d/dx AO_j - array of the integrals of AO_i * d/dy AO_j - array of the integrals of AO_i * d/dz AO_j - - -`ao_deriv_1_y `_ - array of the integrals of AO_i * d/dx AO_j - array of the integrals of AO_i * d/dy AO_j - array of the integrals of AO_i * d/dz AO_j - - -`ao_deriv_1_z `_ - array of the integrals of AO_i * d/dx AO_j - array of the integrals of AO_i * d/dy AO_j - array of the integrals of AO_i * d/dz AO_j - - -`ao_dipole_x `_ - array of the integrals of AO_i * x AO_j - array of the integrals of AO_i * y AO_j - array of the integrals of AO_i * z AO_j - - -`ao_dipole_y `_ - array of the integrals of AO_i * x AO_j - array of the integrals of AO_i * y AO_j - array of the integrals of AO_i * z AO_j - - -`ao_dipole_z `_ - array of the integrals of AO_i * x AO_j - array of the integrals of AO_i * y AO_j - array of the integrals of AO_i * z AO_j - - -`ao_kinetic_integral `_ - array of the priminitve basis kinetic integrals - \langle \chi_i |\hat{T}| \chi_j \rangle - - -`ao_mono_elec_integral `_ - array of the mono electronic hamiltonian on the AOs basis - : sum of the kinetic and nuclear electronic potential - - -`ao_mono_elec_integral_diag `_ - array of the mono electronic hamiltonian on the AOs basis - : sum of the kinetic and nuclear electronic potential - - -`ao_nucl_elec_integral `_ - interaction nuclear electron - - -`ao_nucl_elec_integral_per_atom `_ - ao_nucl_elec_integral_per_atom(i,j,k) = - - where Rk is the geometry of the kth atom - - -`ao_pseudo_integral `_ - Pseudo-potential integrals - - -`ao_pseudo_integral_local `_ - Local pseudo-potential - - -`ao_pseudo_integral_non_local `_ - Local pseudo-potential - - -`ao_spread_x `_ - array of the integrals of AO_i * x^2 AO_j - array of the integrals of AO_i * y^2 AO_j - array of the integrals of AO_i * z^2 AO_j - - -`ao_spread_y `_ - array of the integrals of AO_i * x^2 AO_j - array of the integrals of AO_i * y^2 AO_j - array of the integrals of AO_i * z^2 AO_j - - -`ao_spread_z `_ - array of the integrals of AO_i * x^2 AO_j - array of the integrals of AO_i * y^2 AO_j - array of the integrals of AO_i * z^2 AO_j - - -`check_ortho `_ - Undocumented - - -`disk_access_ao_one_integrals `_ - Read/Write AO one-electron integrals from/to disk [ Write | Read | None ] - - -`disk_access_mo_one_integrals `_ - Read/Write MO one-electron integrals from/to disk [ Write | Read | None ] - - -`do_print `_ - Undocumented - - -`give_polynom_mult_center_mono_elec `_ - Undocumented - - -`i_x1_pol_mult_mono_elec `_ - Undocumented - - -`i_x2_pol_mult_mono_elec `_ - Undocumented - - -`int_gaus_pol `_ - Undocumented - - -`mo_dipole_x `_ - array of the integrals of MO_i * x MO_j - array of the integrals of MO_i * y MO_j - array of the integrals of MO_i * z MO_j - - -`mo_dipole_y `_ - array of the integrals of MO_i * x MO_j - array of the integrals of MO_i * y MO_j - array of the integrals of MO_i * z MO_j - - -`mo_dipole_z `_ - array of the integrals of MO_i * x MO_j - array of the integrals of MO_i * y MO_j - array of the integrals of MO_i * z MO_j - - -`mo_kinetic_integral `_ - Kinetic energy integrals in the MO basis - - -`mo_mono_elec_integral `_ - array of the mono electronic hamiltonian on the MOs basis : - sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) - - -`mo_nucl_elec_integral `_ - interaction nuclear electron on the MO basis - - -`mo_nucl_elec_integral_per_atom `_ - mo_nucl_elec_integral_per_atom(i,j,k) = - - where Rk is the geometry of the kth atom - - -`mo_pseudo_integral `_ - interaction nuclear electron on the MO basis - - -`mo_spread_x `_ - array of the integrals of MO_i * x^2 MO_j - array of the integrals of MO_i * y^2 MO_j - array of the integrals of MO_i * z^2 MO_j - - -`mo_spread_y `_ - array of the integrals of MO_i * x^2 MO_j - array of the integrals of MO_i * y^2 MO_j - array of the integrals of MO_i * z^2 MO_j - - -`mo_spread_z `_ - array of the integrals of MO_i * x^2 MO_j - array of the integrals of MO_i * y^2 MO_j - array of the integrals of MO_i * z^2 MO_j - - -`nai_pol_mult `_ - Undocumented - - -`orthonormalize_mos `_ - Undocumented - - -`overlap_bourrin_deriv_x `_ - Undocumented - - -`overlap_bourrin_dipole `_ - Undocumented - - -`overlap_bourrin_spread `_ - Undocumented - - -`overlap_bourrin_x `_ - Undocumented - - -`overlap_bourrin_x_abs `_ - Undocumented - - -`power `_ - Undocumented - - -`pseudo_dz_k_transp `_ - Transposed arrays for pseudopotentials - - -`pseudo_dz_kl_transp `_ - Transposed arrays for pseudopotentials - - -`pseudo_n_k_transp `_ - Transposed arrays for pseudopotentials - - -`pseudo_n_kl_transp `_ - Transposed arrays for pseudopotentials - - -`pseudo_v_k_transp `_ - Transposed arrays for pseudopotentials - - -`pseudo_v_kl_transp `_ - Transposed arrays for pseudopotentials - - -`read_ao_one_integrals `_ - One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals - - -`read_mo_one_integrals `_ - One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals - - -`read_one_e_integrals `_ - Read the 1-electron integrals into in A(m,n) from file 'filename' - - -`save_ortho_mos `_ - Undocumented - - -`v_e_n `_ - Undocumented - - -`v_phi `_ - Undocumented - - -`v_r `_ - Undocumented - - -`v_theta `_ - Undocumented - - -`wallis `_ - Undocumented - - -`write_ao_one_integrals `_ - One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals - - -`write_mo_one_integrals `_ - One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals - - -`write_one_e_integrals `_ - Write the 1-electron integrals stored in A(m,n) into file 'filename' - diff --git a/src/Integrals_Monoelec/read_write.irp.f b/src/Integrals_Monoelec/read_write.irp.f deleted file mode 100644 index 697bf356..00000000 --- a/src/Integrals_Monoelec/read_write.irp.f +++ /dev/null @@ -1,84 +0,0 @@ - BEGIN_PROVIDER [ logical, read_ao_one_integrals ] -&BEGIN_PROVIDER [ logical, read_mo_one_integrals ] -&BEGIN_PROVIDER [ logical, write_ao_one_integrals ] -&BEGIN_PROVIDER [ logical, write_mo_one_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_one_integrals.EQ.'Read') then - read_ao_one_integrals = .True. - write_ao_one_integrals = .False. - - else if (disk_access_ao_one_integrals.EQ.'Write') then - read_ao_one_integrals = .False. - write_ao_one_integrals = .True. - - else if (disk_access_ao_one_integrals.EQ.'None') then - read_ao_one_integrals = .False. - write_ao_one_integrals = .False. - - else - print *, 'bielec_integrals/disk_access_ao_integrals has a wrong type' - stop 1 - - endif - - if (disk_access_mo_one_integrals.EQ.'Read') then - read_mo_one_integrals = .True. - write_mo_one_integrals = .False. - - else if (disk_access_mo_one_integrals.EQ.'Write') then - read_mo_one_integrals = .False. - write_mo_one_integrals = .True. - - else if (disk_access_mo_one_integrals.EQ.'None') then - read_mo_one_integrals = .False. - write_mo_one_integrals = .False. - - else - print *, 'bielec_integrals/disk_access_mo_integrals has a wrong type' - stop 1 - - endif - -END_PROVIDER - -subroutine write_one_e_integrals(filename, A, m, n) - implicit none - BEGIN_DOC -! Write the 1-electron integrals stored in A(m,n) into file 'filename' - END_DOC - character(len=*), intent(in) :: filename - integer, intent(in) :: m,n - double precision, intent(in) :: A(m,n) - - integer :: iunit - integer, external :: getUnitAndOpen - character*(256) :: f - - iunit = getUnitAndOpen( trim(ezfio_work_dir)//trim(filename), 'W' ) - write(iunit) A - close(iunit) -end - -subroutine read_one_e_integrals(filename, A, m, n) - implicit none - BEGIN_DOC -! Read the 1-electron integrals into in A(m,n) from file 'filename' - END_DOC - character(len=*), intent(in) :: filename - integer, intent(in) :: m,n - double precision, intent(out) :: A(m,n) - - integer :: iunit - integer, external :: getUnitAndOpen - character*(256) :: f - - iunit = getUnitAndOpen( trim(ezfio_work_dir)//trim(filename), 'R' ) - read(iunit) A - close(iunit) -end - diff --git a/src/Integrals_Monoelec/tree_dependency.png b/src/Integrals_Monoelec/tree_dependency.png deleted file mode 100644 index f56c1e77..00000000 Binary files a/src/Integrals_Monoelec/tree_dependency.png and /dev/null differ diff --git a/src/MOGuess/NEEDED_CHILDREN_MODULES b/src/MOGuess/NEEDED_CHILDREN_MODULES index 0a8143ff..f4f641c2 100644 --- a/src/MOGuess/NEEDED_CHILDREN_MODULES +++ b/src/MOGuess/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Integrals_Monoelec +MO_Basis MO_one_e_integrals diff --git a/src/MO_Basis/EZFIO.cfg b/src/MO_Basis/EZFIO.cfg index 6e025934..ac4d3f44 100644 --- a/src/MO_Basis/EZFIO.cfg +++ b/src/MO_Basis/EZFIO.cfg @@ -31,26 +31,3 @@ type: character*(32) doc: Ao_md5 interface: ezfio -[integral_nuclear] -type: double precision -doc: Nucleus-electron integrals in MO basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio -default: false - -[integral_kinetic] -type: double precision -doc: Kinetic energy integrals in MO basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio -default: false - - -[integral_pseudo] -type: double precision -doc: Pseudopotential integrals in MO basis set -size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) -interface: ezfio -default: false - - diff --git a/src/MO_Basis/NEEDED_CHILDREN_MODULES b/src/MO_Basis/NEEDED_CHILDREN_MODULES index fd00d6f5..039ecf1a 100644 --- a/src/MO_Basis/NEEDED_CHILDREN_MODULES +++ b/src/MO_Basis/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -AO_Basis Electrons +AO_Basis AO_one_e_integrals Electrons diff --git a/src/MO_Basis/mos.irp.f b/src/MO_Basis/mos.irp.f index 2662c6e6..5a7053e5 100644 --- a/src/MO_Basis/mos.irp.f +++ b/src/MO_Basis/mos.irp.f @@ -174,18 +174,6 @@ BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_tot_num,ao_num) ] END_PROVIDER -BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_tot_num) ] - implicit none - BEGIN_DOC - ! Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. - END_DOC - - call dgemm('N','N', ao_num, mo_tot_num, ao_num, & - 1.d0, ao_overlap,size(ao_overlap,1), & - mo_coef, size(mo_coef,1), & - 0.d0, S_mo_coef, size(S_mo_coef,1)) - -END_PROVIDER BEGIN_PROVIDER [ double precision, mo_occ, (mo_tot_num) ] implicit none @@ -254,33 +242,6 @@ subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) deallocate(T) end -subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) - implicit none - BEGIN_DOC - ! Transform A from the MO basis to the AO basis - ! - ! (S.C).A_mo.(S.C)t - END_DOC - integer, intent(in) :: LDA_ao,LDA_mo - double precision, intent(in) :: A_mo(LDA_mo,mo_tot_num) - double precision, intent(out) :: A_ao(LDA_ao,ao_num) - double precision, allocatable :: T(:,:) - - allocate ( T(mo_tot_num,ao_num) ) - - call dgemm('N','T', mo_tot_num, ao_num, mo_tot_num, & - 1.d0, A_mo,size(A_mo,1), & - S_mo_coef, size(S_mo_coef,1), & - 0.d0, T, size(T,1)) - - call dgemm('N','N', ao_num, ao_num, mo_tot_num, & - 1.d0, S_mo_coef, size(S_mo_coef,1), & - T, size(T,1), & - 0.d0, A_ao, size(A_ao,1)) - - deallocate(T) -end - subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao) implicit none BEGIN_DOC diff --git a/src/MO_Basis/print_aos.irp.f b/src/MO_Basis/print_aos.irp.f deleted file mode 100644 index f6b3bedf..00000000 --- a/src/MO_Basis/print_aos.irp.f +++ /dev/null @@ -1,53 +0,0 @@ -program pouet - implicit none - integer :: i,j,k - double precision :: r(3) - double precision, allocatable :: aos_array(:),mos_array(:),ao_ortho_array(:) - allocate(aos_array(ao_num),mos_array(mo_tot_num), ao_ortho_array(ao_num)) - integer :: nx,ny - double precision :: interval_x - double precision :: xmin,xmax - double precision :: dx - - double precision :: interval_y - double precision :: ymin,ymax - double precision :: dy - - double precision :: val_max - -!do i = 1, ao_num -! write(41,'(100(F16.10,X))'),ao_ortho_canonical_overlap(i,:) -!enddo - -!stop - - - xmin = nucl_coord(1,1)-6.d0 - xmax = nucl_coord(2,1)+6.d0 - interval_x = xmax - xmin -!interval_x = nucl_dist(1,3) - nx = 500 - dx = interval_x/dble(nx) -!dx = dabs(interval_x)/dble(nx) * 1.d0/sqrt(2.d0) - - r = 0.d0 - r(3) = xmin -!r(2) = nucl_coord(1,2) -!r(3) = nucl_coord(1,3) -!r(1) = nucl_coord(2,1) -!r(2) = 1.D0 -!r(3) = nucl_coord(2,3) - double precision :: dr(3) -!dr = 0.d0 -!dr(1) = -dx -!dr(3) = dx - do j = 1, nx+1 - call give_all_mos_at_r(r,mos_array) - write(37,'(100(F16.10,X))') r(3),mos_array(1)*mos_array(1) , mos_array(2)*mos_array(2), mos_array(1)*mos_array(2) - write(38,'(100(F16.10,X))') r(3),mos_array(1), mos_array(2), mos_array(1)*mos_array(2) -! write(38,'(100(F16.10,X))') r(3),mos_array(10), mos_array(2) - 0.029916d0 * mos_array(10),mos_array(2) + 0.029916d0 * mos_array(10) - r(3) += dx -! r += dr - enddo - deallocate(aos_array,mos_array, ao_ortho_array) -end diff --git a/src/MO_one_e_integrals/EZFIO.cfg b/src/MO_one_e_integrals/EZFIO.cfg new file mode 100644 index 00000000..95a1de6d --- /dev/null +++ b/src/MO_one_e_integrals/EZFIO.cfg @@ -0,0 +1,27 @@ +[integral_nuclear] +type: double precision +doc: Nucleus-electron integrals in MO basis set +size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) +interface: ezfio +default: false + +[integral_kinetic] +type: double precision +doc: Kinetic energy integrals in MO basis set +size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) +interface: ezfio +default: false + +[integral_pseudo] +type: double precision +doc: Pseudopotential integrals in MO basis set +size: (mo_basis.mo_tot_num,mo_basis.mo_tot_num) +interface: ezfio +default: false + + +[disk_access_mo_one_integrals] +type: Disk_access +doc: Read/Write MO one-electron integrals from/to disk [ Write | Read | None ] +interface: ezfio,provider,ocaml +default: None diff --git a/src/MO_one_e_integrals/NEEDED_CHILDREN_MODULES b/src/MO_one_e_integrals/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..8b1b814e --- /dev/null +++ b/src/MO_one_e_integrals/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +AO_one_e_integrals MO_Basis Pseudo diff --git a/src/MO_one_e_integrals/README.rst b/src/MO_one_e_integrals/README.rst new file mode 100644 index 00000000..06b30465 --- /dev/null +++ b/src/MO_one_e_integrals/README.rst @@ -0,0 +1,14 @@ +================== +MO_one_e_integrals +================== + +All the one-electron integrals in MO basis are here. + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. diff --git a/src/MO_one_e_integrals/ao_to_mo.irp.f b/src/MO_one_e_integrals/ao_to_mo.irp.f new file mode 100644 index 00000000..2d0fc431 --- /dev/null +++ b/src/MO_one_e_integrals/ao_to_mo.irp.f @@ -0,0 +1,41 @@ +subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) + implicit none + BEGIN_DOC + ! Transform A from the MO basis to the AO basis + ! + ! (S.C).A_mo.(S.C)t + END_DOC + integer, intent(in) :: LDA_ao,LDA_mo + double precision, intent(in) :: A_mo(LDA_mo,mo_tot_num) + double precision, intent(out) :: A_ao(LDA_ao,ao_num) + double precision, allocatable :: T(:,:) + + allocate ( T(mo_tot_num,ao_num) ) + + call dgemm('N','T', mo_tot_num, ao_num, mo_tot_num, & + 1.d0, A_mo,size(A_mo,1), & + S_mo_coef, size(S_mo_coef,1), & + 0.d0, T, size(T,1)) + + call dgemm('N','N', ao_num, ao_num, mo_tot_num, & + 1.d0, S_mo_coef, size(S_mo_coef,1), & + T, size(T,1), & + 0.d0, A_ao, size(A_ao,1)) + + deallocate(T) +end + +BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_tot_num) ] + implicit none + BEGIN_DOC + ! Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. + END_DOC + + call dgemm('N','N', ao_num, mo_tot_num, ao_num, & + 1.d0, ao_overlap,size(ao_overlap,1), & + mo_coef, size(mo_coef,1), & + 0.d0, S_mo_coef, size(S_mo_coef,1)) + +END_PROVIDER + + diff --git a/src/Integrals_Monoelec/check_orthonormality.irp.f b/src/MO_one_e_integrals/check_orthonormality.irp.f similarity index 100% rename from src/Integrals_Monoelec/check_orthonormality.irp.f rename to src/MO_one_e_integrals/check_orthonormality.irp.f diff --git a/src/Integrals_Monoelec/kin_mo_ints.irp.f b/src/MO_one_e_integrals/kin_mo_ints.irp.f similarity index 82% rename from src/Integrals_Monoelec/kin_mo_ints.irp.f rename to src/MO_one_e_integrals/kin_mo_ints.irp.f index f53cef6b..308dd323 100644 --- a/src/Integrals_Monoelec/kin_mo_ints.irp.f +++ b/src/MO_one_e_integrals/kin_mo_ints.irp.f @@ -5,7 +5,7 @@ BEGIN_PROVIDER [double precision, mo_kinetic_integral, (mo_tot_num,mo_tot_num)] END_DOC if (read_mo_one_integrals) then - call ezfio_get_mo_basis_integral_kinetic(mo_kinetic_integral) + call ezfio_get_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) print *, 'MO kinetic integrals read from disk' else call ao_to_mo( & @@ -16,7 +16,7 @@ BEGIN_PROVIDER [double precision, mo_kinetic_integral, (mo_tot_num,mo_tot_num)] ) endif if (write_mo_one_integrals) then - call ezfio_set_mo_basis_integral_kinetic(mo_kinetic_integral) + call ezfio_set_mo_one_e_integrals_integral_kinetic(mo_kinetic_integral) print *, 'MO kinetic integrals written to disk' endif diff --git a/src/Integrals_Monoelec/mo_mono_ints.irp.f b/src/MO_one_e_integrals/mo_mono_ints.irp.f similarity index 100% rename from src/Integrals_Monoelec/mo_mono_ints.irp.f rename to src/MO_one_e_integrals/mo_mono_ints.irp.f diff --git a/src/MO_Basis/mo_overlap.irp.f b/src/MO_one_e_integrals/mo_overlap.irp.f similarity index 100% rename from src/MO_Basis/mo_overlap.irp.f rename to src/MO_one_e_integrals/mo_overlap.irp.f diff --git a/src/Integrals_Monoelec/orthonormalize.irp.f b/src/MO_one_e_integrals/orthonormalize.irp.f similarity index 100% rename from src/Integrals_Monoelec/orthonormalize.irp.f rename to src/MO_one_e_integrals/orthonormalize.irp.f diff --git a/src/Integrals_Monoelec/pot_mo_ints.irp.f b/src/MO_one_e_integrals/pot_mo_ints.irp.f similarity index 90% rename from src/Integrals_Monoelec/pot_mo_ints.irp.f rename to src/MO_one_e_integrals/pot_mo_ints.irp.f index 5e6556c1..24970bac 100644 --- a/src/Integrals_Monoelec/pot_mo_ints.irp.f +++ b/src/MO_one_e_integrals/pot_mo_ints.irp.f @@ -5,7 +5,7 @@ BEGIN_PROVIDER [double precision, mo_nucl_elec_integral, (mo_tot_num,mo_tot_num) END_DOC if (read_mo_one_integrals) then - call ezfio_get_mo_basis_integral_nuclear(mo_nucl_elec_integral) + call ezfio_get_mo_one_e_integrals_integral_nuclear(mo_nucl_elec_integral) print *, 'MO N-e integrals read from disk' else call ao_to_mo( & @@ -16,7 +16,7 @@ BEGIN_PROVIDER [double precision, mo_nucl_elec_integral, (mo_tot_num,mo_tot_num) ) endif if (write_mo_one_integrals) then - call ezfio_set_mo_basis_integral_nuclear(mo_nucl_elec_integral) + call ezfio_set_mo_one_e_integrals_integral_nuclear(mo_nucl_elec_integral) print *, 'MO N-e integrals written to disk' endif diff --git a/src/Integrals_Monoelec/pot_mo_pseudo_ints.irp.f b/src/MO_one_e_integrals/pot_mo_pseudo_ints.irp.f similarity index 83% rename from src/Integrals_Monoelec/pot_mo_pseudo_ints.irp.f rename to src/MO_one_e_integrals/pot_mo_pseudo_ints.irp.f index c49dfcf0..5e09168f 100644 --- a/src/Integrals_Monoelec/pot_mo_pseudo_ints.irp.f +++ b/src/MO_one_e_integrals/pot_mo_pseudo_ints.irp.f @@ -5,7 +5,7 @@ BEGIN_PROVIDER [double precision, mo_pseudo_integral, (mo_tot_num,mo_tot_num)] END_DOC if (read_mo_one_integrals) then - call ezfio_get_mo_basis_integral_pseudo(mo_pseudo_integral) + call ezfio_get_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) print *, 'MO pseudopotential integrals read from disk' else call ao_to_mo( & @@ -16,7 +16,7 @@ BEGIN_PROVIDER [double precision, mo_pseudo_integral, (mo_tot_num,mo_tot_num)] ) endif if (write_mo_one_integrals) then - call ezfio_set_mo_basis_integral_pseudo(mo_pseudo_integral) + call ezfio_set_mo_one_e_integrals_integral_pseudo(mo_pseudo_integral) print *, 'MO pseudopotential integrals written to disk' endif diff --git a/src/MO_one_e_integrals/read_write.irp.f b/src/MO_one_e_integrals/read_write.irp.f new file mode 100644 index 00000000..302ddc77 --- /dev/null +++ b/src/MO_one_e_integrals/read_write.irp.f @@ -0,0 +1,28 @@ + BEGIN_PROVIDER [ logical, read_mo_one_integrals ] +&BEGIN_PROVIDER [ logical, write_mo_one_integrals ] + + BEGIN_DOC + ! One level of abstraction for disk_access_mo_integrals + END_DOC + implicit none + + if (disk_access_mo_one_integrals.EQ.'Read') then + read_mo_one_integrals = .True. + write_mo_one_integrals = .False. + + else if (disk_access_mo_one_integrals.EQ.'Write') then + read_mo_one_integrals = .False. + write_mo_one_integrals = .True. + + else if (disk_access_mo_one_integrals.EQ.'None') then + read_mo_one_integrals = .False. + write_mo_one_integrals = .False. + + else + print *, 'bielec_integrals/disk_access_mo_integrals has a wrong type' + stop 1 + + endif + +END_PROVIDER + diff --git a/src/Integrals_Monoelec/save_ortho_mos.irp.f b/src/MO_one_e_integrals/save_ortho_mos.irp.f similarity index 100% rename from src/Integrals_Monoelec/save_ortho_mos.irp.f rename to src/MO_one_e_integrals/save_ortho_mos.irp.f diff --git a/src/Integrals_Monoelec/spread_dipole_mo.irp.f b/src/MO_one_e_integrals/spread_dipole_mo.irp.f similarity index 100% rename from src/Integrals_Monoelec/spread_dipole_mo.irp.f rename to src/MO_one_e_integrals/spread_dipole_mo.irp.f diff --git a/src/core_integrals/NEEDED_CHILDREN_MODULES b/src/core_integrals/NEEDED_CHILDREN_MODULES index 6a4d0040..2b19caa2 100644 --- a/src/core_integrals/NEEDED_CHILDREN_MODULES +++ b/src/core_integrals/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Integrals_Monoelec Integrals_Bielec Bitmask +MO_one_e_integrals Integrals_Bielec Bitmask