diff --git a/config/gfortran.cfg b/config/gfortran.cfg index c1032aa1..192e6d49 100644 --- a/config/gfortran.cfg +++ b/config/gfortran.cfg @@ -10,7 +10,7 @@ # # [COMMON] -FC : gfortran -g -ffree-line-length-none -I . +FC : gfortran -g -ffree-line-length-none -mavx -I . LAPACK_LIB : -llapack -lblas IRPF90 : irpf90 IRPF90_FLAGS : --ninja --align=32 diff --git a/plugins/MRCC_Utils/README.rst b/plugins/MRCC_Utils/README.rst index 7e7088a2..e69de29b 100644 --- a/plugins/MRCC_Utils/README.rst +++ b/plugins/MRCC_Utils/README.rst @@ -1,989 +0,0 @@ -=========== -MRCC Module -=========== - -Needed Modules -============== - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Perturbation `_ -* `Selectors_full `_ -* `Generators_full `_ -* `Psiref_Utils `_ - -Documentation -============= - -.. Do not edit this section. It was auto-generated from the -.. by the `update_README.py` script. - -`ci_eigenvectors_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_s2_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_electronic_energy_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_energy_dressed `_ - N_states lowest eigenvalues of the dressed CI matrix - - -`davidson_diag_hjj_mrcc `_ - 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 - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_mrcc `_ - 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 - - -`delta_ii `_ - Dressing matrix in N_det basis - - -`delta_ij `_ - Dressing matrix in N_det basis - - -`diagonalize_ci_dressed `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`find_triples_and_quadruples `_ - Undocumented - - -`h_apply_mrcc `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_mrcc_diexc `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_mrcc_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_matrix_dressed `_ - Dressed H with Delta_ij - - -`h_u_0_mrcc `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`lambda_mrcc `_ - cm/ or perturbative 1/Delta_E(m) - - -`lambda_mrcc_tmp `_ - Undocumented - - -`lambda_pert `_ - cm/ or perturbative 1/Delta_E(m) - - -`mrcc_dress `_ - Undocumented - - -`mrcc_dress_simple `_ - Undocumented - - -`mrcc_iterations `_ - Undocumented - - -`oscillations `_ - Undocumented - - -`pert_determinants `_ - Undocumented - - -`psi_ref_lock `_ - Locks on ref determinants to fill delta_ij - - -`run_mrcc `_ - Undocumented - - -`set_generators_bitmasks_as_holes_and_particles `_ - Undocumented - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `Perturbation `_ -* `Selectors_full `_ -* `Generators_full `_ -* `Psiref_Utils `_ - -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -`a_coef `_ - Undocumented - - -`abort_all `_ - If True, all the calculation is aborted - - -`abort_here `_ - If True, all the calculation is aborted - - -`add_poly `_ - Add two polynomials - D(t) =! D(t) +( B(t)+C(t)) - - -`add_poly_multiply `_ - Add a polynomial multiplied by a constant - D(t) =! D(t) +( cst * B(t)) - - -`align_double `_ - Compute 1st dimension such that it is aligned for vectorization. - - -`apply_rotation `_ - Apply the rotation found by find_rotation - - -`approx_dble `_ - Undocumented - - -`b_coef `_ - Undocumented - - -`binom `_ - Binomial coefficients - - -`binom_func `_ - .. math :: - .br - \frac{i!}{j!(i-j)!} - .br - - -`binom_transp `_ - Binomial coefficients - - -`catch_signal `_ - What to do on Ctrl-C. If two Ctrl-C are pressed within 1 sec, the calculation if aborted. - - -`ci_eigenvectors_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_s2_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_electronic_energy_dressed `_ - Eigenvectors/values of the CI matrix - - -`ci_energy_dressed `_ - N_states lowest eigenvalues of the dressed CI matrix - - -`create_minilist `_ - Undocumented - - -`davidson_diag_hjj_mrcc `_ - 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 - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_diag_mrcc `_ - 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 - - -`dble_fact `_ - Undocumented - - -`dble_fact_even `_ - n!! - - -`dble_fact_odd `_ - n!! - - -`dble_logfact `_ - n!! - - -`ddfact2 `_ - Undocumented - - -`delta_ii `_ - Dressing matrix in N_det basis - - -`delta_ij `_ - Dressing matrix in N_det basis - - -`diagonalize_ci_dressed `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`dset_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`dset_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`dsort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`erf0 `_ - Undocumented - - -`f_integral `_ - function that calculates the following integral - \int_{\-infty}^{+\infty} x^n \exp(-p x^2) dx - - -`fact `_ - n! - - -`fact_inv `_ - 1/n! - - -`find_rotation `_ - Find A.C = B - - -`find_triples_and_quadruples `_ - Undocumented - - -`gammln `_ - Undocumented - - -`gammp `_ - Undocumented - - -`gaussian_product `_ - Gaussian product in 1D. - e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2} - - -`gaussian_product_x `_ - Gaussian product in 1D. - e^{-a (x-x_A)^2} e^{-b (x-x_B)^2} = K_{ab}^x e^{-p (x-x_P)^2} - - -`gcf `_ - Undocumented - - -`gen_det_idx `_ - Undocumented - - -`gen_det_shortcut `_ - Undocumented - - -`gen_det_sorted `_ - Undocumented - - -`gen_det_version `_ - Undocumented - - -`get_pseudo_inverse `_ - Find C = A^-1 - - -`give_explicit_poly_and_gaussian `_ - Transforms the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) - into - fact_k * [ sum (l_x = 0,i_order(1)) P_new(l_x,1) * (x-P_center(1))^l_x ] exp (- p (x-P_center(1))^2 ) - * [ sum (l_y = 0,i_order(2)) P_new(l_y,2) * (y-P_center(2))^l_y ] exp (- p (y-P_center(2))^2 ) - * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 ) - - -`give_explicit_poly_and_gaussian_double `_ - Transforms the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) - exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) exp(-(r-Nucl_center)^2 gama - .br - into - fact_k * [ sum (l_x = 0,i_order(1)) P_new(l_x,1) * (x-P_center(1))^l_x ] exp (- p (x-P_center(1))^2 ) - * [ sum (l_y = 0,i_order(2)) P_new(l_y,2) * (y-P_center(2))^l_y ] exp (- p (y-P_center(2))^2 ) - * [ sum (l_z = 0,i_order(3)) P_new(l_z,3) * (z-P_center(3))^l_z ] exp (- p (z-P_center(3))^2 ) - - -`give_explicit_poly_and_gaussian_x `_ - Transform the product of - (x-x_A)^a(1) (x-x_B)^b(1) (x-x_A)^a(2) (y-y_B)^b(2) (z-z_A)^a(3) (z-z_B)^b(3) exp(-(r-A)^2 alpha) exp(-(r-B)^2 beta) - into - fact_k (x-x_P)^iorder(1) (y-y_P)^iorder(2) (z-z_P)^iorder(3) exp(-p(r-P)^2) - - -`gser `_ - Undocumented - - -`h_apply_mrcc `_ - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -`h_apply_mrcc_diexc `_ - Undocumented - - -`h_apply_mrcc_diexcorg `_ - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_apply_mrcc_diexcp `_ - Undocumented - - -`h_apply_mrcc_monoexc `_ - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -`h_matrix_dressed `_ - Dressed H with Delta_ij - - -`h_u_0_mrcc `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`h_u_0_mrcc_org `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`heap_dsort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_dsort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_i2sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_i2sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_i8sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_i8sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_isort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_isort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`heap_sort `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`heap_sort_big `_ - Sort array x(isize) using the heap sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`hermite `_ - Hermite polynomial - - -`i2radix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i2set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`i2set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`i2sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`i8radix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i8radix_sort_big `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`i8set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`i8set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`i8sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_dsort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_dsort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_i2sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_i2sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_i8sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_i8sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_isort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_isort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`insertion_sort `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`insertion_sort_big `_ - Sort array x(isize) using the insertion sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`inv_int `_ - 1/i - - -`iradix_sort `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`iradix_sort_big `_ - Sort integer array x(isize) using the radix sort algorithm. - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - iradix should be -1 in input. - - -`iset_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`iset_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`isort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`lambda_mrcc `_ - cm/ or perturbative 1/Delta_E(m) - - -`lambda_mrcc_tmp `_ - Undocumented - - -`lambda_pert `_ - cm/ or perturbative 1/Delta_E(m) - - -`lapack_diag `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_diag_s2 `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_diagd `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`lapack_partial_diag `_ - Diagonalize matrix H - .br - H is untouched between input and ouptut - .br - eigevalues(i) = ith lowest eigenvalue of the H matrix - .br - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - .br - - -`logfact `_ - n! - - -`mrcc_dress `_ - Undocumented - - -`mrcc_iterations `_ - Undocumented - - -`multiply_poly `_ - Multiply two polynomials - D(t) =! D(t) +( B(t)*C(t)) - - -`normalize `_ - Normalizes vector u - u is expected to be aligned in memory. - - -`nproc `_ - Number of current OpenMP threads - - -`ortho_lowdin `_ - Compute C_new=C_old.S^-1/2 canonical orthogonalization. - .br - overlap : overlap matrix - .br - LDA : leftmost dimension of overlap array - .br - N : Overlap matrix is NxN (array is (LDA,N) ) - .br - C : Coefficients of the vectors to orthogonalize. On exit, - orthogonal vectors - .br - LDC : leftmost dimension of C - .br - m : Coefficients matrix is MxN, ( array is (LDC,N) ) - .br - - -`oscillations `_ - Undocumented - - -`overlap_a_b_c `_ - Undocumented - - -`overlap_gaussian_x `_ - .. math:: - .br - \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx - .br - - -`overlap_gaussian_xyz `_ - .. math:: - .br - S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\ - S = S_x S_y S_z - .br - - -`overlap_x_abs `_ - .. math :: - .br - \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx - .br - - -`pert_determinants `_ - Undocumented - - -`progress_active `_ - Current status for displaying progress bars. Global variable. - - -`progress_bar `_ - Current status for displaying progress bars. Global variable. - - -`progress_timeout `_ - Current status for displaying progress bars. Global variable. - - -`progress_title `_ - Current status for displaying progress bars. Global variable. - - -`progress_value `_ - Current status for displaying progress bars. Global variable. - - -`psi_ref_lock `_ - Locks on ref determinants to fill delta_ij - - -`recentered_poly2 `_ - Recenter two polynomials - - -`rint `_ - .. math:: - .br - \int_0^1 dx \exp(-p x^2) x^n - .br - - -`rint1 `_ - Standard version of rint - - -`rint_large_n `_ - Version of rint for large values of n - - -`rint_sum `_ - Needed for the calculation of two-electron integrals. - - -`rinteg `_ - Undocumented - - -`rintgauss `_ - Undocumented - - -`run_mrcc `_ - Undocumented - - -`run_progress `_ - Display a progress bar with documentation of what is happening - - -`sabpartial `_ - Undocumented - - -`set_generators_bitmasks_as_holes_and_particles `_ - Undocumented - - -`set_order `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - - -`set_order_big `_ - array A has already been sorted, and iorder has contains the new order of - elements of A. This subroutine changes the order of x to match the new order of A. - This is a version for very large arrays where the indices need - to be in integer*8 format - - -`set_zero_extra_diag `_ - Undocumented - - -`sort `_ - Sort array x(isize). - iorder in input should be (1,2,3,...,isize), and in output - contains the new order of the elements. - - -`start_progress `_ - Starts the progress bar - - -`stop_progress `_ - Stop the progress bar - - -`trap_signals `_ - What to do when a signal is caught. Here, trap Ctrl-C and call the control_C subroutine. - - -`u_dot_u `_ - Compute - - -`u_dot_v `_ - Compute - - -`wall_time `_ - The equivalent of cpu_time, but for the wall time. - - -`write_git_log `_ - Write the last git commit in file iunit. - diff --git a/plugins/MRCC_Utils/mrcc_dress.irp.f b/plugins/MRCC_Utils/mrcc_dress.irp.f index ef87d52a..09b34033 100644 --- a/plugins/MRCC_Utils/mrcc_dress.irp.f +++ b/plugins/MRCC_Utils/mrcc_dress.irp.f @@ -296,6 +296,7 @@ END_PROVIDER subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq,miniList,N_miniList) + use bitmasks implicit none @@ -461,6 +462,7 @@ subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq ! end if + c_ref = connected_to_ref(det_buffer(1,1,i),psi_det_generators,Nint, & i_generator,N_det_generators) diff --git a/src/Determinants/README.rst b/src/Determinants/README.rst index cc9e7ca3..e69de29b 100644 --- a/src/Determinants/README.rst +++ b/src/Determinants/README.rst @@ -1,975 +0,0 @@ -=========== -Dets Module -=========== - -This module contains the determinants of the CI wave function. - -H is applied on the list of generator determinants. Selected determinants -are added into the *H_apply buffer*. Then the new wave function is -constructred as the concatenation of the odl wave function and -some determinants of the H_apply buffer. Generator determinants are built -as a subset of the determinants of the wave function. - - -Assumptions -=========== - -.. Do not edit this section. It was auto-generated from the -.. NEEDED_MODULES_CHILDREN file by the `update_README.py` script. - -* The MOs are orthonormal -* All the determinants have the same number of electrons -* The determinants are orthonormal -* The number of generator determinants <= the number of determinants -* All the determinants in the H_apply buffer are supposed to be different from the - wave function determinants -* All the determinants in the H_apply buffer are supposed to be unique - - -Needed Modules -============== - -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - -.. image:: tree_dependency.png - -* `Integrals_Monoelec `_ -* `Integrals_Bielec `_ - -Needed Modules -============== -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -.. image:: tree_dependency.png - -* `Integrals_Monoelec `_ -* `Integrals_Bielec `_ - -Documentation -============= -.. Do not edit this section It was auto-generated -.. by the `update_README.py` script. - - -`a_operator `_ - Needed for diag_H_mat_elem - - -`abs_psi_coef_max `_ - Max and min values of the coefficients - - -`abs_psi_coef_min `_ - Max and min values of the coefficients - - -`ac_operator `_ - Needed for diag_H_mat_elem - - -`apply_mono `_ - Undocumented - - -`bi_elec_ref_bitmask_energy `_ - Energy of the reference bitmask used in Slater rules - - -`ci_eigenvectors `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_mono `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_s2 `_ - Eigenvectors/values of the CI matrix - - -`ci_eigenvectors_s2_mono `_ - Eigenvectors/values of the CI matrix - - -`ci_electronic_energy `_ - Eigenvectors/values of the CI matrix - - -`ci_electronic_energy_mono `_ - Eigenvectors/values of the CI matrix - - -`ci_energy `_ - N_states lowest eigenvalues of the CI matrix - - -`ci_sc2_eigenvectors `_ - Eigenvectors/values of the CI matrix - - -`ci_sc2_electronic_energy `_ - Eigenvectors/values of the CI matrix - - -`ci_sc2_energy `_ - N_states_diag lowest eigenvalues of the CI matrix - - -`cisd `_ - Undocumented - - -`cisd_sc2 `_ - CISD+SC2 method :: take off all the disconnected terms of a CISD (selected or not) - .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 - Initial guess vectors are not necessarily orthonormal - - -`connected_to_ref `_ - Undocumented - - -`connected_to_ref_by_mono `_ - Undocumented - - -`copy_h_apply_buffer_to_wf `_ - Copies the H_apply buffer to psi_coef. - After calling this subroutine, N_det, psi_det and psi_coef need to be touched - - -`create_wf_of_psi_bilinear_matrix `_ - Generate a wave function containing all possible products - of alpha and beta determinants - - -`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 - iunit : Unit for the I/O - .br - Initial guess vectors are not necessarily orthonormal - - -`davidson_iter_max `_ - Max number of Davidson iterations - - -`davidson_sze_max `_ - Max number of Davidson sizes - - -`davidson_threshold `_ - Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] - - -`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_coef `_ - det_coef - - -`det_connections `_ - Build connection proxy between determinants - - -`det_inf `_ - Undocumented - - -`det_num `_ - det_num - - -`det_occ `_ - det_occ - - -`det_search_key `_ - Return an integer*8 corresponding to a determinant index for searching - - -`det_to_occ_pattern `_ - Transform a determinant to an occupation pattern - - -`diag_algorithm `_ - Diagonalization algorithm (Davidson or Lapack) - - -`diag_h_mat_elem `_ - Computes - - -`diagonalize_ci `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`diagonalize_ci_mono `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix - - -`diagonalize_ci_sc2 `_ - Replace the coefficients of the CI states_diag by the coefficients of the - eigenstates of the CI matrix - - -`do_mono_excitation `_ - Apply the mono excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin - on key_in - ispin = 1 == alpha - ispin = 2 == beta - i_ok = 1 == the excitation is possible - i_ok = -1 == the excitation is not possible - - -`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. - - -`expected_s2 `_ - Expected value of S2 : S*(S+1) - - -`fill_h_apply_buffer_no_selection `_ - Fill the H_apply buffer with determiants for CISD - - -`filter_3_highest_electrons `_ - Returns a determinant with only the 3 highest electrons - - -`filter_connected `_ - Filters out the determinants that are not connected by H - .br - returns the array idx which contains the index of the - .br - determinants in the array key1 that interact - .br - via the H operator with key2. - .br - idx(0) is the number of determinants that interact with key1 - - -`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 - via the H operator with key2. - .br - idx(0) is the number of determinants that interact with key1 - key1 should come from psi_det_sorted_ab. - - -`filter_connected_davidson_shortcut `_ - 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 - via the H operator with key2. - .br - idx(0) is the number of determinants that interact with key1 - key1 should come from psi_det_sorted_ab. - - -`filter_connected_davidson_warp `_ - 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 - via the H operator with key2. - .br - idx(0) is the number of determinants that interact with key1 - key1 should come from psi_det_sorted_ab. - - -`filter_connected_i_h_psi0 `_ - returns the array idx which contains the index of the - .br - determinants in the array key1 that interact - .br - via the H operator with key2. - .br - idx(0) is the number of determinants that interact with key1 - - -`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 - .br - in order to know what double excitation can be repeated on key1 - .br - idx_repeat(0) is the number of determinants that can be used - .br - to repeat the excitations - - -`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 - via the H operator with key2. - idx(0) is the number of determinants that interact with key1 - .br - Determinants are taken from the psi_det_sorted_ab array - - -`generate_all_alpha_beta_det_products `_ - Create a wave function from all possible alpha x beta determinants - - -`get_double_excitation `_ - Returns the two excitation operators between two doubly excited determinants and the phase - - -`get_excitation `_ - Returns the excitation operators between two determinants and the phase - - -`get_excitation_degree `_ - Returns the excitation degree between two determinants - - -`get_excitation_degree_vector `_ - Applies get_excitation_degree to an array of 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 - - -`get_index_in_psi_det_sorted_bit `_ - Returns the index of the determinant in the ``psi_det_sorted_bit`` array - - -`get_mono_excitation `_ - Returns the excitation operator between two singly excited determinants and the phase - - -`get_occ_from_key `_ - Returns a list of occupation numbers from a bitstring - - -`get_s2 `_ - Returns - - -`get_s2_u0 `_ - Undocumented - - -`get_s2_u0_old `_ - Undocumented - - -`h_apply_buffer_allocated `_ - Buffer of determinants/coefficients/perturbative energy for H_apply. - Uninitialized. Filled by H_apply subroutines. - - -`h_apply_buffer_lock `_ - Buffer of determinants/coefficients/perturbative energy for H_apply. - Uninitialized. Filled by H_apply subroutines. - - -`h_matrix_all_dets `_ - H matrix on the basis of the slater determinants defined by psi_det - - -`h_matrix_cas `_ - Undocumented - - -`h_u_0 `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`h_u_0_org `_ - Computes v_0 = H|u_0> - .br - n : number of determinants - .br - H_jj : array of - - -`i_h_j `_ - Returns where i and j are determinants - - -`i_h_j_phase_out `_ - Returns where i and j are determinants - - -`i_h_j_verbose `_ - Returns where i and j are determinants - - -`i_h_psi `_ - for the various Nstates - - -`i_h_psi_sc2 `_ - for the various Nstate - .br - returns in addition - .br - the array of the index of the non connected determinants to key1 - .br - in order to know what double excitation can be repeated on key1 - .br - idx_repeat(0) is the number of determinants that can be used - .br - to repeat the excitations - - -`i_h_psi_sc2_verbose `_ - for the various Nstate - .br - returns in addition - .br - the array of the index of the non connected determinants to key1 - .br - in order to know what double excitation can be repeated on key1 - .br - idx_repeat(0) is the number of determinants that can be used - .br - to repeat the excitations - - -`i_h_psi_sec_ord `_ - for the various Nstates - - -`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 `_ - 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. - - -`int_of_3_highest_electrons `_ - Returns an integer*8 as : - .br - |_<--- 21 bits ---><--- 21 bits ---><--- 21 bits --->| - .br - |0<--- i1 ---><--- i2 ---><--- i3 --->| - .br - It encodes the value of the indices of the 3 highest MOs - in descending order - .br - - -`is_in_wavefunction `_ - True if the determinant ``det`` is in the wave function - - -`kinetic_ref_bitmask_energy `_ - Energy of the reference bitmask used in Slater rules - - -`make_s2_eigenfunction `_ - Undocumented - - -`max_degree_exc `_ - Maximum degree of excitation in the wf - - -`mono_elec_ref_bitmask_energy `_ - Energy of the reference bitmask used in Slater rules - - -`n_con_int `_ - Number of integers to represent the connections between determinants - - -`n_det `_ - Number of determinants in the wave function - - -`n_det_alpha_unique `_ - Unique alpha determinants - - -`n_det_beta_unique `_ - Unique beta determinants - - -`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_max `_ - Max number of determinants in the wave function - - -`n_det_max_jacobi `_ - Maximum number of determinants diagonalized by Jacobi - - -`n_det_max_property `_ - Max number of determinants in the wave function when you select for a given property - - -`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. - - -`n_double_exc_bitmasks `_ - Number of double excitation bitmasks - - -`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 - - -`n_single_exc_bitmasks `_ - Number of single excitation bitmasks - - -`n_states `_ - Number of states to consider - - -`n_states_diag `_ - Number of states to consider for the diagonalization - - -`nucl_elec_ref_bitmask_energy `_ - Energy of the reference bitmask used in Slater rules - - -`occ_pattern_search_key `_ - Return an integer*8 corresponding to a determinant index for searching - - -`occ_pattern_to_dets `_ - Generate all possible determinants for a give occ_pattern - - -`occ_pattern_to_dets_size `_ - Number of possible determinants for a given occ_pattern - - -`one_body_dm_mo `_ - One-body density matrix - - -`one_body_dm_mo_alpha `_ - Alpha and beta one-body density matrix for each state - - -`one_body_dm_mo_beta `_ - Alpha and beta one-body density matrix for each state - - -`one_body_single_double_dm_mo_alpha `_ - Alpha and beta one-body density matrix for each state - - -`one_body_single_double_dm_mo_beta `_ - Alpha and beta one-body density matrix for each state - - -`one_body_spin_density_mo `_ - rho(alpha) - rho(beta) - - -`only_single_double_dm `_ - If true, The One body DM is calculated with ignoring the Double<->Doubles extra diag elements - - -`pouet `_ - Undocumented - - -`psi_average_norm_contrib `_ - Contribution of determinants to the state-averaged density - - -`psi_average_norm_contrib_sorted `_ - Wave function sorted by determinants contribution to the norm (state-averaged) - - -`psi_bilinear_matrix `_ - Coefficient matrix if the wave function is expressed in a bilinear form : - D_a^t C D_b - - -`psi_bilinear_matrix_columns `_ - Sparse coefficient matrix if the wave function is expressed in a bilinear form : - D_a^t C D_b - - -`psi_bilinear_matrix_rows `_ - Sparse coefficient matrix if the wave function is expressed in a bilinear form : - D_a^t C D_b - - -`psi_bilinear_matrix_values `_ - Sparse coefficient matrix if the wave function is expressed in a bilinear form : - D_a^t C D_b - - -`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 `_ - 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 `_ - CAS determinants sorted to accelerate the search of a random determinant in the wave - function. - - -`psi_cas_energy `_ - Undocumented - - -`psi_cas_energy_diagonalized `_ - Undocumented - - -`psi_cas_sorted_bit `_ - CAS determinants sorted to accelerate the search of a random determinant in the wave - function. - - -`psi_coef `_ - The wave function coefficients. Initialized with Hartree-Fock if the EZFIO file - is empty - - -`psi_coef_cas_diagonalized `_ - Undocumented - - -`psi_coef_max `_ - Max and min values of the coefficients - - -`psi_coef_min `_ - Max and min values of the coefficients - - -`psi_coef_sorted `_ - Wave function sorted by determinants contribution to the norm (state-averaged) - - -`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 `_ - 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 `_ - 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 `_ - Size of the psi_det/psi_coef arrays - - -`psi_det_sorted `_ - Wave function sorted by determinants contribution to the norm (state-averaged) - - -`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 `_ - 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 `_ - 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_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 `_ - 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 `_ - CAS determinants sorted to accelerate the search of a random determinant in the wave - function. - - -`psi_non_cas_sorted_bit `_ - CAS determinants sorted to accelerate the search of a random determinant in the wave - function. - - -`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 - - -`put_gess `_ - Undocumented - - -`read_dets `_ - Reads the determinants from the EZFIO file - - -`read_wf `_ - If true, read the wave function from the EZFIO file - - -`rec_occ_pattern_to_dets `_ - Undocumented - - -`ref_bitmask_energy `_ - Energy of the reference bitmask used in Slater rules - - -`remove_duplicates_in_psi_det `_ - Removes duplicate determinants in the wave function. - - -`resize_h_apply_buffer `_ - Resizes the H_apply buffer of proc iproc. The buffer lock should - be set before calling this function. - - -`routine `_ - Undocumented - - -`s2_eig `_ - Force the wave function to be an eigenfunction of S^2 - - -`s2_values `_ - array of the averaged values of the S^2 operator on the various states - - -`s_z `_ - z component of the Spin - - -`s_z2_sz `_ - z component of the Spin - - -`save_natorb `_ - Undocumented - - -`save_natural_mos `_ - Save natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis - - -`save_wavefunction `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_general `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_specified `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_unsorted `_ - Save the wave function into the EZFIO file - - -`set_bite_to_integer `_ - Undocumented - - -`set_natural_mos `_ - Set natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis - - -`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. - - -`sort_dets_ab `_ - Undocumented - - -`sort_dets_ab_v `_ - Undocumented - - -`sort_dets_ba_v `_ - Undocumented - - -`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 `_ - 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 - - -`state_average_weight `_ - Weights in the state-average calculation of the density matrix - - -`tamiser `_ - Undocumented - - -`threshold_convergence_sc2 `_ - convergence of the correlation energy of SC2 iterations - - -`threshold_generators `_ - Thresholds on generators (fraction of the norm) - - -`threshold_selectors `_ - Thresholds on selectors (fraction of the norm) - - -`write_spindeterminants `_ - Undocumented - diff --git a/src/Determinants/davidson.irp.f b/src/Determinants/davidson.irp.f index 7a2f6401..03a699c7 100644 --- a/src/Determinants/davidson.irp.f +++ b/src/Determinants/davidson.irp.f @@ -120,7 +120,9 @@ subroutine tamiser(key, idx, no, n, Nint, N_key) end do end subroutine + subroutine sort_dets_ba_v(key, idx, shortcut, version, N_key, Nint) + use bitmasks implicit none integer(bit_kind),intent(inout) :: key(Nint,2,N_key) @@ -133,13 +135,16 @@ subroutine sort_dets_ba_v(key, idx, shortcut, version, N_key, Nint) tmp(:,1,:N_key) = key(:,2,:N_key) tmp(:,2,:N_key) = key(:,1,:N_key) + call sort_dets_ab_v(tmp, idx, shortcut, version, N_key, Nint) + key(:,1,:N_key) = tmp(:,2,:N_key) key(:,2,:N_key) = tmp(:,1,:N_key) end subroutine + subroutine sort_dets_ab_v(key, idx, shortcut, version, N_key, Nint) use bitmasks implicit none @@ -185,6 +190,7 @@ subroutine sort_dets_ab_v(key, idx, shortcut, version, N_key, Nint) shortcut(shortcut(0)+1) = N_key+1 end subroutine +c subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) use bitmasks