diff --git a/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default b/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default index cf54a1dd..0d9489d5 100644 --- a/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default +++ b/data/ezfio_defaults/WILL_BE_DELETED.ezfio_default @@ -1,19 +1,19 @@ bielec_integrals - read_ao_integrals False - read_mo_integrals False - write_ao_integrals False - write_mo_integrals False + 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 + direct false cis_dressed n_state_cis 10 n_core_cis 0 n_act_cis mo_basis_mo_tot_num - mp2_dressing False - standard_doubles True - en_2_2 False + mp2_dressing false + standard_doubles true + en_2_2 false determinants n_states 1 @@ -21,27 +21,27 @@ determinants n_det_max_jacobi 1000 threshold_generators 0.99 threshold_selectors 0.999 - read_wf False - s2_eig False - only_single_double_dm False + read_wf false + s2_eig false + only_single_double_dm false full_ci n_det_max_fci 10000 n_det_max_fci_property 50000 pt2_max 1.e-4 - do_pt2_end True + do_pt2_end true var_pt2_ratio 0.75 cas_sd n_det_max_cas_sd 100000 pt2_max 1.e-4 - do_pt2_end True + do_pt2_end true var_pt2_ratio 0.75 all_singles n_det_max_fci 50000 pt2_max 1.e-8 - do_pt2_end False + do_pt2_end false hartree_fock n_it_scf_max 200 @@ -55,7 +55,7 @@ cisd_selected cisd_sc2_selected n_det_max_cisd_sc2 10000 pt2_max 1.e-4 - do_pt2_end True + do_pt2_end true properties z_one_point 3.9 diff --git a/data/ezfio_defaults/determinants.ezfio_default b/data/ezfio_defaults/determinants.ezfio_default deleted file mode 100644 index 2cfbe3ea..00000000 --- a/data/ezfio_defaults/determinants.ezfio_default +++ /dev/null @@ -1,9 +0,0 @@ -determinants - n_states 1 - n_states_diag determinants_n_states - n_det_max_jacobi 1000 - threshold_generators 0.99 - threshold_selectors 0.999 - read_wf false - s2_eig false - only_single_double_dm false diff --git a/data/ezfio_defaults/properties.ezfio_default b/data/ezfio_defaults/properties.ezfio_default deleted file mode 100644 index ce06d413..00000000 --- a/data/ezfio_defaults/properties.ezfio_default +++ /dev/null @@ -1,2 +0,0 @@ -properties - z_one_point 3.9 diff --git a/ocaml/Input.ml b/ocaml/Input.ml index fe155f80..5e012996 100644 --- a/ocaml/Input.ml +++ b/ocaml/Input.ml @@ -4,7 +4,7 @@ open Core.Std;; include Input_ao_basis;; include Input_bitmasks;; -include Input_determinants;; +include Input_determinants_by_hand;; include Input_electrons;; include Input_mo_basis;; include Input_nuclei;; diff --git a/ocaml/Input_determinants.ml b/ocaml/Input_determinants_by_hand.ml similarity index 73% rename from ocaml/Input_determinants.ml rename to ocaml/Input_determinants_by_hand.ml index 9af2b7c0..4c0453e6 100644 --- a/ocaml/Input_determinants.ml +++ b/ocaml/Input_determinants_by_hand.ml @@ -2,20 +2,14 @@ open Qptypes;; open Qputils;; open Core.Std;; -module Determinants : sig +module Determinants_by_hand : sig type t = { n_int : N_int_number.t; bit_kind : Bit_kind.t; - mo_label : MO_label.t; n_det : Det_number.t; n_states : States_number.t; n_states_diag : States_number.t; - n_det_max_jacobi : Strictly_positive_int.t; - threshold_generators : Threshold.t; - threshold_selectors : Threshold.t; - read_wf : bool; expected_s2 : Positive_float.t; - s2_eig : bool; psi_coef : Det_coef.t array; psi_det : Determinant.t array; } with sexp @@ -28,16 +22,10 @@ end = struct type t = { n_int : N_int_number.t; bit_kind : Bit_kind.t; - mo_label : MO_label.t; n_det : Det_number.t; n_states : States_number.t; n_states_diag : States_number.t; - n_det_max_jacobi : Strictly_positive_int.t; - threshold_generators : Threshold.t; - threshold_selectors : Threshold.t; - read_wf : bool; expected_s2 : Positive_float.t; - s2_eig : bool; psi_coef : Det_coef.t array; psi_det : Determinant.t array; } with sexp @@ -77,22 +65,6 @@ end = struct |> Ezfio.set_determinants_bit_kind ;; - - let read_mo_label () = - if (not (Ezfio.has_determinants_mo_label ())) then - Ezfio.get_mo_basis_mo_label () - |> Ezfio.set_determinants_mo_label - ; - Ezfio.get_determinants_mo_label () - |> MO_label.of_string - ;; - - let write_mo_label l = - MO_label.to_string l - |> Ezfio.set_determinants_mo_label - ;; - - let read_n_det () = if not (Ezfio.has_determinants_n_det ()) then Ezfio.set_determinants_n_det 1 @@ -138,67 +110,6 @@ end = struct Ezfio.set_determinants_n_states_diag (max n_states n) ;; - - let read_n_det_max_jacobi () = - if not (Ezfio.has_determinants_n_det_max_jacobi ()) then - get_default "n_det_max_jacobi" - |> Int.of_string - |> Ezfio.set_determinants_n_det_max_jacobi - ; - Ezfio.get_determinants_n_det_max_jacobi () - |> Strictly_positive_int.of_int - ;; - - let write_n_det_max_jacobi n = - Strictly_positive_int.to_int n - |> Ezfio.set_determinants_n_det_max_jacobi - ;; - - - let read_threshold_generators () = - if not (Ezfio.has_determinants_threshold_generators ()) then - get_default "threshold_generators" - |> Float.of_string - |> Ezfio.set_determinants_threshold_generators - ; - Ezfio.get_determinants_threshold_generators () - |> Threshold.of_float - ;; - - let write_threshold_generators t = - Threshold.to_float t - |> Ezfio.set_determinants_threshold_generators - ;; - - - let read_threshold_selectors () = - if not (Ezfio.has_determinants_threshold_selectors ()) then - get_default "threshold_selectors" - |> Float.of_string - |> Ezfio.set_determinants_threshold_selectors - ; - Ezfio.get_determinants_threshold_selectors () - |> Threshold.of_float - ;; - - let write_threshold_selectors t = - Threshold.to_float t - |> Ezfio.set_determinants_threshold_selectors - ;; - - - let read_read_wf () = - if not (Ezfio.has_determinants_read_wf ()) then - get_default "read_wf" - |> Bool.of_string - |> Ezfio.set_determinants_read_wf - ; - Ezfio.get_determinants_read_wf () - ;; - - let write_read_wf = Ezfio.set_determinants_read_wf ;; - - let read_expected_s2 () = if not (Ezfio.has_determinants_expected_s2 ()) then begin @@ -219,19 +130,6 @@ end = struct |> Ezfio.set_determinants_expected_s2 ;; - - let read_s2_eig () = - if not (Ezfio.has_determinants_s2_eig ()) then - get_default "s2_eig" - |> Bool.of_string - |> Ezfio.set_determinants_s2_eig - ; - Ezfio.get_determinants_s2_eig () - ;; - - let write_s2_eig = Ezfio.set_determinants_s2_eig ;; - - let read_psi_coef () = if not (Ezfio.has_determinants_psi_coef ()) then begin @@ -315,16 +213,10 @@ end = struct Some { n_int = read_n_int () ; bit_kind = read_bit_kind () ; - mo_label = read_mo_label () ; n_det = read_n_det () ; n_states = read_n_states () ; n_states_diag = read_n_states_diag () ; - n_det_max_jacobi = read_n_det_max_jacobi () ; - threshold_generators = read_threshold_generators () ; - threshold_selectors = read_threshold_selectors () ; - read_wf = read_read_wf () ; expected_s2 = read_expected_s2 () ; - s2_eig = read_s2_eig () ; psi_coef = read_psi_coef () ; psi_det = read_psi_det () ; } @@ -334,31 +226,19 @@ end = struct let write { n_int ; bit_kind ; - mo_label ; n_det ; n_states ; n_states_diag ; - n_det_max_jacobi ; - threshold_generators ; - threshold_selectors ; - read_wf ; expected_s2 ; - s2_eig ; psi_coef ; psi_det ; } = write_n_int n_int ; write_bit_kind bit_kind; - write_mo_label mo_label; write_n_det n_det; write_n_states n_states; write_n_states_diag ~n_states:n_states n_states_diag; - write_n_det_max_jacobi n_det_max_jacobi; - write_threshold_generators threshold_generators; - write_threshold_selectors threshold_selectors; - write_read_wf read_wf; write_expected_s2 expected_s2; - write_s2_eig s2_eig; write_psi_coef ~n_det:n_det psi_coef ~n_states:n_states; write_psi_det ~n_int:n_int ~n_det:n_det psi_det; ;; @@ -399,35 +279,17 @@ end = struct |> String.concat_array ~sep:"\n" in Printf.sprintf " -Read the current wave function :: - - read_wf = %s - -Label of the MOs on which the determinants were computed :: - - mo_label = %s - Force the selected wave function to be an eigenfunction of S^2. If true, input the expected value of S^2 :: - s2_eig = %s expected_s2 = %s -Thresholds on generators and selectors (fraction of the norm) :: - - threshold_generators = %s - threshold_selectors = %s - Number of requested states, and number of states used for the Davidson diagonalization :: n_states = %s n_states_diag = %s -Maximum size of the Hamiltonian matrix that will be fully diagonalized :: - - n_det_max_jacobi = %s - Number of determinants :: n_det = %s @@ -436,15 +298,9 @@ Determinants :: %s " - (b.read_wf |> Bool.to_string) - (b.mo_label |> MO_label.to_string) - (b.s2_eig |> Bool.to_string) (b.expected_s2 |> Positive_float.to_string) - (b.threshold_generators |> Threshold.to_string) - (b.threshold_selectors |> Threshold.to_string) (b.n_states |> States_number.to_string) (b.n_states_diag |> States_number.to_string) - (b.n_det_max_jacobi |> Strictly_positive_int.to_string) (b.n_det |> Det_number.to_string) det_text |> Rst_string.of_string @@ -456,31 +312,19 @@ Determinants :: Printf.sprintf " n_int = %s bit_kind = %s -mo_label = \"%s\" n_det = %s n_states = %s n_states_diag = %s -n_det_max_jacobi = %s -threshold_generators = %s -threshold_selectors = %s -read_wf = %s expected_s2 = %s -s2_eig = %s psi_coef = %s psi_det = %s " (b.n_int |> N_int_number.to_string) (b.bit_kind |> Bit_kind.to_string) - (b.mo_label |> MO_label.to_string) (b.n_det |> Det_number.to_string) (b.n_states |> States_number.to_string) (b.n_states_diag |> States_number.to_string) - (b.n_det_max_jacobi |> Strictly_positive_int.to_string) - (b.threshold_generators |> Threshold.to_string) - (b.threshold_selectors |> Threshold.to_string) - (b.read_wf |> Bool.to_string) (b.expected_s2 |> Positive_float.to_string) - (b.s2_eig |> Bool.to_string) (b.psi_coef |> Array.to_list |> List.map ~f:Det_coef.to_string |> String.concat ~sep:", ") (b.psi_det |> Array.to_list |> List.map ~f:(Determinant.to_string diff --git a/scripts/clean_modules.sh b/scripts/clean_modules.sh index cc25cede..452724f2 100755 --- a/scripts/clean_modules.sh +++ b/scripts/clean_modules.sh @@ -14,7 +14,7 @@ function do_clean() { rm -rf -- \ IRPF90_temp IRPF90_man Makefile.depend $(cat NEEDED_MODULES) include \ - ezfio_interface.irp.f irpf90.make irpf90_entities tags $(ls_exe) + ezfio_interface.irp.f irpf90.make irpf90_entities tags $(ls_exe) *.mod } if [[ -z $1 ]] diff --git a/scripts/ezfio_interface/ei_handler.py b/scripts/ezfio_interface/ei_handler.py index a02b13d5..6d18d071 100755 --- a/scripts/ezfio_interface/ei_handler.py +++ b/scripts/ezfio_interface/ei_handler.py @@ -70,9 +70,9 @@ def is_bool(str_): Take a string, if is a bool return the conversion into fortran and ocaml. """ - if "true" in str_.lower(): + if "true" in str_.strip().lower(): return Type(None, "true", ".True.") - elif "false" in str_.lower(): + elif "false" in str_.strip().lower(): return Type(None, "false", ".False") else: raise TypeError @@ -112,6 +112,8 @@ def get_type_dict(): # ~#~#~#~#~#~#~#~ # fancy_type['integer'] = Type(None, "int", "integer") + fancy_type['integer*8'] = Type(None, "int", "integer*8") + fancy_type['int'] = Type(None, "int", "integer") fancy_type['float'] = Type(None, "float", "double precision") @@ -121,7 +123,7 @@ def get_type_dict(): fancy_type['bool'] = Type(None, "bool", "logical") fancy_type['character*(32)'] = Type(None, "string", "character*(32)") - fancy_type['character*(60)'] = Type(None, "string", "character*(60)") + fancy_type['character*(64)'] = Type(None, "string", "character*(68)") fancy_type['character*(256)'] = Type(None, "string", "character*(256)") # ~#~#~#~#~#~#~#~ # @@ -203,7 +205,7 @@ def get_dict_config_file(config_file_path, module_lower): - ezfio_name : Will be the name of the file - ezfio_dir : Will be the folder who containt the ezfio_name * /ezfio_dir/ezfio_name - * equal to MODULE_lower name for the moment. + * equal to MODULE_lower name by default. - interface : The provider is a imput or a output - default : The default value /!\ stored in a Type named type! if interface == output @@ -216,7 +218,7 @@ def get_dict_config_file(config_file_path, module_lower): d = defaultdict(dict) l_info_required = ["doc", "interface"] - l_info_optional = ["ezfio_name", "size"] + l_info_optional = ["ezfio_dir", "ezfio_name", "size"] # ~#~#~#~#~#~#~#~#~#~#~ # # L o a d _ C o n f i g # @@ -238,10 +240,8 @@ def get_dict_config_file(config_file_path, module_lower): pvd = section.lower() # Create the dictionary who containt the value per default - d_default = {"ezfio_name": pvd} - - # Set the ezfio_dir - d[pvd]["ezfio_dir"] = module_lower + d_default = {"ezfio_name": pvd, + "ezfio_dir": module_lower} # Check if type if avalaible type_ = config_file.get(section, "type") @@ -269,7 +269,7 @@ def get_dict_config_file(config_file_path, module_lower): d[pvd][option] = d_default[option] # If interface is input we need a default value information - if d[pvd]["interface"] == "input": + if d[pvd]["interface"].lower() == "input": try: default_raw = config_file.get(section, "default") except ConfigParser.NoOptionError: @@ -294,6 +294,7 @@ def create_ezfio_provider(dict_ezfio_cfg): default size} create the a list who containt all the code for the provider + output = output_dict_info['ezfio_dir' return [code, ...] """ from ezfio_generate_provider import EZFIO_Provider diff --git a/scripts/ezfio_interface/ezfio_generate_ocaml.py b/scripts/ezfio_interface/ezfio_generate_ocaml.py index 25b6c55f..37b6c6ad 100755 --- a/scripts/ezfio_interface/ezfio_generate_ocaml.py +++ b/scripts/ezfio_interface/ezfio_generate_ocaml.py @@ -1,7 +1,13 @@ #!/usr/bin/env python +""" +This programme generate all the +ocaml template needed by qp_edit + +You can see `ezfio_generate_provider.py` +for an example of utilisation +""" import sys -import os # If type in **kwargs from ei_handler import Type diff --git a/scripts/ezfio_interface/ezfio_generate_provider.py b/scripts/ezfio_interface/ezfio_generate_provider.py index af4fcd6a..7f3c8441 100755 --- a/scripts/ezfio_interface/ezfio_generate_provider.py +++ b/scripts/ezfio_interface/ezfio_generate_provider.py @@ -45,7 +45,7 @@ END_PROVIDER self.set_write() for v in self.values: if not v: - msg = "Error : %s is not set in ezfio_with_default.py" % (v) + msg = "Error : %s is not set in EZFIO.cfg" % (v) print >>sys.stderr, msg sys.exit(1) return self.data % self.__dict__ diff --git a/scripts/ezfio_interface/qp_convert_ezfio_v1_to_v2.sh b/scripts/ezfio_interface/qp_convert_ezfio_v1_to_v2.sh new file mode 100755 index 00000000..3ef9a5f3 --- /dev/null +++ b/scripts/ezfio_interface/qp_convert_ezfio_v1_to_v2.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# Convert a old ezfio file (with option.irp.f ezfio_default) +# into a new EZFIO.cfg type + +# Hartree Fock +# Changin the case, don't know if is needed or not + +echo "Will tranform qp_v1.*_ezfio to qp_v2.*_ezfio" +echo "All action are irrevocable! And is by choice" +echo "You need to stop to use a old version! Plz..." + +echo "Change thresh_SCF > thresh_scf0" +mv $1/hartree_Fock/thresh_SCF $1/hartree_fock/thresh_scf 2> /dev/null + +# Set disk_acess +echo "Change {read,write}_ao_integrals > disk_access_ao_integrals" + +biint=$1/bielec_integrals + +if [[ -f $biint/read_ao_integrals ]]; then + if [[ `cat $1/bielec_integrals/read_ao_integrals` -eq "T" ]] + then + echo "Read" > $biint/disk_access_ao_integrals + + elif [[ `cat $biint/write_ao_integrals` -eq "T" ]] + then + echo "Write" > $biint/disk_access_ao_integrals + + else + echo "None" > $biint/disk_access_ao_integrals + + fi + rm $biint/read_ao_integrals $biint/write_ao_integrals $biint/write_ao_intergals 2> /dev/null +fi + +echo "Done" \ No newline at end of file diff --git a/scripts/ezfio_interface/qp_convert_output_to_ezfio.py b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py new file mode 100755 index 00000000..6b5c5fcd --- /dev/null +++ b/scripts/ezfio_interface/qp_convert_output_to_ezfio.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python +""" +This function acceep + +Usage: + qp_convert_output_to_ezfio.py [--ezfio=] + +Option: + file.out is the file to check (like gamess.out) + folder.ezfio is the name you whant for the ezfio + (by default is file.out.ezfio) + +""" + + +import sys +import os +from functools import reduce + + +# ~#~#~#~#~#~#~#~ # +# Add to the path # +# ~#~#~#~#~#~#~#~ # + + +try: + QPACKAGE_ROOT = os.environ["QPACKAGE_ROOT"] +except: + print "Error: QPACKAGE_ROOT environment variable not found." + sys.exit(1) +else: + sys.path = [QPACKAGE_ROOT + "/EZFIO/Python", + QPACKAGE_ROOT + "/resultsFile", + QPACKAGE_ROOT + "/scripts"] + sys.path + +# ~#~#~#~#~#~ # +# I m p o r t # +# ~#~#~#~#~#~ # + +from ezfio import ezfio + + +try: + from resultsFile import * +except: + print "Error: resultsFile Python library not installed" + sys.exit(1) + +from docopt import docopt + +# _ +# |_ ._ _ _|_ o _ ._ +# | |_| | | (_ |_ | (_) | | +# + + +def write_ezfio(res, filename): + + res.clean_uncontractions() + ezfio.set_file(filename) + + # _ + # |_ | _ _ _|_ ._ _ ._ _ + # |_ | (/_ (_ |_ | (_) | | _> + # + ezfio.set_electrons_elec_alpha_num(res.num_alpha) + ezfio.set_electrons_elec_beta_num(res.num_beta) + + # + # |\ | _ | _ o + # | \| |_| (_ | (/_ | + # + + # ~#~#~#~ # + # I n i t # + # ~#~#~#~ # + + charge = [] + coord_x = [] + coord_y = [] + coord_z = [] + + # ~#~#~#~#~#~#~ # + # P a r s i n g # + # ~#~#~#~#~#~#~ # + + for a in res.geometry: + charge.append(a.charge) + if res.units == 'BOHR': + coord_x.append(a.coord[0]) + coord_y.append(a.coord[1]) + coord_z.append(a.coord[2]) + else: + coord_x.append(a.coord[0] / a0) + coord_y.append(a.coord[1] / a0) + coord_z.append(a.coord[2] / a0) + + # ~#~#~#~#~ # + # W r i t e # + # ~#~#~#~#~ # + + ezfio.set_nuclei_nucl_num(len(res.geometry)) + ezfio.set_nuclei_nucl_charge(charge) + + # Transformt H1 into H + import re + p = re.compile(ur'(\d*)$') + label = [p.sub("", x.name) for x in res.geometry] + ezfio.set_nuclei_nucl_label(label) + + ezfio.set_nuclei_nucl_coord(coord_x + coord_y + coord_z) + + # _ + # /\ _ _ |_) _. _ o _ + # /--\ (_) _> |_) (_| _> | _> + # + + # ~#~#~#~ # + # I n i t # + # ~#~#~#~ # + + import string + at = [] + num_prim = [] + power_x = [] + power_y = [] + power_z = [] + coefficient = [] + exponent = [] + + res.clean_contractions() + res.convert_to_cartesian() + + # ~#~#~#~#~#~#~ # + # P a r s i n g # + # ~#~#~#~#~#~#~ # + + for b in res.basis: + c = b.center + for i, atom in enumerate(res.geometry): + if atom.coord == c: + at.append(i + 1) + num_prim.append(len(b.prim)) + s = b.sym + power_x.append(string.count(s, "x")) + power_y.append(string.count(s, "y")) + power_z.append(string.count(s, "z")) + coefficient.append(b.coef) + exponent.append([p.expo for p in b.prim]) + + # ~#~#~#~#~ # + # W r i t e # + # ~#~#~#~#~ # + + ezfio.set_ao_basis_ao_num(len(res.basis)) + ezfio.set_ao_basis_ao_nucl(at) + ezfio.set_ao_basis_ao_prim_num(num_prim) + ezfio.set_ao_basis_ao_power(power_x + power_y + power_z) + + # ~#~#~#~#~#~#~ # + # P a r s i n g # + # ~#~#~#~#~#~#~ # + + prim_num_max = ezfio.get_ao_basis_ao_prim_num_max() + + for i in range(len(res.basis)): + coefficient[ + i] += [0. for j in range(len(coefficient[i]), prim_num_max)] + exponent[i] += [0. for j in range(len(exponent[i]), prim_num_max)] + + coefficient = reduce(lambda x, y: x + y, coefficient, []) + exponent = reduce(lambda x, y: x + y, exponent, []) + + coef = [] + expo = [] + for i in range(prim_num_max): + for j in range(i, len(coefficient), prim_num_max): + coef.append(coefficient[j]) + expo.append(exponent[j]) + + # ~#~#~#~#~ # + # W r i t e # + # ~#~#~#~#~ # + + ezfio.set_ao_basis_ao_coef(coef) + ezfio.set_ao_basis_ao_expo(expo) + ezfio.set_ao_basis_ao_basis("Read by resultsFile") + + # _ + # |\/| _ _ |_) _. _ o _ + # | | (_) _> |_) (_| _> | _> + # + + # ~#~#~#~ # + # I n i t # + # ~#~#~#~ # + + MoTag = res.determinants_mo_type + ezfio.set_mo_basis_mo_label('Orthonormalized') + MO_type = MoTag + allMOs = res.mo_sets[MO_type] + + # ~#~#~#~#~#~#~ # + # P a r s i n g # + # ~#~#~#~#~#~#~ # + + try: + closed = [(allMOs[i].eigenvalue, i) for i in res.closed_mos] + active = [(allMOs[i].eigenvalue, i) for i in res.active_mos] + virtual = [(allMOs[i].eigenvalue, i) for i in res.virtual_mos] + except: + closed = [] + virtual = [] + active = [(allMOs[i].eigenvalue, i) for i in range(len(allMOs))] + + closed = map(lambda x: x[1], closed) + active = map(lambda x: x[1], active) + virtual = map(lambda x: x[1], virtual) + MOindices = closed + active + virtual + + MOs = [] + for i in MOindices: + MOs.append(allMOs[i]) + + mo_tot_num = len(MOs) + while len(MOindices) < mo_tot_num: + MOindices.append(len(MOindices)) + + MOmap = list(MOindices) + for i in range(len(MOindices)): + MOmap[i] = MOindices.index(i) + + energies = [] + for i in xrange(mo_tot_num): + energies.append(MOs[i].eigenvalue) + + if res.occ_num is not None: + OccNum = [] + for i in MOindices: + OccNum.append(res.occ_num[MO_type][i]) + + while len(OccNum) < mo_tot_num: + OccNum.append(0.) + + MoMatrix = [] + sym0 = [i.sym for i in res.mo_sets[MO_type]] + sym = [i.sym for i in res.mo_sets[MO_type]] + for i in xrange(len(sym)): + sym[MOmap[i]] = sym0[i] + + MoMatrix = [] + for i in xrange(len(MOs)): + m = MOs[i] + for coef in m.vector: + MoMatrix.append(coef) + + while len(MoMatrix) < len(MOs[0].vector) ** 2: + MoMatrix.append(0.) + + # ~#~#~#~#~ # + # W r i t e # + # ~#~#~#~#~ # + + ezfio.set_mo_basis_mo_tot_num(mo_tot_num) + ezfio.set_mo_basis_mo_occ(OccNum) + ezfio.set_mo_basis_mo_coef(MoMatrix) + + +def get_full_path(file_path): + file_path = os.path.expanduser(file_path) + file_path = os.path.expandvars(file_path) + file_path = os.path.abspath(file_path) + return file_path + +if __name__ == '__main__': + arguments = docopt(__doc__) + + file_ = get_full_path(arguments['']) + + if arguments["--ezfio"]: + ezfio_file = get_full_path(arguments["--ezfio"]) + else: + ezfio_file = "{0}.ezfio".format(file_) + + try: + res_file = getFile(file_) + except: + raise + else: + print file_, 'recognized as', str(res_file).split('.')[-1].split()[0] + + write_ezfio(res_file, ezfio_file) diff --git a/scripts/ezfio_interface/qp_edit_template b/scripts/ezfio_interface/qp_edit_template index 8d52acfd..2990a193 100644 --- a/scripts/ezfio_interface/qp_edit_template +++ b/scripts/ezfio_interface/qp_edit_template @@ -4,14 +4,16 @@ open Core.Std;; (** Interactive editing of the input. -@author A. Scemama +WARNING +This file is autogenerad by +`${{QP_ROOT}}/script/ezfio_interface/ei_handler.py` *) (** Keywords used to define input sections *) type keyword = | Ao_basis -| Determinants +| Determinants_by_hand | Electrons | Mo_basis | Nuclei @@ -20,11 +22,11 @@ type keyword = let keyword_to_string = function -| Ao_basis -> "AO basis" -| Determinants -> "Determinants" -| Electrons -> "Electrons" -| Mo_basis -> "MO basis" -| Nuclei -> "Molecule" +| Ao_basis -> "AO basis" +| Determinants_by_hand -> "Determinants_by_hand" +| Electrons -> "Electrons" +| Mo_basis -> "MO basis" +| Nuclei -> "Molecule" {keywords_to_string} ;; @@ -72,8 +74,8 @@ let get s = f Nuclei.(read, to_rst) | Ao_basis -> f Ao_basis.(read, to_rst) - | Determinants -> - f Determinants.(read, to_rst) + | Determinants_by_hand -> + f Determinants_by_hand.(read, to_rst) {section_to_rst} end with @@ -114,7 +116,7 @@ let set str s = match s with {write} | Electrons -> write Electrons.(of_rst, write) s - | Determinants -> write Determinants.(of_rst, write) s + | Determinants_by_hand -> write Determinants_by_hand.(of_rst, write) s | Nuclei -> write Nuclei.(of_rst, write) s | Ao_basis -> () (* TODO *) | Mo_basis -> () (* TODO *) @@ -162,7 +164,7 @@ let run check_only ezfio_filename = Electrons ; {tasks} Mo_basis; - Determinants ; + Determinants_by_hand ; ] in diff --git a/scripts/ezfio_with_default.py b/scripts/ezfio_with_default.py index 1b5f01a8..a2dfa430 100755 --- a/scripts/ezfio_with_default.py +++ b/scripts/ezfio_with_default.py @@ -90,13 +90,19 @@ END_PROVIDER self.default = t def get_default(self): - filename = '/'.join( [os.environ['QPACKAGE_ROOT'], 'data', - 'ezfio_defaults', - 'WILL_BE_DELETED.ezfio_default'] ) + mypath = '/'.join( [os.environ['QPACKAGE_ROOT'], 'data', + 'ezfio_defaults'] ) + + from os import listdir + from os.path import isfile, join + onlyfiles = [ join(mypath,f) for f in listdir(mypath) if isfile(join(mypath,f)) ] + + lines = [] + for filename in onlyfiles: + file = open(filename,'r') + lines.extend(file.readlines()) + file.close() - file = open(filename,'r') - lines = file.readlines() - file.close() k=-1 # Search directory for k,line in enumerate(lines): diff --git a/scripts/generate_h_apply.py b/scripts/generate_h_apply.py index 280c9f72..072a8f1e 100755 --- a/scripts/generate_h_apply.py +++ b/scripts/generate_h_apply.py @@ -1,7 +1,7 @@ #!/usr/bin/env python import os -file = open(os.environ["QPACKAGE_ROOT"]+'/src/Dets/H_apply_template.f','r') +file = open(os.environ["QPACKAGE_ROOT"]+'/src/Determinants/H_apply_template.f','r') template = file.read() file.close() @@ -104,7 +104,7 @@ class H_apply(object): endif SOFT_TOUCH psi_det psi_coef N_det """ - s["printout_now"] = """write(output_Dets,*) & + s["printout_now"] = """write(output_determinants,*) & 100.*float(i_generator)/float(N_det_generators), '% in ', wall_1-wall_0, 's'""" self.data = s @@ -211,9 +211,9 @@ class H_apply(object): delta_pt2(k) = 0.d0 pt2_old(k) = 0.d0 enddo - write(output_Dets,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') & + write(output_determinants,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') & 'N_generators', 'Norm', 'Delta PT2', 'PT2', 'Est. PT2', 'secs' - write(output_Dets,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') & + write(output_determinants,'(A12, X, A8, 3(2X, A9), 2X, A8, 2X, A8, 2X, A8)') & '============', '========', '=========', '=========', '=========', & '=========' """ @@ -226,7 +226,7 @@ class H_apply(object): """ self.data["printout_now"] = """ do k=1,N_st - write(output_Dets,'(I10, 4(2X, F9.6), 2X, F8.1)') & + write(output_determinants,'(I10, 4(2X, F9.6), 2X, F8.1)') & i_generator, norm_psi(k), delta_pt2(k), pt2(k), & pt2(k)/(norm_psi(k)*norm_psi(k)), & wall_1-wall_0 @@ -258,7 +258,7 @@ class H_apply(object): ! SOFT_TOUCH psi_det psi_coef N_det selection_criterion_min = min(selection_criterion_min, maxval(select_max))*0.1d0 selection_criterion = selection_criterion_min - call write_double(output_Dets,selection_criterion,'Selection criterion') + call write_double(output_determinants,selection_criterion,'Selection criterion') """ self.data["keys_work"] = """ e_2_pert_buffer = 0.d0 diff --git a/scripts/qp_convert.py b/scripts/qp_convert.py deleted file mode 100755 index ab008e9e..00000000 --- a/scripts/qp_convert.py +++ /dev/null @@ -1,210 +0,0 @@ -#!/usr/bin/env python - -import sys,os -try: - QPACKAGE_ROOT = os.environ["QPACKAGE_ROOT"] -except: - print "Error: QPACKAGE_ROOT environment variable not found." - sys.exit(1) - -sys.path = [ QPACKAGE_ROOT+"/EZFIO/Python", QPACKAGE_ROOT+"/resultsFile" ]+sys.path -from ezfio import ezfio -import ezfio as ez -print "EZFIO: ", os.path.dirname(ez.__file__) - -try: - from resultsFile import * -except: - print "Error: resultsFile Python library not installed" - sys.exit(1) - - -def write_ezfioFile(res,filename): - res.clean_uncontractions() - ezfio.set_file(filename) - -# Electrons - ezfio.set_electrons_elec_alpha_num(res.num_alpha) - ezfio.set_electrons_elec_beta_num(res.num_beta) - -# Nuclei - ezfio.set_nuclei_nucl_num(len(res.geometry)) - charge = [] - coord = [] - coord_x = [] - coord_y = [] - coord_z = [] - for a in res.geometry: - charge.append(a.charge) - if res.units == 'BOHR': - coord_x.append(a.coord[0]) - coord_y.append(a.coord[1]) - coord_z.append(a.coord[2]) - else: - coord_x.append(a.coord[0]/a0) - coord_y.append(a.coord[1]/a0) - coord_z.append(a.coord[2]/a0) - ezfio.set_nuclei_nucl_charge(charge) - label = map(lambda x: x.name, res.geometry) - ezfio.set_nuclei_nucl_label(label) - ezfio.set_nuclei_nucl_coord(coord_x+coord_y+coord_z) - -# Basis - basis = res.uncontracted_basis - geom = res.geometry - - res.clean_contractions() - # AO Basis - import string - at = [] - num_prim = [] - magnetic_number = [] - angular_number = [] - power_x = [] - power_y = [] - power_z = [] - coefficient = [] - exponent = [] - res.convert_to_cartesian() - for b in res.basis: - c = b.center - for i,atom in enumerate(res.geometry): - if atom.coord == c: - at.append(i+1) - num_prim.append(len(b.prim)) - s = b.sym - power_x.append( string.count(s,"x") ) - power_y.append( string.count(s,"y") ) - power_z.append( string.count(s,"z") ) - coefficient.append( b.coef ) - exponent.append( [ p.expo for p in b.prim ] ) - ezfio.set_ao_basis_ao_num(len(res.basis)) - ezfio.set_ao_basis_ao_nucl(at) - ezfio.set_ao_basis_ao_prim_num(num_prim) - ezfio.set_ao_basis_ao_power(power_x+power_y+power_z) - prim_num_max = ezfio.get_ao_basis_ao_prim_num_max() - len_res_basis = len(res.basis) - for i in range(len(res.basis)): - coefficient[i] += [ 0. for j in range(len(coefficient[i]),prim_num_max) ] - exponent[i] += [ 0. for j in range(len(exponent[i]),prim_num_max) ] - coefficient = reduce(lambda x, y: x+y, coefficient, []) - exponent = reduce(lambda x, y: x+y, exponent, []) - coef = [] - expo = [] - for i in range(prim_num_max): - for j in range(i,len(coefficient),prim_num_max): - coef.append ( coefficient[j] ) - expo.append ( exponent[j] ) - ezfio.set_ao_basis_ao_coef(coef) - ezfio.set_ao_basis_ao_expo(expo) - ezfio.set_ao_basis_ao_basis("Read by resultsFile") - - -# MO - MoTag = res.determinants_mo_type - ezfio.set_mo_basis_mo_label('Orthonormalized') - MO_type = MoTag - allMOs = res.mo_sets[MO_type] - - - try: - closed = [ (allMOs[i].eigenvalue,i) for i in res.closed_mos ] - active = [ (allMOs[i].eigenvalue,i) for i in res.active_mos ] - virtual =[ (allMOs[i].eigenvalue,i) for i in res.virtual_mos ] - except: - closed = [] - virtual = [] - active = [ (allMOs[i].eigenvalue,i) for i in range(len(allMOs)) ] - -# closed.sort() -# active.sort() -# virtual.sort() - closed = map( lambda x: x[1], closed) - active = map( lambda x: x[1], active) - virtual = map( lambda x: x[1], virtual) - MOindices = closed + active + virtual - - MOs = [] - for i in MOindices: - MOs.append(allMOs[i]) - - mo_tot_num = len(MOs) - while len(MOindices) < mo_tot_num: - MOindices.append(len(MOindices)) - - MOmap = list(MOindices) - for i in range(len(MOindices)): - MOmap[i] = MOindices.index(i) - - energies = [] - for i in xrange(mo_tot_num): - energies.append(MOs[i].eigenvalue) - - if res.occ_num is not None: - OccNum = [] - for i in MOindices: - OccNum.append(res.occ_num[MO_type][i]) - - while len(OccNum) < mo_tot_num: - OccNum.append(0.) - - MoMatrix = [] - sym0 = [ i.sym for i in res.mo_sets[MO_type] ] - sym = [ i.sym for i in res.mo_sets[MO_type] ] - for i in xrange(len(sym)): - sym[MOmap[i]] = sym0[i] - - MoMatrix = [] - for i in xrange(len(MOs)): - m = MOs[i] - for coef in m.vector: - MoMatrix.append(coef) - - while len(MoMatrix) < len(MOs[0].vector)**2: - MoMatrix.append(0.) - - mo = [] - for i in MOindices: - mo.append(res.mo_sets[MoTag][i]) - - if len(mo) < mo_tot_num: - newmo = orbital() - newmo.eigenvalue = 0. - newmo.vector = [0. for i in range(mo_tot_num)] - newmo.vector[len(mo)] = 1. - while len(mo) < mo_tot_num: - mo.append(newmo) - Energies = [ m.eigenvalue for m in mo ] - - ezfio.set_mo_basis_mo_tot_num(mo_tot_num) - ezfio.set_mo_basis_mo_occ(OccNum) - ezfio.set_mo_basis_mo_coef(MoMatrix) - - - - -if __name__ == '__main__': - # Check command line - - det_threshold = 0. - - if len(sys.argv) == 2: - State=0 - elif len(sys.argv) == 3: - State=int(sys.argv[2]) - else: - print "usage: "+sys.argv[0]+" file.out [state]" - sys.exit(2) - - firstArg = sys.argv[1] - - file = getFile(firstArg) - print firstArg, 'recognized as', str(file).split('.')[-1].split()[0] - - filename = firstArg+".ezfio" - write_ezfioFile(file,filename) - - - - - diff --git a/src/CAS_SD/NEEDED_MODULES b/src/CAS_SD/NEEDED_MODULES index cbf44be7..f20d16a0 100644 --- a/src/CAS_SD/NEEDED_MODULES +++ b/src/CAS_SD/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/CAS_SD/README.rst b/src/CAS_SD/README.rst index 0dc4ea56..0b3293d5 100644 --- a/src/CAS_SD/README.rst +++ b/src/CAS_SD/README.rst @@ -27,7 +27,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Generators_CAS `_ diff --git a/src/CID/NEEDED_MODULES b/src/CID/NEEDED_MODULES index ac8e21ab..f7a1831f 100644 --- a/src/CID/NEEDED_MODULES +++ b/src/CID/NEEDED_MODULES @@ -1,3 +1,3 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CID/README.rst b/src/CID/README.rst index 6adc4dcd..47cbc40b 100644 --- a/src/CID/README.rst +++ b/src/CID/README.rst @@ -18,7 +18,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CID_SC2_selected/NEEDED_MODULES b/src/CID_SC2_selected/NEEDED_MODULES index 42d83610..67f77e87 100644 --- a/src/CID_SC2_selected/NEEDED_MODULES +++ b/src/CID_SC2_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals 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 Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CID_SC2_selected/README.rst b/src/CID_SC2_selected/README.rst index 720b6385..37680ebb 100644 --- a/src/CID_SC2_selected/README.rst +++ b/src/CID_SC2_selected/README.rst @@ -24,7 +24,7 @@ Needed Modules * `Bitmask `_ * `CISD `_ * `CISD_selected `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CID_selected/NEEDED_MODULES b/src/CID_selected/NEEDED_MODULES index b27ab85e..ca89c5f3 100644 --- a/src/CID_selected/NEEDED_MODULES +++ b/src/CID_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CID_selected/README.rst b/src/CID_selected/README.rst index 2ee45ac6..d8f054ac 100644 --- a/src/CID_selected/README.rst +++ b/src/CID_selected/README.rst @@ -26,7 +26,7 @@ Needed Modules * `Bielec_integrals `_ * `Bitmask `_ * `CISD `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CIS/NEEDED_MODULES b/src/CIS/NEEDED_MODULES index 010e60f5..5cdee2e5 100644 --- a/src/CIS/NEEDED_MODULES +++ b/src/CIS/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CIS/README.rst b/src/CIS/README.rst index e9ba93db..59558a31 100644 --- a/src/CIS/README.rst +++ b/src/CIS/README.rst @@ -34,7 +34,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CISD/NEEDED_MODULES b/src/CISD/NEEDED_MODULES index 010e60f5..5cdee2e5 100644 --- a/src/CISD/NEEDED_MODULES +++ b/src/CISD/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Selectors_full SingleRefMethod Utils diff --git a/src/CISD/README.rst b/src/CISD/README.rst index 07528e59..bcf7aee2 100644 --- a/src/CISD/README.rst +++ b/src/CISD/README.rst @@ -18,7 +18,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CISD_SC2_selected/NEEDED_MODULES b/src/CISD_SC2_selected/NEEDED_MODULES index 42d83610..67f77e87 100644 --- a/src/CISD_SC2_selected/NEEDED_MODULES +++ b/src/CISD_SC2_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals 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 Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CISD_SC2_selected/README.rst b/src/CISD_SC2_selected/README.rst index 25f4368f..915c85f1 100644 --- a/src/CISD_SC2_selected/README.rst +++ b/src/CISD_SC2_selected/README.rst @@ -24,7 +24,7 @@ Needed Modules * `Bitmask `_ * `CISD `_ * `CISD_selected `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/CISD_selected/NEEDED_MODULES b/src/CISD_selected/NEEDED_MODULES index b27ab85e..ca89c5f3 100644 --- a/src/CISD_selected/NEEDED_MODULES +++ b/src/CISD_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask CISD Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask CISD Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/CISD_selected/README.rst b/src/CISD_selected/README.rst index 1ba5f9c5..e2b6989e 100644 --- a/src/CISD_selected/README.rst +++ b/src/CISD_selected/README.rst @@ -32,7 +32,7 @@ Needed Modules * `Bielec_integrals `_ * `Bitmask `_ * `CISD `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/DDCI_selected/NEEDED_MODULES b/src/DDCI_selected/NEEDED_MODULES index cbf44be7..f20d16a0 100644 --- a/src/DDCI_selected/NEEDED_MODULES +++ b/src/DDCI_selected/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Generators_CAS Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/DDCI_selected/README.rst b/src/DDCI_selected/README.rst index db75b101..2b5823c7 100644 --- a/src/DDCI_selected/README.rst +++ b/src/DDCI_selected/README.rst @@ -22,7 +22,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Generators_CAS `_ diff --git a/src/Dets/ASSUMPTIONS.rst b/src/Determinants/ASSUMPTIONS.rst similarity index 100% rename from src/Dets/ASSUMPTIONS.rst rename to src/Determinants/ASSUMPTIONS.rst diff --git a/src/Determinants/EZFIO.cfg b/src/Determinants/EZFIO.cfg new file mode 100644 index 00000000..5f63404b --- /dev/null +++ b/src/Determinants/EZFIO.cfg @@ -0,0 +1,103 @@ +[N_states] +type: States_number +doc: Number of states to consider +interface: input +default: 1 + +[N_det_max_jacobi] +type: Strictly_positive_int +doc: Maximum number of determinants diagonalized by Jacobi +interface: input +default: 1000 + +[read_wf] +type: logical +doc: If true, read the wave function from the EZFIO file +interface: input +default: False + +[only_single_double_dm] +type: logical +doc: If true, The One body DM is calculated with ignoring the Double<->Doubles extra diag elements +interface: input +default: False + +[s2_eig] +type: logical +doc: Force the wave function to be an eigenfunction of S^2 +interface: input +default: False + +[threshold_generators] +type: Threshold +doc: Thresholds on generators (fraction of the norm) +interface: input +default: 0.99 + +[threshold_selectors] +type: Threshold +doc: Thresholds on selectors (fraction of the norm) +interface: input +default: 0.999 + + +# Only create the ezfio_config, (no Input_* and no PROVIDER) + +[n_states_diag] +type: integer +doc: n_states_diag +interface: Ocaml + +[n_int] +interface: OCaml +doc: n_int +type: N_int_number + +[bit_kind] +interface: OCaml +doc: bit_kind +type: Bit_kind + +[mo_label] +interface: OCaml +doc: o_label +type: character*(64) + +[n_det] +interface: OCaml +doc: n_det +type: integer + +[psi_coef] +interface: OCaml +doc: psi_coef +type: double precision +size: (determinants_n_det,determinants_n_states) + +[psi_det] +interface: OCaml +doc: psi_det +type: integer*8 +size: (determinants_n_int*determinants_bit_kind/8,2,determinants_n_det) + +[det_num] +interface: OCaml +doc: det_num +type: integer + +[det_occ] +interface: OCaml +doc: det_occ +type: integer +size: (electrons_elec_alpha_num,determinants_det_num,2) + +[det_coef] +interface: OCaml +doc: det_coef +type: double precision +size: (determinants_det_num) + +[expected_s2] +interface: OCaml +doc: expcted_s2 +type: double precision \ No newline at end of file diff --git a/src/Dets/H_apply.irp.f b/src/Determinants/H_apply.irp.f similarity index 100% rename from src/Dets/H_apply.irp.f rename to src/Determinants/H_apply.irp.f diff --git a/src/Dets/H_apply_template.f b/src/Determinants/H_apply_template.f similarity index 100% rename from src/Dets/H_apply_template.f rename to src/Determinants/H_apply_template.f diff --git a/src/Dets/Makefile b/src/Determinants/Makefile similarity index 100% rename from src/Dets/Makefile rename to src/Determinants/Makefile diff --git a/src/Dets/NEEDED_MODULES b/src/Determinants/NEEDED_MODULES similarity index 100% rename from src/Dets/NEEDED_MODULES rename to src/Determinants/NEEDED_MODULES diff --git a/src/Dets/README.rst b/src/Determinants/README.rst similarity index 74% rename from src/Dets/README.rst rename to src/Determinants/README.rst index f03df8da..445c8b5e 100644 --- a/src/Dets/README.rst +++ b/src/Determinants/README.rst @@ -49,26 +49,26 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. -`copy_h_apply_buffer_to_wf `_ +`copy_h_apply_buffer_to_wf `_ Copies the H_apply buffer to psi_coef. You need to touch psi_det, psi_coef and N_det after calling this function. After calling this subroutine, N_det, psi_det and psi_coef need to be touched -`fill_h_apply_buffer_no_selection `_ +`fill_h_apply_buffer_no_selection `_ Fill the H_apply buffer with determiants for CISD -`h_apply_buffer_allocated `_ +`h_apply_buffer_allocated `_ Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. -`h_apply_buffer_lock `_ +`h_apply_buffer_lock `_ Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. -`resize_h_apply_buffer `_ +`resize_h_apply_buffer `_ Undocumented -`cisd_sc2 `_ +`cisd_sc2 `_ CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not) .br dets_in : bitmasks corresponding to determinants @@ -84,32 +84,25 @@ Documentation .br Initial guess vectors are not necessarily orthonormal -`connected_to_ref `_ +`connected_to_ref `_ Undocumented -`connected_to_ref_by_mono `_ +`connected_to_ref_by_mono `_ Undocumented -`det_is_not_or_may_be_in_ref `_ - If true, det is not in ref - If false, det may be in ref - -`det_search_key `_ +`det_search_key `_ Return an integer*8 corresponding to a determinant index for searching -`get_index_in_psi_det_sorted_bit `_ +`get_index_in_psi_det_sorted_bit `_ Returns the index of the determinant in the ``psi_det_sorted_bit`` array -`is_in_wavefunction `_ +`is_in_wavefunction `_ True if the determinant ``det`` is in the wave function -`key_pattern_not_in_ref `_ - Min and max values of the integers of the keys of the reference - -`occ_pattern_search_key `_ +`occ_pattern_search_key `_ Return an integer*8 corresponding to a determinant index for searching -`do_mono_excitation `_ +`do_mono_excitation `_ Apply the mono excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin on key_in ispin = 1 == alpha @@ -117,13 +110,13 @@ Documentation i_ok = 1 == the excitation is possible i_ok = -1 == the excitation is not possible -`davidson_converged `_ +`davidson_converged `_ True if the Davidson algorithm is converged -`davidson_criterion `_ +`davidson_criterion `_ Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] -`davidson_diag `_ +`davidson_diag `_ Davidson diagonalization. .br dets_in : bitmasks corresponding to determinants @@ -141,7 +134,7 @@ Documentation .br Initial guess vectors are not necessarily orthonormal -`davidson_diag_hjj `_ +`davidson_diag_hjj `_ Davidson diagonalization with specific diagonal elements of the H matrix .br H_jj : specific diagonal H matrix elements to diagonalize de Davidson @@ -161,55 +154,49 @@ Documentation .br Initial guess vectors are not necessarily orthonormal -`davidson_iter_max `_ +`davidson_iter_max `_ Max number of Davidson iterations -`davidson_sze_max `_ +`davidson_sze_max `_ Max number of Davidson sizes -`davidson_threshold `_ +`davidson_threshold `_ Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] -`one_body_dm_mo `_ +`one_body_dm_mo `_ One-body density matrix -`one_body_dm_mo_alpha `_ +`one_body_dm_mo_alpha `_ Alpha and beta one-body density matrix for each state -`one_body_dm_mo_beta `_ +`one_body_dm_mo_beta `_ Alpha and beta one-body density matrix for each state -`one_body_single_double_dm_mo_alpha `_ +`one_body_single_double_dm_mo_alpha `_ Alpha and beta one-body density matrix for each state -`one_body_single_double_dm_mo_beta `_ +`one_body_single_double_dm_mo_beta `_ Alpha and beta one-body density matrix for each state -`one_body_spin_density_mo `_ +`one_body_spin_density_mo `_ rho(alpha) - rho(beta) -`save_natural_mos `_ +`save_natural_mos `_ Save natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis -`set_natural_mos `_ +`set_natural_mos `_ Set natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis -`state_average_weight `_ +`state_average_weight `_ Weights in the state-average calculation of the density matrix -`det_svd `_ +`det_svd `_ Computes the SVD of the Alpha x Beta determinant coefficient matrix -`create_wf_of_psi_svd_matrix `_ - Matrix of wf coefficients. Outer product of alpha and beta determinants - -`filter_3_highest_electrons `_ +`filter_3_highest_electrons `_ Returns a determinant with only the 3 highest electrons -`generate_all_alpha_beta_det_products `_ - Create a wave function from all possible alpha x beta determinants - -`int_of_3_highest_electrons `_ +`int_of_3_highest_electrons `_ Returns an integer*8 as : .br |_<--- 21 bits ---><--- 21 bits ---><--- 21 bits --->| @@ -220,191 +207,158 @@ Documentation in descending order .br -`max_degree_exc `_ +`max_degree_exc `_ Maximum degree of excitation in the wf -`n_det `_ +`n_det `_ Number of determinants in the wave function -`n_det_alpha_unique `_ - Unique alpha determinants - -`n_det_beta_unique `_ - Unique beta determinants - -`psi_average_norm_contrib `_ +`psi_average_norm_contrib `_ Contribution of determinants to the state-averaged density -`psi_average_norm_contrib_sorted `_ +`psi_average_norm_contrib_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) -`psi_coef `_ +`psi_coef `_ The wave function coefficients. Initialized with Hartree-Fock if the EZFIO file is empty -`psi_coef_sorted `_ +`psi_coef_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) -`psi_coef_sorted_ab `_ +`psi_coef_sorted_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_coef_sorted_bit `_ +`psi_coef_sorted_bit `_ Determinants on which we apply for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. -`psi_det `_ +`psi_det `_ The wave function determinants. Initialized with Hartree-Fock if the EZFIO file is empty -`psi_det_alpha `_ - List of alpha determinants of psi_det - -`psi_det_alpha_unique `_ - Unique alpha determinants - -`psi_det_beta `_ - List of beta determinants of psi_det - -`psi_det_beta_unique `_ - Unique beta determinants - -`psi_det_size `_ +`psi_det_size `_ Size of the psi_det/psi_coef arrays -`psi_det_sorted `_ +`psi_det_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) -`psi_det_sorted_ab `_ +`psi_det_sorted_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_det_sorted_bit `_ +`psi_det_sorted_bit `_ Determinants on which we apply for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. -`psi_det_sorted_next_ab `_ +`psi_det_sorted_next_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_svd_alpha `_ - SVD wave function - -`psi_svd_beta `_ - SVD wave function - -`psi_svd_coefs `_ - SVD wave function - -`psi_svd_matrix `_ - Matrix of wf coefficients. Outer product of alpha and beta determinants - -`read_dets `_ +`read_dets `_ Reads the determinants from the EZFIO file -`save_wavefunction `_ +`save_wavefunction `_ Save the wave function into the EZFIO file -`save_wavefunction_general `_ +`save_wavefunction_general `_ Save the wave function into the EZFIO file -`save_wavefunction_unsorted `_ +`save_wavefunction_unsorted `_ Save the wave function into the EZFIO file -`sort_dets_by_3_highest_electrons `_ +`sort_dets_by_3_highest_electrons `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`sort_dets_by_det_search_key `_ +`sort_dets_by_det_search_key `_ Determinants are sorted are sorted according to their det_search_key. Useful to accelerate the search of a random determinant in the wave function. -`spin_det_search_key `_ - Return an integer*8 corresponding to a determinant index for searching - -`double_exc_bitmask `_ +`double_exc_bitmask `_ double_exc_bitmask(:,1,i) is the bitmask for holes of excitation 1 double_exc_bitmask(:,2,i) is the bitmask for particles of excitation 1 double_exc_bitmask(:,3,i) is the bitmask for holes of excitation 2 double_exc_bitmask(:,4,i) is the bitmask for particles of excitation 2 for a given couple of hole/particle excitations i. -`n_double_exc_bitmasks `_ +`n_double_exc_bitmasks `_ Number of double excitation bitmasks -`n_single_exc_bitmasks `_ +`n_single_exc_bitmasks `_ Number of single excitation bitmasks -`single_exc_bitmask `_ +`single_exc_bitmask `_ single_exc_bitmask(:,1,i) is the bitmask for holes single_exc_bitmask(:,2,i) is the bitmask for particles for a given couple of hole/particle excitations i. -`ci_eigenvectors `_ +`ci_eigenvectors `_ Eigenvectors/values of the CI matrix -`ci_eigenvectors_s2 `_ +`ci_eigenvectors_s2 `_ Eigenvectors/values of the CI matrix -`ci_electronic_energy `_ +`ci_electronic_energy `_ Eigenvectors/values of the CI matrix -`ci_energy `_ +`ci_energy `_ N_states lowest eigenvalues of the CI matrix -`diag_algorithm `_ +`diag_algorithm `_ Diagonalization algorithm (Davidson or Lapack) -`diagonalize_ci `_ +`diagonalize_ci `_ Replace the coefficients of the CI states by the coefficients of the eigenstates of the CI matrix -`ci_sc2_eigenvectors `_ +`ci_sc2_eigenvectors `_ Eigenvectors/values of the CI matrix -`ci_sc2_electronic_energy `_ +`ci_sc2_electronic_energy `_ Eigenvectors/values of the CI matrix -`ci_sc2_energy `_ +`ci_sc2_energy `_ N_states_diag lowest eigenvalues of the CI matrix -`diagonalize_ci_sc2 `_ +`diagonalize_ci_sc2 `_ Replace the coefficients of the CI states_diag by the coefficients of the eigenstates of the CI matrix -`threshold_convergence_sc2 `_ +`threshold_convergence_sc2 `_ convergence of the correlation energy of SC2 iterations -`ci_eigenvectors_mono `_ +`ci_eigenvectors_mono `_ Eigenvectors/values of the CI matrix -`ci_eigenvectors_s2_mono `_ +`ci_eigenvectors_s2_mono `_ Eigenvectors/values of the CI matrix -`ci_electronic_energy_mono `_ +`ci_electronic_energy_mono `_ Eigenvectors/values of the CI matrix -`diagonalize_ci_mono `_ +`diagonalize_ci_mono `_ Replace the coefficients of the CI states by the coefficients of the eigenstates of the CI matrix -`apply_mono `_ +`apply_mono `_ Undocumented -`filter_connected `_ +`filter_connected `_ Filters out the determinants that are not connected by H .br returns the array idx which contains the index of the @@ -415,7 +369,7 @@ Documentation .br idx(0) is the number of determinants that interact with key1 -`filter_connected_davidson `_ +`filter_connected_davidson `_ Filters out the determinants that are not connected by H returns the array idx which contains the index of the determinants in the array key1 that interact @@ -424,7 +378,7 @@ Documentation idx(0) is the number of determinants that interact with key1 key1 should come from psi_det_sorted_ab. -`filter_connected_i_h_psi0 `_ +`filter_connected_i_h_psi0 `_ returns the array idx which contains the index of the .br determinants in the array key1 that interact @@ -433,7 +387,7 @@ Documentation .br idx(0) is the number of determinants that interact with key1 -`filter_connected_i_h_psi0_sc2 `_ +`filter_connected_i_h_psi0_sc2 `_ standard filter_connected_i_H_psi but returns in addition .br the array of the index of the non connected determinants to key1 @@ -444,7 +398,7 @@ Documentation .br to repeat the excitations -`filter_connected_sorted_ab `_ +`filter_connected_sorted_ab `_ Filters out the determinants that are not connected by H returns the array idx which contains the index of the determinants in the array key1 that interact @@ -453,197 +407,197 @@ Documentation .br Determinants are taken from the psi_det_sorted_ab array -`put_gess `_ +`put_gess `_ Undocumented -`det_to_occ_pattern `_ +`det_to_occ_pattern `_ Transform a determinant to an occupation pattern -`make_s2_eigenfunction `_ +`make_s2_eigenfunction `_ Undocumented -`n_occ_pattern `_ +`n_occ_pattern `_ array of the occ_pattern present in the wf psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupation psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation -`occ_pattern_to_dets `_ +`occ_pattern_to_dets `_ Generate all possible determinants for a give occ_pattern -`occ_pattern_to_dets_size `_ +`occ_pattern_to_dets_size `_ Number of possible determinants for a given occ_pattern -`psi_occ_pattern `_ +`psi_occ_pattern `_ array of the occ_pattern present in the wf psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupation psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation -`rec_occ_pattern_to_dets `_ +`rec_occ_pattern_to_dets `_ Undocumented -`n_states_diag `_ +`n_states_diag `_ Number of states to consider for the diagonalization -`pouet `_ +`pouet `_ Undocumented -`routine `_ +`routine `_ Undocumented -`idx_cas `_ +`idx_cas `_ CAS wave function, defined from the application of the CAS bitmask on the determinants. idx_cas gives the indice of the CAS determinant in psi_det. -`idx_non_cas `_ +`idx_non_cas `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. -`n_det_cas `_ +`n_det_cas `_ CAS wave function, defined from the application of the CAS bitmask on the determinants. idx_cas gives the indice of the CAS determinant in psi_det. -`n_det_non_cas `_ +`n_det_non_cas `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. -`psi_cas `_ +`psi_cas `_ CAS wave function, defined from the application of the CAS bitmask on the determinants. idx_cas gives the indice of the CAS determinant in psi_det. -`psi_cas_coef `_ +`psi_cas_coef `_ CAS wave function, defined from the application of the CAS bitmask on the determinants. idx_cas gives the indice of the CAS determinant in psi_det. -`psi_cas_coef_sorted_bit `_ +`psi_cas_coef_sorted_bit `_ CAS determinants sorted to accelerate the search of a random determinant in the wave function. -`psi_cas_sorted_bit `_ +`psi_cas_sorted_bit `_ CAS determinants sorted to accelerate the search of a random determinant in the wave function. -`psi_non_cas `_ +`psi_non_cas `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. -`psi_non_cas_coef `_ +`psi_non_cas_coef `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. -`psi_non_cas_coef_sorted_bit `_ +`psi_non_cas_coef_sorted_bit `_ CAS determinants sorted to accelerate the search of a random determinant in the wave function. -`psi_non_cas_sorted_bit `_ +`psi_non_cas_sorted_bit `_ CAS determinants sorted to accelerate the search of a random determinant in the wave function. -`bi_elec_ref_bitmask_energy `_ +`bi_elec_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`kinetic_ref_bitmask_energy `_ +`kinetic_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`mono_elec_ref_bitmask_energy `_ +`mono_elec_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`nucl_elec_ref_bitmask_energy `_ +`nucl_elec_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`ref_bitmask_energy `_ +`ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`expected_s2 `_ +`expected_s2 `_ Expected value of S2 : S*(S+1) -`get_s2 `_ +`get_s2 `_ Returns -`get_s2_u0 `_ +`get_s2_u0 `_ Undocumented -`s2_values `_ +`s2_values `_ array of the averaged values of the S^2 operator on the various states -`s_z `_ +`s_z `_ z component of the Spin -`s_z2_sz `_ +`s_z2_sz `_ z component of the Spin -`prog_save_casino `_ +`prog_save_casino `_ Undocumented -`save_casino `_ +`save_casino `_ Undocumented -`save_dets_qmcchem `_ +`save_dets_qmcchem `_ Undocumented -`save_for_qmc `_ +`save_for_qmc `_ Undocumented -`save_natorb `_ +`save_natorb `_ Undocumented -`a_operator `_ +`a_operator `_ Needed for diag_H_mat_elem -`ac_operator `_ +`ac_operator `_ Needed for diag_H_mat_elem -`decode_exc `_ +`decode_exc `_ Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles s1,s2 : Spins (1:alpha, 2:beta) degree : Degree of excitation -`det_connections `_ +`det_connections `_ Build connection proxy between determinants -`diag_h_mat_elem `_ +`diag_h_mat_elem `_ Computes -`get_double_excitation `_ +`get_double_excitation `_ Returns the two excitation operators between two doubly excited determinants and the phase -`get_excitation `_ +`get_excitation `_ Returns the excitation operators between two determinants and the phase -`get_excitation_degree `_ +`get_excitation_degree `_ Returns the excitation degree between two determinants -`get_excitation_degree_vector `_ +`get_excitation_degree_vector `_ Applies get_excitation_degree to an array of determinants -`get_mono_excitation `_ +`get_mono_excitation `_ Returns the excitation operator between two singly excited determinants and the phase -`get_occ_from_key `_ +`get_occ_from_key `_ Returns a list of occupation numbers from a bitstring -`h_u_0 `_ +`h_u_0 `_ Computes v_0 = H|u_0> .br n : number of determinants .br H_jj : array of -`i_h_j `_ +`i_h_j `_ Returns where i and j are determinants -`i_h_j_verbose `_ +`i_h_j_verbose `_ Returns where i and j are determinants -`i_h_psi `_ +`i_h_psi `_ for the various Nstates -`i_h_psi_sc2 `_ +`i_h_psi_sc2 `_ for the various Nstate .br returns in addition @@ -656,7 +610,7 @@ Documentation .br to repeat the excitations -`i_h_psi_sc2_verbose `_ +`i_h_psi_sc2_verbose `_ for the various Nstate .br returns in addition @@ -669,19 +623,73 @@ Documentation .br to repeat the excitations -`i_h_psi_sec_ord `_ +`i_h_psi_sec_ord `_ for the various Nstates -`n_con_int `_ +`n_con_int `_ Number of integers to represent the connections between determinants -`write_spindeterminants `_ +`create_wf_of_psi_svd_matrix `_ + Matrix of wf coefficients. Outer product of alpha and beta determinants + +`generate_all_alpha_beta_det_products `_ + Create a wave function from all possible alpha x beta determinants + +`get_index_in_psi_det_alpha_unique `_ + Returns the index of the determinant in the ``psi_det_alpha_unique`` array + +`get_index_in_psi_det_beta_unique `_ + Returns the index of the determinant in the ``psi_det_beta_unique`` array + +`n_det_alpha_unique `_ + Unique alpha determinants + +`n_det_beta_unique `_ + Unique beta determinants + +`psi_det_alpha `_ + List of alpha determinants of psi_det + +`psi_det_alpha_unique `_ + Unique alpha determinants + +`psi_det_beta `_ + List of beta determinants of psi_det + +`psi_det_beta_unique `_ + Unique beta determinants + +`psi_svd_alpha `_ + SVD wave function + +`psi_svd_beta `_ + SVD wave function + +`psi_svd_coefs `_ + SVD wave function + +`psi_svd_matrix `_ + Matrix of wf coefficients. Outer product of alpha and beta determinants + +`psi_svd_matrix_columns `_ + Matrix of wf coefficients. Outer product of alpha and beta determinants + +`psi_svd_matrix_rows `_ + Matrix of wf coefficients. Outer product of alpha and beta determinants + +`psi_svd_matrix_values `_ + Matrix of wf coefficients. Outer product of alpha and beta determinants + +`spin_det_search_key `_ + Return an integer*8 corresponding to a determinant index for searching + +`write_spindeterminants `_ Undocumented -`cisd `_ +`cisd `_ Undocumented -`h_matrix_all_dets `_ +`h_matrix_all_dets `_ H matrix on the basis of the slater determinants defined by psi_det diff --git a/src/Dets/SC2.irp.f b/src/Determinants/SC2.irp.f similarity index 89% rename from src/Dets/SC2.irp.f rename to src/Determinants/SC2.irp.f index 8a6c10d7..440b2870 100644 --- a/src/Dets/SC2.irp.f +++ b/src/Determinants/SC2.irp.f @@ -43,10 +43,10 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,convergence) allocate (doubles(Nint,2,sze),e_corr_array(sze),H_jj_ref(sze),H_jj_dressed(sze),& index_double(sze), degree_exc(sze), hij_double(sze)) - call write_time(output_Dets) - write(output_Dets,'(A)') '' - write(output_Dets,'(A)') 'CISD SC2' - write(output_Dets,'(A)') '========' + call write_time(output_determinants) + write(output_determinants,'(A)') '' + write(output_determinants,'(A)') 'CISD SC2' + write(output_determinants,'(A)') '========' !$OMP PARALLEL DEFAULT(NONE) & !$OMP SHARED(sze,N_st, & !$OMP H_jj_ref,Nint,dets_in,u_in) & @@ -175,7 +175,7 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,convergence) enddo deallocate (H_matrix_tmp, eigenvalues, eigenvectors) else - call davidson_diag_hjj(dets_in,u_in,H_jj_dressed,energies,dim_in,sze,N_st,Nint,output_Dets) + call davidson_diag_hjj(dets_in,u_in,H_jj_dressed,energies,dim_in,sze,N_st,Nint,output_determinants) endif e_corr_double = 0.d0 @@ -184,18 +184,18 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,convergence) e_corr_array(i) = u_in(index_double(i),1)*inv_c0 * hij_double(i) e_corr_double += e_corr_array(i) enddo - write(output_Dets,'(A,I3)') 'SC2 Iteration ', iter - write(output_Dets,'(A)') '------------------' - write(output_Dets,'(A)') '' - write(output_Dets,'(A)') '===== ================' - write(output_Dets,'(A)') 'State Energy ' - write(output_Dets,'(A)') '===== ================' + write(output_determinants,'(A,I3)') 'SC2 Iteration ', iter + write(output_determinants,'(A)') '------------------' + write(output_determinants,'(A)') '' + write(output_determinants,'(A)') '===== ================' + write(output_determinants,'(A)') 'State Energy ' + write(output_determinants,'(A)') '===== ================' do i=1,N_st - write(output_Dets,'(I5,X,F16.10)') i, energies(i)+nuclear_repulsion + write(output_determinants,'(I5,X,F16.10)') i, energies(i)+nuclear_repulsion enddo - write(output_Dets,'(A)') '===== ================' - write(output_Dets,'(A)') '' - call write_double(output_Dets,(e_corr_double - e_corr_double_before),& + write(output_determinants,'(A)') '===== ================' + write(output_determinants,'(A)') '' + call write_double(output_determinants,(e_corr_double - e_corr_double_before),& 'Delta(E_corr)') converged = dabs(e_corr_double - e_corr_double_before) < convergence converged = converged .or. abort_here @@ -206,7 +206,7 @@ subroutine CISD_SC2(dets_in,u_in,energies,dim_in,sze,N_st,Nint,convergence) enddo - call write_time(output_Dets) + call write_time(output_determinants) deallocate (doubles,e_corr_array,H_jj_ref,H_jj_dressed, & index_double, degree_exc, hij_double) diff --git a/src/Dets/connected_to_ref.irp.f b/src/Determinants/connected_to_ref.irp.f similarity index 84% rename from src/Dets/connected_to_ref.irp.f rename to src/Determinants/connected_to_ref.irp.f index 3c7eb581..2d40b621 100644 --- a/src/Dets/connected_to_ref.irp.f +++ b/src/Determinants/connected_to_ref.irp.f @@ -162,7 +162,7 @@ integer function connected_to_ref(key,keys,Nint,N_past_in,Ndet) integer :: N_past integer :: i, l integer :: degree_x2 - logical :: det_is_not_or_may_be_in_ref, t + logical :: t double precision :: hij_elec ! output : 0 : not connected @@ -260,7 +260,7 @@ integer function connected_to_ref_by_mono(key,keys,Nint,N_past_in,Ndet) integer :: N_past integer :: i, l integer :: degree_x2 - logical :: det_is_not_or_may_be_in_ref, t + logical :: t double precision :: hij_elec ! output : 0 : not connected @@ -355,66 +355,3 @@ integer function connected_to_ref_by_mono(key,keys,Nint,N_past_in,Ndet) end - -logical function det_is_not_or_may_be_in_ref(key,Nint) - use bitmasks - implicit none - BEGIN_DOC - ! If true, det is not in ref - ! If false, det may be in ref - END_DOC - integer, intent(in) :: Nint - integer(bit_kind), intent(in) :: key(Nint,2) - integer(bit_kind) :: key_int - integer*1 :: key_short(bit_kind) - !DIR$ ATTRIBUTES ALIGN : 32 :: key_short - equivalence (key_int,key_short) - - integer :: i, ispin, k - - det_is_not_or_may_be_in_ref = .False. - do ispin=1,2 - do i=1,Nint - key_int = key(i,ispin) - do k=1,bit_kind - det_is_not_or_may_be_in_ref = & - det_is_not_or_may_be_in_ref .or. & - key_pattern_not_in_ref(key_short(k), i, ispin) - enddo - if(det_is_not_or_may_be_in_ref) then - return - endif - enddo - enddo - -end - - -BEGIN_PROVIDER [ logical, key_pattern_not_in_ref, (-128:127,N_int,2) ] - use bitmasks - implicit none - BEGIN_DOC - ! Min and max values of the integers of the keys of the reference - END_DOC - - integer :: i, j, ispin - integer(bit_kind) :: key - integer*1 :: key_short(bit_kind) - equivalence (key,key_short) - integer :: idx, k - - key_pattern_not_in_ref = .True. - - do j=1,N_det - do ispin=1,2 - do i=1,N_int - key = psi_det(i,ispin,j) - do k=1,bit_kind - key_pattern_not_in_ref( key_short(k), i, ispin ) = .False. - enddo - enddo - enddo - enddo - -END_PROVIDER - diff --git a/src/Dets/create_excitations.irp.f b/src/Determinants/create_excitations.irp.f similarity index 100% rename from src/Dets/create_excitations.irp.f rename to src/Determinants/create_excitations.irp.f diff --git a/src/Dets/davidson.irp.f b/src/Determinants/davidson.irp.f similarity index 100% rename from src/Dets/davidson.irp.f rename to src/Determinants/davidson.irp.f diff --git a/src/Dets/density_matrix.irp.f b/src/Determinants/density_matrix.irp.f similarity index 100% rename from src/Dets/density_matrix.irp.f rename to src/Determinants/density_matrix.irp.f diff --git a/src/Dets/det_svd.irp.f b/src/Determinants/det_svd.irp.f similarity index 100% rename from src/Dets/det_svd.irp.f rename to src/Determinants/det_svd.irp.f diff --git a/src/Dets/determinants.irp.f b/src/Determinants/determinants.irp.f similarity index 68% rename from src/Dets/determinants.irp.f rename to src/Determinants/determinants.irp.f index 00e683fc..a70d0fe8 100644 --- a/src/Dets/determinants.irp.f +++ b/src/Determinants/determinants.irp.f @@ -25,7 +25,7 @@ BEGIN_PROVIDER [ integer, N_det ] else N_det = 1 endif - call write_int(output_dets,N_det,'Number of determinants') + call write_int(output_determinants,N_det,'Number of determinants') ASSERT (N_det > 0) END_PROVIDER @@ -58,7 +58,7 @@ BEGIN_PROVIDER [ integer, psi_det_size ] psi_det_size = 1 endif psi_det_size = max(psi_det_size,10000) - call write_int(output_dets,psi_det_size,'Dimension of the psi arrays') + call write_int(output_determinants,psi_det_size,'Dimension of the psi arrays') END_PROVIDER @@ -294,132 +294,6 @@ END_PROVIDER -!==============================================================================! -! ! -! Independent alpha/beta parts ! -! ! -!==============================================================================! - -integer*8 function spin_det_search_key(det,Nint) - use bitmasks - implicit none - BEGIN_DOC -! Return an integer*8 corresponding to a determinant index for searching - END_DOC - integer, intent(in) :: Nint - integer(bit_kind), intent(in) :: det(Nint) - integer :: i - spin_det_search_key = det(1) - do i=2,Nint - spin_det_search_key = ieor(spin_det_search_key,det(i)) - enddo -end - - -BEGIN_PROVIDER [ integer(bit_kind), psi_det_alpha, (N_int,psi_det_size) ] - implicit none - BEGIN_DOC -! List of alpha determinants of psi_det - END_DOC - integer :: i,k - - do i=1,N_det - do k=1,N_int - psi_det_alpha(k,i) = psi_det(k,1,i) - enddo - enddo -END_PROVIDER - -BEGIN_PROVIDER [ integer(bit_kind), psi_det_beta, (N_int,psi_det_size) ] - implicit none - BEGIN_DOC -! List of beta determinants of psi_det - END_DOC - integer :: i,k - - do i=1,N_det - do k=1,N_int - psi_det_beta(k,i) = psi_det(k,2,i) - enddo - enddo -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_alpha_unique, (N_int,psi_det_size) ] -&BEGIN_PROVIDER [ integer, N_det_alpha_unique ] - implicit none - BEGIN_DOC - ! Unique alpha determinants - END_DOC - - integer :: i,k - integer, allocatable :: iorder(:) - integer*8, allocatable :: bit_tmp(:) - integer*8 :: last_key - integer*8, external :: spin_det_search_key - - allocate ( iorder(N_det), bit_tmp(N_det)) - - do i=1,N_det - iorder(i) = i - bit_tmp(i) = spin_det_search_key(psi_det_alpha(1,i),N_int) - enddo - - call i8sort(bit_tmp,iorder,N_det) - - N_det_alpha_unique = 0 - last_key = 0_8 - do i=1,N_det - if (bit_tmp(i) /= last_key) then - last_key = bit_tmp(i) - N_det_alpha_unique += 1 - do k=1,N_int - psi_det_alpha_unique(k,N_det_alpha_unique) = psi_det_alpha(k,iorder(i)) - enddo - endif - enddo - - deallocate (iorder, bit_tmp) -END_PROVIDER - - BEGIN_PROVIDER [ integer(bit_kind), psi_det_beta_unique, (N_int,psi_det_size) ] -&BEGIN_PROVIDER [ integer, N_det_beta_unique ] - implicit none - BEGIN_DOC - ! Unique beta determinants - END_DOC - - integer :: i,k - integer, allocatable :: iorder(:) - integer*8, allocatable :: bit_tmp(:) - integer*8 :: last_key - integer*8, external :: spin_det_search_key - - allocate ( iorder(N_det), bit_tmp(N_det)) - - do i=1,N_det - iorder(i) = i - bit_tmp(i) = spin_det_search_key(psi_det_beta(1,i),N_int) - enddo - - call i8sort(bit_tmp,iorder,N_det) - - N_det_beta_unique = 0 - last_key = 0_8 - do i=1,N_det - if (bit_tmp(i) /= last_key) then - last_key = bit_tmp(i) - N_det_beta_unique += 1 - do k=1,N_int - psi_det_beta_unique(k,N_det_beta_unique) = psi_det_beta(k,iorder(i)) - enddo - endif - enddo - - deallocate (iorder, bit_tmp) -END_PROVIDER - - - !==============================================================================! ! ! ! Sorting providers ! @@ -700,177 +574,6 @@ subroutine sort_dets_by_3_highest_electrons(det_in,coef_in,det_out,coef_out, & end -!==============================================================================! -! ! -! Alpha x Beta Matrix ! -! ! -!==============================================================================! - -BEGIN_PROVIDER [ double precision, psi_svd_matrix, (N_det_alpha_unique,N_det_beta_unique,N_states) ] - use bitmasks - implicit none - BEGIN_DOC -! Matrix of wf coefficients. Outer product of alpha and beta determinants - END_DOC - integer :: i,j,k - integer(bit_kind) :: tmp_det(N_int,2) - integer :: idx - integer, external :: get_index_in_psi_det_sorted_bit - logical, external :: is_in_wavefunction - - psi_svd_matrix = 0.d0 - do j=1,N_det_beta_unique - do k=1,N_int - tmp_det(k,2) = psi_det_beta_unique(k,j) - enddo - do i=1,N_det_alpha_unique - do k=1,N_int - tmp_det(k,1) = psi_det_alpha_unique(k,i) - enddo - idx = get_index_in_psi_det_sorted_bit(tmp_det,N_int) - if (idx > 0) then - do k=1,N_states - psi_svd_matrix(i,j,k) = psi_coef_sorted_bit(idx,k) - enddo - endif - enddo - enddo - -END_PROVIDER - -subroutine create_wf_of_psi_svd_matrix - use bitmasks - implicit none - BEGIN_DOC -! Matrix of wf coefficients. Outer product of alpha and beta determinants - END_DOC - integer :: i,j,k - integer(bit_kind) :: tmp_det(N_int,2) - integer :: idx - integer, external :: get_index_in_psi_det_sorted_bit - logical, external :: is_in_wavefunction - double precision :: norm(N_states) - - call generate_all_alpha_beta_det_products - norm = 0.d0 - do j=1,N_det_beta_unique - do k=1,N_int - tmp_det(k,2) = psi_det_beta_unique(k,j) - enddo - do i=1,N_det_alpha_unique - do k=1,N_int - tmp_det(k,1) = psi_det_alpha_unique(k,i) - enddo - idx = get_index_in_psi_det_sorted_bit(tmp_det,N_int) - if (idx > 0) then - do k=1,N_states - psi_coef_sorted_bit(idx,k) = psi_svd_matrix(i,j,k) - norm(k) += psi_svd_matrix(i,j,k) - enddo - endif - enddo - enddo - do k=1,N_states - norm(k) = 1.d0/dsqrt(norm(k)) - do i=1,N_det - psi_coef_sorted_bit(i,k) = psi_coef_sorted_bit(i,k)*norm(k) - enddo - enddo - psi_det = psi_det_sorted_bit - psi_coef = psi_coef_sorted_bit - TOUCH psi_det psi_coef - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - norm(1) = 0.d0 - do i=1,N_det - norm(1) += psi_average_norm_contrib_sorted(i) - if (norm(1) >= 0.999999d0) then - exit - endif - enddo - N_det = min(i,N_det) - SOFT_TOUCH psi_det psi_coef N_det - -end - -subroutine generate_all_alpha_beta_det_products - implicit none - BEGIN_DOC -! Create a wave function from all possible alpha x beta determinants - END_DOC - integer :: i,j,k,l - integer :: idx - integer, external :: get_index_in_psi_det_sorted_bit - integer(bit_kind), allocatable :: tmp_det(:,:,:) - logical, external :: is_in_wavefunction - - allocate (tmp_det(N_int,2,N_det_alpha_unique)) - do j=1,N_det_beta_unique - l = 1 - do i=1,N_det_alpha_unique - do k=1,N_int - tmp_det(k,1,l) = psi_det_alpha_unique(k,i) - tmp_det(k,2,l) = psi_det_beta_unique (k,j) - enddo - if (.not.is_in_wavefunction(tmp_det(1,1,l),N_int,N_det)) then - l = l+1 - endif - enddo - call fill_H_apply_buffer_no_selection(l-1, tmp_det, N_int, 1) - enddo - deallocate (tmp_det) - call copy_H_apply_buffer_to_wf - SOFT_TOUCH psi_det psi_coef N_det -end - - BEGIN_PROVIDER [ double precision, psi_svd_alpha, (N_det_alpha_unique,N_det_alpha_unique,N_states) ] -&BEGIN_PROVIDER [ double precision, psi_svd_beta , (N_det_beta_unique,N_det_beta_unique,N_states) ] -&BEGIN_PROVIDER [ double precision, psi_svd_coefs, (N_det_beta_unique,N_states) ] - implicit none - BEGIN_DOC - ! SVD wave function - END_DOC - - integer :: lwork, info, istate - double precision, allocatable :: work(:), tmp(:,:), copy(:,:) - allocate (work(1),tmp(N_det_beta_unique,N_det_beta_unique), & - copy(size(psi_svd_matrix,1),size(psi_svd_matrix,2))) - - do istate = 1,N_states - copy(:,:) = psi_svd_matrix(:,:,istate) - lwork=-1 - call dgesvd('A','A', N_det_alpha_unique, N_det_beta_unique, & - copy, size(copy,1), & - psi_svd_coefs(1,istate), psi_svd_alpha(1,1,istate), & - size(psi_svd_alpha,1), & - tmp, size(psi_svd_beta,2), & - work, lwork, info) - lwork = work(1) - deallocate(work) - allocate(work(lwork)) - call dgesvd('A','A', N_det_alpha_unique, N_det_beta_unique, & - copy, size(copy,1), & - psi_svd_coefs(1,istate), psi_svd_alpha(1,1,istate), & - size(psi_svd_alpha,1), & - tmp, size(psi_svd_beta,2), & - work, lwork, info) - deallocate(work) - if (info /= 0) then - print *, irp_here//': error in det SVD' - stop 1 - endif - integer :: i,j - do j=1,N_det_beta_unique - do i=1,N_det_beta_unique - psi_svd_beta(i,j,istate) = tmp(j,i) - enddo - enddo - deallocate(tmp,copy) - enddo - -END_PROVIDER - - !==============================================================================! ! ! ! Read/write routines ! @@ -1024,7 +727,7 @@ subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) enddo call ezfio_set_determinants_psi_coef(psi_coef_save) - call write_int(output_dets,ndet,'Saved determinants') + call write_int(output_determinants,ndet,'Saved determinants') call stop_progress deallocate (psi_coef_save) end diff --git a/src/Dets/determinants_bitmasks.irp.f b/src/Determinants/determinants_bitmasks.irp.f similarity index 100% rename from src/Dets/determinants_bitmasks.irp.f rename to src/Determinants/determinants_bitmasks.irp.f diff --git a/src/Dets/diagonalize_CI.irp.f b/src/Determinants/diagonalize_CI.irp.f similarity index 92% rename from src/Dets/diagonalize_CI.irp.f rename to src/Determinants/diagonalize_CI.irp.f index 55612920..0e697ab3 100644 --- a/src/Dets/diagonalize_CI.irp.f +++ b/src/Determinants/diagonalize_CI.irp.f @@ -23,12 +23,12 @@ BEGIN_PROVIDER [ double precision, CI_energy, (N_states_diag) ] integer :: j character*(8) :: st - call write_time(output_Dets) + call write_time(output_determinants) do j=1,N_states_diag CI_energy(j) = CI_electronic_energy(j) + nuclear_repulsion write(st,'(I4)') j - call write_double(output_Dets,CI_energy(j),'Energy of state '//trim(st)) - call write_double(output_Dets,CI_eigenvectors_s2(j),'S^2 of state '//trim(st)) + call write_double(output_determinants,CI_energy(j),'Energy of state '//trim(st)) + call write_double(output_determinants,CI_eigenvectors_s2(j),'S^2 of state '//trim(st)) enddo END_PROVIDER @@ -51,7 +51,7 @@ END_PROVIDER if (diag_algorithm == "Davidson") then call davidson_diag(psi_det,CI_eigenvectors,CI_electronic_energy, & - size(CI_eigenvectors,1),N_det,N_states_diag,N_int,output_Dets) + size(CI_eigenvectors,1),N_det,N_states_diag,N_int,output_determinants) else if (diag_algorithm == "Lapack") then diff --git a/src/Dets/diagonalize_CI_SC2.irp.f b/src/Determinants/diagonalize_CI_SC2.irp.f similarity index 92% rename from src/Dets/diagonalize_CI_SC2.irp.f rename to src/Determinants/diagonalize_CI_SC2.irp.f index 86ba72b9..3b0d7904 100644 --- a/src/Dets/diagonalize_CI_SC2.irp.f +++ b/src/Determinants/diagonalize_CI_SC2.irp.f @@ -6,11 +6,11 @@ BEGIN_PROVIDER [ double precision, CI_SC2_energy, (N_states_diag) ] integer :: j character*(8) :: st - call write_time(output_Dets) + call write_time(output_determinants) do j=1,N_states_diag CI_SC2_energy(j) = CI_SC2_electronic_energy(j) + nuclear_repulsion write(st,'(I4)') j - call write_double(output_Dets,CI_SC2_energy(j),'Energy of state '//trim(st)) + call write_double(output_determinants,CI_SC2_energy(j),'Energy of state '//trim(st)) enddo END_PROVIDER diff --git a/src/Dets/diagonalize_CI_mono.irp.f b/src/Determinants/diagonalize_CI_mono.irp.f similarity index 99% rename from src/Dets/diagonalize_CI_mono.irp.f rename to src/Determinants/diagonalize_CI_mono.irp.f index a3c5b103..1c9a4de3 100644 --- a/src/Dets/diagonalize_CI_mono.irp.f +++ b/src/Determinants/diagonalize_CI_mono.irp.f @@ -16,7 +16,7 @@ if (diag_algorithm == "Davidson") then call davidson_diag(psi_det,CI_eigenvectors_mono,CI_electronic_energy, & - size(CI_eigenvectors_mono,1),N_det,N_states_diag,N_int,output_Dets) + size(CI_eigenvectors_mono,1),N_det,N_states_diag,N_int,output_determinants) else if (diag_algorithm == "Lapack") then diff --git a/src/Dets/excitations_utils.irp.f b/src/Determinants/excitations_utils.irp.f similarity index 100% rename from src/Dets/excitations_utils.irp.f rename to src/Determinants/excitations_utils.irp.f diff --git a/src/Dets/filter_connected.irp.f b/src/Determinants/filter_connected.irp.f similarity index 100% rename from src/Dets/filter_connected.irp.f rename to src/Determinants/filter_connected.irp.f diff --git a/src/Dets/guess_doublet.irp.f b/src/Determinants/guess_doublet.irp.f similarity index 100% rename from src/Dets/guess_doublet.irp.f rename to src/Determinants/guess_doublet.irp.f diff --git a/src/Dets/guess_singlet.irp.f b/src/Determinants/guess_singlet.irp.f similarity index 100% rename from src/Dets/guess_singlet.irp.f rename to src/Determinants/guess_singlet.irp.f diff --git a/src/Dets/guess_triplet.irp.f b/src/Determinants/guess_triplet.irp.f similarity index 100% rename from src/Dets/guess_triplet.irp.f rename to src/Determinants/guess_triplet.irp.f diff --git a/src/Dets/occ_pattern.irp.f b/src/Determinants/occ_pattern.irp.f similarity index 99% rename from src/Dets/occ_pattern.irp.f rename to src/Determinants/occ_pattern.irp.f index 29d0dacf..a0fd4a3c 100644 --- a/src/Dets/occ_pattern.irp.f +++ b/src/Determinants/occ_pattern.irp.f @@ -333,7 +333,7 @@ subroutine make_s2_eigenfunction ! enddo ! enddo ! !TODO DEBUG - call write_int(output_dets,N_det_new, 'Added deteminants for S^2') + call write_int(output_determinants,N_det_new, 'Added deteminants for S^2') end diff --git a/src/Determinants/options.irp.f b/src/Determinants/options.irp.f new file mode 100644 index 00000000..d4283128 --- /dev/null +++ b/src/Determinants/options.irp.f @@ -0,0 +1,22 @@ +BEGIN_PROVIDER [ integer, N_states_diag ] + implicit none + BEGIN_DOC +! Number of states to consider for the diagonalization + END_DOC + + logical :: has + PROVIDE ezfio_filename + call ezfio_has_determinants_n_states_diag(has) + if (has) then + call ezfio_get_determinants_n_states_diag(N_states_diag) + else + N_states_diag = N_states + endif + + call write_time(output_determinants) + call write_int(output_determinants, N_states_diag, & + 'N_states_diag') + + +END_PROVIDER + diff --git a/src/Dets/program_beginer_determinants.irp.f b/src/Determinants/program_beginer_determinants.irp.f similarity index 100% rename from src/Dets/program_beginer_determinants.irp.f rename to src/Determinants/program_beginer_determinants.irp.f diff --git a/src/Dets/psi_cas.irp.f b/src/Determinants/psi_cas.irp.f similarity index 97% rename from src/Dets/psi_cas.irp.f rename to src/Determinants/psi_cas.irp.f index 299e5e8f..8ca081d6 100644 --- a/src/Dets/psi_cas.irp.f +++ b/src/Determinants/psi_cas.irp.f @@ -38,7 +38,7 @@ use bitmasks enddo endif enddo - call write_int(output_dets,N_det_cas, 'Number of determinants in the CAS') + call write_int(output_determinants,N_det_cas, 'Number of determinants in the CAS') END_PROVIDER diff --git a/src/Dets/ref_bitmask.irp.f b/src/Determinants/ref_bitmask.irp.f similarity index 100% rename from src/Dets/ref_bitmask.irp.f rename to src/Determinants/ref_bitmask.irp.f diff --git a/src/Dets/s2.irp.f b/src/Determinants/s2.irp.f similarity index 100% rename from src/Dets/s2.irp.f rename to src/Determinants/s2.irp.f diff --git a/src/Dets/save_for_casino.irp.f b/src/Determinants/save_for_casino.irp.f similarity index 100% rename from src/Dets/save_for_casino.irp.f rename to src/Determinants/save_for_casino.irp.f diff --git a/src/Dets/save_for_qmcchem.irp.f b/src/Determinants/save_for_qmcchem.irp.f similarity index 94% rename from src/Dets/save_for_qmcchem.irp.f rename to src/Determinants/save_for_qmcchem.irp.f index 7dea70c6..b707ff7c 100644 --- a/src/Dets/save_for_qmcchem.irp.f +++ b/src/Determinants/save_for_qmcchem.irp.f @@ -32,7 +32,7 @@ subroutine save_dets_qmcchem deallocate(occ_tmp) ! OMP END PARALLEL call ezfio_set_determinants_det_occ(occ) - call write_int(output_dets,N_det,'Determinants saved for QMC') + call write_int(output_determinants,N_det,'Determinants saved for QMC') deallocate(occ) open(unit=31,file=trim(ezfio_filename)//'/mo_basis/mo_classif') write(31,'(I1)') 1 diff --git a/src/Dets/save_natorb.irp.f b/src/Determinants/save_natorb.irp.f similarity index 100% rename from src/Dets/save_natorb.irp.f rename to src/Determinants/save_natorb.irp.f diff --git a/src/Dets/slater_rules.irp.f b/src/Determinants/slater_rules.irp.f similarity index 100% rename from src/Dets/slater_rules.irp.f rename to src/Determinants/slater_rules.irp.f diff --git a/src/Dets/spindeterminants.ezfio_config b/src/Determinants/spindeterminants.ezfio_config similarity index 75% rename from src/Dets/spindeterminants.ezfio_config rename to src/Determinants/spindeterminants.ezfio_config index 1c7d81e3..39ccb82b 100644 --- a/src/Dets/spindeterminants.ezfio_config +++ b/src/Determinants/spindeterminants.ezfio_config @@ -1,12 +1,15 @@ spindeterminants n_det_alpha integer n_det_beta integer + n_det integer n_int integer bit_kind integer n_states integer psi_det_alpha integer*8 (spindeterminants_n_int*spindeterminants_bit_kind/8,spindeterminants_n_det_alpha) psi_det_beta integer*8 (spindeterminants_n_int*spindeterminants_bit_kind/8,spindeterminants_n_det_beta) - psi_coef_matrix double precision (spindeterminants_n_det_alpha,spindeterminants_n_det_beta,spindeterminants_n_states) + psi_coef_matrix_rows integer (spindeterminants_n_det) + psi_coef_matrix_columns integer (spindeterminants_n_det) + psi_coef_matrix_values double precision (spindeterminants_n_det,spindeterminants_n_states) n_svd_coefs integer psi_svd_alpha double precision (spindeterminants_n_det_alpha,spindeterminants_n_svd_coefs,spindeterminants_n_states) psi_svd_beta double precision (spindeterminants_n_det_beta,spindeterminants_n_svd_coefs,spindeterminants_n_states) diff --git a/src/Determinants/spindeterminants.irp.f b/src/Determinants/spindeterminants.irp.f new file mode 100644 index 00000000..ffd28f85 --- /dev/null +++ b/src/Determinants/spindeterminants.irp.f @@ -0,0 +1,615 @@ +!==============================================================================! +! ! +! Independent alpha/beta parts ! +! ! +!==============================================================================! + +use bitmasks + +integer*8 function spin_det_search_key(det,Nint) + use bitmasks + implicit none + BEGIN_DOC +! Return an integer*8 corresponding to a determinant index for searching + END_DOC + integer, intent(in) :: Nint + integer(bit_kind), intent(in) :: det(Nint) + integer :: i + spin_det_search_key = det(1) + do i=2,Nint + spin_det_search_key = ieor(spin_det_search_key,det(i)) + enddo +end + + +BEGIN_PROVIDER [ integer(bit_kind), psi_det_alpha, (N_int,psi_det_size) ] + implicit none + BEGIN_DOC +! List of alpha determinants of psi_det + END_DOC + integer :: i,k + + do i=1,N_det + do k=1,N_int + psi_det_alpha(k,i) = psi_det(k,1,i) + enddo + enddo +END_PROVIDER + +BEGIN_PROVIDER [ integer(bit_kind), psi_det_beta, (N_int,psi_det_size) ] + implicit none + BEGIN_DOC +! List of beta determinants of psi_det + END_DOC + integer :: i,k + + do i=1,N_det + do k=1,N_int + psi_det_beta(k,i) = psi_det(k,2,i) + enddo + enddo +END_PROVIDER + + BEGIN_PROVIDER [ integer(bit_kind), psi_det_alpha_unique, (N_int,psi_det_size) ] +&BEGIN_PROVIDER [ integer, N_det_alpha_unique ] + implicit none + BEGIN_DOC + ! Unique alpha determinants + END_DOC + + integer :: i,k + integer, allocatable :: iorder(:) + integer*8, allocatable :: bit_tmp(:) + integer*8 :: last_key + integer*8, external :: spin_det_search_key + + allocate ( iorder(N_det), bit_tmp(N_det)) + + do i=1,N_det + iorder(i) = i + bit_tmp(i) = spin_det_search_key(psi_det_alpha(1,i),N_int) + enddo + + call i8sort(bit_tmp,iorder,N_det) + + N_det_alpha_unique = 0 + last_key = 0_8 + do i=1,N_det + if (bit_tmp(i) /= last_key) then + last_key = bit_tmp(i) + N_det_alpha_unique += 1 + do k=1,N_int + psi_det_alpha_unique(k,N_det_alpha_unique) = psi_det_alpha(k,iorder(i)) + enddo + endif + enddo + + deallocate (iorder, bit_tmp) +END_PROVIDER + + BEGIN_PROVIDER [ integer(bit_kind), psi_det_beta_unique, (N_int,psi_det_size) ] +&BEGIN_PROVIDER [ integer, N_det_beta_unique ] + implicit none + BEGIN_DOC + ! Unique beta determinants + END_DOC + + integer :: i,k + integer, allocatable :: iorder(:) + integer*8, allocatable :: bit_tmp(:) + integer*8 :: last_key + integer*8, external :: spin_det_search_key + + allocate ( iorder(N_det), bit_tmp(N_det)) + + do i=1,N_det + iorder(i) = i + bit_tmp(i) = spin_det_search_key(psi_det_beta(1,i),N_int) + enddo + + call i8sort(bit_tmp,iorder,N_det) + + N_det_beta_unique = 0 + last_key = 0_8 + do i=1,N_det + if (bit_tmp(i) /= last_key) then + last_key = bit_tmp(i) + N_det_beta_unique += 1 + do k=1,N_int + psi_det_beta_unique(k,N_det_beta_unique) = psi_det_beta(k,iorder(i)) + enddo + endif + enddo + + deallocate (iorder, bit_tmp) +END_PROVIDER + + + + + +integer function get_index_in_psi_det_alpha_unique(key,Nint) + use bitmasks + BEGIN_DOC +! Returns the index of the determinant in the ``psi_det_alpha_unique`` array + END_DOC + implicit none + + integer, intent(in) :: Nint + integer(bit_kind), intent(in) :: key(Nint) + + integer :: i, ibegin, iend, istep, l + integer*8 :: det_ref, det_search + integer*8, external :: spin_det_search_key + logical :: is_in_wavefunction + + is_in_wavefunction = .False. + get_index_in_psi_det_alpha_unique = 0 + ibegin = 1 + iend = N_det_alpha_unique + 1 + + !DIR$ FORCEINLINE + det_ref = spin_det_search_key(key,Nint) + !DIR$ FORCEINLINE + det_search = spin_det_search_key(psi_det_alpha_unique(1,1),Nint) + + istep = ishft(iend-ibegin,-1) + i=ibegin+istep + do while (istep > 0) + !DIR$ FORCEINLINE + det_search = spin_det_search_key(psi_det_alpha_unique(1,i),Nint) + if ( det_search > det_ref ) then + iend = i + else if ( det_search == det_ref ) then + exit + else + ibegin = i + endif + istep = ishft(iend-ibegin,-1) + i = ibegin + istep + end do + + !DIR$ FORCEINLINE + do while (spin_det_search_key(psi_det_alpha_unique(1,i),Nint) == det_ref) + i = i-1 + if (i == 0) then + exit + endif + enddo + i += 1 + + if (i > N_det_alpha_unique) then + return + endif + + !DIR$ FORCEINLINE + do while (spin_det_search_key(psi_det_alpha_unique(1,i),Nint) == det_ref) + if (key(1) /= psi_det_alpha_unique(1,i)) then + continue + else + is_in_wavefunction = .True. + !DIR$ IVDEP + !DIR$ LOOP COUNT MIN(3) + do l=2,Nint + if (key(l) /= psi_det_alpha_unique(l,i)) then + is_in_wavefunction = .False. + endif + enddo + if (is_in_wavefunction) then + get_index_in_psi_det_alpha_unique = i + return + endif + endif + i += 1 + if (i > N_det_alpha_unique) then + return + endif + + enddo + +end + +integer function get_index_in_psi_det_beta_unique(key,Nint) + use bitmasks + BEGIN_DOC +! Returns the index of the determinant in the ``psi_det_beta_unique`` array + END_DOC + implicit none + + integer, intent(in) :: Nint + integer(bit_kind), intent(in) :: key(Nint) + + integer :: i, ibegin, iend, istep, l + integer*8 :: det_ref, det_search + integer*8, external :: spin_det_search_key + logical :: is_in_wavefunction + + is_in_wavefunction = .False. + get_index_in_psi_det_beta_unique = 0 + ibegin = 1 + iend = N_det_beta_unique + 1 + + !DIR$ FORCEINLINE + det_ref = spin_det_search_key(key,Nint) + !DIR$ FORCEINLINE + det_search = spin_det_search_key(psi_det_beta_unique(1,1),Nint) + + istep = ishft(iend-ibegin,-1) + i=ibegin+istep + do while (istep > 0) + !DIR$ FORCEINLINE + det_search = spin_det_search_key(psi_det_beta_unique(1,i),Nint) + if ( det_search > det_ref ) then + iend = i + else if ( det_search == det_ref ) then + exit + else + ibegin = i + endif + istep = ishft(iend-ibegin,-1) + i = ibegin + istep + end do + + !DIR$ FORCEINLINE + do while (spin_det_search_key(psi_det_beta_unique(1,i),Nint) == det_ref) + i = i-1 + if (i == 0) then + exit + endif + enddo + i += 1 + + if (i > N_det_beta_unique) then + return + endif + + !DIR$ FORCEINLINE + do while (spin_det_search_key(psi_det_beta_unique(1,i),Nint) == det_ref) + if (key(1) /= psi_det_beta_unique(1,i)) then + continue + else + is_in_wavefunction = .True. + !DIR$ IVDEP + !DIR$ LOOP COUNT MIN(3) + do l=2,Nint + if (key(l) /= psi_det_beta_unique(l,i)) then + is_in_wavefunction = .False. + endif + enddo + if (is_in_wavefunction) then + get_index_in_psi_det_beta_unique = i + return + endif + endif + i += 1 + if (i > N_det_beta_unique) then + return + endif + + enddo + +end + + +subroutine write_spindeterminants + use bitmasks + implicit none + integer*8, allocatable :: tmpdet(:,:) + integer :: N_int2 + integer :: i,j,k + integer*8 :: det_8(100) + integer(bit_kind) :: det_bk((100*8)/bit_kind) + equivalence (det_8, det_bk) + + N_int2 = (N_int*bit_kind)/8 + call ezfio_set_spindeterminants_n_det_alpha(N_det_alpha_unique) + call ezfio_set_spindeterminants_n_det_beta(N_det_beta_unique) + call ezfio_set_spindeterminants_n_det(N_det) + call ezfio_set_spindeterminants_n_int(N_int) + call ezfio_set_spindeterminants_bit_kind(bit_kind) + call ezfio_set_spindeterminants_n_states(N_states) + + allocate(tmpdet(N_int2,N_det_alpha_unique)) + do i=1,N_det_alpha_unique + do k=1,N_int + det_bk(k) = psi_det_alpha_unique(k,i) + enddo + do k=1,N_int2 + tmpdet(k,i) = det_8(k) + enddo + enddo + call ezfio_set_spindeterminants_psi_det_alpha(psi_det_alpha_unique) + deallocate(tmpdet) + + allocate(tmpdet(N_int2,N_det_beta_unique)) + do i=1,N_det_beta_unique + do k=1,N_int + det_bk(k) = psi_det_beta_unique(k,i) + enddo + do k=1,N_int2 + tmpdet(k,i) = det_8(k) + enddo + enddo + call ezfio_set_spindeterminants_psi_det_beta(psi_det_beta_unique) + deallocate(tmpdet) + + call ezfio_set_spindeterminants_psi_coef_matrix_values(psi_svd_matrix_values) + call ezfio_set_spindeterminants_psi_coef_matrix_rows(psi_svd_matrix_rows) + call ezfio_set_spindeterminants_psi_coef_matrix_columns(psi_svd_matrix_columns) + + integer :: n_svd_coefs + double precision :: norm, f + f = 1.d0/dble(N_states) + norm = 1.d0 + do n_svd_coefs=1,N_det_alpha_unique + do k=1,N_states + norm -= psi_svd_coefs(n_svd_coefs,k)*psi_svd_coefs(n_svd_coefs,k) + enddo + if (norm < 1.d-4) then + exit + endif + enddo + n_svd_coefs -= 1 + call ezfio_set_spindeterminants_n_svd_coefs(n_svd_coefs) + + double precision, allocatable :: dtmp(:,:,:) + allocate(dtmp(N_det_alpha_unique,n_svd_coefs,N_states)) + do k=1,N_states + do j=1,n_svd_coefs + do i=1,N_det_alpha_unique + dtmp(i,j,k) = psi_svd_alpha(i,j,k) + enddo + enddo + enddo + call ezfio_set_spindeterminants_psi_svd_alpha(dtmp) + deallocate(dtmp) + + allocate(dtmp(N_det_beta_unique,n_svd_coefs,N_states)) + do k=1,N_states + do j=1,n_svd_coefs + do i=1,N_det_beta_unique + dtmp(i,j,k) = psi_svd_beta(i,j,k) + enddo + enddo + enddo + call ezfio_set_spindeterminants_psi_svd_beta(dtmp) + deallocate(dtmp) + + allocate(dtmp(n_svd_coefs,N_states,1)) + do k=1,N_states + do j=1,n_svd_coefs + dtmp(j,k,1) = psi_svd_coefs(j,k) + enddo + enddo + call ezfio_set_spindeterminants_psi_svd_coefs(dtmp) + deallocate(dtmp) + +end + + +!==============================================================================! +! ! +! Alpha x Beta Matrix ! +! ! +!==============================================================================! + +BEGIN_PROVIDER [ double precision, psi_svd_matrix_values, (N_det,N_states) ] +&BEGIN_PROVIDER [ integer, psi_svd_matrix_rows, (N_det) ] +&BEGIN_PROVIDER [ integer, psi_svd_matrix_columns, (N_det) ] + use bitmasks + implicit none + BEGIN_DOC +! Matrix of wf coefficients. Outer product of alpha and beta determinants + END_DOC + integer :: i,j,k, l + integer(bit_kind) :: tmp_det(N_int,2) + integer :: idx + integer, external :: get_index_in_psi_det_sorted_bit + logical, external :: is_in_wavefunction + + + PROVIDE psi_coef_sorted_bit + +! l=0 +! do j=1,N_det_beta_unique +! do k=1,N_int +! tmp_det(k,2) = psi_det_beta_unique(k,j) +! enddo +! do i=1,N_det_alpha_unique +! do k=1,N_int +! tmp_det(k,1) = psi_det_alpha_unique(k,i) +! enddo +! idx = get_index_in_psi_det_sorted_bit(tmp_det,N_int) +! if (idx > 0) then +! l += 1 +! psi_svd_matrix_rows(l) = i +! psi_svd_matrix_columns(l) = j +! do k=1,N_states +! psi_svd_matrix_values(l,k) = psi_coef_sorted_bit(idx,k) +! enddo +! endif +! enddo +! enddo +! ASSERT (l == N_det) + + integer, allocatable :: iorder(:), to_sort(:) + integer, external :: get_index_in_psi_det_alpha_unique + integer, external :: get_index_in_psi_det_beta_unique + allocate(iorder(N_det), to_sort(N_det)) + do k=1,N_det + i = get_index_in_psi_det_alpha_unique(psi_det(1,1,k),N_int) + j = get_index_in_psi_det_beta_unique (psi_det(1,2,k),N_int) + do l=1,N_states + psi_svd_matrix_values(k,l) = psi_coef(k,l) + enddo + psi_svd_matrix_rows(k) = i + psi_svd_matrix_columns(k) = j + to_sort(k) = N_det_alpha_unique * (j-1) + i + iorder(k) = k + enddo + call isort(to_sort, iorder, N_det) + call iset_order(psi_svd_matrix_rows,iorder,N_det) + call iset_order(psi_svd_matrix_columns,iorder,N_det) + call dset_order(psi_svd_matrix_values,iorder,N_det) + deallocate(iorder,to_sort) +END_PROVIDER + +BEGIN_PROVIDER [ double precision, psi_svd_matrix, (N_det_alpha_unique,N_det_beta_unique,N_states) ] + implicit none + BEGIN_DOC +! Matrix of wf coefficients. Outer product of alpha and beta determinants + END_DOC + integer :: i,j,k,istate + psi_svd_matrix = 0.d0 + do k=1,N_det + i = psi_svd_matrix_rows(k) + j = psi_svd_matrix_columns(k) + do istate=1,N_states + psi_svd_matrix(i,j,istate) = psi_svd_matrix_values(k,istate) + enddo + enddo +END_PROVIDER + +subroutine create_wf_of_psi_svd_matrix + use bitmasks + implicit none + BEGIN_DOC +! Matrix of wf coefficients. Outer product of alpha and beta determinants + END_DOC + integer :: i,j,k + integer(bit_kind) :: tmp_det(N_int,2) + integer :: idx + integer, external :: get_index_in_psi_det_sorted_bit + logical, external :: is_in_wavefunction + double precision :: norm(N_states) + + call generate_all_alpha_beta_det_products + norm = 0.d0 + do j=1,N_det_beta_unique + do k=1,N_int + tmp_det(k,2) = psi_det_beta_unique(k,j) + enddo + do i=1,N_det_alpha_unique + do k=1,N_int + tmp_det(k,1) = psi_det_alpha_unique(k,i) + enddo + idx = get_index_in_psi_det_sorted_bit(tmp_det,N_int) + if (idx > 0) then + do k=1,N_states + psi_coef_sorted_bit(idx,k) = psi_svd_matrix(i,j,k) + norm(k) += psi_svd_matrix(i,j,k) + enddo + endif + enddo + enddo + do k=1,N_states + norm(k) = 1.d0/dsqrt(norm(k)) + do i=1,N_det + psi_coef_sorted_bit(i,k) = psi_coef_sorted_bit(i,k)*norm(k) + enddo + enddo + psi_det = psi_det_sorted_bit + psi_coef = psi_coef_sorted_bit + TOUCH psi_det psi_coef + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + norm(1) = 0.d0 + do i=1,N_det + norm(1) += psi_average_norm_contrib_sorted(i) + if (norm(1) >= 0.999999d0) then + exit + endif + enddo + N_det = min(i,N_det) + SOFT_TOUCH psi_det psi_coef N_det + +end + +subroutine generate_all_alpha_beta_det_products + implicit none + BEGIN_DOC +! Create a wave function from all possible alpha x beta determinants + END_DOC + integer :: i,j,k,l + integer :: idx, iproc + integer, external :: get_index_in_psi_det_sorted_bit + integer(bit_kind), allocatable :: tmp_det(:,:,:) + logical, external :: is_in_wavefunction + integer, external :: omp_get_thread_num + + !$OMP PARALLEL DEFAULT(NONE) SHARED(psi_coef_sorted_bit,N_det_beta_unique,& + !$OMP N_det_alpha_unique, N_int, psi_det_alpha_unique, psi_det_beta_unique,& + !$OMP N_det) & + !$OMP PRIVATE(i,j,k,l,tmp_det,idx,iproc) + !$ iproc = omp_get_thread_num() + allocate (tmp_det(N_int,2,N_det_alpha_unique)) + !$OMP DO + do j=1,N_det_beta_unique + l = 1 + do i=1,N_det_alpha_unique + do k=1,N_int + tmp_det(k,1,l) = psi_det_alpha_unique(k,i) + tmp_det(k,2,l) = psi_det_beta_unique (k,j) + enddo + if (.not.is_in_wavefunction(tmp_det(1,1,l),N_int,N_det)) then + l = l+1 + endif + enddo + call fill_H_apply_buffer_no_selection(l-1, tmp_det, N_int, iproc) + enddo + !$OMP END DO NOWAIT + deallocate(tmp_det) + !$OMP END PARALLEL + deallocate (tmp_det) + call copy_H_apply_buffer_to_wf + SOFT_TOUCH psi_det psi_coef N_det +end + + BEGIN_PROVIDER [ double precision, psi_svd_alpha, (N_det_alpha_unique,N_det_alpha_unique,N_states) ] +&BEGIN_PROVIDER [ double precision, psi_svd_beta , (N_det_beta_unique,N_det_beta_unique,N_states) ] +&BEGIN_PROVIDER [ double precision, psi_svd_coefs, (N_det_beta_unique,N_states) ] + implicit none + BEGIN_DOC + ! SVD wave function + END_DOC + + integer :: lwork, info, istate + double precision, allocatable :: work(:), tmp(:,:), copy(:,:) + allocate (work(1),tmp(N_det_beta_unique,N_det_beta_unique), & + copy(size(psi_svd_matrix,1),size(psi_svd_matrix,2))) + + do istate = 1,N_states + copy(:,:) = psi_svd_matrix(:,:,istate) + lwork=-1 + call dgesvd('A','A', N_det_alpha_unique, N_det_beta_unique, & + copy, size(copy,1), & + psi_svd_coefs(1,istate), psi_svd_alpha(1,1,istate), & + size(psi_svd_alpha,1), & + tmp, size(psi_svd_beta,2), & + work, lwork, info) + lwork = work(1) + deallocate(work) + allocate(work(lwork)) + call dgesvd('A','A', N_det_alpha_unique, N_det_beta_unique, & + copy, size(copy,1), & + psi_svd_coefs(1,istate), psi_svd_alpha(1,1,istate), & + size(psi_svd_alpha,1), & + tmp, size(psi_svd_beta,2), & + work, lwork, info) + deallocate(work) + if (info /= 0) then + print *, irp_here//': error in det SVD' + stop 1 + endif + integer :: i,j + do j=1,N_det_beta_unique + do i=1,N_det_beta_unique + psi_svd_beta(i,j,istate) = tmp(j,i) + enddo + enddo + deallocate(tmp,copy) + enddo + +END_PROVIDER + + diff --git a/src/Dets/truncate_wf.irp.f b/src/Determinants/truncate_wf.irp.f similarity index 100% rename from src/Dets/truncate_wf.irp.f rename to src/Determinants/truncate_wf.irp.f diff --git a/src/Dets/utils.irp.f b/src/Determinants/utils.irp.f similarity index 100% rename from src/Dets/utils.irp.f rename to src/Determinants/utils.irp.f diff --git a/src/Dets/determinants.ezfio_config b/src/Dets/determinants.ezfio_config deleted file mode 100644 index 0937502a..00000000 --- a/src/Dets/determinants.ezfio_config +++ /dev/null @@ -1,20 +0,0 @@ -determinants - n_int integer - bit_kind integer - mo_label character*(64) - n_det integer - n_states integer - n_states_diag integer - psi_coef double precision (determinants_n_det,determinants_n_states) - psi_det integer*8 (determinants_n_int*determinants_bit_kind/8,2,determinants_n_det) - n_det_max_jacobi integer - threshold_generators double precision - threshold_selectors double precision - det_num integer - det_occ integer (electrons_elec_alpha_num,determinants_det_num,2) - det_coef double precision (determinants_det_num) - read_wf logical - expected_s2 double precision - s2_eig logical - only_single_double_dm logical - diff --git a/src/Dets/options.irp.f b/src/Dets/options.irp.f deleted file mode 100644 index dda5c04a..00000000 --- a/src/Dets/options.irp.f +++ /dev/null @@ -1,61 +0,0 @@ -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "integer" ) -T.set_name ( "N_states" ) -T.set_doc ( "Number of states to consider" ) -T.set_ezfio_dir ( "determinants" ) -T.set_ezfio_name( "N_states" ) -T.set_output ( "output_dets" ) -print T - - -T.set_name ( "N_det_max_jacobi" ) -T.set_doc ( "Maximum number of determinants diagonalized by Jacobi" ) -T.set_ezfio_name( "N_det_max_jacobi" ) -print T - -T.set_type ( "logical" ) -T.set_name ( "read_wf" ) -T.set_doc ( "If true, read the wave function from the EZFIO file" ) -T.set_ezfio_name( "read_wf" ) -T.set_output ( "output_dets" ) -print T - -T.set_type ( "logical" ) -T.set_name ( "only_single_double_dm" ) -T.set_doc ( "If true, The One body DM is calculated with ignoring the Double<->Doubles extra diag elements" ) -T.set_ezfio_name( "only_single_double_dm" ) -T.set_output ( "output_dets" ) -print T - - -T.set_name ( "s2_eig" ) -T.set_doc ( "Force the wave function to be an eigenfunction of S^2" ) -T.set_ezfio_name( "s2_eig" ) -print T - -END_SHELL - -BEGIN_PROVIDER [ integer, N_states_diag ] - implicit none - BEGIN_DOC -! Number of states to consider for the diagonalization - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_determinants_n_states_diag(has) - if (has) then - call ezfio_get_determinants_n_states_diag(N_states_diag) - else - N_states_diag = N_states - endif - - call write_time(output_dets) - call write_int(output_dets, N_states_diag, & - 'N_states_diag') - - -END_PROVIDER - diff --git a/src/Dets/spindeterminants.irp.f b/src/Dets/spindeterminants.irp.f deleted file mode 100644 index 4b426faa..00000000 --- a/src/Dets/spindeterminants.irp.f +++ /dev/null @@ -1,91 +0,0 @@ -subroutine write_spindeterminants - use bitmasks - implicit none - integer*8, allocatable :: tmpdet(:,:) - integer :: N_int2 - integer :: i,j,k - integer*8 :: det_8(100) - integer(bit_kind) :: det_bk((100*8)/bit_kind) - equivalence (det_8, det_bk) - - N_int2 = (N_int*bit_kind)/8 - call ezfio_set_spindeterminants_n_det_alpha(N_det_alpha_unique) - call ezfio_set_spindeterminants_n_det_beta(N_det_beta_unique) - call ezfio_set_spindeterminants_n_int(N_int) - call ezfio_set_spindeterminants_bit_kind(bit_kind) - call ezfio_set_spindeterminants_n_states(N_states) - - allocate(tmpdet(N_int2,N_det_alpha_unique)) - do i=1,N_det_alpha_unique - do k=1,N_int - det_bk(k) = psi_det_alpha_unique(k,i) - enddo - do k=1,N_int2 - tmpdet(k,i) = det_8(k) - enddo - enddo - call ezfio_set_spindeterminants_psi_det_alpha(psi_det_alpha_unique) - deallocate(tmpdet) - - allocate(tmpdet(N_int2,N_det_beta_unique)) - do i=1,N_det_beta_unique - do k=1,N_int - det_bk(k) = psi_det_beta_unique(k,i) - enddo - do k=1,N_int2 - tmpdet(k,i) = det_8(k) - enddo - enddo - call ezfio_set_spindeterminants_psi_det_beta(psi_det_beta_unique) - deallocate(tmpdet) - - call ezfio_set_spindeterminants_psi_coef_matrix(psi_svd_matrix) - - integer :: n_svd_coefs - double precision :: norm, f - f = 1.d0/dble(N_states) - norm = 1.d0 - do n_svd_coefs=1,N_det_alpha_unique - do k=1,N_states - norm -= psi_svd_coefs(n_svd_coefs,k)*psi_svd_coefs(n_svd_coefs,k) - enddo - if (norm < 1.d-6) then - exit - endif - enddo - n_svd_coefs -= 1 - call ezfio_set_spindeterminants_n_svd_coefs(n_svd_coefs) - - double precision, allocatable :: dtmp(:,:,:) - allocate(dtmp(N_det_alpha_unique,n_svd_coefs,N_states)) - do k=1,N_states - do j=1,n_svd_coefs - do i=1,N_det_alpha_unique - dtmp(i,j,k) = psi_svd_alpha(i,j,k) - enddo - enddo - enddo - call ezfio_set_spindeterminants_psi_svd_alpha(dtmp) - deallocate(dtmp) - - allocate(dtmp(N_det_beta_unique,n_svd_coefs,N_states)) - do k=1,N_states - do j=1,n_svd_coefs - do i=1,N_det_beta_unique - dtmp(i,j,k) = psi_svd_beta(i,j,k) - enddo - enddo - enddo - call ezfio_set_spindeterminants_psi_svd_beta(dtmp) - deallocate(dtmp) - - allocate(dtmp(n_svd_coefs,N_states,1)) - do k=1,N_states - do j=1,n_svd_coefs - dtmp(j,k,1) = psi_svd_coefs(j,k) - enddo - enddo - call ezfio_set_spindeterminants_psi_svd_coefs(dtmp) - deallocate(dtmp) - -end diff --git a/src/FCIdump/NEEDED_MODULES b/src/FCIdump/NEEDED_MODULES index 7f2f0ca8..c5e6c2d3 100644 --- a/src/FCIdump/NEEDED_MODULES +++ b/src/FCIdump/NEEDED_MODULES @@ -1 +1 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/FCIdump/README.rst b/src/FCIdump/README.rst index 1fdd9660..bf39955b 100644 --- a/src/FCIdump/README.rst +++ b/src/FCIdump/README.rst @@ -24,7 +24,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `MonoInts `_ diff --git a/src/Full_CI/NEEDED_MODULES b/src/Full_CI/NEEDED_MODULES index 5e074d3c..f225090c 100644 --- a/src/Full_CI/NEEDED_MODULES +++ b/src/Full_CI/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/Full_CI/README.rst b/src/Full_CI/README.rst index 0b37ca69..53fdc1d5 100644 --- a/src/Full_CI/README.rst +++ b/src/Full_CI/README.rst @@ -27,7 +27,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Generators_full `_ diff --git a/src/Generators_CAS/NEEDED_MODULES b/src/Generators_CAS/NEEDED_MODULES index 7f2f0ca8..c5e6c2d3 100644 --- a/src/Generators_CAS/NEEDED_MODULES +++ b/src/Generators_CAS/NEEDED_MODULES @@ -1 +1 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_CAS/README.rst b/src/Generators_CAS/README.rst index 53e8c5a0..3fca0916 100644 --- a/src/Generators_CAS/README.rst +++ b/src/Generators_CAS/README.rst @@ -46,7 +46,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `MonoInts `_ diff --git a/src/Generators_CAS/generators.irp.f b/src/Generators_CAS/generators.irp.f index 511877a0..f47341de 100644 --- a/src/Generators_CAS/generators.irp.f +++ b/src/Generators_CAS/generators.irp.f @@ -7,7 +7,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ] END_DOC integer :: i,k,l logical :: good - call write_time(output_dets) + call write_time(output_determinants) N_det_generators = 0 do i=1,N_det do l=1,n_cas_bitmask @@ -28,7 +28,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ] endif enddo N_det_generators = max(N_det_generators,1) - call write_int(output_dets,N_det_generators,'Number of generators') + call write_int(output_determinants,N_det_generators,'Number of generators') END_PROVIDER BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators, (N_int,2,psi_det_size) ] diff --git a/src/Generators_full/NEEDED_MODULES b/src/Generators_full/NEEDED_MODULES index 7d973bce..a848a687 100644 --- a/src/Generators_full/NEEDED_MODULES +++ b/src/Generators_full/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_full/README.rst b/src/Generators_full/README.rst index a8492dbc..79f4037c 100644 --- a/src/Generators_full/README.rst +++ b/src/Generators_full/README.rst @@ -11,25 +11,25 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. -`degree_max_generators `_ +`degree_max_generators `_ Max degree of excitation (respect to HF) of the generators -`n_det_generators `_ +`n_det_generators `_ For Single reference wave functions, the number of generators is 1 : the Hartree-Fock determinant -`psi_coef_generators `_ +`psi_coef_generators `_ For Single reference wave functions, the generator is the Hartree-Fock determinant -`psi_det_generators `_ +`psi_det_generators `_ For Single reference wave functions, the generator is the Hartree-Fock determinant -`select_max `_ +`select_max `_ Memo to skip useless selectors -`size_select_max `_ +`size_select_max `_ Size of the select_max array @@ -43,7 +43,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/Generators_full/generators.irp.f b/src/Generators_full/generators.irp.f index 4d261acd..a61fc5c5 100644 --- a/src/Generators_full/generators.irp.f +++ b/src/Generators_full/generators.irp.f @@ -1,17 +1,5 @@ use bitmasks -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "double precision" ) -T.set_name ( "threshold_generators" ) -T.set_doc ( "Percentage of the norm of the state-averaged wave function to consider for the generators" ) -T.set_ezfio_dir ( "determinants" ) -T.set_ezfio_name( "threshold_generators" ) -T.set_output ( "output_dets" ) -print T -END_SHELL - BEGIN_PROVIDER [ integer, N_det_generators ] implicit none BEGIN_DOC @@ -20,7 +8,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ] END_DOC integer :: i double precision :: norm - call write_time(output_dets) + call write_time(output_determinants) norm = 0.d0 N_det_generators = N_det do i=1,N_det @@ -31,7 +19,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ] endif enddo N_det_generators = max(N_det_generators,1) - call write_int(output_dets,N_det_generators,'Number of generators') + call write_int(output_determinants,N_det_generators,'Number of generators') END_PROVIDER BEGIN_PROVIDER [ integer(bit_kind), psi_det_generators, (N_int,2,psi_det_size) ] diff --git a/src/Generators_restart/NEEDED_MODULES b/src/Generators_restart/NEEDED_MODULES index 7f2f0ca8..c5e6c2d3 100644 --- a/src/Generators_restart/NEEDED_MODULES +++ b/src/Generators_restart/NEEDED_MODULES @@ -1 +1 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_restart/generators.irp.f b/src/Generators_restart/generators.irp.f index 2e0bc375..0a82e6f9 100644 --- a/src/Generators_restart/generators.irp.f +++ b/src/Generators_restart/generators.irp.f @@ -13,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_generators ] N_det_generators = N_det ifirst = 1 endif - call write_int(output_dets,N_det_generators,'Number of generators') + call write_int(output_determinants,N_det_generators,'Number of generators') END_PROVIDER diff --git a/src/MP2/NEEDED_MODULES b/src/MP2/NEEDED_MODULES index 076746d1..b7a006c3 100644 --- a/src/MP2/NEEDED_MODULES +++ b/src/MP2/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full SingleRefMethod Utils diff --git a/src/MP2/README.rst b/src/MP2/README.rst index 92d915b6..74db8039 100644 --- a/src/MP2/README.rst +++ b/src/MP2/README.rst @@ -22,7 +22,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/MRCC/NEEDED_MODULES b/src/MRCC/NEEDED_MODULES index 5e074d3c..f225090c 100644 --- a/src/MRCC/NEEDED_MODULES +++ b/src/MRCC/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Generators_full Hartree_Fock MOGuess MonoInts MOs Nuclei Output Perturbation Properties Selectors_full Utils diff --git a/src/MRCC/README.rst b/src/MRCC/README.rst index 702d19aa..f96f329f 100644 --- a/src/MRCC/README.rst +++ b/src/MRCC/README.rst @@ -11,7 +11,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Generators_full `_ diff --git a/src/MRCC/mrcc_utils.irp.f b/src/MRCC/mrcc_utils.irp.f index d33b7902..9b4add38 100644 --- a/src/MRCC/mrcc_utils.irp.f +++ b/src/MRCC/mrcc_utils.irp.f @@ -94,7 +94,7 @@ END_PROVIDER stop 'use Lapack' ! call davidson_diag(psi_det,CI_eigenvectors_dressed,CI_electronic_energy_dressed, & -! size(CI_eigenvectors_dressed,1),N_det,N_states_diag,N_int,output_Dets) +! size(CI_eigenvectors_dressed,1),N_det,N_states_diag,N_int,output_determinants) else if (diag_algorithm == "Lapack") then @@ -137,7 +137,7 @@ BEGIN_PROVIDER [ double precision, CI_energy_dressed, (N_states_diag) ] integer :: j character*(8) :: st - call write_time(output_Dets) + call write_time(output_determinants) do j=1,N_states_diag CI_energy_dressed(j) = CI_electronic_energy_dressed(j) + nuclear_repulsion enddo diff --git a/src/Makefile.config.ifort b/src/Makefile.config.ifort deleted file mode 100644 index 164d348e..00000000 --- a/src/Makefile.config.ifort +++ /dev/null @@ -1,30 +0,0 @@ -OPENMP =1 -PROFILE =0 -DEBUG = 0 - -IRPF90_FLAGS+= --align=32 -FC = ifort -g -FCFLAGS= -FCFLAGS+= -axAVX,SSE4.2 -FCFLAGS+= -O2 -FCFLAGS+= -ip -FCFLAGS+= -opt-prefetch -FCFLAGS+= -ftz -MKL=-mkl=parallel - -ifeq ($(PROFILE),1) -FC += -p -g -CXX += -pg -endif - -ifeq ($(OPENMP),1) -FC += -openmp -IRPF90_FLAGS += --openmp -CXX += -fopenmp -endif - -ifeq ($(DEBUG),1) -FC += -C -traceback -fpe0 -IRPF90_FLAGS += -a -#FCFLAGS =-O0 -endif diff --git a/src/NEEDED_MODULES b/src/NEEDED_MODULES index efe8b8f8..80176c68 100644 --- a/src/NEEDED_MODULES +++ b/src/NEEDED_MODULES @@ -1 +1 @@ -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 DDCI_selected MRCC +AOs Bielec_integrals Bitmask CID CID_SC2_selected CID_selected CIS CISD CISD_selected CISD_SC2_selected Determinants Electrons Ezfio_files Full_CI Generators_full Hartree_Fock MOGuess MonoInts MOs MP2 Nuclei Output Selectors_full Utils Molden FCIdump Generators_CAS CAS_SD DDCI_selected MRCC diff --git a/src/Output/NEEDED_MODULES b/src/Output/NEEDED_MODULES index 5d0065cc..f684b5aa 100644 --- a/src/Output/NEEDED_MODULES +++ b/src/Output/NEEDED_MODULES @@ -1 +1 @@ -Utils +Utils Ezfio_files diff --git a/src/Output/README.rst b/src/Output/README.rst index adcae302..7b510fc1 100644 --- a/src/Output/README.rst +++ b/src/Output/README.rst @@ -32,6 +32,7 @@ Needed Modules .. NEEDED_MODULES file. * `Utils `_ +* `Ezfio_files `_ Documentation ============= diff --git a/src/Output/output.irp.f b/src/Output/output.irp.f index d227dda8..85f5cc0e 100644 --- a/src/Output/output.irp.f +++ b/src/Output/output.irp.f @@ -19,7 +19,7 @@ BEGIN_SHELL [ /bin/bash ] BEGIN_DOC ! Output file for $NAME END_DOC - PROVIDE output_wall_time_0 output_cpu_time_0 + PROVIDE output_wall_time_0 output_cpu_time_0 ezfio_filename integer :: getUnitAndOpen call ezfio_set_output_empty(.False.) IRP_IF COARRAY diff --git a/src/Perturbation/NEEDED_MODULES b/src/Perturbation/NEEDED_MODULES index 4fa6ff4b..4e0f218e 100644 --- a/src/Perturbation/NEEDED_MODULES +++ b/src/Perturbation/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Properties Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Properties Utils diff --git a/src/Perturbation/selection.irp.f b/src/Perturbation/selection.irp.f index 4230293a..77313888 100644 --- a/src/Perturbation/selection.irp.f +++ b/src/Perturbation/selection.irp.f @@ -135,7 +135,7 @@ subroutine remove_small_contributions if (N_removed > 0) then N_det = N_det - N_removed SOFT_TOUCH N_det psi_det psi_coef - call write_int(output_dets,N_removed, 'Removed determinants') + call write_int(output_determinants,N_removed, 'Removed determinants') endif end diff --git a/src/Properties/EZFIO.cfg b/src/Properties/EZFIO.cfg new file mode 100644 index 00000000..d230011d --- /dev/null +++ b/src/Properties/EZFIO.cfg @@ -0,0 +1,5 @@ +[z_one_point] +type: double precision +doc: z point on which the integrated delta rho is calculated +interface: input +default: 3.9 \ No newline at end of file diff --git a/src/Properties/NEEDED_MODULES b/src/Properties/NEEDED_MODULES index 9095dbdf..62dbbe42 100644 --- a/src/Properties/NEEDED_MODULES +++ b/src/Properties/NEEDED_MODULES @@ -1 +1 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Properties/options.irp.f b/src/Properties/options.irp.f deleted file mode 100644 index 0fd5a4c1..00000000 --- a/src/Properties/options.irp.f +++ /dev/null @@ -1,13 +0,0 @@ -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "double precision" ) -T.set_name ( "z_one_point" ) -T.set_doc ( "z point on which the integrated delta rho is calculated" ) -T.set_ezfio_dir ( "properties" ) -T.set_ezfio_name( "z_one_point" ) -T.set_output ( "output_full_ci" ) -print T - -END_SHELL - diff --git a/src/Properties/properties.ezfio_config b/src/Properties/properties.ezfio_config deleted file mode 100644 index 018b56d0..00000000 --- a/src/Properties/properties.ezfio_config +++ /dev/null @@ -1,2 +0,0 @@ -properties - z_one_point double precision diff --git a/src/Selectors_full/NEEDED_MODULES b/src/Selectors_full/NEEDED_MODULES index 7d973bce..a848a687 100644 --- a/src/Selectors_full/NEEDED_MODULES +++ b/src/Selectors_full/NEEDED_MODULES @@ -1,2 +1,2 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files Hartree_Fock MOGuess MonoInts MOs Nuclei Output Utils diff --git a/src/Selectors_full/README.rst b/src/Selectors_full/README.rst index aaa07bbd..2ca9380a 100644 --- a/src/Selectors_full/README.rst +++ b/src/Selectors_full/README.rst @@ -123,38 +123,38 @@ Documentation .br n_double_selectors = number of double excitations in the selectors determinants -`n_det_selectors `_ +`n_det_selectors `_ For Single reference wave functions, the number of selectors is 1 : the Hartree-Fock determinant -`psi_selectors `_ +`psi_selectors `_ Determinants on which we apply for perturbation. -`psi_selectors_ab `_ +`psi_selectors_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_selectors_coef `_ +`psi_selectors_coef `_ Determinants on which we apply for perturbation. -`psi_selectors_coef_ab `_ +`psi_selectors_coef_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_selectors_diag_h_mat `_ +`psi_selectors_diag_h_mat `_ Diagonal elements of the H matrix for each selectors -`psi_selectors_next_ab `_ +`psi_selectors_next_ab `_ Determinants on which we apply . They are sorted by the 3 highest electrons in the alpha part, then by the 3 highest electrons in the beta part to accelerate the research of connected determinants. -`psi_selectors_size `_ +`psi_selectors_size `_ Undocumented @@ -168,7 +168,7 @@ Needed Modules * `AOs `_ * `Bielec_integrals `_ * `Bitmask `_ -* `Dets `_ +* `Determinants `_ * `Electrons `_ * `Ezfio_files `_ * `Hartree_Fock `_ diff --git a/src/Selectors_full/selectors.irp.f b/src/Selectors_full/selectors.irp.f index 986241f5..73ae6371 100644 --- a/src/Selectors_full/selectors.irp.f +++ b/src/Selectors_full/selectors.irp.f @@ -1,17 +1,5 @@ use bitmasks -BEGIN_SHELL [ /usr/bin/python ] -from ezfio_with_default import EZFIO_Provider -T = EZFIO_Provider() -T.set_type ( "double precision" ) -T.set_name ( "threshold_selectors" ) -T.set_doc ( "Percentage of the norm of the state-averaged wave function to consider for the selectors" ) -T.set_ezfio_dir ( "determinants" ) -T.set_ezfio_name( "threshold_selectors" ) -T.set_output ( "output_dets" ) -print T -END_SHELL - BEGIN_PROVIDER [ integer, psi_selectors_size ] implicit none psi_selectors_size = psi_det_size @@ -25,7 +13,7 @@ BEGIN_PROVIDER [ integer, N_det_selectors] END_DOC integer :: i double precision :: norm - call write_time(output_dets) + call write_time(output_determinants) norm = 0.d0 N_det_selectors = N_det do i=1,N_det @@ -36,7 +24,7 @@ BEGIN_PROVIDER [ integer, N_det_selectors] endif enddo N_det_selectors = max(N_det_selectors,1) - call write_int(output_dets,N_det_selectors,'Number of selectors') + call write_int(output_determinants,N_det_selectors,'Number of selectors') END_PROVIDER BEGIN_PROVIDER [ integer(bit_kind), psi_selectors, (N_int,2,psi_selectors_size) ] diff --git a/src/Selectors_no_sorted/NEEDED_MODULES b/src/Selectors_no_sorted/NEEDED_MODULES index 7f2f0ca8..c5e6c2d3 100644 --- a/src/Selectors_no_sorted/NEEDED_MODULES +++ b/src/Selectors_no_sorted/NEEDED_MODULES @@ -1 +1 @@ -AOs Bielec_integrals Bitmask Dets Electrons Ezfio_files MonoInts MOs Nuclei Output Utils +AOs Bielec_integrals Bitmask Determinants Electrons Ezfio_files MonoInts MOs Nuclei Output Utils diff --git a/src/Selectors_no_sorted/selectors.irp.f b/src/Selectors_no_sorted/selectors.irp.f index d6c20804..8080e99c 100644 --- a/src/Selectors_no_sorted/selectors.irp.f +++ b/src/Selectors_no_sorted/selectors.irp.f @@ -15,11 +15,11 @@ BEGIN_PROVIDER [ integer, N_det_selectors] END_DOC integer :: i double precision :: norm - call write_time(output_dets) + call write_time(output_determinants) norm = 0.d0 N_det_selectors = N_det N_det_selectors = max(N_det_selectors,1) - call write_int(output_dets,N_det_selectors,'Number of selectors') + call write_int(output_determinants,N_det_selectors,'Number of selectors') END_PROVIDER diff --git a/tests/HBO.out b/tests/HBO.out new file mode 100644 index 00000000..ab71c53f --- /dev/null +++ b/tests/HBO.out @@ -0,0 +1,619 @@ +----- GAMESS execution script ----- +This job is running on host LPQLX15 +under operating system Linux at jeudi 16 avril 2015, 11:11:32 (UTC+0200) +Available scratch disk space (Kbyte units) at beginning of the job is +Filesystem 1K-blocks Used Available Use% Mounted on +/dev/sda1 464085784 81207016 359281456 19% / + + Distributed Data Interface kickoff program. + Initiating 1 compute processes on 1 nodes to run the following command: + /usr/local/gamess/gamess.01.x HBO + + ****************************************************** + * GAMESS VERSION = 22 FEB 2006 (R5) * + * FROM IOWA STATE UNIVERSITY * + * M.W.SCHMIDT, K.K.BALDRIDGE, J.A.BOATZ, S.T.ELBERT, * + * M.S.GORDON, J.H.JENSEN, S.KOSEKI, N.MATSUNAGA, * + * K.A.NGUYEN, S.J.SU, T.L.WINDUS, * + * TOGETHER WITH M.DUPUIS, J.A.MONTGOMERY * + * J.COMPUT.CHEM. 14, 1347-1363(1993) * + ***************** AMD 64 BIT VERSION ***************** + + SINCE 1993, STUDENTS AND POSTDOCS WORKING AT IOWA STATE UNIVERSITY + AND ALSO IN THEIR VARIOUS JOBS AFTER LEAVING ISU HAVE MADE IMPORTANT + CONTRIBUTIONS TO THE CODE: + IVANA ADAMOVIC, CHRISTINE AIKENS, YURI ALEXEEV, POOJA ARORA, ROB BELL, + PRADIPTA BANDYOPADHYAY, BRETT BODE, GALINA CHABAN, WEI CHEN, + CHEOL HO CHOI, PAUL DAY, TIM DUDLEY, DMITRI FEDOROV, GRAHAM FLETCHER, + MARK FREITAG, KURT GLAESEMANN, GRANT MERRILL, TAKESHI NAGATA, + HEATHER NETZLOFF, BOSILJKA NJEGIC, RYAN OLSON, MIKE PAK, JIM SHOEMAKER, + LYUDMILA SLIPCHENKO, JIE SONG, TETSUYA TAKETSUGU, SIMON WEBB. + + ADDITIONAL CODE HAS BEEN PROVIDED BY COLLABORATORS IN OTHER GROUPS: + IOWA STATE UNIVERSITY: JOE IVANIC, KLAUS RUEDENBERG + UNIVERSITY OF TOKYO: KIMIHIKO HIRAO, HARUYUKI NAKANO, TAKAHITO + NAKAJIMA, TAKAO TSUNEDA, MUNEAKI KAMIYA, SUSUMU YANAGISAWA, + KIYOSHI YAGI + UNIVERSITY OF SOUTHERN DENMARK: FRANK JENSEN + UNIVERSITY OF IOWA: VISVALDAS KAIRYS, HUI LI + NATIONAL INST. OF STANDARDS AND TECHNOLOGY: WALT STEVENS, DAVID GARMER + UNIVERSITY OF PISA: BENEDETTA MENNUCCI, JACOPO TOMASI + UNIVERSITY OF MEMPHIS: HENRY KURTZ, PRAKASHAN KORAMBATH + UNIVERSITY OF ALBERTA: MARIUSZ KLOBUKOWSKI + UNIVERSITY OF NEW ENGLAND: MARK SPACKMAN + MIE UNIVERSITY: HIROAKI UMEDA + MICHIGAN STATE UNIVERSITY: + KAROL KOWALSKI, MARTA WLOCH, PIOTR PIECUCH + UNIVERSITY OF SILESIA: MONIKA MUSIAL, STANISLAW KUCHARSKI + FACULTES UNIVERSITAIRES NOTRE-DAME DE LA PAIX: + OLIVIER QUINET, BENOIT CHAMPAGNE + UNIVERSITY OF CALIFORNIA - SANTA BARBARA: BERNARD KIRTMAN + INSTITUTE FOR MOLECULAR SCIENCE: KAZUYA ISHIMURA AND SHIGERU NAGASE + UNIVERSITY OF NOTRE DAME: DAN CHIPMAN + KYUSHU UNIVERSITY: + FENG LONG GU, JACEK KORCHOWIEC, MARCIN MAKOWSKI, AND YURIKO AOKI + PENNSYLVANIA STATE UNIVERSITY: + TZVETELIN IORDANOV, CHET SWALINA, SHARON HAMMES-SCHIFFER + + EXECUTION OF GAMESS BEGUN Thu Apr 16 11:11:32 2015 + + ECHO OF THE FIRST FEW INPUT CARDS - + INPUT CARD> + INPUT CARD> $CONTRL + INPUT CARD> RUNTYP=ENERGY + INPUT CARD> MULT=1 + INPUT CARD> SCFTYP=ROHF + INPUT CARD> $END + INPUT CARD> + INPUT CARD> $GUESS + INPUT CARD> GUESS=HCORE + INPUT CARD> $END + INPUT CARD> + INPUT CARD> $DATA + INPUT CARD> HBO + INPUT CARD>C1 + INPUT CARD>H 1.0 0. 0. 0. + INPUT CARD>S 3 + INPUT CARD> 1 18.7311370 0.0334946 + INPUT CARD> 2 2.8253944 0.2347269 + INPUT CARD> 3 0.6401217 0.8137573 + INPUT CARD>S 1 + INPUT CARD> 1 0.1612778 1.0000000 + INPUT CARD> + INPUT CARD>B 5.0 1.1660 0. 0. + INPUT CARD>S 4 + INPUT CARD> 1 330.7528500 0.0179942 + INPUT CARD> 2 49.8438650 0.1246937 + INPUT CARD> 3 11.1170540 0.4343354 + INPUT CARD> 4 2.9227243 0.5609794 + INPUT CARD>L 3 + INPUT CARD> 1 5.6812646 -0.1303871 0.0637429 + INPUT CARD> 2 1.4544046 -0.2514344 0.2761331 + INPUT CARD> 3 0.4283786 1.2051292 0.7773866 + INPUT CARD>L 1 + INPUT CARD> 1 0.1442192 1.0000000 1.0000000 + INPUT CARD> + INPUT CARD>B 8.0 2.3660 0. 0. + INPUT CARD>S 4 + INPUT CARD> 1 883.2728600 0.0175506 + INPUT CARD> 2 133.1292800 0.1228292 + INPUT CARD> 3 29.9064080 0.4348836 + INPUT CARD> 4 7.9786772 0.5600108 + INPUT CARD>L 3 + INPUT CARD> 1 16.1944470 -0.1134010 0.0685453 + INPUT CARD> 2 3.7800860 -0.1772865 0.3312254 + INPUT CARD> 3 1.0709836 1.1504079 0.7346079 + INPUT CARD>L 1 + INPUT CARD> 1 0.2838798 1.0000000 1.0000000 + INPUT CARD> + INPUT CARD> $END + + ..... DONE SETTING UP THE RUN ..... + 1000000 WORDS OF MEMORY AVAILABLE + + + RUN TITLE + --------- + HBO + + THE POINT GROUP OF THE MOLECULE IS C1 + THE ORDER OF THE PRINCIPAL AXIS IS 0 + + ATOM ATOMIC COORDINATES (BOHR) + CHARGE X Y Z + H 1.0 0.0000000000 0.0000000000 0.0000000000 + B 5.0 2.2034205017 0.0000000000 0.0000000000 + B 8.0 4.4710916869 0.0000000000 0.0000000000 + + INTERNUCLEAR DISTANCES (ANGS.) + ------------------------------ + + H B B + + 1 H 0.0000000 1.1660000 * 2.3660000 * + 2 B 1.1660000 * 0.0000000 1.2000000 * + 3 B 2.3660000 * 1.2000000 * 0.0000000 + + ATOMIC BASIS SET + ---------------- + THE CONTRACTED PRIMITIVE FUNCTIONS HAVE BEEN UNNORMALIZED + THE CONTRACTED BASIS FUNCTIONS ARE NOW NORMALIZED TO UNITY + + SHELL TYPE PRIMITIVE EXPONENT CONTRACTION COEFFICIENT(S) + + H + + 1 S 1 18.7311370 0.033494602358 + 1 S 2 2.8253944 0.234726916524 + 1 S 3 0.6401217 0.813757357284 + + 2 S 4 0.1612778 1.000000000000 + + B + + 3 S 5 330.7528500 0.017994199122 + 3 S 6 49.8438650 0.124693693914 + 3 S 7 11.1170540 0.434335378802 + 3 S 8 2.9227243 0.560979372621 + + 4 L 9 5.6812646 -0.130387101955 0.063742897507 + 4 L 10 1.4544046 -0.251434403769 0.276133089199 + 4 L 11 0.4283786 1.205129218067 0.777386569593 + + 5 L 12 0.1442192 1.000000000000 1.000000000000 + + B + + 6 S 13 883.2728600 0.017550600144 + 6 S 14 133.1292800 0.122829201010 + 6 S 15 29.9064080 0.434883603578 + 6 S 16 7.9786772 0.560010804607 + + 7 L 17 16.1944470 -0.113401005792 0.068545299729 + 7 L 18 3.7800860 -0.177286509055 0.331225398691 + 7 L 19 1.0709836 1.150407958755 0.734607897097 + + 8 L 20 0.2838798 1.000000000000 1.000000000000 + + TOTAL NUMBER OF BASIS SET SHELLS = 8 + NUMBER OF CARTESIAN GAUSSIAN BASIS FUNCTIONS = 20 + NUMBER OF ELECTRONS = 14 + CHARGE OF MOLECULE = 0 + SPIN MULTIPLICITY = 1 + NUMBER OF OCCUPIED ORBITALS (ALPHA) = 7 + NUMBER OF OCCUPIED ORBITALS (BETA ) = 7 + TOTAL NUMBER OF ATOMS = 3 + THE NUCLEAR REPULSION ENERGY IS 21.6977130101 + + THIS MOLECULE IS RECOGNIZED AS BEING LINEAR. + + $CONTRL OPTIONS + --------------- + SCFTYP=ROHF RUNTYP=ENERGY EXETYP=RUN + MPLEVL= 0 CITYP =NONE CCTYP =NONE VBTYP =NONE + MULT = 1 ICHARG= 0 NZVAR = 0 COORD =UNIQUE + PP =NONE RELWFN=NONE LOCAL =NONE NUMGRD= F + ISPHER= -1 NOSYM = 0 MAXIT = 30 UNITS =ANGS + PLTORB= F MOLPLT= F AIMPAC= F FRIEND= + NPRINT= 7 IREST = 0 GEOM =INPUT + NORMF = 0 NORMP = 0 ITOL = 20 ICUT = 9 + INTTYP=BEST GRDTYP=BEST QMTTOL= 1.0E-06 + + $SYSTEM OPTIONS + --------------- + REPLICATED MEMORY= 1000000 WORDS (ON EVERY NODE). + DISTRIBUTED MEMDDI= 0 MILLION WORDS IN AGGREGATE, + MEMDDI DISTRIBUTED OVER 1 PROCESSORS IS 0 WORDS/PROCESSOR. + TOTAL MEMORY REQUESTED ON EACH PROCESSOR= 1000000 WORDS. + TIMLIM= 525600.00 MINUTES, OR 365.00 DAYS. + PARALL= F BALTYP= NXTVAL KDIAG= 0 COREFL= F + + ---------------- + PROPERTIES INPUT + ---------------- + + MOMENTS FIELD POTENTIAL DENSITY + IEMOM = 1 IEFLD = 0 IEPOT = 0 IEDEN = 0 + WHERE =COMASS WHERE =NUCLEI WHERE =NUCLEI WHERE =NUCLEI + OUTPUT=BOTH OUTPUT=BOTH OUTPUT=BOTH OUTPUT=BOTH + IEMINT= 0 IEFINT= 0 IEDINT= 0 + MORB = 0 + EXTRAPOLATION IN EFFECT + SOSCF IN EFFECT + ORBITAL PRINTING OPTION: NPREO= 1 20 2 1 + + ------------------------------- + INTEGRAL TRANSFORMATION OPTIONS + ------------------------------- + NWORD = 0 CUTOFF = 1.0E-09 + MPTRAN = 0 DIRTRF = F + AOINTS =DUP + + ---------------------- + INTEGRAL INPUT OPTIONS + ---------------------- + NOPK = 1 NORDER= 0 SCHWRZ= F + + ------------------------------------------ + THE POINT GROUP IS C1 , NAXIS= 0, ORDER= 1 + ------------------------------------------ + + DIMENSIONS OF THE SYMMETRY SUBSPACES ARE + A = 20 + + ..... DONE SETTING UP THE RUN ..... + STEP CPU TIME = 0.01 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + + ******************** + 1 ELECTRON INTEGRALS + ******************** + ...... END OF ONE-ELECTRON INTEGRALS ...... + STEP CPU TIME = 0.00 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + + ------------- + GUESS OPTIONS + ------------- + GUESS =HCORE NORB = 0 NORDER= 0 + MIX = F PRTMO = F PUNMO = F + TOLZ = 1.0E-08 TOLE = 1.0E-05 + SYMDEN= F PURIFY= F + + INITIAL GUESS ORBITALS GENERATED BY HCORE ROUTINE. + + SYMMETRIES FOR INITIAL GUESS ORBITALS FOLLOW. ALPHA SET(S). + 7 ORBITALS ARE OCCUPIED ( 2 CORE ORBITALS). + 3=A 4=A 5=A 6=A 7=A 8=A 9=A + 10=A 11=A 12=A 13=A 14=A 15=A 16=A + 17=A + + SYMMETRIES FOR INITIAL GUESS ORBITALS FOLLOW. BETA SET(S). + 7 ORBITALS ARE OCCUPIED ( 2 CORE ORBITALS). + 3=A 4=A 5=A 6=A 7=A 8=A 9=A + 10=A 11=A 12=A 13=A 14=A 15=A 16=A + 17=A + ...... END OF INITIAL ORBITAL SELECTION ...... + STEP CPU TIME = 0.00 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + + ---------------------- + AO INTEGRAL TECHNOLOGY + ---------------------- + S,P,L SHELL ROTATED AXIS INTEGRALS, REPROGRAMMED BY + KAZUYA ISHIMURA (IMS) AND JOSE SIERRA (SYNSTAR). + S,P,D,L SHELL ROTATED AXIS INTEGRALS PROGRAMMED BY + KAZUYA ISHIMURA (INSTITUTE FOR MOLECULAR SCIENCE). + S,P,D,F,G SHELL TO TOTAL QUARTET ANGULAR MOMENTUM SUM 5, + ERIC PROGRAM BY GRAHAM FLETCHER (ELORET AND NASA ADVANCED + SUPERCOMPUTING DIVISION, AMES RESEARCH CENTER). + S,P,D,F,G,L SHELL GENERAL RYS QUADRATURE PROGRAMMED BY + MICHEL DUPUIS (PACIFIC NORTHWEST NATIONAL LABORATORY). + + -------------------- + 2 ELECTRON INTEGRALS + -------------------- + + THE -PK- OPTION IS OFF, THE INTEGRALS ARE NOT IN SUPERMATRIX FORM. + STORING 15000 INTEGRALS/RECORD ON DISK, USING 12 BYTES/INTEGRAL. + TWO ELECTRON INTEGRAL EVALUATION REQUIRES 89392 WORDS OF MEMORY. + II,JST,KST,LST = 1 1 1 1 NREC = 1 INTLOC = 1 + II,JST,KST,LST = 2 1 1 1 NREC = 1 INTLOC = 2 + II,JST,KST,LST = 3 1 1 1 NREC = 1 INTLOC = 7 + II,JST,KST,LST = 4 1 1 1 NREC = 1 INTLOC = 22 + II,JST,KST,LST = 5 1 1 1 NREC = 1 INTLOC = 169 + II,JST,KST,LST = 6 1 1 1 NREC = 1 INTLOC = 678 + II,JST,KST,LST = 7 1 1 1 NREC = 1 INTLOC = 1045 + II,JST,KST,LST = 8 1 1 1 NREC = 1 INTLOC = 3095 + TOTAL NUMBER OF NONZERO TWO-ELECTRON INTEGRALS = 7058 + 1 INTEGRAL RECORDS WERE STORED ON DISK FILE 8. + ...... END OF TWO-ELECTRON INTEGRALS ..... + STEP CPU TIME = 0.01 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + + --------------------------- + ROHF SCF CALCULATION + --------------------------- + + NUCLEAR ENERGY = 21.6977130101 + MAXIT = 30 NPUNCH= 2 MULT= 1 + EXTRAP=T DAMP=F SHIFT=F RSTRCT=F DIIS=F SOSCF=T + DENSITY MATRIX CONV= 1.00E-05 + ROHF CANONICALIZATION PARAMETERS + C-C O-O V-V + ALPHA -0.5000 0.5000 1.5000 + BETA 1.5000 0.5000 -0.5000 + SOSCF WILL OPTIMIZE 91 ORBITAL ROTATION ANGLES. SOGTOL= 2.500E-01 + MEMORY REQUIRED FOR UHF/ROHF STEP= 34446 WORDS. + + ITER EX TOTAL ENERGY E CHANGE DENSITY CHANGE ORB. GRAD + 1 0 -89.6780199978 -89.6780199978 13.802827629 0.000000000 + 2 1 -86.8672057689 2.8108142288 13.697658380 1.147034737 + 3 2 -90.7237904418 -3.8565846728 6.184375907 0.885015488 + 4 3 -88.5602746012 2.1635158406 6.139277282 0.784307787 + 5 0 -90.8787176080 -2.3184430069 2.371801774 0.897367372 + ---------------START SECOND ORDER SCF--------------- + 6 1 -99.6901335684 -8.8114159604 0.589370704 0.247448832 + 7 2 -99.6027127341 0.0874208344 0.282419417 0.261235193 + 8 3 -100.0104700579 -0.4077573239 0.097896975 0.028403161 + 9 4 -100.0166758568 -0.0062057989 0.041892588 0.022623440 + 10 5 -100.0185127886 -0.0018369318 0.005554114 0.004257220 + 11 6 -100.0185731832 -0.0000603946 0.002182788 0.001537483 + 12 7 -100.0185817542 -0.0000085710 0.000686329 0.000164155 + 13 8 -100.0185822279 -0.0000004737 0.000159733 0.000052231 + 14 9 -100.0185822583 -0.0000000304 0.000031771 0.000009807 + 15 10 -100.0185822589 -0.0000000006 0.000003729 0.000001197 + 16 11 -100.0185822589 -0.0000000000 0.000000462 0.000000205 + + ----------------- + DENSITY CONVERGED + ----------------- + + FINAL ROHF ENERGY IS -100.0185822589 AFTER 16 ITERATIONS + + -------------------- + SPIN SZ = 0.000 + S-SQUARED = -0.000 + -------------------- + + ------------ + EIGENVECTORS + ------------ + + 1 2 3 4 5 + -20.5358 -7.6507 -1.3450 -0.6694 -0.6084 + A A A A A + 1 H 1 S 0.000344 -0.001283 0.014215 0.292154 0.137956 + 2 H 1 S 0.009984 0.010621 -0.040706 0.189877 0.183728 + 3 B 2 S 0.001078 0.993835 -0.103615 -0.167500 0.038365 + 4 B 2 S 0.003671 0.056948 0.125777 0.229996 -0.092389 + 5 B 2 X 0.000735 0.002873 0.178961 -0.173521 -0.351664 + 6 B 2 Y 0.000000 0.000000 0.000000 0.000000 0.000000 + 7 B 2 Z 0.000000 0.000000 0.000000 0.000000 0.000000 + 8 B 2 S 0.007386 -0.022682 0.028991 0.265728 0.011974 + 9 B 2 X 0.019131 0.008736 -0.072950 -0.150274 0.027354 + 10 B 2 Y 0.000000 0.000000 0.000000 0.000000 0.000000 + 11 B 2 Z 0.000000 0.000000 0.000000 0.000000 0.000000 + 12 O 3 S 0.992054 -0.001164 -0.212590 0.045561 -0.066200 + 13 O 3 S 0.053959 0.001671 0.432154 -0.104949 0.138600 + 14 O 3 X -0.002799 -0.001577 -0.143624 -0.191121 0.522743 + 15 O 3 Y 0.000000 0.000000 0.000000 0.000000 0.000000 + 16 O 3 Z 0.000000 0.000000 0.000000 0.000000 0.000000 + 17 O 3 S -0.038715 -0.006953 0.509977 -0.099891 0.303790 + 18 O 3 X 0.008857 0.005154 -0.052386 -0.130143 0.293535 + 19 O 3 Y 0.000000 0.000000 0.000000 0.000000 0.000000 + 20 O 3 Z 0.000000 0.000000 0.000000 0.000000 0.000000 + + 6 7 8 9 10 + -0.5169 -0.5169 0.1699 0.1699 0.2267 + A A A A A + 1 H 1 S 0.000000 0.000000 0.000000 0.000000 -0.150419 + 2 H 1 S 0.000000 0.000000 0.000000 0.000000 -1.466998 + 3 B 2 S 0.000000 0.000000 0.000000 0.000000 -0.144359 + 4 B 2 S 0.000000 0.000000 0.000000 0.000000 -0.048306 + 5 B 2 X 0.000000 0.000000 0.000000 0.000000 -0.139034 + 6 B 2 Y -0.083449 0.221695 0.137663 0.278557 0.000000 + 7 B 2 Z 0.221695 0.083449 0.278557 -0.137663 0.000000 + 8 B 2 S 0.000000 0.000000 0.000000 0.000000 2.027943 + 9 B 2 X 0.000000 0.000000 0.000000 0.000000 -0.144405 + 10 B 2 Y -0.050412 0.133928 0.379815 0.768545 0.000000 + 11 B 2 Z 0.133928 0.050412 0.768545 -0.379815 0.000000 + 12 O 3 S 0.000000 0.000000 0.000000 0.000000 0.053464 + 13 O 3 S 0.000000 0.000000 0.000000 0.000000 -0.086787 + 14 O 3 X 0.000000 0.000000 0.000000 0.000000 0.153448 + 15 O 3 Y -0.190568 0.506276 -0.136229 -0.275656 0.000000 + 16 O 3 Z 0.506276 0.190568 -0.275656 0.136229 0.000000 + 17 O 3 S 0.000000 0.000000 0.000000 0.000000 -0.606405 + 18 O 3 X 0.000000 0.000000 0.000000 0.000000 0.320500 + 19 O 3 Y -0.148054 0.393331 -0.221558 -0.448317 0.000000 + 20 O 3 Z 0.393331 0.148054 -0.448317 0.221558 0.000000 + + 11 12 13 14 15 + 0.4316 0.7045 0.7045 0.7350 1.1048 + A A A A A + 1 H 1 S -0.197856 0.000000 0.000000 0.585371 -0.661822 + 2 H 1 S 2.428044 0.000000 0.000000 1.162180 1.538010 + 3 B 2 S 0.027852 0.000000 0.000000 0.045321 0.010878 + 4 B 2 S -0.331748 0.000000 0.000000 0.814476 1.936129 + 5 B 2 X 0.288153 0.000000 0.000000 -0.704191 0.333782 + 6 B 2 Y 0.000000 0.097971 1.207126 0.000000 0.000000 + 7 B 2 Z 0.000000 1.207126 -0.097971 0.000000 0.000000 + 8 B 2 S 0.216139 0.000000 0.000000 -1.451072 -1.909797 + 9 B 2 X 2.635346 0.000000 0.000000 2.283710 0.676105 + 10 B 2 Y 0.000000 -0.085320 -1.051252 0.000000 0.000000 + 11 B 2 Z 0.000000 -1.051252 0.085320 0.000000 0.000000 + 12 O 3 S 0.086152 0.000000 0.000000 0.027095 0.050912 + 13 O 3 S -0.030658 0.000000 0.000000 -0.048038 -0.187902 + 14 O 3 X 0.005711 0.000000 0.000000 -0.124028 0.248507 + 15 O 3 Y 0.000000 -0.002880 -0.035481 0.000000 0.000000 + 16 O 3 Z 0.000000 -0.035481 0.002880 0.000000 0.000000 + 17 O 3 S -1.936881 0.000000 0.000000 -0.740239 -0.345357 + 18 O 3 X 0.485099 0.000000 0.000000 -0.079803 0.535249 + 19 O 3 Y 0.000000 0.000732 0.009020 0.000000 0.000000 + 20 O 3 Z 0.000000 0.009020 -0.000732 0.000000 0.000000 + + 16 17 18 19 20 + 1.2423 1.3557 1.3557 1.4100 2.2399 + A A A A A + 1 H 1 S 0.719124 0.000000 0.000000 0.725323 -0.157789 + 2 H 1 S -1.191244 0.000000 0.000000 -0.477445 -1.225214 + 3 B 2 S 0.105177 0.000000 0.000000 -0.060885 -0.141177 + 4 B 2 S 0.511585 0.000000 0.000000 0.050787 -0.875118 + 5 B 2 X 1.035905 0.000000 0.000000 0.780799 -0.452459 + 6 B 2 Y 0.000000 0.002283 0.015609 0.000000 0.000000 + 7 B 2 Z 0.000000 0.015609 -0.002283 0.000000 0.000000 + 8 B 2 S 1.010217 0.000000 0.000000 0.112107 -0.746938 + 9 B 2 X -0.643431 0.000000 0.000000 -0.134607 -2.362585 + 10 B 2 Y 0.000000 -0.058566 -0.400461 0.000000 0.000000 + 11 B 2 Z 0.000000 -0.400461 0.058566 0.000000 0.000000 + 12 O 3 S 0.065107 0.000000 0.000000 0.020195 0.012799 + 13 O 3 S -0.268804 0.000000 0.000000 -0.067586 -1.977025 + 14 O 3 X -0.440790 0.000000 0.000000 0.885097 0.119422 + 15 O 3 Y 0.000000 -0.143987 -0.984542 0.000000 0.000000 + 16 O 3 Z 0.000000 -0.984542 0.143987 0.000000 0.000000 + 17 O 3 S -0.423279 0.000000 0.000000 -0.263857 4.377413 + 18 O 3 X 1.480677 0.000000 0.000000 -0.527277 -1.336333 + 19 O 3 Y 0.000000 0.174511 1.193260 0.000000 0.000000 + 20 O 3 Z 0.000000 1.193260 -0.174511 0.000000 0.000000 + ...... END OF ROHF CALCULATION ...... + STEP CPU TIME = 0.00 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + + ---------------------------------------------------------------- + PROPERTY VALUES FOR THE ROHF SELF-CONSISTENT FIELD WAVEFUNCTION + ---------------------------------------------------------------- + + ----------------- + ENERGY COMPONENTS + ----------------- + + WAVEFUNCTION NORMALIZATION = 1.0000000000 + + ONE ELECTRON ENERGY = -179.7468005131 + TWO ELECTRON ENERGY = 58.0305052441 + NUCLEAR REPULSION ENERGY = 21.6977130101 + ------------------ + TOTAL ENERGY = -100.0185822589 + + ELECTRON-ELECTRON POTENTIAL ENERGY = 58.0305052441 + NUCLEUS-ELECTRON POTENTIAL ENERGY = -279.7201121919 + NUCLEUS-NUCLEUS POTENTIAL ENERGY = 21.6977130101 + ------------------ + TOTAL POTENTIAL ENERGY = -199.9918939377 + TOTAL KINETIC ENERGY = 99.9733116788 + VIRIAL RATIO (V/T) = 2.0004528267 + + ...... PI ENERGY ANALYSIS ...... + + ENERGY ANALYSIS: + FOCK ENERGY= -63.6857886983 + BARE H ENERGY= -179.7468005131 + ELECTRONIC ENERGY = -121.7162946057 + KINETIC ENERGY= 99.9733116788 + N-N REPULSION= 21.6977130101 + TOTAL ENERGY= -100.0185815956 + SIGMA PART(1+2)= -104.7962806542 + (K,V1,2)= 92.4442005381 -240.4183928275 43.1779116353 + PI PART(1+2)= -16.9200139514 + (K,V1,2)= 7.5291111407 -39.3017193643 14.8525942722 + SIGMA SKELETON, ERROR= -83.0985676441 -0.0000000000 + MIXED PART= 0.00000E+00 0.00000E+00 0.00000E+00 0.00000E+00 + ...... END OF PI ENERGY ANALYSIS ...... + + --------------------------------------- + MULLIKEN AND LOWDIN POPULATION ANALYSES + --------------------------------------- + + MULLIKEN ATOMIC POPULATION IN EACH MOLECULAR ORBITAL + + 1 2 3 4 5 + + 2.000000 2.000000 2.000000 2.000000 2.000000 + + 1 0.000109 0.002431 -0.009540 0.732140 0.208060 + 2 0.004773 2.000884 0.269059 0.988894 0.366310 + 3 1.995118 -0.003315 1.740481 0.278967 1.425630 + + 6 7 + + 2.000000 2.000000 + + 1 0.000000 0.000000 + 2 0.420558 0.420558 + 3 1.579442 1.579442 + + ATOMIC SPIN POPULATION (ALPHA MINUS BETA) + ATOM MULL.POP. LOW.POP. + 1 H 0.000000 0.000000 + 2 B 0.000000 0.000000 + 3 B 0.000000 0.000000 + + ----- POPULATIONS IN EACH AO ----- + MULLIKEN LOWDIN + 1 H 1 S 0.51411 0.47971 + 2 H 1 S 0.41909 0.48591 + 3 B 2 S 1.99770 1.98102 + 4 B 2 S 0.45972 0.43762 + 5 B 2 X 0.70045 0.64124 + 6 B 2 Y 0.25163 0.23600 + 7 B 2 Z 0.25163 0.23600 + 8 B 2 S 0.37344 0.43074 + 9 B 2 X 0.09860 0.36418 + 10 B 2 Y 0.16892 0.22234 + 11 B 2 Z 0.16892 0.22234 + 12 O 3 S 1.99590 1.99380 + 13 O 3 S 0.85319 0.83536 + 14 O 3 X 0.99185 0.94649 + 15 O 3 Y 0.86458 0.82908 + 16 O 3 Z 0.86458 0.82908 + 17 O 3 S 1.06945 0.76118 + 18 O 3 X 0.52649 0.64275 + 19 O 3 Y 0.71487 0.71259 + 20 O 3 Z 0.71487 0.71259 + + ----- MULLIKEN ATOMIC OVERLAP POPULATIONS ----- + (OFF-DIAGONAL ELEMENTS NEED TO BE MULTIPLIED BY 2) + + 1 2 3 + + 1 0.5637982 + 2 0.3833280 3.4279422 + 3 -0.0139266 0.6597650 7.9499266 + + TOTAL MULLIKEN AND LOWDIN ATOMIC POPULATIONS + ATOM MULL.POP. CHARGE LOW.POP. CHARGE + 1 H 0.933200 0.066800 0.965622 0.034378 + 2 B 4.471035 0.528965 4.771474 0.228526 + 3 B 8.595765 -0.595765 8.262905 -0.262905 + + ------------------------------- + BOND ORDER AND VALENCE ANALYSIS BOND ORDER THRESHOLD=0.050 + ------------------------------- + + BOND BOND BOND + ATOM PAIR DIST ORDER ATOM PAIR DIST ORDER ATOM PAIR DIST ORDER + 1 2 1.166 0.974 2 3 1.200 2.151 + + TOTAL BONDED FREE + ATOM VALENCE VALENCE VALENCE + 1 H 0.969 0.969 -0.000 + 2 B 3.125 3.125 -0.000 + 3 B 2.145 2.145 -0.000 + + ----------------------------------------- + ATOMIC SPIN DENSITY AT THE NUCLEUS (A.U.) + ----------------------------------------- + SPIN DENS ALPHA DENS BETA DENS + 1 H 1.0 0.0000000 0.19961 0.19961 + 2 B 5.0 0.0000000 30.17561 30.17561 + 3 B 8.0 0.0000000 131.78303 131.78303 + + --------------------- + ELECTROSTATIC MOMENTS + --------------------- + + POINT 1 X Y Z (BOHR) CHARGE + 3.418988 0.000000 0.000000 -0.00 (A.U.) + DX DY DZ /D/ (DEBYE) + -3.311042 0.000000 0.000000 3.311042 + ...... END OF PROPERTY EVALUATION ...... + STEP CPU TIME = 0.00 TOTAL CPU TIME = 0.0 ( 0.0 MIN) + TOTAL WALL CLOCK TIME= 0.0 SECONDS, CPU UTILIZATION IS 100.00% + 440000 WORDS OF DYNAMIC MEMORY USED + EXECUTION OF GAMESS TERMINATED NORMALLY Thu Apr 16 11:11:32 2015 + DDI: 1128 bytes (0.0 MB / 0 MWords) used by master data server. + + ---------------------------------------- + CPU timing information for all processes + ======================================== + 0: 0.029395 + 0.008325 = 0.037720 + ---------------------------------------- + ddikick.x: exited gracefully. +----- accounting info ----- +jeudi 16 avril 2015, 11:11:35 (UTC+0200) +Files used on the master node LPQLX15 were: +-rw-rw-r-- 1 razoa razoa 8438 avril 16 11:11 /tmp/gamess/HBO.dat +-rw-r--r-- 1 razoa razoa 1404 avril 16 11:11 /tmp/gamess/HBO.F05 +-rw-rw-r-- 1 razoa razoa 180016 avril 16 11:11 /tmp/gamess/HBO.F08 +-rw-rw-r-- 1 razoa razoa 4711680 avril 16 11:11 /tmp/gamess/HBO.F10 +0.104u 0.077s 0:03.22 5.2% 0+0k 0+16io 0pf+0w diff --git a/tests/unit_test/unit_test.py b/tests/unit_test/unit_test.py index eb9b1e79..c01b4974 100755 --- a/tests/unit_test/unit_test.py +++ b/tests/unit_test/unit_test.py @@ -62,7 +62,6 @@ def get_error_message(l_exepected, l_cur): # / |_ _ _ | o ._ ._ _|_ # \_ | | (/_ (_ |< | | | |_) |_| |_ # | - def check_disk_acess(geo, basis, mult=1): import uuid @@ -147,8 +146,6 @@ def check_mo_guess(geo, basis, mult=1): # / |_ _ _ | _. | _ _ # \_ | | (/_ (_ |< \/ (_| | |_| (/_ _> # - - def run_hf(geo, basis, mult=1): """ Run a simle by default hf @@ -286,6 +283,56 @@ def hf_then_10k_test(geo, basis): return return_code +# _ +# / |_ _ _ | _. ._ _ _ ._ _ ._ _|_ +# \_ | | (/_ (_ |< (_| |_) (_ (_) | | \/ (/_ | |_ +# | | __ +def check_convert(path_out): + ''' + Path_out is the out_file + ''' + + # ~#~#~#~#~#~#~#~#~#~ # + # R e f _ e n e r g y # + # ~#~#~#~#~#~#~#~#~#~ # + + ref_energy = defaultdict(dict) + + ref_energy["HBO.out"] = -100.0185822589 + + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + # S e t _ p a r a m e t e r # + # ~#~#~#~#~#~#~#~#~#~#~#~#~ # + + cmd = "cp {0}/tests/{1} .".format(qpackage_root, path_out) + subprocess.check_call([cmd], shell=True) + + cmd = "qp_convert_output_to_ezfio.py {0}".format(path_out) + subprocess.check_call([cmd], shell=True) + + # Test 2 + cmd = "qp_edit -c {0}.ezfio".format(path_out) + subprocess.check_call([cmd], shell=True) + + cmd = "qp_run SCF {0}.ezfio".format(path_out) + subprocess.check_call([cmd], shell=True) + + # ~#~#~#~#~ # + # C h e c k # + # ~#~#~#~#~ # + + ezfio.set_file("{0}.ezfio".format(path_out)) + + cur_e = ezfio.get_hartree_fock_energy() + ref_e = ref_energy[path_out] + + if abs(cur_e - ref_e) <= precision: + subprocess.call(["rm {0}".format(path_out)], shell=True) + subprocess.call(["rm -R {0}.ezfio".format(path_out)], shell=True) + return True + else: + raise ValueError(get_error_message([ref_e], [cur_e])) + # ___ # | _ _ _|_ # | (/_ _> |_ @@ -295,6 +342,9 @@ class ValueTest(unittest.TestCase): def test_full_ci_10k_pt2_end(self): self.assertTrue(hf_then_10k_test("methane", "sto-3g")) + def test_check_convert_hf_energy(self): + self.assertTrue(check_convert("HBO.out")) + class InputTest(unittest.TestCase):