From 942b9339c6a0a7a3ff244d1b4eb2d67c623d1374 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 29 Jul 2014 14:23:33 +0200 Subject: [PATCH] Added ezfio_defaults in data --- data/ezfio_defaults | 34 +++++ scripts/ezfio_with_default.py | 141 +++++++++++++++++++ src/BiInts/README.rst | 21 --- src/BiInts/options.irp.f | 154 ++++++--------------- src/CIS_dressed/README.rst | 114 +++++++-------- src/CIS_dressed/options.irp.f | 128 +++++------------ src/Dets/README.rst | 46 +++--- src/Dets/determinants.irp.f | 35 ----- src/Dets/options.irp.f | 25 ++++ src/Dets/parameters.irp.f | 16 --- src/Full_CI/README.rst | 10 -- src/Full_CI/options.irp.f | 25 ++++ src/Full_CI/parameters.irp.f | 50 ------- src/Hartree_Fock/README.rst | 101 ++++++++++++++ src/Hartree_Fock/hartree_fock.ezfio_config | 1 - src/Hartree_Fock/options.irp.f | 69 +++------ src/Output/output.irp.f | 15 ++ 17 files changed, 507 insertions(+), 478 deletions(-) create mode 100644 data/ezfio_defaults create mode 100755 scripts/ezfio_with_default.py create mode 100644 src/Dets/options.irp.f delete mode 100644 src/Dets/parameters.irp.f create mode 100644 src/Full_CI/options.irp.f delete mode 100644 src/Full_CI/parameters.irp.f diff --git a/data/ezfio_defaults b/data/ezfio_defaults new file mode 100644 index 00000000..e2a8d57d --- /dev/null +++ b/data/ezfio_defaults @@ -0,0 +1,34 @@ +bielec_integrals + read_ao_integrals False + read_mo_integrals False + write_ao_integrals False + write_mo_integrals False + threshold_ao 1.e-12 + threshold_mo 1.e-12 + 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 + +determinants + n_states 1 + n_det_max_jacobi 5000 + threshold_generators 1.0 + threshold_selectors 1.0 + read_wf False + +full_ci + n_det_max_fci 1000000 + pt2_max 1.e-4 + do_pt2_end True + +hartree_fock + n_it_scf_max 200 + thresh_scf 1.e-10 + + diff --git a/scripts/ezfio_with_default.py b/scripts/ezfio_with_default.py new file mode 100755 index 00000000..1208f4b7 --- /dev/null +++ b/scripts/ezfio_with_default.py @@ -0,0 +1,141 @@ +#!/usr/bin/env python + +__author__ = "Anthony Scemama" +__date__ = "Tue Jul 29 12:20:00 CEST 2014" + +""" +Creates the provider of a variable that has to be +fetched from the EZFIO file. +""" + +import sys +import os + + +class EZFIO_Provider(object): + + data = """BEGIN_PROVIDER [ %(type)s, %(name)s ] + implicit none + BEGIN_DOC +! %(doc)s + END_DOC + + logical :: has + PROVIDE ezfio_filename + call ezfio_has_%(ezfio_dir)s_%(ezfio_name)s(has) + if (has) then + call ezfio_get_%(ezfio_dir)s_%(ezfio_name)s(%(name)s) + else + %(default)s + endif + %(write)s + +END_PROVIDER +""" + + write_correspondance = { + "integer" : "write_int", + "logical" : "write_bool", + "double precision" : "write_double" } + + def __init__(self): + self.values = "type doc default name ezfio_dir ezfio_name write output".split() + for v in self.values: + exec "self.%s = None"%(v) in locals() + + def __repr__(self): + self.get_default() + self.set_write() + for v in self.values: + exec "test = self.%s is None"%(v) in locals() + if test: + print >>sys.stderr, "Error : %s is not set in ezfio_with_default.py"%(v) + for v in self.values: + exec "x = str(self.%s)"%(v) in locals() + print >>sys.stderr, "%s : %s"%(v, x) + sys.exit(1) + return self.data%self.__dict__ + + def set_write(self): + self.write = "" + if self.type in self.write_correspondance: + write = self.write_correspondance[self.type] + output = self.output + name = self.name + self.write = """ + call write_time(%(output)s) + call %(write)s(%(output)s, %(name)s, & + '%(name)s') + """%locals() + + def set_type(self,t): + self.type = t.lower() + + def set_doc(self,t): + self.doc = t.replace('\n', '\n! ') + + def set_name(self,t): + self.name = t + + def set_ezfio_dir(self,t): + self.ezfio_dir = t.lower() + + def set_ezfio_name(self,t): + self.ezfio_name = t.lower() + + def set_output(self,t): + self.output = t + + def set_default(self,t): + self.default = t + + def get_default(self): + filename = '/'.join( [os.environ['QPACKAGE_ROOT'], 'data', 'ezfio_defaults'] ) + file = open(filename,'r') + lines = file.readlines() + file.close() + # Search directory + for k,line in enumerate(lines): + if line[0] != ' ': + if line.strip().lower() == self.ezfio_dir: + break + if k+1 == len(lines): + return + # Search name + while k < len(lines): + k+=1 + buffer = lines[k].split() + if len(buffer) == 0: + return + if buffer[0].lower() == self.ezfio_name: + break + v = buffer[1] + name = self.name + try: + v_eval = eval(v) + if type(v_eval) == bool: + v = '.%s.'%(v) + elif type(v_eval) == float: + v = v.replace('e','d') + v = v.replace('E','D') + v = "%(name)s = %(v)s"%locals() + except: + v = "call ezfio_get_%(v)s(%(name)s)"%locals() + self.default = v + + +def test_module(): + T = EZFIO_Provider() + T.set_type ( "double precision" ) + T.set_name ( "thresh_SCF" ) + T.set_doc ( "Threshold on the convergence of the Hartree Fock energy" ) + T.set_ezfio_dir ( "Hartree_Fock" ) + T.set_ezfio_name( "thresh_SCF" ) + T.set_output ( "output_Hartree_Fock" ) + print T + + +if __name__ == '__main__': + test_module() + + diff --git a/src/BiInts/README.rst b/src/BiInts/README.rst index 343dbcb1..6287ffad 100644 --- a/src/BiInts/README.rst +++ b/src/BiInts/README.rst @@ -179,26 +179,5 @@ Documentation `mo_bielec_integrals_index `_ Computes an unique index for i,j,k,l integrals -`ao_integrals_threshold `_ - If < ao_integrals_threshold, = 0 - -`do_direct_integrals `_ - If True, compute integrals on the fly - -`mo_integrals_threshold `_ - If < mo_integrals_threshold, = 0 - -`read_ao_integrals `_ - If true, read AO integrals in EZFIO - -`read_mo_integrals `_ - If true, read MO integrals in EZFIO - -`write_ao_integrals `_ - If true, write AO integrals in EZFIO - -`write_mo_integrals `_ - If true, write MO integrals in EZFIO - diff --git a/src/BiInts/options.irp.f b/src/BiInts/options.irp.f index f5d5fb8d..3a54fd19 100644 --- a/src/BiInts/options.irp.f +++ b/src/BiInts/options.irp.f @@ -1,120 +1,46 @@ -BEGIN_PROVIDER [ logical, write_mo_integrals ] - implicit none - BEGIN_DOC - ! If true, write MO integrals in EZFIO - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_write_mo_integrals(has) - if (has) then - call ezfio_get_bielec_integrals_write_mo_integrals(write_mo_integrals) - else - write_mo_integrals = .False. - endif - -END_PROVIDER +BEGIN_SHELL [ /usr/bin/python ] +from ezfio_with_default import EZFIO_Provider +T = EZFIO_Provider() +T.set_type ( "logical" ) +T.set_name ( "do_direct_integrals" ) +T.set_doc ( "If true, compute integrals on the fly" ) +T.set_ezfio_dir ( "bielec_integrals" ) +T.set_ezfio_name( "direct" ) +T.set_output ( "output_biints" ) +print T -BEGIN_PROVIDER [ logical, write_ao_integrals ] - implicit none - BEGIN_DOC - ! If true, write AO integrals in EZFIO - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_write_ao_integrals(has) - if (has) then - call ezfio_get_bielec_integrals_write_ao_integrals(write_ao_integrals) - else - write_ao_integrals = .False. - endif - -END_PROVIDER +T.set_type ( "logical" ) +T.set_name ( "write_mo_integrals" ) +T.set_doc ( "If true, write MO integrals in EZFIO" ) +T.set_ezfio_name( "write_mo_integrals" ) +print T -BEGIN_PROVIDER [ logical, read_mo_integrals ] - implicit none - BEGIN_DOC - ! If true, read MO integrals in EZFIO - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_read_mo_integrals(has) - if (has) then - call ezfio_get_bielec_integrals_read_mo_integrals(read_mo_integrals) - else - read_mo_integrals = .False. - endif - -END_PROVIDER +T.set_name ( "write_ao_integrals" ) +T.set_doc ( "If true, write AO integrals in EZFIO" ) +T.set_ezfio_name( "write_ao_integrals" ) +print T -BEGIN_PROVIDER [ logical, read_ao_integrals ] - implicit none - BEGIN_DOC - ! If true, read AO integrals in EZFIO - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_read_ao_integrals(has) - if (has) then - call ezfio_get_bielec_integrals_read_ao_integrals(read_ao_integrals) - else - read_ao_integrals = .False. - endif - -END_PROVIDER +T.set_name ( "read_mo_integrals" ) +T.set_doc ( "If true, read MO integrals in EZFIO" ) +T.set_ezfio_name( "read_mo_integrals" ) +print T -BEGIN_PROVIDER [ double precision, ao_integrals_threshold ] - implicit none - BEGIN_DOC - ! If < ao_integrals_threshold, = 0 - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_threshold_ao(has) - if (has) then - call ezfio_get_bielec_integrals_threshold_ao(ao_integrals_threshold) - else - ao_integrals_threshold = 1.d-12 - endif - -END_PROVIDER +T.set_name ( "read_ao_integrals" ) +T.set_doc ( "If true, read AO integrals in EZFIO" ) +T.set_ezfio_name( "read_ao_integrals" ) +print T + +T.set_type ( "double precision" ) +T.set_name ( "ao_integrals_threshold" ) +T.set_doc ( "If < ao_integrals_threshold, = 0" ) +T.set_ezfio_name( "threshold_ao" ) +print T + +T.set_name ( "mo_integrals_threshold" ) +T.set_doc ( "If < mo_integrals_threshold, = 0" ) +T.set_ezfio_name( "threshold_mo" ) +print T + +END_SHELL -BEGIN_PROVIDER [ double precision, mo_integrals_threshold ] - implicit none - BEGIN_DOC - ! If < mo_integrals_threshold, = 0 - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_threshold_mo(has) - if (has) then - call ezfio_get_bielec_integrals_threshold_mo(mo_integrals_threshold) - else - mo_integrals_threshold = 1.d-11 - endif - -END_PROVIDER - - -BEGIN_PROVIDER [ logical, do_direct_integrals ] - implicit none - BEGIN_DOC -! If True, compute integrals on the fly - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_bielec_integrals_direct(has) - if (has) then - call ezfio_get_bielec_integrals_direct(do_direct_integrals) - else - do_direct_integrals = .False. - endif - -END_PROVIDER diff --git a/src/CIS_dressed/README.rst b/src/CIS_dressed/README.rst index 43b300e0..cfd23864 100644 --- a/src/CIS_dressed/README.rst +++ b/src/CIS_dressed/README.rst @@ -24,10 +24,22 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. +`cis_dt `_ + Undocumented + +`cis_d `_ + Undocumented + +`cis_full `_ + Undocumented + +`save_cis `_ + Undocumented + `coefs_cis `_ the first states of the CIS matrix -`diag_elements `_ +`diag_elements `_ Array of the energy of the CIS determinants ordered in the CIS matrix `eigenvalues_cis `_ @@ -75,57 +87,59 @@ Documentation `s_2_cis_dress_d_dt `_ The first states of the CIS matrix dressed by the doubles and the disconnected triples -`diag_elements_sorted `_ - Array of the energy of the CIS determinants sorted by energy and - Index in the CIS matrix - -`diag_elements_sorted_index `_ - Array of the energy of the CIS determinants sorted by energy and - Index in the CIS matrix - -`diexcitation `_ - Undocumented - -`dress_by_doubles `_ - Undocumented - -`dress_t_con `_ - Generating all the Triples and, in the loops, the connected Singles - -`dress_t_discon `_ - Calculation of the dressing by the disconnected Triples, via the impossible - -`dress_t_discon_array_cis `_ - Calculation of the dressing by the disconnected Triples, via the impossible - -`eigenvalues_dressed_cis `_ - The first states of the dressed CIS matrix - -`en2_corr_energy `_ +`en2_corr_energy `_ Calculation of the EN2 correlation energy (EN2_corr_energy) and calculation of the contribution of the disconnected Triples on the Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) +`h_imp_en `_ + Calculation of the EN2 correlation energy (EN2_corr_energy) + and calculation of the contribution of the disconnected Triples on the + Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) + +`hp_imp_en `_ + Calculation of the EN2 correlation energy (EN2_corr_energy) + and calculation of the contribution of the disconnected Triples on the + Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) + +`p_imp_en `_ + Calculation of the EN2 correlation energy (EN2_corr_energy) + and calculation of the contribution of the disconnected Triples on the + Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) + +`diag_elements_sorted `_ + Array of the energy of the CIS determinants sorted by energy and + Index in the CIS matrix + +`diag_elements_sorted_index `_ + Array of the energy of the CIS determinants sorted by energy and + Index in the CIS matrix + +`dress_by_doubles `_ + Undocumented + +`dress_t_con `_ + Generating all the Triples and, in the loops, the connected Singles + +`dress_t_discon `_ + Calculation of the dressing by the disconnected Triples, via the impossible + +`dress_t_discon_array_cis `_ + Calculation of the dressing by the disconnected Triples, via the impossible + +`eigenvalues_dressed_cis `_ + The first states of the dressed CIS matrix + `h_imp `_ Calculation of the MP2 correlation energy (MP2_corr_energy) and calculation of the contribution of the disconnected Triples on the Singles, via the impossible (p_imp, h_imp, hp_imp) -`h_imp_en `_ - Calculation of the EN2 correlation energy (EN2_corr_energy) - and calculation of the contribution of the disconnected Triples on the - Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) - `hp_imp `_ Calculation of the MP2 correlation energy (MP2_corr_energy) and calculation of the contribution of the disconnected Triples on the Singles, via the impossible (p_imp, h_imp, hp_imp) -`hp_imp_en `_ - Calculation of the EN2 correlation energy (EN2_corr_energy) - and calculation of the contribution of the disconnected Triples on the - Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) - `mp2_corr_energy `_ Calculation of the MP2 correlation energy (MP2_corr_energy) and calculation of the contribution of the disconnected Triples on the @@ -136,12 +150,7 @@ Documentation and calculation of the contribution of the disconnected Triples on the Singles, via the impossible (p_imp, h_imp, hp_imp) -`p_imp_en `_ - Calculation of the EN2 correlation energy (EN2_corr_energy) - and calculation of the contribution of the disconnected Triples on the - Singles, via the impossible (p_imp_EN, h_imp_EN, hp_imp_EN) - -`size_psi_cis `_ +`size_psi_cis `_ Definition of the size of the CIS vector `get_dm_from_psi `_ @@ -214,20 +223,11 @@ Documentation .br CIS_states_properties(i,1:6) = the same but for the hole state i -`mp2_dressing `_ - Number of states asked for the CIS vector +`diexcitation `_ + Undocumented -`n_act_cis `_ - Number of states asked for the CIS vector - -`n_core_cis `_ - Number of states asked for the CIS vector - -`n_state_cis `_ - Number of states asked for the CIS vector - -`standard_doubles `_ - Number of states asked for the CIS vector +`repeat_all_doubles `_ + Undocumented diff --git a/src/CIS_dressed/options.irp.f b/src/CIS_dressed/options.irp.f index 2dc27eb9..542a9941 100644 --- a/src/CIS_dressed/options.irp.f +++ b/src/CIS_dressed/options.irp.f @@ -1,104 +1,40 @@ -BEGIN_PROVIDER [ integer , n_state_cis ] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC +BEGIN_SHELL [ /usr/bin/python ] +from ezfio_with_default import EZFIO_Provider +T = EZFIO_Provider() +T.set_type ( "integer" ) +T.set_name ( "n_state_cis" ) +T.set_doc ( "Number of states asked for the CIS vector" ) +T.set_ezfio_dir ( "cis_dressed" ) +T.set_ezfio_name( "n_state_cis" ) +T.set_output ( "output_CIS" ) +print T - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_n_state_cis(has) - if (has) then - call ezfio_get_cis_dressed_n_state_cis(n_state_cis) - else - n_state_cis = 10 - call ezfio_set_cis_dressed_n_state_cis(n_state_cis) - endif +T.set_name ( "n_core_cis" ) +T.set_doc ( "Number of core orbitals in the dressed CIS" ) +T.set_ezfio_name( "n_core_cis" ) +print T -END_PROVIDER +T.set_name ( "n_act_cis" ) +T.set_doc ( "Number of active orbitals in the dressed CIS" ) +T.set_ezfio_name( "n_act_cis" ) +print T -BEGIN_PROVIDER [ integer , n_core_cis] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC +T.set_type ( "logical" ) +T.set_name ( "mp2_dressing" ) +T.set_doc ( "If true, use MP2 dressing in the dressed CIS" ) +T.set_ezfio_name( "mp2_dressing" ) +print T - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_n_core_cis(has) - if (has) then - call ezfio_get_cis_dressed_n_core_cis(n_core_cis) - else - n_core_cis = 0 - endif +T.set_name ( "standard_doubles" ) +T.set_doc ( "If true, use standard doubles in the dressed CIS" ) +T.set_ezfio_name( "standard_doubles" ) +print T -END_PROVIDER +T.set_name ( "en_2_2" ) +T.set_doc ( "TODO") +T.set_ezfio_name( "en_2_2" ) +print T -BEGIN_PROVIDER [ integer , n_act_cis] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_n_act_cis(has) - if (has) then - call ezfio_get_cis_dressed_n_act_cis(n_act_cis) - else - n_act_cis = mo_tot_num - endif - -END_PROVIDER - -BEGIN_PROVIDER [ logical , mp2_dressing] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_mp2_dressing(has) - if (has) then - call ezfio_get_cis_dressed_mp2_dressing(mp2_dressing) - else - mp2_dressing = .False. - endif - -END_PROVIDER - -BEGIN_PROVIDER [ logical , standard_doubles] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_standard_doubles(has) - if (has) then - call ezfio_get_cis_dressed_standard_doubles(standard_doubles) - else - standard_doubles = .True. - endif - -END_PROVIDER +END_SHELL -BEGIN_PROVIDER [ logical , en_2_2] - implicit none - BEGIN_DOC - ! Number of states asked for the CIS vector - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_cis_dressed_en_2_2(has) - if (has) then - call ezfio_get_cis_dressed_en_2_2(en_2_2) - else - en_2_2 = .False. - endif - -END_PROVIDER - diff --git a/src/Dets/README.rst b/src/Dets/README.rst index a5707417..de6b5069 100644 --- a/src/Dets/README.rst +++ b/src/Dets/README.rst @@ -50,21 +50,18 @@ 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. -`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 `_ Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. -`h_apply_threshold `_ - Theshold on | | - -`resize_h_apply_buffer `_ +`resize_h_apply_buffer `_ Undocumented `cisd_sc2 `_ @@ -170,58 +167,52 @@ Documentation `state_average_weight `_ Weights in the state-average calculation of the density matrix -`det_search_key `_ +`det_search_key `_ Return an integer*8 corresponding to a determinant index for searching -`n_det `_ +`n_det `_ Number of determinants in the wave function -`n_det_max_jacobi `_ - Maximum number of determinants diagonalized my jacobi - -`n_states `_ - Number of states to consider - -`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_bit `_ +`psi_coef_sorted_bit `_ Determinants on which we apply for perturbation. o They are sorted by determinants interpreted as integers. Useful to accelerate the search of a determinant -`psi_det `_ +`psi_det `_ The wave function determinants. Initialized with Hartree-Fock if the EZFIO file is empty -`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_bit `_ +`psi_det_sorted_bit `_ Determinants on which we apply for perturbation. o They are sorted by determinants interpreted as integers. Useful to accelerate the search of a determinant -`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 `double_exc_bitmask `_ @@ -316,9 +307,6 @@ Documentation .br to repeat the excitations -`read_wf `_ - If true, read the wave function from the EZFIO file - `get_s2 `_ Returns diff --git a/src/Dets/determinants.irp.f b/src/Dets/determinants.irp.f index 19c32e52..913b6a7d 100644 --- a/src/Dets/determinants.irp.f +++ b/src/Dets/determinants.irp.f @@ -1,22 +1,5 @@ use bitmasks -BEGIN_PROVIDER [ integer, N_states ] - implicit none - BEGIN_DOC -! Number of states to consider - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_determinants_n_states(exists) - if (exists) then - call ezfio_get_determinants_n_states(N_states) - else - N_states = 1 - endif - call write_int(output_dets,N_states,'Number of states') - ASSERT (N_states > 0) -END_PROVIDER - BEGIN_PROVIDER [ integer, N_det ] implicit none BEGIN_DOC @@ -49,24 +32,6 @@ BEGIN_PROVIDER [ integer, N_det ] END_PROVIDER -BEGIN_PROVIDER [ integer, N_det_max_jacobi ] - implicit none - BEGIN_DOC - ! Maximum number of determinants diagonalized my jacobi - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_determinants_n_det_max_jacobi(exists) - if (exists) then - call ezfio_get_determinants_n_det_max_jacobi(N_det_max_jacobi) - else - N_det_max_jacobi = 5000 - endif - call write_int(output_dets,N_det_max_jacobi,'Lapack diagonalization up to') - ASSERT (N_det_max_jacobi > 0) -END_PROVIDER - - BEGIN_PROVIDER [ integer, psi_det_size ] implicit none BEGIN_DOC diff --git a/src/Dets/options.irp.f b/src/Dets/options.irp.f new file mode 100644 index 00000000..2a8ffe47 --- /dev/null +++ b/src/Dets/options.irp.f @@ -0,0 +1,25 @@ +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 +END_SHELL + + diff --git a/src/Dets/parameters.irp.f b/src/Dets/parameters.irp.f deleted file mode 100644 index 3004fce2..00000000 --- a/src/Dets/parameters.irp.f +++ /dev/null @@ -1,16 +0,0 @@ -BEGIN_PROVIDER [ logical , read_wf ] - implicit none - BEGIN_DOC -! If true, read the wave function from the EZFIO file - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_determinants_read_wf(exists) - if (exists) then - call ezfio_get_determinants_read_wf(read_wf) - else - read_wf = .True. - endif -!call write_i(output_determinants,read_wf,' computes the PT2 at the end of the selection ') -END_PROVIDER - diff --git a/src/Full_CI/README.rst b/src/Full_CI/README.rst index ed9fa014..f63f5a06 100644 --- a/src/Full_CI/README.rst +++ b/src/Full_CI/README.rst @@ -10,16 +10,6 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. -`do_pt2_end `_ - if True then compute the PT2 when the selection process is finished - -`n_det_max_fci `_ - Max number od determinants in the wave function - -`pt2_max `_ - The selection process stops when the largest PT2 (for all the states) is lower than pt2_max - in absolute value - Needed Modules diff --git a/src/Full_CI/options.irp.f b/src/Full_CI/options.irp.f new file mode 100644 index 00000000..807f778a --- /dev/null +++ b/src/Full_CI/options.irp.f @@ -0,0 +1,25 @@ +BEGIN_SHELL [ /usr/bin/python ] +from ezfio_with_default import EZFIO_Provider +T = EZFIO_Provider() +T.set_type ( "integer" ) +T.set_name ( "N_det_max_fci" ) +T.set_doc ( "Max number of determinants in the wave function" ) +T.set_ezfio_dir ( "full_ci" ) +T.set_ezfio_name( "N_det_max_fci" ) +T.set_output ( "output_full_ci" ) +print T + +T.set_type ( "logical" ) +T.set_name ( "do_pt2_end" ) +T.set_doc ( "If true, compute the PT2 at the end of the selection" ) +T.set_ezfio_name( "do_pt2_end" ) +print T + +T.set_type ( "double precision" ) +T.set_name ( "pt2_max" ) +T.set_doc ( """The selection process stops when the largest PT2 (for all the states) +is lower than pt2_max in absolute value""" ) +T.set_ezfio_name( "pt2_max" ) +print T +END_SHELL + diff --git a/src/Full_CI/parameters.irp.f b/src/Full_CI/parameters.irp.f deleted file mode 100644 index 6b5c39d0..00000000 --- a/src/Full_CI/parameters.irp.f +++ /dev/null @@ -1,50 +0,0 @@ -BEGIN_PROVIDER [ integer, N_det_max_fci ] - implicit none - BEGIN_DOC -! Max number od determinants in the wave function - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_full_ci_n_det_max_fci(exists) - if (exists) then - call ezfio_get_full_ci_n_det_max_fci(n_det_max_fci) - else - n_det_max_fci = 10000 - endif - call write_int(output_full_ci,n_det_max_fci,'Max number of determinants ') - ASSERT (n_det_max_fci > 0) -END_PROVIDER - - -BEGIN_PROVIDER [ logical , do_pt2_end ] - implicit none - BEGIN_DOC -! if True then compute the PT2 when the selection process is finished - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_full_ci_do_pt2_end(exists) - if (exists) then - call ezfio_get_full_ci_do_pt2_end(do_pt2_end) - else - do_pt2_end = .True. - endif -!call write_i(output_full_ci,do_pt2_end,' computes the PT2 at the end of the selection ') -END_PROVIDER - - -BEGIN_PROVIDER [ double precision , pt2_max ] - implicit none - BEGIN_DOC -! The selection process stops when the largest PT2 (for all the states) is lower than pt2_max -! in absolute value - END_DOC - logical :: exists - PROVIDE ezfio_filename - call ezfio_has_full_ci_pt2_max(exists) - if (exists) then - call ezfio_get_full_ci_pt2_max(pt2_max) - else - pt2_max = 0.1d0 - endif -END_PROVIDER diff --git a/src/Hartree_Fock/README.rst b/src/Hartree_Fock/README.rst index 0418aca5..8f468717 100644 --- a/src/Hartree_Fock/README.rst +++ b/src/Hartree_Fock/README.rst @@ -26,5 +26,106 @@ Documentation .. Do not edit this section. It was auto-generated from the .. NEEDED_MODULES file. +`ao_bi_elec_integral_alpha `_ + Alpha Fock matrix in AO basis set + +`ao_bi_elec_integral_beta `_ + Alpha Fock matrix in AO basis set + +`fock_matrix_alpha_ao `_ + Alpha Fock matrix in AO basis set + +`fock_matrix_alpha_mo `_ + Fock matrix on the MO basis + +`fock_matrix_ao `_ + Fock matrix in AO basis set + +`fock_matrix_beta_ao `_ + Alpha Fock matrix in AO basis set + +`fock_matrix_beta_mo `_ + Fock matrix on the MO basis + +`fock_matrix_diag_mo `_ + Fock matrix on the MO basis. + For open shells, the ROHF Fock Matrix is + .br + | F-K | F + K/2 | F | + |---------------------------------| + | F + K/2 | F | F - K/2 | + |---------------------------------| + | F | F - K/2 | F + K | + .br + F = 1/2 (Fa + Fb) + .br + K = Fb - Fa + .br + +`fock_matrix_mo `_ + Fock matrix on the MO basis. + For open shells, the ROHF Fock Matrix is + .br + | F-K | F + K/2 | F | + |---------------------------------| + | F + K/2 | F | F - K/2 | + |---------------------------------| + | F | F - K/2 | F + K | + .br + F = 1/2 (Fa + Fb) + .br + K = Fb - Fa + .br + +`fock_mo_to_ao `_ + Undocumented + +`hf_energy `_ + Hartree-Fock energy + +`hf_density_matrix_ao `_ + Density matrix in the AO basis + +`hf_density_matrix_ao_alpha `_ + Alpha density matrix in the AO basis + +`hf_density_matrix_ao_beta `_ + Beta density matrix in the AO basis + +`run `_ + Undocumented + +`scf `_ + Undocumented + +`damping_scf `_ + Undocumented + +`diagonal_fock_matrix_mo `_ + Diagonal Fock matrix in the MO basis + +`diagonal_fock_matrix_mo_sum `_ + diagonal element of the fock matrix calculated as the sum over all the interactions + with all the electrons in the RHF determinant + diagonal_Fock_matrix_mo_sum(i) = sum_{j=1, N_elec} 2 J_ij -K_ij + +`eigenvectors_fock_matrix_mo `_ + Diagonal Fock matrix in the MO basis + +`bi_elec_ref_bitmask_energy `_ + Energy of the reference bitmask used in Slater rules + +`kinetic_ref_bitmask_energy `_ + Energy of the reference bitmask used in Slater rules + +`mono_elec_ref_bitmask_energy `_ + Energy of the reference bitmask used in Slater rules + +`nucl_elec_ref_bitmask_energy `_ + Energy of the reference bitmask used in Slater rules + +`ref_bitmask_energy `_ + Energy of the reference bitmask used in Slater rules + diff --git a/src/Hartree_Fock/hartree_fock.ezfio_config b/src/Hartree_Fock/hartree_fock.ezfio_config index 0a53b7a9..bbb383f9 100644 --- a/src/Hartree_Fock/hartree_fock.ezfio_config +++ b/src/Hartree_Fock/hartree_fock.ezfio_config @@ -1,5 +1,4 @@ hartree_fock thresh_scf double precision n_it_scf_max integer - diis logical diff --git a/src/Hartree_Fock/options.irp.f b/src/Hartree_Fock/options.irp.f index 6576e36c..20b96b7c 100644 --- a/src/Hartree_Fock/options.irp.f +++ b/src/Hartree_Fock/options.irp.f @@ -1,55 +1,26 @@ -BEGIN_PROVIDER [ double precision,thresh_SCF ] - implicit none - BEGIN_DOC -! Threshold on the convergence of the Hartree Fock energy - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_Hartree_Fock_thresh_SCF(has) - if (has) then - call ezfio_get_Hartree_Fock_thresh_SCF(thresh_SCF) - else - thresh_SCF = 1.d-10 - endif - call write_time(output_Hartree_Fock) - call write_double(output_Hartree_Fock, thresh_SCF, & - 'thresh_SCF') +BEGIN_SHELL [ /usr/bin/python ] +from ezfio_with_default import EZFIO_Provider +T = EZFIO_Provider() +T.set_type ( "double precision" ) +T.set_name ( "thresh_SCF" ) +T.set_doc ( "Threshold on the convergence of the Hartree Fock energy" ) +T.set_ezfio_dir ( "Hartree_Fock" ) +T.set_ezfio_name( "thresh_SCF" ) +T.set_output ( "output_Hartree_Fock" ) +print T -END_PROVIDER - -BEGIN_PROVIDER [ integer, n_it_scf_max] - implicit none - BEGIN_DOC -! Maximum number of SCF iterations - END_DOC - - logical :: has - PROVIDE ezfio_filename - call ezfio_has_Hartree_Fock_n_it_scf_max (has) - if (has) then - call ezfio_get_Hartree_Fock_n_it_scf_max(n_it_scf_max) - else - n_it_scf_max = 30 - endif - -END_PROVIDER +T = EZFIO_Provider() +T.set_type ( "integer" ) +T.set_name ( "n_it_scf_max" ) +T.set_doc ( "Maximum number of SCF iterations" ) +T.set_ezfio_dir ( "Hartree_Fock" ) +T.set_ezfio_name( "n_it_scf_max" ) +T.set_output ( "output_Hartree_Fock" ) +print T -BEGIN_PROVIDER [ logical, do_DIIS ] - implicit none - BEGIN_DOC -! If True, compute integrals on the fly - END_DOC +END_SHELL + - logical :: has - PROVIDE ezfio_filename - call ezfio_has_Hartree_Fock_DIIS(has) - if (has) then - call ezfio_get_Hartree_Fock_DIIS(do_DIIS) - else - do_DIIS = .False. - endif -END_PROVIDER diff --git a/src/Output/output.irp.f b/src/Output/output.irp.f index 70649f9d..034f2a95 100644 --- a/src/Output/output.irp.f +++ b/src/Output/output.irp.f @@ -85,3 +85,18 @@ subroutine write_int(iunit,value,label) end +subroutine write_bool(iunit,value,label) + implicit none + BEGIN_DOC + ! Write an logical value in output + END_DOC + integer, intent(in) :: iunit + logical :: value + character*(*) :: label + character*(64), parameter :: f = '(A50,L1)' + character*(50) :: newlabel + write(newlabel,'(A,A)') '* ',trim(label) + write(iunit,f) newlabel, value +end + +