diff --git a/ocaml/qptypes_generator.ml b/ocaml/qptypes_generator.ml index ba633a60..aa6bd533 100644 --- a/ocaml/qptypes_generator.ml +++ b/ocaml/qptypes_generator.ml @@ -58,7 +58,7 @@ let input_data = " * Det_number_max : int assert (x > 0) ; - if (x > 10000000000) then + if (x > 10_00_000_000) then warning \"More than 10 billion determinants\"; * States_number : int @@ -142,18 +142,18 @@ let input_data = " let input_ezfio = " * MO_number : int mo_basis_mo_tot_num - 1 : 10000 - More than 10000 MOs + 1 : 10_000 + More than 10_000 MOs * AO_number : int ao_basis_ao_num - 1 : 10000 - More than 10000 AOs + 1 : 10_000 + More than 10_000 AOs * Nucl_number : int nuclei_nucl_num - 1 : 10000 - More than 10000 nuclei + 1 : 10_000 + More than 10_000 nuclei * N_int_number : int determinants_n_int @@ -162,8 +162,8 @@ let input_ezfio = " * Det_number : int determinants_n_det - 1 : 10000000000 - More than 10 billion of determinants + 1 : 10_000_000_000 + More than 10 billion determinants " diff --git a/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES b/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES index 91dd3eff..6ff49e64 100644 --- a/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES +++ b/plugins/CAS_SD_ZMQ/NEEDED_CHILDREN_MODULES @@ -1,2 +1,2 @@ -Generators_CAS Perturbation Selectors_CASSD ZMQ DavidsonUndressed +Generators_CAS Perturbation Selectors_CASSD ZMQ Davidson diff --git a/plugins/CID/NEEDED_CHILDREN_MODULES b/plugins/CID/NEEDED_CHILDREN_MODULES index 3272abe5..1632a44d 100644 --- a/plugins/CID/NEEDED_CHILDREN_MODULES +++ b/plugins/CID/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Selectors_full SingleRefMethod DavidsonUndressed +Selectors_full SingleRefMethod Davidson diff --git a/plugins/CID_selected/NEEDED_CHILDREN_MODULES b/plugins/CID_selected/NEEDED_CHILDREN_MODULES index ea9febd6..6b12c0ee 100644 --- a/plugins/CID_selected/NEEDED_CHILDREN_MODULES +++ b/plugins/CID_selected/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Perturbation CID DavidsonUndressed +Perturbation CID Davidson diff --git a/plugins/CIS/NEEDED_CHILDREN_MODULES b/plugins/CIS/NEEDED_CHILDREN_MODULES index 3272abe5..1632a44d 100644 --- a/plugins/CIS/NEEDED_CHILDREN_MODULES +++ b/plugins/CIS/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Selectors_full SingleRefMethod DavidsonUndressed +Selectors_full SingleRefMethod Davidson diff --git a/plugins/CISD/NEEDED_CHILDREN_MODULES b/plugins/CISD/NEEDED_CHILDREN_MODULES index 3272abe5..1632a44d 100644 --- a/plugins/CISD/NEEDED_CHILDREN_MODULES +++ b/plugins/CISD/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Selectors_full SingleRefMethod DavidsonUndressed +Selectors_full SingleRefMethod Davidson diff --git a/plugins/Casino/NEEDED_CHILDREN_MODULES b/plugins/Casino/NEEDED_CHILDREN_MODULES index 2a87d1c1..34de8ddb 100644 --- a/plugins/Casino/NEEDED_CHILDREN_MODULES +++ b/plugins/Casino/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Determinants DavidsonUndressed +Determinants Davidson diff --git a/plugins/DavidsonDressed/NEEDED_CHILDREN_MODULES b/plugins/DavidsonDressed/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..22a71c5e --- /dev/null +++ b/plugins/DavidsonDressed/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Davidson_Utils diff --git a/src/DavidsonDressed/README.rst b/plugins/DavidsonDressed/README.rst similarity index 100% rename from src/DavidsonDressed/README.rst rename to plugins/DavidsonDressed/README.rst diff --git a/src/DavidsonDressed/diagonalize_CI.irp.f b/plugins/DavidsonDressed/diagonalize_CI.irp.f similarity index 100% rename from src/DavidsonDressed/diagonalize_CI.irp.f rename to plugins/DavidsonDressed/diagonalize_CI.irp.f diff --git a/plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES b/plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES index cc81a88f..1d6553e8 100644 --- a/plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES +++ b/plugins/Full_CI_ZMQ/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Perturbation Selectors_full Generators_full ZMQ FourIdx MPI DavidsonUndressed +Perturbation Selectors_full Generators_full ZMQ FourIdx MPI Davidson diff --git a/plugins/Perturbation/dipole_moment.irp.f b/plugins/Perturbation/dipole_moment.irp.f index 53beb081..0c83436b 100644 --- a/plugins/Perturbation/dipole_moment.irp.f +++ b/plugins/Perturbation/dipole_moment.irp.f @@ -12,7 +12,7 @@ subroutine pt2_dipole_moment_z(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,n_ integer(bit_kind), intent(in) :: minilist(Nint,2,N_det_selectors) BEGIN_DOC - ! compute the perturbatibe contribution to the dipole moment of one determinant + ! compute the perturbative contribution to the dipole moment of one determinant ! ! for the various n_st states, at various level of theory. ! diff --git a/plugins/Properties/NEEDED_CHILDREN_MODULES b/plugins/Properties/NEEDED_CHILDREN_MODULES index 2a87d1c1..320d5dd0 100644 --- a/plugins/Properties/NEEDED_CHILDREN_MODULES +++ b/plugins/Properties/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Determinants DavidsonUndressed +Determinants Davidson diff --git a/plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES b/plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES index 22828878..c11605ac 100644 --- a/plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES +++ b/plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Psiref_Utils DavidsonUndressed +Psiref_Utils diff --git a/plugins/mrcepa0/NEEDED_CHILDREN_MODULES b/plugins/mrcepa0/NEEDED_CHILDREN_MODULES index fe8255d1..11d8e8a8 100644 --- a/plugins/mrcepa0/NEEDED_CHILDREN_MODULES +++ b/plugins/mrcepa0/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Perturbation Selectors_full Generators_full Psiref_CAS MRCC_Utils ZMQ +Perturbation Selectors_full Generators_full Psiref_CAS MRCC_Utils ZMQ DavidsonDressed diff --git a/plugins/mrcepa0/dressing_vector.irp.f b/plugins/mrcepa0/dressing_vector.irp.f new file mode 100644 index 00000000..7c5809d9 --- /dev/null +++ b/plugins/mrcepa0/dressing_vector.irp.f @@ -0,0 +1,29 @@ + BEGIN_PROVIDER [ double precision, dressing_column_h, (N_det,N_states) ] +&BEGIN_PROVIDER [ double precision, dressing_column_s, (N_det,N_states) ] + implicit none + BEGIN_DOC + ! Null dressing vectors + END_DOC + dressing_column_h(:,:) = 0.d0 + dressing_column_s(:,:) = 0.d0 + + integer :: i,ii,k,j,jj, l + double precision :: f, tmp + double precision, external :: u_dot_v + + do k=1,N_states + l = dressed_column_idx(k) + f = 1.d0/psi_coef(l,k) + do jj = 1, n_det_non_ref + j = idx_non_ref(jj) + dressing_column_h(j,k) = delta_ij (k,jj) + dressing_column_s(j,k) = delta_ij_s2(k,jj) + enddo + tmp = u_dot_v(dressing_column_h(1,k), psi_coef(1,k), N_det) + dressing_column_h(l,k) -= tmp * f + tmp = u_dot_v(dressing_column_s(1,k), psi_coef(1,k), N_det) + dressing_column_s(l,k) -= tmp * f + enddo + +END_PROVIDER + diff --git a/src/Davidson/NEEDED_CHILDREN_MODULES b/src/Davidson/NEEDED_CHILDREN_MODULES index 9361eccd..22a71c5e 100644 --- a/src/Davidson/NEEDED_CHILDREN_MODULES +++ b/src/Davidson/NEEDED_CHILDREN_MODULES @@ -1 +1 @@ -Determinants DavidsonDressed +Davidson_Utils diff --git a/src/Davidson/README.rst b/src/Davidson/README.rst index 62a7495b..e11d0703 100644 --- a/src/Davidson/README.rst +++ b/src/Davidson/README.rst @@ -1,322 +1,14 @@ +================= +DavidsonUndressed +================= + +Module for main files with undressed Davidson + Needed Modules ============== .. Do not edit this section It was auto-generated .. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `Determinants `_ - Documentation ============= .. Do not edit this section It was auto-generated .. by the `update_README.py` script. - - -`ci_eigenvectors `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_s2 `_ - Eigenvectors/values of the CI matrix - - -`ci_electronic_energy `_ - Eigenvectors/values of the CI matrix - - -`ci_energy `_ - N_states lowest eigenvalues of the CI matrix - - -`davidson_collector `_ - Undocumented - - -`davidson_converged `_ - True if the Davidson algorithm is converged - - -`davidson_criterion `_ - Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] - - -`davidson_diag `_ - Davidson diagonalization. - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - iunit : Unit number for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`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 - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - N_st_diag : Number of states in which H is diagonalized - .br - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_hjj_sjj `_ - Davidson diagonalization with specific diagonal elements of the H matrix - .br - H_jj : specific diagonal H matrix elements to diagonalize de Davidson - .br - S2_out : Output : s^2 - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - N_st_diag : Number of states in which H is diagonalized. Assumed > sze - .br - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_hs2 `_ - Davidson diagonalization. - .br - dets_in : bitmasks corresponding to determinants - .br - u_in : guess coefficients on the various states. Overwritten - on exit - .br - dim_in : leftmost dimension of u_in - .br - sze : Number of determinants - .br - N_st : Number of eigenstates - .br - iunit : Unit number for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_pull_results `_ - Undocumented - - -`davidson_push_results `_ - Undocumented - - -`davidson_run_slave `_ - Undocumented - - -`davidson_slave `_ - Undocumented - - -`davidson_slave_inproc `_ - Undocumented - - -`davidson_slave_tcp `_ - Undocumented - - -`davidson_slave_work `_ - Undocumented - - -`davidson_sze_max `_ - Number of micro-iterations before re-contracting - - -`det_inf `_ - Ordering function for determinants - - -`diag_and_save `_ - Undocumented - - -`diagonalize_ci `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`disk_based_davidson `_ - If true, disk space is used to store the vectors - - -`distributed_davidson `_ - If true, use the distributed algorithm - - -`find_reference `_ - Undocumented - - -`first_guess `_ - Select all the determinants with the lowest energy as a starting point. - - -`h_s2_u_0_nstates `_ - Computes v_0 = H|u_0> and s_0 = S^2 |u_0> - .br - n : number of determinants - .br - H_jj : array of - .br - S2_jj : array of - - -`h_s2_u_0_nstates_openmp `_ - Computes v_0 = H|u_0> and s_0 = S^2 |u_0> - .br - Assumes that the determinants are in psi_det - .br - istart, iend, ishift, istep are used in ZMQ parallelization. - - -`h_s2_u_0_nstates_openmp_work `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_openmp_work_1 `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_openmp_work_2 `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_openmp_work_3 `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_openmp_work_4 `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_openmp_work_n_int `_ - Computes v_t = H|u_t> and s_t = S^2 |u_t> - .br - Default should be 1,N_det,0,1 - - -`h_s2_u_0_nstates_test `_ - Undocumented - - -`h_s2_u_0_nstates_zmq `_ - Computes v_0 = H|u_0> and s_0 = S^2 |u_0> - .br - n : number of determinants - .br - H_jj : array of - .br - S2_jj : array of - - -`h_u_0_nstates `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - .br - - -`n_states_diag `_ - Number of states to consider during the Davdison diagonalization - - -`nthreads_davidson `_ - Number of threads for Davdison - - -`print_h_matrix_restart `_ - Undocumented - - -`provide_everything `_ - Undocumented - - -`psi_energy `_ - Energy of the current wave function - - -`routine `_ - Undocumented - - -`sort_dets_ab `_ - Uncodumented : TODO - - -`sort_dets_ab_v `_ - Uncodumented : TODO - - -`sort_dets_ba_v `_ - Uncodumented : TODO - - -`state_following `_ - If true, the states are re-ordered to match the input states - - -`tamiser `_ - Uncodumented : TODO - - -`threshold_davidson `_ - Thresholds of Davidson's algorithm - - -`u_0_h_u_0 `_ - Computes e_0 = / - .br - n : number of determinants - .br - diff --git a/src/DavidsonUndressed/davidson_slave.irp.f b/src/Davidson/davidson_slave.irp.f similarity index 100% rename from src/DavidsonUndressed/davidson_slave.irp.f rename to src/Davidson/davidson_slave.irp.f diff --git a/src/DavidsonUndressed/diag_restart_save_all_states.irp.f b/src/Davidson/diag_restart_save_all_states.irp.f similarity index 100% rename from src/DavidsonUndressed/diag_restart_save_all_states.irp.f rename to src/Davidson/diag_restart_save_all_states.irp.f diff --git a/src/DavidsonUndressed/diag_restart_save_lowest_state.irp.f b/src/Davidson/diag_restart_save_lowest_state.irp.f similarity index 100% rename from src/DavidsonUndressed/diag_restart_save_lowest_state.irp.f rename to src/Davidson/diag_restart_save_lowest_state.irp.f diff --git a/src/DavidsonUndressed/diag_restart_save_one_state.irp.f b/src/Davidson/diag_restart_save_one_state.irp.f similarity index 100% rename from src/DavidsonUndressed/diag_restart_save_one_state.irp.f rename to src/Davidson/diag_restart_save_one_state.irp.f diff --git a/src/DavidsonUndressed/guess_lowest_state.irp.f b/src/Davidson/guess_lowest_state.irp.f similarity index 100% rename from src/DavidsonUndressed/guess_lowest_state.irp.f rename to src/Davidson/guess_lowest_state.irp.f diff --git a/plugins/UndressedMethod/null_dressing_vector.irp.f b/src/Davidson/null_dressing_vector.irp.f similarity index 100% rename from plugins/UndressedMethod/null_dressing_vector.irp.f rename to src/Davidson/null_dressing_vector.irp.f diff --git a/src/DavidsonUndressed/print_H_matrix_restart.irp.f b/src/Davidson/print_H_matrix_restart.irp.f similarity index 100% rename from src/DavidsonUndressed/print_H_matrix_restart.irp.f rename to src/Davidson/print_H_matrix_restart.irp.f diff --git a/src/DavidsonUndressed/print_energy.irp.f b/src/Davidson/print_energy.irp.f similarity index 100% rename from src/DavidsonUndressed/print_energy.irp.f rename to src/Davidson/print_energy.irp.f diff --git a/src/Davidson/tree_dependency.png b/src/Davidson/tree_dependency.png deleted file mode 100644 index e69de29b..00000000 diff --git a/src/DavidsonDressed/NEEDED_CHILDREN_MODULES b/src/DavidsonDressed/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 8b137891..00000000 --- a/src/DavidsonDressed/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/DavidsonUndressed/NEEDED_CHILDREN_MODULES b/src/DavidsonUndressed/NEEDED_CHILDREN_MODULES deleted file mode 100644 index 25180044..00000000 --- a/src/DavidsonUndressed/NEEDED_CHILDREN_MODULES +++ /dev/null @@ -1 +0,0 @@ -Davidson UndressedMethod diff --git a/src/DavidsonUndressed/README.rst b/src/DavidsonUndressed/README.rst deleted file mode 100644 index e11d0703..00000000 --- a/src/DavidsonUndressed/README.rst +++ /dev/null @@ -1,14 +0,0 @@ -================= -DavidsonUndressed -================= - -Module for main files with undressed Davidson - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. diff --git a/src/Davidson/EZFIO.cfg b/src/Davidson_Utils/EZFIO.cfg similarity index 100% rename from src/Davidson/EZFIO.cfg rename to src/Davidson_Utils/EZFIO.cfg diff --git a/src/Davidson_Utils/NEEDED_CHILDREN_MODULES b/src/Davidson_Utils/NEEDED_CHILDREN_MODULES new file mode 100644 index 00000000..aae89501 --- /dev/null +++ b/src/Davidson_Utils/NEEDED_CHILDREN_MODULES @@ -0,0 +1 @@ +Determinants diff --git a/src/Davidson_Utils/README.rst b/src/Davidson_Utils/README.rst new file mode 100644 index 00000000..19499c1f --- /dev/null +++ b/src/Davidson_Utils/README.rst @@ -0,0 +1,331 @@ +Davidson_Utils +============== + +Abstract module for Davidson diagonalization. Contains everything required for the +Davidson algorithm, dressed or not. If a dressing is used, the dressing column should +be defined and the DavidsonDressed module should be used. If no dressing is required, +the Davidson module should be used, and it has a default null dressing vector. + + +Needed Modules +============== +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +.. image:: tree_dependency.png + +* `Determinants `_ + +Documentation +============= +.. Do not edit this section It was auto-generated +.. by the `update_README.py` script. + + +`ci_eigenvectors `_ + Eigenvectors/values of the CI matrix + + +`ci_eigenvectors_s2 `_ + Eigenvectors/values of the CI matrix + + +`ci_electronic_energy `_ + Eigenvectors/values of the CI matrix + + +`ci_energy `_ + N_states lowest eigenvalues of the CI matrix + + +`davidson_collector `_ + Undocumented + + +`davidson_converged `_ + True if the Davidson algorithm is converged + + +`davidson_criterion `_ + Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] + + +`davidson_diag `_ + Davidson diagonalization. + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit number for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`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 + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + N_st_diag : Number of states in which H is diagonalized + .br + iunit : Unit for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_diag_hjj_sjj `_ + Davidson diagonalization with specific diagonal elements of the H matrix + .br + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + .br + S2_out : Output : s^2 + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + N_st_diag : Number of states in which H is diagonalized. Assumed > sze + .br + iunit : Unit for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_diag_hs2 `_ + Davidson diagonalization. + .br + dets_in : bitmasks corresponding to determinants + .br + u_in : guess coefficients on the various states. Overwritten + on exit + .br + dim_in : leftmost dimension of u_in + .br + sze : Number of determinants + .br + N_st : Number of eigenstates + .br + iunit : Unit number for the I/O + .br + Initial guess vectors are not necessarily orthonormal + + +`davidson_pull_results `_ + Undocumented + + +`davidson_push_results `_ + Undocumented + + +`davidson_run_slave `_ + Undocumented + + +`davidson_slave `_ + Undocumented + + +`davidson_slave_inproc `_ + Undocumented + + +`davidson_slave_tcp `_ + Undocumented + + +`davidson_slave_work `_ + Undocumented + + +`davidson_sze_max `_ + Number of micro-iterations before re-contracting + + +`det_inf `_ + Ordering function for determinants + + +`diag_and_save `_ + Undocumented + + +`diagonalize_ci `_ + Replace the coefficients of the CI states by the coefficients of the + eigenstates of the CI matrix + + +`disk_based_davidson `_ + If true, disk space is used to store the vectors + + +`distributed_davidson `_ + If true, use the distributed algorithm + + +`find_reference `_ + Undocumented + + +`first_guess `_ + Select all the determinants with the lowest energy as a starting point. + + +`h_s2_u_0_nstates `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + n : number of determinants + .br + H_jj : array of + .br + S2_jj : array of + + +`h_s2_u_0_nstates_openmp `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + Assumes that the determinants are in psi_det + .br + istart, iend, ishift, istep are used in ZMQ parallelization. + + +`h_s2_u_0_nstates_openmp_work `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_1 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_2 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_3 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_4 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_n_int `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_test `_ + Undocumented + + +`h_s2_u_0_nstates_zmq `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + n : number of determinants + .br + H_jj : array of + .br + S2_jj : array of + + +`h_u_0_nstates `_ + Computes v_0 = H|u_0> + .br + n : number of determinants + .br + H_jj : array of + .br + + +`n_states_diag `_ + Number of states to consider during the Davdison diagonalization + + +`nthreads_davidson `_ + Number of threads for Davdison + + +`print_h_matrix_restart `_ + Undocumented + + +`provide_everything `_ + Undocumented + + +`psi_energy `_ + Energy of the current wave function + + +`routine `_ + Undocumented + + +`sort_dets_ab `_ + Uncodumented : TODO + + +`sort_dets_ab_v `_ + Uncodumented : TODO + + +`sort_dets_ba_v `_ + Uncodumented : TODO + + +`state_following `_ + If true, the states are re-ordered to match the input states + + +`tamiser `_ + Uncodumented : TODO + + +`threshold_davidson `_ + Thresholds of Davidson's algorithm + + +`u_0_h_u_0 `_ + Computes e_0 = / + .br + n : number of determinants + .br + diff --git a/src/Davidson/davidson_parallel.irp.f b/src/Davidson_Utils/davidson_parallel.irp.f similarity index 100% rename from src/Davidson/davidson_parallel.irp.f rename to src/Davidson_Utils/davidson_parallel.irp.f diff --git a/src/Davidson/diagonalization.irp.f b/src/Davidson_Utils/diagonalization.irp.f similarity index 100% rename from src/Davidson/diagonalization.irp.f rename to src/Davidson_Utils/diagonalization.irp.f diff --git a/src/DavidsonDressed/diagonalization_hs2_dressed.irp.f b/src/Davidson_Utils/diagonalization_hs2_dressed.irp.f similarity index 92% rename from src/DavidsonDressed/diagonalization_hs2_dressed.irp.f rename to src/Davidson_Utils/diagonalization_hs2_dressed.irp.f index 8a477b5a..297db3c5 100644 --- a/src/DavidsonDressed/diagonalization_hs2_dressed.irp.f +++ b/src/Davidson_Utils/diagonalization_hs2_dressed.irp.f @@ -478,43 +478,3 @@ end -subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze) - use bitmasks - implicit none - BEGIN_DOC - ! Computes e_0 = / - ! - ! n : number of determinants - ! - END_DOC - integer, intent(in) :: n,Nint, N_st, sze - double precision, intent(out) :: e_0(N_st) - double precision, intent(inout) :: u_0(sze,N_st) - integer(bit_kind),intent(in) :: keys_tmp(Nint,2,n) - - double precision, allocatable :: v_0(:,:), s_0(:,:), u_1(:,:) - double precision :: u_dot_u,u_dot_v,diag_H_mat_elem - integer :: i,j - - if ((sze > 100000).and.distributed_davidson) then - allocate (v_0(sze,N_states_diag),s_0(sze,N_states_diag), u_1(sze,N_states_diag)) - u_1(1:sze,1:N_states) = u_0(1:sze,1:N_states) - u_1(1:sze,N_states+1:N_states_diag) = 0.d0 - call H_S2_u_0_nstates_zmq(v_0,s_0,u_1,N_states_diag,sze) - deallocate(u_1) - else - allocate (v_0(sze,N_st),s_0(sze,N_st)) - call H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) - endif - double precision :: norm - do i=1,N_st - norm = u_dot_u(u_0(1,i),n) - if (norm /= 0.d0) then - e_0(i) = u_dot_v(v_0(1,i),u_0(1,i),n) - else - e_0(i) = 0.d0 - endif - enddo - deallocate (s_0, v_0) -end - diff --git a/src/Davidson/diagonalize_CI.irp.f b/src/Davidson_Utils/diagonalize_CI.irp.f similarity index 100% rename from src/Davidson/diagonalize_CI.irp.f rename to src/Davidson_Utils/diagonalize_CI.irp.f diff --git a/src/Davidson/find_reference.irp.f b/src/Davidson_Utils/find_reference.irp.f similarity index 100% rename from src/Davidson/find_reference.irp.f rename to src/Davidson_Utils/find_reference.irp.f diff --git a/src/Davidson/parameters.irp.f b/src/Davidson_Utils/parameters.irp.f similarity index 100% rename from src/Davidson/parameters.irp.f rename to src/Davidson_Utils/parameters.irp.f diff --git a/src/Davidson/u0Hu0.irp.f b/src/Davidson_Utils/u0Hu0.irp.f similarity index 92% rename from src/Davidson/u0Hu0.irp.f rename to src/Davidson_Utils/u0Hu0.irp.f index e4b1de50..dc020fc9 100644 --- a/src/Davidson/u0Hu0.irp.f +++ b/src/Davidson_Utils/u0Hu0.irp.f @@ -458,3 +458,43 @@ N_int;; END_TEMPLATE +subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + use bitmasks + implicit none + BEGIN_DOC + ! Computes e_0 = / + ! + ! n : number of determinants + ! + END_DOC + integer, intent(in) :: n,Nint, N_st, sze + double precision, intent(out) :: e_0(N_st) + double precision, intent(inout) :: u_0(sze,N_st) + integer(bit_kind),intent(in) :: keys_tmp(Nint,2,n) + + double precision, allocatable :: v_0(:,:), s_0(:,:), u_1(:,:) + double precision :: u_dot_u,u_dot_v,diag_H_mat_elem + integer :: i,j + + if ((sze > 100000).and.distributed_davidson) then + allocate (v_0(sze,N_states_diag),s_0(sze,N_states_diag), u_1(sze,N_states_diag)) + u_1(1:sze,1:N_states) = u_0(1:sze,1:N_states) + u_1(1:sze,N_states+1:N_states_diag) = 0.d0 + call H_S2_u_0_nstates_zmq(v_0,s_0,u_1,N_states_diag,sze) + deallocate(u_1) + else + allocate (v_0(sze,N_st),s_0(sze,N_st)) + call H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) + endif + double precision :: norm + do i=1,N_st + norm = u_dot_u(u_0(1,i),n) + if (norm /= 0.d0) then + e_0(i) = u_dot_v(v_0(1,i),u_0(1,i),n) + else + e_0(i) = 0.d0 + endif + enddo + deallocate (s_0, v_0) +end +