From e32775711881af8c4bd19558ace3c02468393569 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Wed, 9 Jan 2019 18:38:44 +0100 Subject: [PATCH 1/6] fixed rs_ks_scf density --- src/density_for_dft/density_for_dft.irp.f | 46 +++++++++---- src/determinants/density_matrix.irp.f | 83 ----------------------- src/kohn_sham/ks_scf.irp.f | 4 +- src/kohn_sham_rs/rs_ks_scf.irp.f | 3 +- src/mo_one_e_ints/ao_to_mo.irp.f | 27 +++++++- 5 files changed, 60 insertions(+), 103 deletions(-) diff --git a/src/density_for_dft/density_for_dft.irp.f b/src/density_for_dft/density_for_dft.irp.f index ccfb141f..a1292286 100644 --- a/src/density_for_dft/density_for_dft.irp.f +++ b/src/density_for_dft/density_for_dft.irp.f @@ -12,6 +12,9 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_num,mo_num, else if (density_for_dft .EQ. "WFT")then provide mo_coef one_body_dm_mo_alpha_for_dft = one_body_dm_mo_alpha + else if (density_for_dft .EQ. "KS")then + provide mo_coef + one_body_dm_mo_alpha_for_dft = one_body_dm_mo_alpha_one_det endif END_PROVIDER @@ -30,6 +33,9 @@ BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_num,mo_num, N else if (density_for_dft .EQ. "WFT")then provide mo_coef one_body_dm_mo_beta_for_dft = one_body_dm_mo_beta + else if (density_for_dft .EQ. "KS")then + provide mo_coef + one_body_dm_mo_beta_for_dft = one_body_dm_mo_beta_one_det endif END_PROVIDER @@ -53,25 +59,37 @@ END_PROVIDER ! one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft END_DOC implicit none - integer :: i,j,k,l,istate + integer :: istate double precision :: mo_alpha,mo_beta one_body_dm_alpha_ao_for_dft = 0.d0 one_body_dm_beta_ao_for_dft = 0.d0 - do k = 1, ao_num - do l = 1, ao_num - do i = 1, mo_num - do j = 1, mo_num - do istate = 1, N_states - mo_alpha = one_body_dm_mo_alpha_for_dft(j,i,istate) - mo_beta = one_body_dm_mo_beta_for_dft(j,i,istate) - one_body_dm_alpha_ao_for_dft(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha - one_body_dm_beta_ao_for_dft(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_beta - enddo - enddo - enddo - enddo + do istate = 1, N_states + call mo_to_ao_no_overlap( one_body_dm_mo_alpha_for_dft(1,1,istate), & + size(one_body_dm_mo_alpha_for_dft,1), & + one_body_dm_alpha_ao_for_dft(1,1,istate), & + size(one_body_dm_alpha_ao_for_dft,1) ) + call mo_to_ao_no_overlap( one_body_dm_mo_beta_for_dft(1,1,istate), & + size(one_body_dm_mo_beta_for_dft,1), & + one_body_dm_beta_ao_for_dft(1,1,istate), & + size(one_body_dm_beta_ao_for_dft,1) ) enddo END_PROVIDER + BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_one_det, (mo_num,mo_num, N_states)] +&BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_one_det, (mo_num,mo_num, N_states)] + implicit none + BEGIN_DOC +! One body density matrix on the |MO| basis for a single determinant + END_DOC + integer :: i + one_body_dm_mo_alpha_one_det = 0.d0 + one_body_dm_mo_beta_one_det = 0.d0 + do i =1, elec_alpha_num + one_body_dm_mo_alpha_one_det(i,i, 1:N_states) = 1.d0 + enddo + do i =1, elec_beta_num + one_body_dm_mo_beta_one_det(i,i, 1:N_states) = 1.d0 + enddo +END_PROVIDER diff --git a/src/determinants/density_matrix.irp.f b/src/determinants/density_matrix.irp.f index bd5d4318..c096c0fc 100644 --- a/src/determinants/density_matrix.irp.f +++ b/src/determinants/density_matrix.irp.f @@ -231,89 +231,6 @@ END_PROVIDER END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_alpha, (mo_num,mo_num) ] -&BEGIN_PROVIDER [ double precision, one_body_single_double_dm_mo_beta, (mo_num,mo_num) ] - implicit none - BEGIN_DOC - ! $\alpha$ and $\beta$ one-body density matrix for each state - END_DOC - - integer :: j,k,l,m - integer :: occ(N_int*bit_kind_size,2) - double precision :: ck, cl, ckl - double precision :: phase - integer :: h1,h2,p1,p2,s1,s2, degree - integer :: exc(0:2,2,2),n_occ_alpha - double precision, allocatable :: tmp_a(:,:), tmp_b(:,:) - integer :: degree_respect_to_HF_k - integer :: degree_respect_to_HF_l - - PROVIDE elec_alpha_num elec_beta_num - - one_body_single_double_dm_mo_alpha = 0.d0 - one_body_single_double_dm_mo_beta = 0.d0 - !$OMP PARALLEL DEFAULT(NONE) & - !$OMP PRIVATE(j,k,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc,& - !$OMP tmp_a, tmp_b, n_occ_alpha,degree_respect_to_HF_k,degree_respect_to_HF_l)& - !$OMP SHARED(ref_bitmask,psi_det,psi_coef,N_int,N_states,state_average_weight,elec_alpha_num,& - !$OMP elec_beta_num,one_body_single_double_dm_mo_alpha,one_body_single_double_dm_mo_beta,N_det,& - !$OMP mo_num) - allocate(tmp_a(mo_num,mo_num), tmp_b(mo_num,mo_num) ) - tmp_a = 0.d0 - tmp_b = 0.d0 - !$OMP DO SCHEDULE(dynamic) - do k=1,N_det - call bitstring_to_list(psi_det(1,1,k), occ(1,1), n_occ_alpha, N_int) - call bitstring_to_list(psi_det(1,2,k), occ(1,2), n_occ_alpha, N_int) - call get_excitation_degree(ref_bitmask,psi_det(1,1,k),degree_respect_to_HF_k,N_int) - - do m=1,N_states - ck = psi_coef(k,m)*psi_coef(k,m) * state_average_weight(m) - call get_excitation_degree(ref_bitmask,psi_det(1,1,k),degree_respect_to_HF_l,N_int) - if(degree_respect_to_HF_l.le.0)then - do l=1,elec_alpha_num - j = occ(l,1) - tmp_a(j,j) += ck - enddo - do l=1,elec_beta_num - j = occ(l,2) - tmp_b(j,j) += ck - enddo - endif - enddo - do l=1,k-1 - call get_excitation_degree(ref_bitmask,psi_det(1,1,l),degree_respect_to_HF_l,N_int) - if(degree_respect_to_HF_k.ne.0)cycle - if(degree_respect_to_HF_l.eq.2.and.degree_respect_to_HF_k.ne.2)cycle - call get_excitation_degree(psi_det(1,1,k),psi_det(1,1,l),degree,N_int) - if (degree /= 1) then - cycle - endif - call get_mono_excitation(psi_det(1,1,k),psi_det(1,1,l),exc,phase,N_int) - call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - do m=1,N_states - ckl = psi_coef(k,m) * psi_coef(l,m) * phase * state_average_weight(m) - if (s1==1) then - tmp_a(h1,p1) += ckl - tmp_a(p1,h1) += ckl - else - tmp_b(h1,p1) += ckl - tmp_b(p1,h1) += ckl - endif - enddo - enddo - enddo - !$OMP END DO NOWAIT - !$OMP CRITICAL - one_body_single_double_dm_mo_alpha = one_body_single_double_dm_mo_alpha + tmp_a - !$OMP END CRITICAL - !$OMP CRITICAL - one_body_single_double_dm_mo_beta = one_body_single_double_dm_mo_beta + tmp_b - !$OMP END CRITICAL - deallocate(tmp_a,tmp_b) - !$OMP END PARALLEL -END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_num,mo_num) ] implicit none BEGIN_DOC diff --git a/src/kohn_sham/ks_scf.irp.f b/src/kohn_sham/ks_scf.irp.f index 6bd31be1..b2dd0e82 100644 --- a/src/kohn_sham/ks_scf.irp.f +++ b/src/kohn_sham/ks_scf.irp.f @@ -10,10 +10,8 @@ program srs_ks_cf touch io_mo_one_e_integrals io_ao_one_e_integrals = "None" touch io_ao_one_e_integrals - read_wf = .False. - density_for_dft ="WFT" + density_for_dft ="KS" touch density_for_dft - touch read_wf print*, '**************************' print*, 'mu_erf_dft = ',mu_erf_dft print*, '**************************' diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index 57c8787d..53d451c1 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -12,9 +12,8 @@ program rs_ks_scf touch io_ao_one_e_integrals read_wf = .False. - density_for_dft ="WFT" + density_for_dft ="KS" touch density_for_dft - touch read_wf print*, '**************************' print*, 'mu_erf_dft = ',mu_erf_dft print*, '**************************' diff --git a/src/mo_one_e_ints/ao_to_mo.irp.f b/src/mo_one_e_ints/ao_to_mo.irp.f index 4216abef..a0d8caaa 100644 --- a/src/mo_one_e_ints/ao_to_mo.irp.f +++ b/src/mo_one_e_ints/ao_to_mo.irp.f @@ -3,7 +3,7 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) BEGIN_DOC ! Transform A from the MO basis to the AO basis ! - ! (S.C).A_mo.(S.C)t + ! $(S.C).A_{mo}.(S.C)^\dagger$ END_DOC integer, intent(in) :: LDA_ao,LDA_mo double precision, intent(in) :: A_mo(LDA_mo,mo_num) @@ -25,6 +25,31 @@ subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) deallocate(T) end +subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao) + implicit none + BEGIN_DOC + ! $C.A_{mo}.C^\dagger$ + END_DOC + integer, intent(in) :: LDA_ao,LDA_mo + double precision, intent(in) :: A_mo(LDA_mo,mo_num) + double precision, intent(out) :: A_ao(LDA_ao,ao_num) + double precision, allocatable :: T(:,:) + + allocate ( T(mo_num,ao_num) ) + + call dgemm('N','T', mo_num, ao_num, mo_num, & + 1.d0, A_mo,size(A_mo,1), & + mo_coef, size(mo_coef,1), & + 0.d0, T, size(T,1)) + + call dgemm('N','N', ao_num, ao_num, mo_num, & + 1.d0, mo_coef, size(mo_coef,1), & + T, size(T,1), & + 0.d0, A_ao, size(A_ao,1)) + + deallocate(T) +end + BEGIN_PROVIDER [ double precision, S_mo_coef, (ao_num, mo_num) ] implicit none BEGIN_DOC From c53b3ebadecbb4dc4550d6feb4e4ec5220d3eb33 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Wed, 9 Jan 2019 19:16:58 +0100 Subject: [PATCH 2/6] renaming massive on one e density --- REPLACE | 36 +++ docs/source/modules/aux_quantities.rst | 10 +- docs/source/modules/cipsi.rst | 14 + docs/source/modules/davidson.rst | 10 +- docs/source/modules/density_for_dft.rst | 60 ++-- docs/source/modules/determinants.rst | 136 ++++----- docs/source/modules/dft_utils_in_r.rst | 138 ++++----- docs/source/modules/dft_utils_one_e.rst | 22 +- docs/source/modules/fci.rst | 31 ++ docs/source/modules/hartree_fock.rst | 87 ++++++ docs/source/modules/iterations.rst | 2 +- docs/source/modules/kohn_sham.rst | 267 +----------------- docs/source/modules/kohn_sham_rs.rst | 166 ++++++++++- docs/source/modules/mo_basis.rst | 6 +- docs/source/modules/mo_one_e_ints.rst | 16 +- docs/source/modules/scf_utils.rst | 4 +- docs/source/modules/tools.rst | 20 +- .../programmers_guide/index_providers.rst | 73 ++--- scripts/qp_name | 2 + src/aux_quantities/EZFIO.cfg | 8 +- src/aux_quantities/README.rst | 2 +- src/density_for_dft/density_for_dft.irp.f | 60 ++-- src/determinants/density_matrix.irp.f | 88 +++--- src/determinants/psi_energy_mono_elec.irp.f | 8 +- src/dft_utils_in_r/README.rst | 2 +- src/dft_utils_in_r/dm_in_r.irp.f | 74 ++--- src/dft_utils_one_e/e_xc.irp.f | 12 +- src/dft_utils_one_e/one_e_energy_dft.irp.f | 8 +- src/dft_utils_one_e/pot_ao.irp.f | 12 +- src/dft_utils_one_e/pot_general.irp.f | 6 +- src/dft_utils_one_e/sr_coulomb.irp.f | 6 +- src/dft_utils_one_e/sr_exc.irp.f | 12 +- src/dft_utils_one_e/sr_pot_ao.irp.f | 12 +- src/kohn_sham/ks_enery.irp.f | 8 +- src/kohn_sham_rs/rs_ks_energy.irp.f | 8 +- src/kohn_sham_rs/rs_ks_scf.irp.f | 2 +- ..._one_body_dm.irp.f => save_one_e_dm.irp.f} | 8 +- 37 files changed, 775 insertions(+), 661 deletions(-) rename src/tools/{save_one_body_dm.irp.f => save_one_e_dm.irp.f} (56%) diff --git a/REPLACE b/REPLACE index 0a6e2a64..0d464239 100644 --- a/REPLACE +++ b/REPLACE @@ -144,3 +144,39 @@ qp_name ao_bi_elec_integral_beta -r ao_two_e_integral_beta qp_name ao_bi_elec_integral_alpha -r ao_two_e_integral_alpha qp_name ao_bi_elec_integral_alpha_tmp -r ao_two_e_integral_alpha_tmp qp_name ao_bi_elec_integral_beta_tmp -r ao_two_e_integral_beta_tmp +qp_name data_one_body_alpha_dm_mo -r data_one_body_dm_alpha_mo +qp_name data_one_body_beta_dm_mo -r data_one_body_dm_beta_mo +qp_name one_body_dm_alpha_ao_for_dft -r one_e_dm_alpha_ao_for_dft +qp_name one_body_dm_alpha_at_r -r one_e_dm_alpha_at_r +qp_name one_body_dm_ao_alpha -r one_e_dm_ao_alpha +qp_name one_body_dm_ao_beta -r one_e_dm_ao_beta +qp_name one_body_dm_average_mo_for_dft -r one_e_dm_average_mo_for_dft +qp_name one_body_dm_beta_ao_for_dft -r one_e_dm_beta_ao_for_dft +qp_name one_body_dm_beta_at_r -r one_e_dm_beta_at_r +qp_name one_body_dm_dagger_mo_spin_index -r one_e_dm_dagger_mo_spin_index +qp_name one_body_dm_mo -r one_e_dm_mo +qp_name one_body_dm_mo_alpha -r one_e_dm_mo_alpha +qp_name one_body_dm_mo_alpha_average -r one_e_dm_mo_alpha_average +qp_name one_body_dm_mo_alpha_for_dft -r one_e_dm_mo_alpha_for_dft +qp_name one_body_dm_mo_beta -r one_e_dm_mo_beta +qp_name one_body_dm_mo_beta_average -r one_e_dm_mo_beta_average +qp_name one_body_dm_mo_beta_for_dft -r one_e_dm_mo_beta_for_dft +qp_name one_body_dm_mo_diff -r one_e_dm_mo_diff +qp_name one_body_dm_mo_for_dft -r one_e_dm_mo_for_dft +qp_name one_body_dm_mo_spin_index -r one_e_dm_mo_spin_index +qp_name one_body_grad_2_dm_alpha_at_r -r one_e_grad_2_dm_alpha_at_r +qp_name one_body_grad_2_dm_beta_at_r -r one_e_grad_2_dm_beta_at_r +qp_name one_body_spin_density_ao -r one_e_spin_density_ao +qp_name one_body_spin_density_mo -r one_e_spin_density_mo +qp_name one_electron_energy -r one_e_energy +qp_name one_dm_alpha_in_r -r one_e_dm_alpha_in_r +qp_name one_dm_and_grad_alpha_in_r -r one_e_dm_and_grad_alpha_in_r +qp_name one_dm_and_grad_beta_in_r -r one_e_dm_and_grad_beta_in_r +qp_name one_dm_beta_in_r -r one_e_dm_beta_in_r +qp_name ezfio_set_aux_quantities_data_one_body_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_alpha_dm_mo +qp_name ezfio_set_aux_quantities_data_one_body_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_beta_dm_mo +qp_name data_one_body_dm_alpha_mo -r data_one_e_dm_alpha_mo +qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo +qp_name save_one_body_dm -r save_one_e_dm +qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo +qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo diff --git a/docs/source/modules/aux_quantities.rst b/docs/source/modules/aux_quantities.rst index ba56eac3..8c342696 100644 --- a/docs/source/modules/aux_quantities.rst +++ b/docs/source/modules/aux_quantities.rst @@ -18,7 +18,7 @@ on the density in order to speed up convergence. The main providers of that module are: -* `data_one_body_alpha_dm_mo` and `data_one_body_beta_dm_mo` which are the +* `data_one_e_dm_alpha_mo` and `data_one_e_dm_beta_mo` which are the one-body alpha and beta densities which are necessary read from the EZFIO folder. @@ -41,12 +41,12 @@ EZFIO parameters Projected energy computed with the wave function -.. option:: data_one_body_alpha_dm_mo +.. option:: data_one_e_dm_alpha_mo - Alpha one body density matrix on the MO basis computed with the wave function + Alpha one body density matrix on the |MO| basis computed with the wave function -.. option:: data_one_body_beta_dm_mo +.. option:: data_one_e_dm_beta_mo - Beta one body density matrix on the MO basis computed with the wave function + Beta one body density matrix on the |MO| basis computed with the wave function diff --git a/docs/source/modules/cipsi.rst b/docs/source/modules/cipsi.rst index 935a8933..bf084f35 100644 --- a/docs/source/modules/cipsi.rst +++ b/docs/source/modules/cipsi.rst @@ -755,6 +755,20 @@ Subroutines / functions +.. c:function:: remove_duplicates_in_selection_buffer + + .. code:: text + + subroutine remove_duplicates_in_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + .. c:function:: run_cipsi .. code:: text diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst index dbc7f628..f2d9fbe7 100644 --- a/docs/source/modules/davidson.rst +++ b/docs/source/modules/davidson.rst @@ -449,7 +449,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -465,7 +465,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -481,7 +481,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -497,7 +497,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -513,7 +513,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst index 2c5db607..ecae22f2 100644 --- a/docs/source/modules/density_for_dft.rst +++ b/docs/source/modules/density_for_dft.rst @@ -39,25 +39,53 @@ Providers --------- -.. c:var:: one_body_dm_alpha_ao_for_dft +.. c:var:: one_body_dm_mo_alpha_one_det .. code:: text - double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) - double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states) File: :file:`density_for_dft.irp.f` - one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + One body density matrix on the |MO| basis for a single determinant -.. c:var:: one_body_dm_average_mo_for_dft +.. c:var:: one_body_dm_mo_beta_one_det .. code:: text - double precision, allocatable :: one_body_dm_average_mo_for_dft (mo_num,mo_num) + double precision, allocatable :: one_body_dm_mo_alpha_one_det (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta_one_det (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + One body density matrix on the |MO| basis for a single determinant + + + + +.. c:var:: one_e_dm_alpha_ao_for_dft + + .. code:: text + + double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_e_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + File: :file:`density_for_dft.irp.f` + + one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft + + + + +.. c:var:: one_e_dm_average_mo_for_dft + + .. code:: text + + double precision, allocatable :: one_e_dm_average_mo_for_dft (mo_num,mo_num) File: :file:`density_for_dft.irp.f` @@ -66,25 +94,25 @@ Providers -.. c:var:: one_body_dm_beta_ao_for_dft +.. c:var:: one_e_dm_beta_ao_for_dft .. code:: text - double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) - double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_e_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_e_dm_beta_ao_for_dft (ao_num,ao_num,N_states) File: :file:`density_for_dft.irp.f` - one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft -.. c:var:: one_body_dm_mo_alpha_for_dft +.. c:var:: one_e_dm_mo_alpha_for_dft .. code:: text - double precision, allocatable :: one_body_dm_mo_alpha_for_dft (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_alpha_for_dft (mo_num,mo_num,N_states) File: :file:`density_for_dft.irp.f` @@ -93,11 +121,11 @@ Providers -.. c:var:: one_body_dm_mo_beta_for_dft +.. c:var:: one_e_dm_mo_beta_for_dft .. code:: text - double precision, allocatable :: one_body_dm_mo_beta_for_dft (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_beta_for_dft (mo_num,mo_num,N_states) File: :file:`density_for_dft.irp.f` @@ -106,11 +134,11 @@ Providers -.. c:var:: one_body_dm_mo_for_dft +.. c:var:: one_e_dm_mo_for_dft .. code:: text - double precision, allocatable :: one_body_dm_mo_for_dft (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_for_dft (mo_num,mo_num,N_states) File: :file:`density_for_dft.irp.f` diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst index c2d56042..3839e24e 100644 --- a/docs/source/modules/determinants.rst +++ b/docs/source/modules/determinants.rst @@ -451,7 +451,7 @@ Providers integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) integer :: n_det_alpha_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\alpha` determinants @@ -465,7 +465,7 @@ Providers integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) integer :: n_det_beta_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\beta` determinants @@ -550,12 +550,12 @@ Providers -.. c:var:: one_body_dm_ao_alpha +.. c:var:: one_e_dm_ao_alpha .. code:: text - double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) - double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num) File: :file:`density_matrix.irp.f` @@ -564,12 +564,12 @@ Providers -.. c:var:: one_body_dm_ao_beta +.. c:var:: one_e_dm_ao_beta .. code:: text - double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) - double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_e_dm_ao_beta (ao_num,ao_num) File: :file:`density_matrix.irp.f` @@ -578,11 +578,11 @@ Providers -.. c:var:: one_body_dm_dagger_mo_spin_index +.. c:var:: one_e_dm_dagger_mo_spin_index .. code:: text - double precision, allocatable :: one_body_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2) + double precision, allocatable :: one_e_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2) File: :file:`density_matrix.irp.f` @@ -591,11 +591,11 @@ Providers -.. c:var:: one_body_dm_mo +.. c:var:: one_e_dm_mo .. code:: text - double precision, allocatable :: one_body_dm_mo (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo (mo_num,mo_num) File: :file:`density_matrix.irp.f` @@ -604,12 +604,12 @@ Providers -.. c:var:: one_body_dm_mo_alpha +.. c:var:: one_e_dm_mo_alpha .. code:: text - double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) - double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states) File: :file:`density_matrix.irp.f` @@ -618,12 +618,12 @@ Providers -.. c:var:: one_body_dm_mo_alpha_average +.. c:var:: one_e_dm_mo_alpha_average .. code:: text - double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) - double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num) File: :file:`density_matrix.irp.f` @@ -632,12 +632,12 @@ Providers -.. c:var:: one_body_dm_mo_beta +.. c:var:: one_e_dm_mo_beta .. code:: text - double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) - double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_e_dm_mo_beta (mo_num,mo_num,N_states) File: :file:`density_matrix.irp.f` @@ -646,12 +646,12 @@ Providers -.. c:var:: one_body_dm_mo_beta_average +.. c:var:: one_e_dm_mo_beta_average .. code:: text - double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) - double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_e_dm_mo_beta_average (mo_num,mo_num) File: :file:`density_matrix.irp.f` @@ -660,11 +660,11 @@ Providers -.. c:var:: one_body_dm_mo_diff +.. c:var:: one_e_dm_mo_diff .. code:: text - double precision, allocatable :: one_body_dm_mo_diff (mo_num,mo_num,2:N_states) + double precision, allocatable :: one_e_dm_mo_diff (mo_num,mo_num,2:N_states) File: :file:`density_matrix.irp.f` @@ -673,11 +673,11 @@ Providers -.. c:var:: one_body_dm_mo_spin_index +.. c:var:: one_e_dm_mo_spin_index .. code:: text - double precision, allocatable :: one_body_dm_mo_spin_index (mo_num,mo_num,N_states,2) + double precision, allocatable :: one_e_dm_mo_spin_index (mo_num,mo_num,N_states,2) File: :file:`density_matrix.irp.f` @@ -686,39 +686,11 @@ Providers -.. c:var:: one_body_single_double_dm_mo_alpha +.. c:var:: one_e_spin_density_ao .. code:: text - double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) - double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) - - File: :file:`density_matrix.irp.f` - - :math:`\alpha` and :math:`\beta` one-body density matrix for each state - - - - -.. c:var:: one_body_single_double_dm_mo_beta - - .. code:: text - - double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) - double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) - - File: :file:`density_matrix.irp.f` - - :math:`\alpha` and :math:`\beta` one-body density matrix for each state - - - - -.. c:var:: one_body_spin_density_ao - - .. code:: text - - double precision, allocatable :: one_body_spin_density_ao (ao_num,ao_num) + double precision, allocatable :: one_e_spin_density_ao (ao_num,ao_num) File: :file:`density_matrix.irp.f` @@ -727,11 +699,11 @@ Providers -.. c:var:: one_body_spin_density_mo +.. c:var:: one_e_spin_density_mo .. code:: text - double precision, allocatable :: one_body_spin_density_mo (mo_num,mo_num) + double precision, allocatable :: one_e_spin_density_mo (mo_num,mo_num) File: :file:`density_matrix.irp.f` @@ -1215,7 +1187,7 @@ Providers integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) integer :: n_det_alpha_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\alpha` determinants @@ -1242,7 +1214,7 @@ Providers integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) integer :: n_det_beta_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\beta` determinants @@ -1335,7 +1307,7 @@ Providers psi_energy_h_core = :math:`\langle \Psi | h_{core} |\Psi \rangle` - computed using the :c:data:`one_body_dm_mo_alpha` + :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals` + computed using the :c:data:`one_e_dm_mo_alpha` + :c:data:`one_e_dm_mo_beta` and :c:data:`mo_one_e_integrals` @@ -2337,7 +2309,7 @@ Subroutines / functions subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2355,7 +2327,7 @@ Subroutines / functions subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2373,7 +2345,7 @@ Subroutines / functions subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2391,7 +2363,7 @@ Subroutines / functions subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2445,7 +2417,7 @@ Subroutines / functions subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2463,7 +2435,7 @@ Subroutines / functions subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2481,7 +2453,7 @@ Subroutines / functions subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2539,7 +2511,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_2(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2559,7 +2531,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_3(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2579,7 +2551,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_4(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2599,7 +2571,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_N_int(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2619,7 +2591,7 @@ Subroutines / functions subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -3273,6 +3245,20 @@ Subroutines / functions +.. c:function:: pouet + + .. code:: text + + subroutine pouet + + File: :file:`test.irp.f` + + + + + + + .. c:function:: pull_pt2 .. code:: text diff --git a/docs/source/modules/dft_utils_in_r.rst b/docs/source/modules/dft_utils_in_r.rst index bf815025..66fad90b 100644 --- a/docs/source/modules/dft_utils_in_r.rst +++ b/docs/source/modules/dft_utils_in_r.rst @@ -16,7 +16,7 @@ The main providers for this module are: * `aos_in_r_array`: values of the |AO| basis on the grid point. * `mos_in_r_array`: values of the |MO| basis on the grid point. -* `one_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points. +* `one_e_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points. @@ -195,72 +195,26 @@ Providers -.. c:var:: one_body_dm_alpha_at_r +.. c:var:: one_e_dm_alpha_at_r .. code:: text - double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states) File: :file:`dm_in_r.irp.f` - one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_e_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number -.. c:var:: one_body_dm_beta_at_r +.. c:var:: one_e_dm_alpha_in_r .. code:: text - double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) - - File: :file:`dm_in_r.irp.f` - - one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number - - - - -.. c:var:: one_body_grad_2_dm_alpha_at_r - - .. code:: text - - double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) - - File: :file:`dm_in_r.irp.f` - - one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number - - - - -.. c:var:: one_body_grad_2_dm_beta_at_r - - .. code:: text - - double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) - - File: :file:`dm_in_r.irp.f` - - one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number - - - - -.. c:var:: one_dm_alpha_in_r - - .. code:: text - - double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) - double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) File: :file:`dm_in_r.irp.f` @@ -269,44 +223,58 @@ Providers -.. c:var:: one_dm_and_grad_alpha_in_r +.. c:var:: one_e_dm_and_grad_alpha_in_r .. code:: text - double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) File: :file:`dm_in_r.irp.f` - one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number -.. c:var:: one_dm_and_grad_beta_in_r +.. c:var:: one_e_dm_and_grad_beta_in_r .. code:: text - double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) - double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) File: :file:`dm_in_r.irp.f` - one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number -.. c:var:: one_dm_beta_in_r +.. c:var:: one_e_dm_beta_at_r .. code:: text - double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) - double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_e_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_e_dm_beta_in_r + + .. code:: text + + double precision, allocatable :: one_e_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_e_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) File: :file:`dm_in_r.irp.f` @@ -315,6 +283,38 @@ Providers +.. c:var:: one_e_grad_2_dm_alpha_at_r + + .. code:: text + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_e_grad_2_dm_beta_at_r + + .. code:: text + + double precision, allocatable :: one_e_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_e_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_e_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + Subroutines / functions ----------------------- diff --git a/docs/source/modules/dft_utils_one_e.rst b/docs/source/modules/dft_utils_one_e.rst index 09708468..e07bb442 100644 --- a/docs/source/modules/dft_utils_one_e.rst +++ b/docs/source/modules/dft_utils_one_e.rst @@ -1090,14 +1090,12 @@ Providers .. code:: text - double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range correlation alpha/beta potentials with LDA functional on the |AO| basis @@ -1122,14 +1120,12 @@ Providers .. code:: text - double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range correlation alpha/beta potentials with LDA functional on the |AO| basis @@ -1156,12 +1152,10 @@ Providers double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range exchange alpha/beta potentials with LDA functional on the |AO| basis @@ -1188,12 +1182,10 @@ Providers double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range exchange alpha/beta potentials with LDA functional on the |AO| basis @@ -1352,7 +1344,7 @@ Providers File: :file:`one_e_energy_dft.irp.f` - kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft @@ -1367,7 +1359,7 @@ Providers File: :file:`one_e_energy_dft.irp.f` - kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft @@ -1382,7 +1374,7 @@ Providers File: :file:`one_e_energy_dft.irp.f` - kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft + kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst index 35f79f49..ce23a9b7 100644 --- a/docs/source/modules/fci.rst +++ b/docs/source/modules/fci.rst @@ -36,6 +36,23 @@ EZFIO parameters +Providers +--------- + + +.. c:var:: nthreads_pt2 + + .. code:: text + + integer :: nthreads_pt2 + + File: :file:`environment.irp.f` + + Number of threads for Davidson + + + + Subroutines / functions ----------------------- @@ -69,6 +86,20 @@ Subroutines / functions +.. c:function:: run + + .. code:: text + + subroutine run + + File: :file:`pt2.irp.f` + + + + + + + .. c:function:: save_energy .. code:: text diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst index 2005e9af..dcfa30cb 100644 --- a/docs/source/modules/hartree_fock.rst +++ b/docs/source/modules/hartree_fock.rst @@ -63,6 +63,79 @@ Providers --------- +.. c:var:: ao_two_e_integral_alpha + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: ao_two_e_integral_beta + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: extra_e_contrib_density + + .. code:: text + + double precision :: extra_e_contrib_density + + File: :file:`hf_energy.irp.f` + + Extra contribution to the SCF energy coming from the density. + + For a Hartree-Fock calculation: extra_e_contrib_density = 0 + + For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - trace of the V_xc potential + + + + +.. c:var:: fock_matrix_ao_alpha + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: fock_matrix_ao_beta + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + .. c:var:: hf_energy .. code:: text @@ -113,6 +186,20 @@ Subroutines / functions +.. c:function:: create_guess + + .. code:: text + + subroutine create_guess + + File: :file:`scf.irp.f` + + Create a MO guess if no MOs are present in the EZFIO directory + + + + + .. c:function:: scf .. code:: text diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst index 81b89008..ed35c921 100644 --- a/docs/source/modules/iterations.rst +++ b/docs/source/modules/iterations.rst @@ -91,7 +91,7 @@ Subroutines / functions .. code:: text - subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_) + subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_,n_st) File: :file:`print_summary.irp.f` diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst index 1dac5f0f..d5939021 100644 --- a/docs/source/modules/kohn_sham.rst +++ b/docs/source/modules/kohn_sham.rst @@ -52,236 +52,13 @@ Providers --------- -.. c:var:: ao_potential_alpha_xc - - .. code:: text - - double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) - double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: ao_potential_beta_xc - - .. code:: text - - double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) - double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: ao_two_e_integral_alpha - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) - double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: ao_two_e_integral_beta - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) - double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: e_correlation_dft - - .. code:: text - - double precision :: e_correlation_dft - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: e_exchange_dft - - .. code:: text - - double precision :: e_exchange_dft - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: extra_e_contrib_density - - .. code:: text - - double precision :: extra_e_contrib_density - - File: :file:`ks_enery.irp.f` - - Extra contribution to the SCF energy coming from the density. - - For a Hartree-Fock calculation: extra_e_contrib_density = 0 - - For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - 1/2 trace of the V_xc potential - - - - -.. c:var:: fock_matrix_alpha_no_xc_ao - - .. code:: text - - double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) - double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Mono electronic an Coulomb matrix in ao basis set - - - - -.. c:var:: fock_matrix_ao_alpha - - .. code:: text - - double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) - double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: fock_matrix_ao_beta - - .. code:: text - - double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) - double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: fock_matrix_beta_no_xc_ao - - .. code:: text - - double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) - double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Mono electronic an Coulomb matrix in ao basis set - - - - -.. c:var:: fock_matrix_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - .. c:var:: ks_energy .. code:: text double precision :: ks_energy double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: one_electron_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: trace_potential_xc - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: two_electron_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy + double precision :: one_e_energy double precision :: fock_matrix_energy double precision :: trace_potential_xc @@ -297,48 +74,6 @@ Subroutines / functions -.. c:function:: check_coherence_functional - - .. code:: text - - subroutine check_coherence_functional - - File: :file:`ks_scf.irp.f` - - - - - - - -.. c:function:: create_guess - - .. code:: text - - subroutine create_guess - - File: :file:`ks_scf.irp.f` - - Create a MO guess if no MOs are present in the EZFIO directory - - - - - -.. c:function:: run - - .. code:: text - - subroutine run - - File: :file:`ks_scf.irp.f` - - Run SCF calculation - - - - - .. c:function:: srs_ks_cf .. code:: text diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst index 9ab0aa5e..f918b93d 100644 --- a/docs/source/modules/kohn_sham_rs.rst +++ b/docs/source/modules/kohn_sham_rs.rst @@ -60,13 +60,163 @@ Providers --------- +.. c:var:: ao_potential_alpha_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: ao_potential_beta_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_correlation_dft + + .. code:: text + + double precision :: e_correlation_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_exchange_dft + + .. code:: text + + double precision :: e_exchange_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: fock_matrix_alpha_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_beta_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: one_e_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + .. c:var:: rs_ks_energy .. code:: text double precision :: rs_ks_energy double precision :: two_electron_energy - double precision :: one_electron_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: trace_potential_xc + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_e_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: two_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_e_energy double precision :: fock_matrix_energy double precision :: trace_potential_xc @@ -82,6 +232,20 @@ Subroutines / functions +.. c:function:: check_coherence_functional + + .. code:: text + + subroutine check_coherence_functional + + File: :file:`rs_ks_scf.irp.f` + + + + + + + .. c:function:: rs_ks_scf .. code:: text diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst index bf647f5c..044702fe 100644 --- a/docs/source/modules/mo_basis.rst +++ b/docs/source/modules/mo_basis.rst @@ -329,15 +329,15 @@ Subroutines / functions -.. c:function:: reorder_active_orb +.. c:function:: reorder_core_orb .. code:: text - subroutine reorder_active_orb + subroutine reorder_core_orb File: :file:`track_orb.irp.f` - routines that takes the current :c:data:`mo_coef` and reorder the active orbitals (see :c:data:`list_act` and :c:data:`n_act_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` + routines that takes the current :c:data:`mo_coef` and reorder the core orbitals (see :c:data:`list_core` and :c:data:`n_core_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` diff --git a/docs/source/modules/mo_one_e_ints.rst b/docs/source/modules/mo_one_e_ints.rst index 167b62c8..98ea57b7 100644 --- a/docs/source/modules/mo_one_e_ints.rst +++ b/docs/source/modules/mo_one_e_ints.rst @@ -268,7 +268,21 @@ Subroutines / functions Transform A from the MO basis to the AO basis - (S.C).A_mo.(S.C)t + :math:`(S.C).A_{mo}.(S.C)^\dagger` + + + + + +.. c:function:: mo_to_ao_no_overlap + + .. code:: text + + subroutine mo_to_ao_no_overlap(A_mo,LDA_mo,A_ao,LDA_ao) + + File: :file:`ao_to_mo.irp.f` + + :math:`C.A_{mo}.C^\dagger` diff --git a/docs/source/modules/scf_utils.rst b/docs/source/modules/scf_utils.rst index d9ec8f4f..8866bd75 100644 --- a/docs/source/modules/scf_utils.rst +++ b/docs/source/modules/scf_utils.rst @@ -97,9 +97,9 @@ EZFIO parameters Calculated HF energy -.. option:: no_oa_or_av_opt +.. option:: frozen_orb_scf - If true, leave the active orbitals untouched in the SCF procedure + If true, leave untouched all the orbitals defined as core and optimize all the orbitals defined as active with qp_set_mo_class Default: False diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst index 8ce52439..0322a156 100644 --- a/docs/source/modules/tools.rst +++ b/docs/source/modules/tools.rst @@ -145,7 +145,25 @@ Subroutines / functions programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. - Then, the global variable data_one_body_alpha_dm_mo and data_one_body_beta_dm_mo will automatically read the density in a further calculation. + Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read the density in a further calculation. + + This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). + + + + + +.. c:function:: save_one_e_dm + + .. code:: text + + subroutine save_one_e_dm + + File: :file:`save_one_e_dm.irp.f` + + programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. + + Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read the density in a further calculation. This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index 01b305aa..42ddd368 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -150,8 +150,10 @@ Index of Providers * :c:data:`damping_for_rs_dft` * :c:data:`data_energy_proj` * :c:data:`data_energy_var` -* :c:data:`data_one_body_alpha_dm_mo` -* :c:data:`data_one_body_beta_dm_mo` +* :c:data:`data_one_body_dm_alpha_mo` +* :c:data:`data_one_body_dm_beta_mo` +* :c:data:`data_one_e_dm_alpha_mo` +* :c:data:`data_one_e_dm_beta_mo` * :c:data:`davidson_criterion` * :c:data:`davidson_sze_max` * :c:data:`degree_max_generators` @@ -231,6 +233,7 @@ Index of Providers * :c:data:`fock_wee_closed_shell` * :c:data:`fps_spf_matrix_ao` * :c:data:`fps_spf_matrix_mo` +* :c:data:`frozen_orb_scf` * :c:data:`full_ijkl_bitmask` * :c:data:`full_ijkl_bitmask_4` * :c:data:`gauleg_t2` @@ -433,11 +436,11 @@ Index of Providers * :c:data:`n_virt_orb` * :c:data:`n_virt_orb_allocate` * :c:data:`no_ivvv_integrals` -* :c:data:`no_oa_or_av_opt` * :c:data:`no_vvv_integrals` * :c:data:`no_vvvv_integrals` * :c:data:`nproc` * :c:data:`nthreads_davidson` +* :c:data:`nthreads_pt2` * :c:data:`nucl_aos` * :c:data:`nucl_aos_transposed` * :c:data:`nucl_charge` @@ -456,35 +459,35 @@ Index of Providers * :c:data:`nucl_num` * :c:data:`nucl_num_shell_aos` * :c:data:`nuclear_repulsion` -* :c:data:`one_body_dm_alpha_ao_for_dft` -* :c:data:`one_body_dm_alpha_at_r` -* :c:data:`one_body_dm_ao_alpha` -* :c:data:`one_body_dm_ao_beta` -* :c:data:`one_body_dm_average_mo_for_dft` -* :c:data:`one_body_dm_beta_ao_for_dft` -* :c:data:`one_body_dm_beta_at_r` -* :c:data:`one_body_dm_dagger_mo_spin_index` -* :c:data:`one_body_dm_mo` -* :c:data:`one_body_dm_mo_alpha` -* :c:data:`one_body_dm_mo_alpha_average` -* :c:data:`one_body_dm_mo_alpha_for_dft` -* :c:data:`one_body_dm_mo_beta` -* :c:data:`one_body_dm_mo_beta_average` -* :c:data:`one_body_dm_mo_beta_for_dft` -* :c:data:`one_body_dm_mo_diff` -* :c:data:`one_body_dm_mo_for_dft` -* :c:data:`one_body_dm_mo_spin_index` -* :c:data:`one_body_grad_2_dm_alpha_at_r` -* :c:data:`one_body_grad_2_dm_beta_at_r` -* :c:data:`one_body_single_double_dm_mo_alpha` -* :c:data:`one_body_single_double_dm_mo_beta` -* :c:data:`one_body_spin_density_ao` -* :c:data:`one_body_spin_density_mo` -* :c:data:`one_dm_alpha_in_r` -* :c:data:`one_dm_and_grad_alpha_in_r` -* :c:data:`one_dm_and_grad_beta_in_r` -* :c:data:`one_dm_beta_in_r` -* :c:data:`one_electron_energy` +* :c:data:`one_body_dm_mo_alpha_one_det` +* :c:data:`one_body_dm_mo_beta_one_det` +* :c:data:`one_e_dm_alpha_ao_for_dft` +* :c:data:`one_e_dm_alpha_at_r` +* :c:data:`one_e_dm_alpha_in_r` +* :c:data:`one_e_dm_and_grad_alpha_in_r` +* :c:data:`one_e_dm_and_grad_beta_in_r` +* :c:data:`one_e_dm_ao_alpha` +* :c:data:`one_e_dm_ao_beta` +* :c:data:`one_e_dm_average_mo_for_dft` +* :c:data:`one_e_dm_beta_ao_for_dft` +* :c:data:`one_e_dm_beta_at_r` +* :c:data:`one_e_dm_beta_in_r` +* :c:data:`one_e_dm_dagger_mo_spin_index` +* :c:data:`one_e_dm_mo` +* :c:data:`one_e_dm_mo_alpha` +* :c:data:`one_e_dm_mo_alpha_average` +* :c:data:`one_e_dm_mo_alpha_for_dft` +* :c:data:`one_e_dm_mo_beta` +* :c:data:`one_e_dm_mo_beta_average` +* :c:data:`one_e_dm_mo_beta_for_dft` +* :c:data:`one_e_dm_mo_diff` +* :c:data:`one_e_dm_mo_for_dft` +* :c:data:`one_e_dm_mo_spin_index` +* :c:data:`one_e_energy` +* :c:data:`one_e_grad_2_dm_alpha_at_r` +* :c:data:`one_e_grad_2_dm_beta_at_r` +* :c:data:`one_e_spin_density_ao` +* :c:data:`one_e_spin_density_mo` * :c:data:`only_expected_s2` * :c:data:`output_cpu_time_0` * :c:data:`output_wall_time_0` @@ -1110,6 +1113,7 @@ Index of Subroutines/Functions * :c:func:`mo_as_svd_vectors_of_mo_matrix` * :c:func:`mo_as_svd_vectors_of_mo_matrix_eig` * :c:func:`mo_to_ao` +* :c:func:`mo_to_ao_no_overlap` * :c:func:`mo_two_e_integral` * :c:func:`mo_two_e_integral_erf` * :c:func:`mo_two_e_integrals_erf_index` @@ -1169,6 +1173,7 @@ Index of Subroutines/Functions * :c:func:`perturb_buffer_moller_plesset` * :c:func:`perturb_buffer_moller_plesset_general` * :c:func:`perturb_buffer_qdpt` +* :c:func:`pouet` * :c:func:`primitive_value` * :c:func:`print_det` * :c:func:`print_e_conv` @@ -1213,8 +1218,9 @@ Index of Subroutines/Functions * :c:func:`read_dets` * :c:func:`recentered_poly2` * :c:func:`remove_duplicates_in_psi_det` +* :c:func:`remove_duplicates_in_selection_buffer` * :c:func:`remove_small_contributions` -* :c:func:`reorder_active_orb` +* :c:func:`reorder_core_orb` * :c:func:`repeat_all_e_corr` * :c:func:`reset_zmq_addresses` * :c:func:`resident_memory` @@ -1252,6 +1258,7 @@ Index of Subroutines/Functions * :c:func:`save_natorb` * :c:func:`save_natural_mos` * :c:func:`save_one_body_dm` +* :c:func:`save_one_e_dm` * :c:func:`save_ortho_mos` * :c:func:`save_ref_determinant` * :c:func:`save_wavefunction` diff --git a/scripts/qp_name b/scripts/qp_name index fb741c7e..1f7bb38f 100755 --- a/scripts/qp_name +++ b/scripts/qp_name @@ -90,6 +90,8 @@ def main(arguments): f.write(f_new) print "Done" + with open( os.path.join(QP_ROOT,"REPLACE"), 'a') as f: + print >>f, "qp_name "+" ".join(sys.argv[1:]) diff --git a/src/aux_quantities/EZFIO.cfg b/src/aux_quantities/EZFIO.cfg index e8e86deb..2e1c5b12 100644 --- a/src/aux_quantities/EZFIO.cfg +++ b/src/aux_quantities/EZFIO.cfg @@ -10,16 +10,16 @@ doc: Projected energy computed with the wave function interface: ezfio, provider size: (determinants.n_states) -[data_one_body_alpha_dm_mo] +[data_one_e_dm_alpha_mo] interface: ezfio, provider -doc: Alpha one body density matrix on the MO basis computed with the wave function +doc: Alpha one body density matrix on the |MO| basis computed with the wave function type: double precision size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states) -[data_one_body_beta_dm_mo] +[data_one_e_dm_beta_mo] interface: ezfio, provider -doc: Beta one body density matrix on the MO basis computed with the wave function +doc: Beta one body density matrix on the |MO| basis computed with the wave function type: double precision size: (mo_basis.mo_num,mo_basis.mo_num,determinants.n_states) diff --git a/src/aux_quantities/README.rst b/src/aux_quantities/README.rst index 333bca52..e35e3564 100644 --- a/src/aux_quantities/README.rst +++ b/src/aux_quantities/README.rst @@ -12,7 +12,7 @@ on the density in order to speed up convergence. The main providers of that module are: -* `data_one_body_alpha_dm_mo` and `data_one_body_beta_dm_mo` which are the +* `data_one_e_dm_alpha_mo` and `data_one_e_dm_beta_mo` which are the one-body alpha and beta densities which are necessary read from the EZFIO folder. diff --git a/src/density_for_dft/density_for_dft.irp.f b/src/density_for_dft/density_for_dft.irp.f index a1292286..5ad56a66 100644 --- a/src/density_for_dft/density_for_dft.irp.f +++ b/src/density_for_dft/density_for_dft.irp.f @@ -1,78 +1,78 @@ -BEGIN_PROVIDER [double precision, one_body_dm_mo_alpha_for_dft, (mo_num,mo_num, N_states)] +BEGIN_PROVIDER [double precision, one_e_dm_mo_alpha_for_dft, (mo_num,mo_num, N_states)] implicit none BEGIN_DOC ! density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density END_DOC double precision :: delta_alpha(mo_num,mo_num,N_states) if(density_for_dft .EQ. "damping_rs_dft")then - delta_alpha = one_body_dm_mo_alpha - data_one_body_alpha_dm_mo - one_body_dm_mo_alpha_for_dft = data_one_body_alpha_dm_mo + damping_for_rs_dft * delta_alpha + delta_alpha = one_e_dm_mo_alpha - data_one_e_dm_alpha_mo + one_e_dm_mo_alpha_for_dft = data_one_e_dm_alpha_mo + damping_for_rs_dft * delta_alpha else if (density_for_dft .EQ. "input_density")then - one_body_dm_mo_alpha_for_dft = data_one_body_alpha_dm_mo + one_e_dm_mo_alpha_for_dft = data_one_e_dm_alpha_mo else if (density_for_dft .EQ. "WFT")then provide mo_coef - one_body_dm_mo_alpha_for_dft = one_body_dm_mo_alpha + one_e_dm_mo_alpha_for_dft = one_e_dm_mo_alpha else if (density_for_dft .EQ. "KS")then provide mo_coef - one_body_dm_mo_alpha_for_dft = one_body_dm_mo_alpha_one_det + one_e_dm_mo_alpha_for_dft = one_body_dm_mo_alpha_one_det endif END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_mo_beta_for_dft, (mo_num,mo_num, N_states)] +BEGIN_PROVIDER [double precision, one_e_dm_mo_beta_for_dft, (mo_num,mo_num, N_states)] implicit none BEGIN_DOC ! density matrix for beta electrons in the MO basis used for all DFT calculations based on the density END_DOC double precision :: delta_beta(mo_num,mo_num,N_states) if(density_for_dft .EQ. "damping_rs_dft")then - delta_beta = one_body_dm_mo_beta - data_one_body_beta_dm_mo - one_body_dm_mo_beta_for_dft = data_one_body_beta_dm_mo + damping_for_rs_dft * delta_beta + delta_beta = one_e_dm_mo_beta - data_one_e_dm_beta_mo + one_e_dm_mo_beta_for_dft = data_one_e_dm_beta_mo + damping_for_rs_dft * delta_beta else if (density_for_dft .EQ. "input_density")then - one_body_dm_mo_beta_for_dft = data_one_body_beta_dm_mo + one_e_dm_mo_beta_for_dft = data_one_e_dm_beta_mo else if (density_for_dft .EQ. "WFT")then provide mo_coef - one_body_dm_mo_beta_for_dft = one_body_dm_mo_beta + one_e_dm_mo_beta_for_dft = one_e_dm_mo_beta else if (density_for_dft .EQ. "KS")then provide mo_coef - one_body_dm_mo_beta_for_dft = one_body_dm_mo_beta_one_det + one_e_dm_mo_beta_for_dft = one_body_dm_mo_beta_one_det endif END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_mo_for_dft, (mo_num,mo_num, N_states)] +BEGIN_PROVIDER [double precision, one_e_dm_mo_for_dft, (mo_num,mo_num, N_states)] implicit none - one_body_dm_mo_for_dft = one_body_dm_mo_beta_for_dft + one_body_dm_mo_alpha_for_dft + one_e_dm_mo_for_dft = one_e_dm_mo_beta_for_dft + one_e_dm_mo_alpha_for_dft END_PROVIDER -BEGIN_PROVIDER [double precision, one_body_dm_average_mo_for_dft, (mo_num,mo_num)] +BEGIN_PROVIDER [double precision, one_e_dm_average_mo_for_dft, (mo_num,mo_num)] implicit none integer :: i - one_body_dm_average_mo_for_dft = 0.d0 + one_e_dm_average_mo_for_dft = 0.d0 do i = 1, N_states - one_body_dm_average_mo_for_dft(:,:) += one_body_dm_mo_for_dft(:,:,i) * state_average_weight(i) + one_e_dm_average_mo_for_dft(:,:) += one_e_dm_mo_for_dft(:,:,i) * state_average_weight(i) enddo END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_dm_alpha_ao_for_dft, (ao_num,ao_num,N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_beta_ao_for_dft, (ao_num,ao_num,N_states) ] + BEGIN_PROVIDER [ double precision, one_e_dm_alpha_ao_for_dft, (ao_num,ao_num,N_states) ] +&BEGIN_PROVIDER [ double precision, one_e_dm_beta_ao_for_dft, (ao_num,ao_num,N_states) ] BEGIN_DOC -! one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft +! one body density matrix on the AO basis based on one_e_dm_mo_alpha_for_dft END_DOC implicit none integer :: istate double precision :: mo_alpha,mo_beta - one_body_dm_alpha_ao_for_dft = 0.d0 - one_body_dm_beta_ao_for_dft = 0.d0 + one_e_dm_alpha_ao_for_dft = 0.d0 + one_e_dm_beta_ao_for_dft = 0.d0 do istate = 1, N_states - call mo_to_ao_no_overlap( one_body_dm_mo_alpha_for_dft(1,1,istate), & - size(one_body_dm_mo_alpha_for_dft,1), & - one_body_dm_alpha_ao_for_dft(1,1,istate), & - size(one_body_dm_alpha_ao_for_dft,1) ) - call mo_to_ao_no_overlap( one_body_dm_mo_beta_for_dft(1,1,istate), & - size(one_body_dm_mo_beta_for_dft,1), & - one_body_dm_beta_ao_for_dft(1,1,istate), & - size(one_body_dm_beta_ao_for_dft,1) ) + call mo_to_ao_no_overlap( one_e_dm_mo_alpha_for_dft(1,1,istate), & + size(one_e_dm_mo_alpha_for_dft,1), & + one_e_dm_alpha_ao_for_dft(1,1,istate), & + size(one_e_dm_alpha_ao_for_dft,1) ) + call mo_to_ao_no_overlap( one_e_dm_mo_beta_for_dft(1,1,istate), & + size(one_e_dm_mo_beta_for_dft,1), & + one_e_dm_beta_ao_for_dft(1,1,istate), & + size(one_e_dm_beta_ao_for_dft,1) ) enddo END_PROVIDER diff --git a/src/determinants/density_matrix.irp.f b/src/determinants/density_matrix.irp.f index c096c0fc..64474c31 100644 --- a/src/determinants/density_matrix.irp.f +++ b/src/determinants/density_matrix.irp.f @@ -1,19 +1,19 @@ - BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha_average, (mo_num,mo_num) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta_average, (mo_num,mo_num) ] + BEGIN_PROVIDER [ double precision, one_e_dm_mo_alpha_average, (mo_num,mo_num) ] +&BEGIN_PROVIDER [ double precision, one_e_dm_mo_beta_average, (mo_num,mo_num) ] implicit none BEGIN_DOC ! $\alpha$ and $\beta$ one-body density matrix for each state END_DOC integer :: i - one_body_dm_mo_alpha_average = 0.d0 - one_body_dm_mo_beta_average = 0.d0 + one_e_dm_mo_alpha_average = 0.d0 + one_e_dm_mo_beta_average = 0.d0 do i = 1,N_states - one_body_dm_mo_alpha_average(:,:) += one_body_dm_mo_alpha(:,:,i) * state_average_weight(i) - one_body_dm_mo_beta_average(:,:) += one_body_dm_mo_beta(:,:,i) * state_average_weight(i) + one_e_dm_mo_alpha_average(:,:) += one_e_dm_mo_alpha(:,:,i) * state_average_weight(i) + one_e_dm_mo_beta_average(:,:) += one_e_dm_mo_beta(:,:,i) * state_average_weight(i) enddo END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_states) ] +BEGIN_PROVIDER [ double precision, one_e_dm_mo_diff, (mo_num,mo_num,2:N_states) ] implicit none BEGIN_DOC ! Difference of the one-body density matrix with respect to the ground state @@ -23,9 +23,9 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_state do istate=2,N_states do j=1,mo_num do i=1,mo_num - one_body_dm_mo_diff(i,j,istate) = & - one_body_dm_mo_alpha(i,j,istate) - one_body_dm_mo_alpha(i,j,1) +& - one_body_dm_mo_beta (i,j,istate) - one_body_dm_mo_beta (i,j,1) + one_e_dm_mo_diff(i,j,istate) = & + one_e_dm_mo_alpha(i,j,istate) - one_e_dm_mo_alpha(i,j,1) +& + one_e_dm_mo_beta (i,j,istate) - one_e_dm_mo_beta (i,j,1) enddo enddo enddo @@ -33,14 +33,14 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_diff, (mo_num,mo_num,2:N_state END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_states,2) ] +BEGIN_PROVIDER [ double precision, one_e_dm_mo_spin_index, (mo_num,mo_num,N_states,2) ] implicit none integer :: i,j,ispin,istate ispin = 1 do istate = 1, N_states do j = 1, mo_num do i = 1, mo_num - one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_alpha(i,j,istate) + one_e_dm_mo_spin_index(i,j,istate,ispin) = one_e_dm_mo_alpha(i,j,istate) enddo enddo enddo @@ -49,7 +49,7 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_s do istate = 1, N_states do j = 1, mo_num do i = 1, mo_num - one_body_dm_mo_spin_index(i,j,istate,ispin) = one_body_dm_mo_beta(i,j,istate) + one_e_dm_mo_spin_index(i,j,istate,ispin) = one_e_dm_mo_beta(i,j,istate) enddo enddo enddo @@ -57,16 +57,16 @@ BEGIN_PROVIDER [ double precision, one_body_dm_mo_spin_index, (mo_num,mo_num,N_s END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_num,N_states,2) ] +BEGIN_PROVIDER [ double precision, one_e_dm_dagger_mo_spin_index, (mo_num,mo_num,N_states,2) ] implicit none integer :: i,j,ispin,istate ispin = 1 do istate = 1, N_states do j = 1, mo_num - one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_alpha(j,j,istate) + one_e_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_e_dm_mo_alpha(j,j,istate) do i = j+1, mo_num - one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate) - one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_alpha(i,j,istate) + one_e_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_e_dm_mo_alpha(i,j,istate) + one_e_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_e_dm_mo_alpha(i,j,istate) enddo enddo enddo @@ -74,18 +74,18 @@ BEGIN_PROVIDER [ double precision, one_body_dm_dagger_mo_spin_index, (mo_num,mo_ ispin = 2 do istate = 1, N_states do j = 1, mo_num - one_body_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_body_dm_mo_beta(j,j,istate) + one_e_dm_dagger_mo_spin_index(j,j,istate,ispin) = 1 - one_e_dm_mo_beta(j,j,istate) do i = j+1, mo_num - one_body_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_body_dm_mo_beta(i,j,istate) - one_body_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_body_dm_mo_beta(i,j,istate) + one_e_dm_dagger_mo_spin_index(i,j,istate,ispin) = -one_e_dm_mo_beta(i,j,istate) + one_e_dm_dagger_mo_spin_index(j,i,istate,ispin) = -one_e_dm_mo_beta(i,j,istate) enddo enddo enddo END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_dm_mo_alpha, (mo_num,mo_num,N_states) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_mo_beta, (mo_num,mo_num,N_states) ] + BEGIN_PROVIDER [ double precision, one_e_dm_mo_alpha, (mo_num,mo_num,N_states) ] +&BEGIN_PROVIDER [ double precision, one_e_dm_mo_beta, (mo_num,mo_num,N_states) ] implicit none BEGIN_DOC ! $\alpha$ and $\beta$ one-body density matrix for each state @@ -103,13 +103,13 @@ END_PROVIDER PROVIDE psi_det - one_body_dm_mo_alpha = 0.d0 - one_body_dm_mo_beta = 0.d0 + one_e_dm_mo_alpha = 0.d0 + one_e_dm_mo_beta = 0.d0 !$OMP PARALLEL DEFAULT(NONE) & !$OMP PRIVATE(j,k,k_a,k_b,l,m,occ,ck, cl, ckl,phase,h1,h2,p1,p2,s1,s2, degree,exc,& !$OMP tmp_a, tmp_b, n_occ, krow, kcol, lrow, lcol, tmp_det, tmp_det2)& !$OMP SHARED(psi_det,psi_coef,N_int,N_states,elec_alpha_num, & - !$OMP elec_beta_num,one_body_dm_mo_alpha,one_body_dm_mo_beta,N_det,& + !$OMP elec_beta_num,one_e_dm_mo_alpha,one_e_dm_mo_beta,N_det,& !$OMP mo_num,psi_bilinear_matrix_rows,psi_bilinear_matrix_columns,& !$OMP psi_bilinear_matrix_transp_rows, psi_bilinear_matrix_transp_columns,& !$OMP psi_bilinear_matrix_order_reverse, psi_det_alpha_unique, psi_det_beta_unique,& @@ -168,7 +168,7 @@ END_PROVIDER !$OMP END DO NOWAIT !$OMP CRITICAL - one_body_dm_mo_alpha(:,:,:) = one_body_dm_mo_alpha(:,:,:) + tmp_a(:,:,:) + one_e_dm_mo_alpha(:,:,:) = one_e_dm_mo_alpha(:,:,:) + tmp_a(:,:,:) !$OMP END CRITICAL deallocate(tmp_a) @@ -223,7 +223,7 @@ END_PROVIDER enddo !$OMP END DO NOWAIT !$OMP CRITICAL - one_body_dm_mo_beta(:,:,:) = one_body_dm_mo_beta(:,:,:) + tmp_b(:,:,:) + one_e_dm_mo_beta(:,:,:) = one_e_dm_mo_beta(:,:,:) + tmp_b(:,:,:) !$OMP END CRITICAL deallocate(tmp_b) @@ -231,20 +231,20 @@ END_PROVIDER END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_dm_mo, (mo_num,mo_num) ] +BEGIN_PROVIDER [ double precision, one_e_dm_mo, (mo_num,mo_num) ] implicit none BEGIN_DOC ! One-body density matrix END_DOC - one_body_dm_mo = one_body_dm_mo_alpha_average + one_body_dm_mo_beta_average + one_e_dm_mo = one_e_dm_mo_alpha_average + one_e_dm_mo_beta_average END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_spin_density_mo, (mo_num,mo_num) ] +BEGIN_PROVIDER [ double precision, one_e_spin_density_mo, (mo_num,mo_num) ] implicit none BEGIN_DOC ! $\rho(\alpha) - \rho(\beta)$ END_DOC - one_body_spin_density_mo = one_body_dm_mo_alpha_average - one_body_dm_mo_beta_average + one_e_spin_density_mo = one_e_dm_mo_alpha_average - one_e_dm_mo_beta_average END_PROVIDER subroutine set_natural_mos @@ -257,7 +257,7 @@ subroutine set_natural_mos double precision, allocatable :: tmp(:,:) label = "Natural" - call mo_as_svd_vectors_of_mo_matrix_eig(one_body_dm_mo,size(one_body_dm_mo,1),mo_num,mo_num,mo_occ,label) + call mo_as_svd_vectors_of_mo_matrix_eig(one_e_dm_mo,size(one_e_dm_mo,1),mo_num,mo_num,mo_occ,label) soft_touch mo_occ end @@ -320,7 +320,7 @@ BEGIN_PROVIDER [ double precision, state_average_weight, (N_states) ] END_PROVIDER -BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ] +BEGIN_PROVIDER [ double precision, one_e_spin_density_ao, (ao_num,ao_num) ] BEGIN_DOC ! One body spin density matrix on the |AO| basis : $\rho_{AO}(\alpha) - \rho_{AO}(\beta)$ END_DOC @@ -328,14 +328,14 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ] integer :: i,j,k,l double precision :: dm_mo - one_body_spin_density_ao = 0.d0 + one_e_spin_density_ao = 0.d0 do k = 1, ao_num do l = 1, ao_num do i = 1, mo_num do j = 1, mo_num - dm_mo = one_body_spin_density_mo(j,i) + dm_mo = one_e_spin_density_mo(j,i) ! if(dabs(dm_mo).le.1.d-10)cycle - one_body_spin_density_ao(l,k) += mo_coef(k,i) * mo_coef(l,j) * dm_mo + one_e_spin_density_ao(l,k) += mo_coef(k,i) * mo_coef(l,j) * dm_mo enddo enddo @@ -344,8 +344,8 @@ BEGIN_PROVIDER [ double precision, one_body_spin_density_ao, (ao_num,ao_num) ] END_PROVIDER - BEGIN_PROVIDER [ double precision, one_body_dm_ao_alpha, (ao_num,ao_num) ] -&BEGIN_PROVIDER [ double precision, one_body_dm_ao_beta, (ao_num,ao_num) ] + BEGIN_PROVIDER [ double precision, one_e_dm_ao_alpha, (ao_num,ao_num) ] +&BEGIN_PROVIDER [ double precision, one_e_dm_ao_beta, (ao_num,ao_num) ] BEGIN_DOC ! One body density matrix on the |AO| basis : $\rho_{AO}(\alpha), \rho_{AO}(\beta)$. END_DOC @@ -353,17 +353,17 @@ END_PROVIDER integer :: i,j,k,l double precision :: mo_alpha,mo_beta - one_body_dm_ao_alpha = 0.d0 - one_body_dm_ao_beta = 0.d0 + one_e_dm_ao_alpha = 0.d0 + one_e_dm_ao_beta = 0.d0 do k = 1, ao_num do l = 1, ao_num do i = 1, mo_num do j = 1, mo_num - mo_alpha = one_body_dm_mo_alpha_average(j,i) - mo_beta = one_body_dm_mo_beta_average(j,i) + mo_alpha = one_e_dm_mo_alpha_average(j,i) + mo_beta = one_e_dm_mo_beta_average(j,i) ! if(dabs(dm_mo).le.1.d-10)cycle - one_body_dm_ao_alpha(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha - one_body_dm_ao_beta(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_beta + one_e_dm_ao_alpha(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha + one_e_dm_ao_beta(l,k) += mo_coef(k,i) * mo_coef(l,j) * mo_beta enddo enddo enddo diff --git a/src/determinants/psi_energy_mono_elec.irp.f b/src/determinants/psi_energy_mono_elec.irp.f index f5a17024..d4334c0b 100644 --- a/src/determinants/psi_energy_mono_elec.irp.f +++ b/src/determinants/psi_energy_mono_elec.irp.f @@ -6,14 +6,14 @@ BEGIN_DOC ! psi_energy_h_core = $\langle \Psi | h_{core} |\Psi \rangle$ ! -! computed using the :c:data:`one_body_dm_mo_alpha` + -! :c:data:`one_body_dm_mo_beta` and :c:data:`mo_one_e_integrals` +! computed using the :c:data:`one_e_dm_mo_alpha` + +! :c:data:`one_e_dm_mo_beta` and :c:data:`mo_one_e_integrals` END_DOC psi_energy_h_core = 0.d0 do i = 1, N_states do j = 1, mo_num do k = 1, mo_num - psi_energy_h_core(i) += mo_one_e_integrals(k,j) * (one_body_dm_mo_alpha(k,j,i) + one_body_dm_mo_beta(k,j,i)) + psi_energy_h_core(i) += mo_one_e_integrals(k,j) * (one_e_dm_mo_alpha(k,j,i) + one_e_dm_mo_beta(k,j,i)) enddo enddo enddo @@ -21,7 +21,7 @@ accu = 0.d0 do i = 1, N_states do j = 1, mo_num - accu += one_body_dm_mo_alpha(j,j,i) + one_body_dm_mo_beta(j,j,i) + accu += one_e_dm_mo_alpha(j,j,i) + one_e_dm_mo_beta(j,j,i) enddo accu = (elec_alpha_num + elec_beta_num ) / accu psi_energy_h_core(i) = psi_energy_h_core(i) * accu diff --git a/src/dft_utils_in_r/README.rst b/src/dft_utils_in_r/README.rst index d4c4a178..d183447c 100644 --- a/src/dft_utils_in_r/README.rst +++ b/src/dft_utils_in_r/README.rst @@ -10,5 +10,5 @@ The main providers for this module are: * `aos_in_r_array`: values of the |AO| basis on the grid point. * `mos_in_r_array`: values of the |MO| basis on the grid point. -* `one_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points. +* `one_e_dm_and_grad_alpha_in_r`: values of the density and its gradienst on the grid points. diff --git a/src/dft_utils_in_r/dm_in_r.irp.f b/src/dft_utils_in_r/dm_in_r.irp.f index f87397d8..0d5d182b 100644 --- a/src/dft_utils_in_r/dm_in_r.irp.f +++ b/src/dft_utils_in_r/dm_in_r.irp.f @@ -13,11 +13,11 @@ subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b) do istate = 1, N_states aos_array_bis = aos_array ! alpha density - call dgemv('N',ao_num,ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1) + call dgemv('N',ao_num,ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1) dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) ! beta density aos_array_bis = aos_array - call dgemv('N',ao_num,ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1) + call dgemv('N',ao_num,ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),ao_num,aos_array,1,0.d0,aos_array_bis,1) dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) enddo end @@ -40,11 +40,11 @@ subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array) do istate = 1, N_states aos_array_bis = aos_array ! alpha density - call dsymv('U',ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),size(one_body_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) + call dsymv('U',ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),size(one_e_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) ! beta density aos_array_bis = aos_array - call dsymv('U',ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),size(one_body_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) + call dsymv('U',ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),size(one_e_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) enddo end @@ -80,7 +80,7 @@ end do istate = 1, N_states ! alpha density ! aos_array_bis = \rho_ao * aos_array - call dsymv('U',ao_num,1.d0,one_body_dm_alpha_ao_for_dft(1,1,istate),size(one_body_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) + call dsymv('U',ao_num,1.d0,one_e_dm_alpha_ao_for_dft(1,1,istate),size(one_e_dm_alpha_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) dm_a(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) ! grad_dm(1) = \sum_i aos_grad_array(i,1) * aos_array_bis(i) @@ -91,7 +91,7 @@ end ! aos_grad_array_bis = \rho_ao * aos_grad_array ! beta density - call dsymv('U',ao_num,1.d0,one_body_dm_beta_ao_for_dft(1,1,istate),size(one_body_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) + call dsymv('U',ao_num,1.d0,one_e_dm_beta_ao_for_dft(1,1,istate),size(one_e_dm_beta_ao_for_dft,1),aos_array,1,0.d0,aos_array_bis,1) dm_b(istate) = u_dot_v(aos_array,aos_array_bis,ao_num) ! grad_dm(1) = \sum_i aos_grad_array(i,1) * aos_array_bis(i) @@ -103,8 +103,8 @@ end enddo end - BEGIN_PROVIDER [double precision, one_dm_alpha_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ] -&BEGIN_PROVIDER [double precision, one_dm_beta_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ] + BEGIN_PROVIDER [double precision, one_e_dm_alpha_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ] +&BEGIN_PROVIDER [double precision, one_e_dm_beta_in_r, (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) ] implicit none integer :: i,j,k,l,m,istate double precision :: contrib @@ -114,8 +114,8 @@ end do k = 1, n_points_radial_grid -1 do l = 1, n_points_integration_angular do istate = 1, N_States - one_dm_alpha_in_r(l,k,j,istate) = 0.d0 - one_dm_beta_in_r(l,k,j,istate) = 0.d0 + one_e_dm_alpha_in_r(l,k,j,istate) = 0.d0 + one_e_dm_beta_in_r(l,k,j,istate) = 0.d0 enddo r(1) = grid_points_per_atom(1,l,k,j) r(2) = grid_points_per_atom(2,l,k,j) @@ -124,8 +124,8 @@ end double precision :: dm_a(N_states),dm_b(N_states) call dm_dft_alpha_beta_at_r(r,dm_a,dm_b) do istate=1,N_states - one_dm_alpha_in_r(l,k,j,istate) = dm_a(istate) - one_dm_beta_in_r(l,k,j,istate) = dm_b(istate) + one_e_dm_alpha_in_r(l,k,j,istate) = dm_a(istate) + one_e_dm_beta_in_r(l,k,j,istate) = dm_b(istate) enddo enddo @@ -135,12 +135,12 @@ end END_PROVIDER - BEGIN_PROVIDER [double precision, one_body_dm_alpha_at_r, (n_points_final_grid,N_states) ] -&BEGIN_PROVIDER [double precision, one_body_dm_beta_at_r, (n_points_final_grid,N_states) ] + BEGIN_PROVIDER [double precision, one_e_dm_alpha_at_r, (n_points_final_grid,N_states) ] +&BEGIN_PROVIDER [double precision, one_e_dm_beta_at_r, (n_points_final_grid,N_states) ] implicit none BEGIN_DOC -! one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) -! one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) +! one_e_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) +! one_e_dm_beta_at_r(i,istate) = n_beta(r_i,istate) ! where r_i is the ith point of the grid and istate is the state number END_DOC integer :: i,istate @@ -153,24 +153,24 @@ END_PROVIDER r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) call dm_dft_alpha_beta_at_r(r,dm_a,dm_b) - one_body_dm_alpha_at_r(i,istate) = dm_a(istate) - one_body_dm_beta_at_r(i,istate) = dm_b(istate) + one_e_dm_alpha_at_r(i,istate) = dm_a(istate) + one_e_dm_beta_at_r(i,istate) = dm_b(istate) enddo enddo END_PROVIDER - BEGIN_PROVIDER [double precision, one_dm_and_grad_alpha_in_r, (4,n_points_final_grid,N_states) ] -&BEGIN_PROVIDER [double precision, one_dm_and_grad_beta_in_r, (4,n_points_final_grid,N_states) ] -&BEGIN_PROVIDER [double precision, one_body_grad_2_dm_alpha_at_r, (n_points_final_grid,N_states) ] -&BEGIN_PROVIDER [double precision, one_body_grad_2_dm_beta_at_r, (n_points_final_grid,N_states) ] + BEGIN_PROVIDER [double precision, one_e_dm_and_grad_alpha_in_r, (4,n_points_final_grid,N_states) ] +&BEGIN_PROVIDER [double precision, one_e_dm_and_grad_beta_in_r, (4,n_points_final_grid,N_states) ] +&BEGIN_PROVIDER [double precision, one_e_grad_2_dm_alpha_at_r, (n_points_final_grid,N_states) ] +&BEGIN_PROVIDER [double precision, one_e_grad_2_dm_beta_at_r, (n_points_final_grid,N_states) ] BEGIN_DOC -! one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) -! one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) -! one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) -! one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) -! one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 +! one_e_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) +! one_e_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) +! one_e_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) +! one_e_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) +! one_e_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 ! where r_i is the ith point of the grid and istate is the state number END_DOC implicit none @@ -188,17 +188,17 @@ END_PROVIDER r(3) = final_grid_points(3,i) !!!! Works also with the ao basis call density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, dm_a_grad, dm_b_grad, aos_array, grad_aos_array) - one_dm_and_grad_alpha_in_r(1,i,istate) = dm_a_grad(1,istate) - one_dm_and_grad_alpha_in_r(2,i,istate) = dm_a_grad(2,istate) - one_dm_and_grad_alpha_in_r(3,i,istate) = dm_a_grad(3,istate) - one_dm_and_grad_alpha_in_r(4,i,istate) = dm_a(istate) - one_body_grad_2_dm_alpha_at_r(i,istate) = dm_a_grad(1,istate) * dm_a_grad(1,istate) + dm_a_grad(2,istate) * dm_a_grad(2,istate) + dm_a_grad(3,istate) * dm_a_grad(3,istate) + one_e_dm_and_grad_alpha_in_r(1,i,istate) = dm_a_grad(1,istate) + one_e_dm_and_grad_alpha_in_r(2,i,istate) = dm_a_grad(2,istate) + one_e_dm_and_grad_alpha_in_r(3,i,istate) = dm_a_grad(3,istate) + one_e_dm_and_grad_alpha_in_r(4,i,istate) = dm_a(istate) + one_e_grad_2_dm_alpha_at_r(i,istate) = dm_a_grad(1,istate) * dm_a_grad(1,istate) + dm_a_grad(2,istate) * dm_a_grad(2,istate) + dm_a_grad(3,istate) * dm_a_grad(3,istate) - one_dm_and_grad_beta_in_r(1,i,istate) = dm_b_grad(1,istate) - one_dm_and_grad_beta_in_r(2,i,istate) = dm_b_grad(2,istate) - one_dm_and_grad_beta_in_r(3,i,istate) = dm_b_grad(3,istate) - one_dm_and_grad_beta_in_r(4,i,istate) = dm_b(istate) - one_body_grad_2_dm_beta_at_r(i,istate) = dm_b_grad(1,istate) * dm_b_grad(1,istate) + dm_b_grad(2,istate) * dm_b_grad(2,istate) + dm_b_grad(3,istate) * dm_b_grad(3,istate) + one_e_dm_and_grad_beta_in_r(1,i,istate) = dm_b_grad(1,istate) + one_e_dm_and_grad_beta_in_r(2,i,istate) = dm_b_grad(2,istate) + one_e_dm_and_grad_beta_in_r(3,i,istate) = dm_b_grad(3,istate) + one_e_dm_and_grad_beta_in_r(4,i,istate) = dm_b(istate) + one_e_grad_2_dm_beta_at_r(i,istate) = dm_b_grad(1,istate) * dm_b_grad(1,istate) + dm_b_grad(2,istate) * dm_b_grad(2,istate) + dm_b_grad(3,istate) * dm_b_grad(3,istate) enddo enddo diff --git a/src/dft_utils_one_e/e_xc.irp.f b/src/dft_utils_one_e/e_xc.irp.f index 6d89fa7e..efb8497f 100644 --- a/src/dft_utils_one_e/e_xc.irp.f +++ b/src/dft_utils_one_e/e_xc.irp.f @@ -20,8 +20,8 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rhoa(istate) = one_body_dm_alpha_at_r(i,istate) - rhob(istate) = one_body_dm_beta_at_r(i,istate) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) call ec_LDA(rhoa(istate),rhob(istate),e_c,vc_a,vc_b) call ex_LDA(rhoa(istate),rhob(istate),e_x,vx_a,vx_b) energy_x_LDA(istate) += weight * e_x @@ -59,10 +59,10 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) grad_rho_a_2 = 0.d0 grad_rho_b_2 = 0.d0 grad_rho_a_b = 0.d0 diff --git a/src/dft_utils_one_e/one_e_energy_dft.irp.f b/src/dft_utils_one_e/one_e_energy_dft.irp.f index cb0e12ca..b4272280 100644 --- a/src/dft_utils_one_e/one_e_energy_dft.irp.f +++ b/src/dft_utils_one_e/one_e_energy_dft.irp.f @@ -3,7 +3,7 @@ &BEGIN_PROVIDER [double precision, psi_dft_energy_h_core, (N_states) ] implicit none BEGIN_DOC -! kinetic, electron-nuclear and total h_core energy computed with the density matrix one_body_dm_mo_beta_for_dft+one_body_dm_mo_alpha_for_dft +! kinetic, electron-nuclear and total h_core energy computed with the density matrix one_e_dm_mo_beta_for_dft+one_e_dm_mo_alpha_for_dft END_DOC integer :: i,j,istate double precision :: accu @@ -12,15 +12,15 @@ do istate = 1, N_states do i = 1, mo_num do j = 1, mo_num - psi_dft_energy_kinetic(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integrals(j,i) - psi_dft_energy_nuclear_elec(istate) += ( one_body_dm_mo_alpha_for_dft(j,i,istate)+one_body_dm_mo_beta_for_dft(j,i,istate)) * mo_integrals_n_e(j,i) + psi_dft_energy_kinetic(istate) += ( one_e_dm_mo_alpha_for_dft(j,i,istate)+one_e_dm_mo_beta_for_dft(j,i,istate)) * mo_kinetic_integrals(j,i) + psi_dft_energy_nuclear_elec(istate) += ( one_e_dm_mo_alpha_for_dft(j,i,istate)+one_e_dm_mo_beta_for_dft(j,i,istate)) * mo_integrals_n_e(j,i) enddo enddo enddo accu = 0.d0 do i = 1, N_states do j = 1, mo_num - accu += one_body_dm_mo_alpha_for_dft(j,j,i) + one_body_dm_mo_beta_for_dft(j,j,i) + accu += one_e_dm_mo_alpha_for_dft(j,j,i) + one_e_dm_mo_beta_for_dft(j,j,i) enddo accu = (elec_alpha_num + elec_beta_num ) / accu psi_dft_energy_kinetic(i) = psi_dft_energy_kinetic(i) * accu diff --git a/src/dft_utils_one_e/pot_ao.irp.f b/src/dft_utils_one_e/pot_ao.irp.f index e7c0d932..2d05e9a8 100644 --- a/src/dft_utils_one_e/pot_ao.irp.f +++ b/src/dft_utils_one_e/pot_ao.irp.f @@ -20,8 +20,8 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rhoa(istate) = one_body_dm_alpha_at_r(i,istate) - rhob(istate) = one_body_dm_beta_at_r(i,istate) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) do j =1, ao_num @@ -95,10 +95,10 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) grad_rho_a_2 = 0.d0 grad_rho_b_2 = 0.d0 grad_rho_a_b = 0.d0 diff --git a/src/dft_utils_one_e/pot_general.irp.f b/src/dft_utils_one_e/pot_general.irp.f index 4c80cc81..07884b27 100644 --- a/src/dft_utils_one_e/pot_general.irp.f +++ b/src/dft_utils_one_e/pot_general.irp.f @@ -116,9 +116,9 @@ END_PROVIDER Trace_v_H(istate) = 0.d0 do i = 1, mo_num do j = 1, mo_num - Trace_v_xc(istate) += (potential_x_alpha_mo(j,i,istate) + potential_c_alpha_mo(j,i,istate)) * one_body_dm_mo_alpha_for_dft(j,i,istate) - Trace_v_xc(istate) += (potential_x_beta_mo(j,i,istate) + potential_c_beta_mo(j,i,istate) ) * one_body_dm_mo_beta_for_dft(j,i,istate) - dm = one_body_dm_mo_alpha_for_dft(j,i,istate) + one_body_dm_mo_beta_for_dft(j,i,istate) + Trace_v_xc(istate) += (potential_x_alpha_mo(j,i,istate) + potential_c_alpha_mo(j,i,istate)) * one_e_dm_mo_alpha_for_dft(j,i,istate) + Trace_v_xc(istate) += (potential_x_beta_mo(j,i,istate) + potential_c_beta_mo(j,i,istate) ) * one_e_dm_mo_beta_for_dft(j,i,istate) + dm = one_e_dm_mo_alpha_for_dft(j,i,istate) + one_e_dm_mo_beta_for_dft(j,i,istate) Trace_v_H(istate) += dm * short_range_Hartree_operator(j,i,istate) enddo enddo diff --git a/src/dft_utils_one_e/sr_coulomb.irp.f b/src/dft_utils_one_e/sr_coulomb.irp.f index 4187a8da..7da501b5 100644 --- a/src/dft_utils_one_e/sr_coulomb.irp.f +++ b/src/dft_utils_one_e/sr_coulomb.irp.f @@ -16,7 +16,7 @@ short_range_Hartree = 0.d0 do i = 1, mo_num do j = 1, mo_num - if(dabs(one_body_dm_average_mo_for_dft(j,i)).le.1.d-12)cycle + if(dabs(one_e_dm_average_mo_for_dft(j,i)).le.1.d-12)cycle call get_mo_two_e_integrals_i1j1(i,j,mo_num,integrals_array,mo_integrals_map) call get_mo_two_e_integrals_erf_i1j1(i,j,mo_num,integrals_erf_array,mo_integrals_erf_map) do istate = 1, N_states @@ -24,9 +24,9 @@ do l = 1, mo_num integral = integrals_array(l,k) integral_erf = integrals_erf_array(l,k) - contrib = one_body_dm_mo_for_dft(i,j,istate) * (integral - integral_erf) + contrib = one_e_dm_mo_for_dft(i,j,istate) * (integral - integral_erf) short_range_Hartree_operator(l,k,istate) += contrib - short_range_Hartree(istate) += contrib * one_body_dm_mo_for_dft(k,l,istate) + short_range_Hartree(istate) += contrib * one_e_dm_mo_for_dft(k,l,istate) enddo enddo enddo diff --git a/src/dft_utils_one_e/sr_exc.irp.f b/src/dft_utils_one_e/sr_exc.irp.f index 0aee350a..89849de0 100644 --- a/src/dft_utils_one_e/sr_exc.irp.f +++ b/src/dft_utils_one_e/sr_exc.irp.f @@ -20,8 +20,8 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rhoa(istate) = one_body_dm_alpha_at_r(i,istate) - rhob(istate) = one_body_dm_beta_at_r(i,istate) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) energy_sr_x_LDA(istate) += weight * e_x @@ -59,10 +59,10 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) grad_rho_a_2 = 0.d0 grad_rho_b_2 = 0.d0 grad_rho_a_b = 0.d0 diff --git a/src/dft_utils_one_e/sr_pot_ao.irp.f b/src/dft_utils_one_e/sr_pot_ao.irp.f index 89e0a3dd..0474b211 100644 --- a/src/dft_utils_one_e/sr_pot_ao.irp.f +++ b/src/dft_utils_one_e/sr_pot_ao.irp.f @@ -18,8 +18,8 @@ r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight=final_weight_at_r_vector(i) - rhoa(istate) = one_body_dm_alpha_at_r(i,istate) - rhob(istate) = one_body_dm_beta_at_r(i,istate) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) call ec_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_c,sr_vc_a,sr_vc_b) call ex_LDA_sr(mu_erf_dft,rhoa(istate),rhob(istate),e_x,sr_vx_a,sr_vx_b) do j =1, ao_num @@ -107,10 +107,10 @@ END_PROVIDER r(2) = final_grid_points(2,i) r(3) = final_grid_points(3,i) weight = final_weight_at_r_vector(i) - rho_a(istate) = one_dm_and_grad_alpha_in_r(4,i,istate) - rho_b(istate) = one_dm_and_grad_beta_in_r(4,i,istate) - grad_rho_a(1:3,istate) = one_dm_and_grad_alpha_in_r(1:3,i,istate) - grad_rho_b(1:3,istate) = one_dm_and_grad_beta_in_r(1:3,i,istate) + rho_a(istate) = one_e_dm_and_grad_alpha_in_r(4,i,istate) + rho_b(istate) = one_e_dm_and_grad_beta_in_r(4,i,istate) + grad_rho_a(1:3,istate) = one_e_dm_and_grad_alpha_in_r(1:3,i,istate) + grad_rho_b(1:3,istate) = one_e_dm_and_grad_beta_in_r(1:3,i,istate) grad_rho_a_2 = 0.d0 grad_rho_b_2 = 0.d0 grad_rho_a_b = 0.d0 diff --git a/src/kohn_sham/ks_enery.irp.f b/src/kohn_sham/ks_enery.irp.f index 07d1f659..d482ee56 100644 --- a/src/kohn_sham/ks_enery.irp.f +++ b/src/kohn_sham/ks_enery.irp.f @@ -1,6 +1,6 @@ BEGIN_PROVIDER [ double precision, KS_energy] &BEGIN_PROVIDER [ double precision, two_electron_energy] -&BEGIN_PROVIDER [ double precision, one_electron_energy] +&BEGIN_PROVIDER [ double precision, one_e_energy] &BEGIN_PROVIDER [ double precision, Fock_matrix_energy] &BEGIN_PROVIDER [ double precision, trace_potential_xc ] implicit none @@ -11,7 +11,7 @@ integer :: i,j double precision :: accu_mono,accu_fock KS_energy = nuclear_repulsion - one_electron_energy = 0.d0 + one_e_energy = 0.d0 two_electron_energy = 0.d0 Fock_matrix_energy = 0.d0 trace_potential_xc = 0.d0 @@ -21,12 +21,12 @@ Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) - one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) + one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo - KS_energy += e_exchange_dft + e_correlation_dft + one_electron_energy + two_electron_energy + KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_electron_energy END_PROVIDER BEGIN_PROVIDER [double precision, extra_e_contrib_density] diff --git a/src/kohn_sham_rs/rs_ks_energy.irp.f b/src/kohn_sham_rs/rs_ks_energy.irp.f index 222c374d..a557891f 100644 --- a/src/kohn_sham_rs/rs_ks_energy.irp.f +++ b/src/kohn_sham_rs/rs_ks_energy.irp.f @@ -1,6 +1,6 @@ BEGIN_PROVIDER [ double precision, RS_KS_energy ] &BEGIN_PROVIDER [ double precision, two_electron_energy] -&BEGIN_PROVIDER [ double precision, one_electron_energy] +&BEGIN_PROVIDER [ double precision, one_e_energy] &BEGIN_PROVIDER [ double precision, Fock_matrix_energy] &BEGIN_PROVIDER [ double precision, trace_potential_xc ] implicit none @@ -11,7 +11,7 @@ integer :: i,j double precision :: accu_mono,accu_fock - one_electron_energy = 0.d0 + one_e_energy = 0.d0 two_electron_energy = 0.d0 Fock_matrix_energy = 0.d0 trace_potential_xc = 0.d0 @@ -21,11 +21,11 @@ Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) - one_electron_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) + one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo - RS_KS_energy += e_exchange_dft + e_correlation_dft + one_electron_energy + two_electron_energy + RS_KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_electron_energy END_PROVIDER BEGIN_PROVIDER [double precision, extra_e_contrib_density] diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index 53d451c1..f89a1267 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -94,7 +94,7 @@ subroutine run call Roothaan_Hall_SCF call ezfio_set_kohn_sham_rs_energy(SCF_energy) - write(*, '(A22,X,F16.10)') 'one_electron_energy = ',one_electron_energy + write(*, '(A22,X,F16.10)') 'one_e_energy = ',one_e_energy write(*, '(A22,X,F16.10)') 'two_electron_energy = ',two_electron_energy write(*, '(A22,X,F16.10)') 'e_exchange_dft = ',e_exchange_dft write(*, '(A22,X,F16.10)') 'e_correlation_dft = ',e_correlation_dft diff --git a/src/tools/save_one_body_dm.irp.f b/src/tools/save_one_e_dm.irp.f similarity index 56% rename from src/tools/save_one_body_dm.irp.f rename to src/tools/save_one_e_dm.irp.f index 67964131..e51a97d1 100644 --- a/src/tools/save_one_body_dm.irp.f +++ b/src/tools/save_one_e_dm.irp.f @@ -1,9 +1,9 @@ -program save_one_body_dm +program save_one_e_dm implicit none BEGIN_DOC ! programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. ! -! Then, the global variable data_one_body_alpha_dm_mo and data_one_body_beta_dm_mo will automatically read the density in a further calculation. +! Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read the density in a further calculation. ! ! This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). END_DOC @@ -15,6 +15,6 @@ end subroutine routine - call ezfio_set_aux_quantities_data_one_body_alpha_dm_mo(one_body_dm_mo_alpha) - call ezfio_set_aux_quantities_data_one_body_beta_dm_mo(one_body_dm_mo_beta) + call ezfio_set_aux_quantities_data_one_e_dm_alpha_mo(one_e_dm_mo_alpha) + call ezfio_set_aux_quantities_data_one_e_dm_beta_mo(one_e_dm_mo_beta) end From 9f9f7d78702b0fa05c215337141bdb7607947d02 Mon Sep 17 00:00:00 2001 From: eginer Date: Thu, 10 Jan 2019 17:52:54 +0100 Subject: [PATCH 3/6] changes --- INSTALL.rst | 51 +++- TODO | 4 + docs/source/index.rst | 1 + docs/source/intro/selected_ci.rst | 29 +- docs/source/modules/cipsi.rst | 14 + docs/source/modules/davidson.rst | 10 +- docs/source/modules/determinants.rst | 32 +-- docs/source/modules/dft_utils_one_e.rst | 16 +- docs/source/modules/fci.rst | 17 ++ docs/source/modules/hartree_fock.rst | 101 +++++++ docs/source/modules/iterations.rst | 2 +- docs/source/modules/kohn_sham.rst | 265 ------------------ docs/source/modules/kohn_sham_rs.rst | 164 +++++++++++ docs/source/modules/mo_basis.rst | 6 +- docs/source/modules/scf_utils.rst | 4 +- .../programmers_guide/index_providers.rst | 6 +- docs/source/users_guide/qp_plugins.rst | 40 ++- 17 files changed, 446 insertions(+), 316 deletions(-) diff --git a/INSTALL.rst b/INSTALL.rst index 59a680d7..131e1bda 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -25,9 +25,8 @@ sets all the environment variables required for the normal operation of the Running this script will also tell you which external dependencies are missing and need to be installed. -Then, source the :file:`quantum_package.rc` file in your current shell before -installing the dependencies. - +When all dependencies have been installed, ( the :command:`configure` will tell you) +source the :file:`quantum_package.rc` in order to load all environment variables and compile the |QP|. Requirements @@ -71,6 +70,52 @@ architecture. Modify it if needed, and run :command:`configure` with Help for installing external dependencies ========================================= +Using the :command:`configure` executable +----------------------------------------- + +The :command:`configure` executable can help you in installing the minimal dependencies you will need to compile the |QP|. +The command is to be used as follows: + +.. code:: bash + + ./configure --install + +The following packages are supported by the :command:`configure` installer: + +* ninja +* irpf90 +* zeromq +* f77zmq ( :math:`\approx` 3 minutes) +* ocaml +* ezfio +* emsl +* docopt +* resultsFile +* bats + +Example: + +.. code:: bash + + ./configure -i ezfio + +.. note:: + + When installing the ocaml package, you will be asked the location of where it should be installed. + A safe option is to enter the path proposed by the |QP|: + + QP>> Please install it here: /your_quantum_package_directory/bin + + So just enter the proposition of the |QP| and press enter. + + +If the :command:`configure` executable fails to install a specific dependency +----------------------------------------------------------------------------- + +If the :command:`configure` executable does not succeed to install a specific dependency, +there are some proposition of how to download and install the minimal dependencies to compile and use the |QP| + + Before doing anything below, try to install the packages with your package manager (:command:`apt`, :command:`yum`, etc) diff --git a/TODO b/TODO index cfb152b5..78fa79cd 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,7 @@ +============ +Probleme with EMSL + + * Mettre le fichier LIB * Faire que le slave de Hartree-fock est le calcul des integrales AO en parallele diff --git a/docs/source/index.rst b/docs/source/index.rst index 0e068bd3..2d176985 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -38,6 +38,7 @@ programmers_guide/programming programmers_guide/ezfio programmers_guide/index + programmers_guide/plugins .. toctree:: diff --git a/docs/source/intro/selected_ci.rst b/docs/source/intro/selected_ci.rst index 41ba8820..443a678f 100644 --- a/docs/source/intro/selected_ci.rst +++ b/docs/source/intro/selected_ci.rst @@ -105,13 +105,25 @@ The determinants in |SetDI| will be characterized as **internal**. Of course, such a procedure can be applied on any state and therefore can allow to treat both ground and excited states. -Approximations to accelerate the selection ------------------------------------------- +Stochastic approximations for the selection and the computation of |EPT| +------------------------------------------------------------------------ The simple algorithm would be too slow to make calculations possible. Instead, -we use the 3-class |CIPSI| approximation to accelerate the selection, -:cite:`Evangelisti_1983` where instead of generating all possible |kalpha|, -we only generate a subset which are likely to be selected. +the |QP| uses a stochastic algorithm :cite:`Garniron_2017.2` in order to compute +efficiently the |EPT| and to select on-the-fly the best Slater determinants. + +In such a way, the selection step introduces no extra cost with respect to the |EPT| calculation and the |EPT| +itself is unbiased but associated with a statistical error bar rapidly converging. + + +Deterministic approximations for the selection +---------------------------------------------- + +The following description was used in a previous version of the |CIPSI| algorithm +which was less efficient. Nonetheless, it introduces the notions of **generator** and **selector** determinants +which are much more general than the |CIPSI| algorithm that targets the |FCI| and can be used to realize virtually +**any kind of CI in a selected way**. + We define **generator** determinants, as determinants of the internal space from which the |kalpha| are generated. @@ -124,6 +136,11 @@ The default is to use :option:`determinants threshold_generators` = 0.99 for the generators, and :option:`determinants threshold_selectors` = 0.999 for the selectors. +This is nothing but the 3-class |CIPSI| approximation to accelerate the selection, +:cite:`Evangelisti_1983` where instead of generating all possible |kalpha|, +we only generate a subset which are likely to be selected. + + The computation of |EPT| using a truncated wave function is biased, so if an accurate estimate of the |FCI| energy is desired, it is preferable to recompute |EPT| with the hybrid deterministic/stochastic algorithm @@ -147,7 +164,7 @@ a selected |CAS-SD|. And if one add the rule to prevent for doing double excitations with two holes and two particles outside of the active space, one obtains a selected |DDCI| method. -All such things can be done very easily when programming the the |qp|. +All such things can be done very easily when programming the |qp|. ----------------------------------- diff --git a/docs/source/modules/cipsi.rst b/docs/source/modules/cipsi.rst index 935a8933..bf084f35 100644 --- a/docs/source/modules/cipsi.rst +++ b/docs/source/modules/cipsi.rst @@ -755,6 +755,20 @@ Subroutines / functions +.. c:function:: remove_duplicates_in_selection_buffer + + .. code:: text + + subroutine remove_duplicates_in_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + .. c:function:: run_cipsi .. code:: text diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst index dbc7f628..f2d9fbe7 100644 --- a/docs/source/modules/davidson.rst +++ b/docs/source/modules/davidson.rst @@ -449,7 +449,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -465,7 +465,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -481,7 +481,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -497,7 +497,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` @@ -513,7 +513,7 @@ Subroutines / functions subroutine H_S2_u_0_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - File: :file:`u0_h_u0.irp.f_template_468` + File: :file:`u0_h_u0.irp.f_template_477` Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst index c2d56042..715d065a 100644 --- a/docs/source/modules/determinants.rst +++ b/docs/source/modules/determinants.rst @@ -451,7 +451,7 @@ Providers integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) integer :: n_det_alpha_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\alpha` determinants @@ -465,7 +465,7 @@ Providers integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) integer :: n_det_beta_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\beta` determinants @@ -1215,7 +1215,7 @@ Providers integer(bit_kind), allocatable :: psi_det_alpha_unique (N_int,psi_det_size) integer :: n_det_alpha_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\alpha` determinants @@ -1242,7 +1242,7 @@ Providers integer(bit_kind), allocatable :: psi_det_beta_unique (N_int,psi_det_size) integer :: n_det_beta_unique - File: :file:`spindeterminants.irp.f_template_141` + File: :file:`spindeterminants.irp.f_template_143` Unique :math:`\beta` determinants @@ -2337,7 +2337,7 @@ Subroutines / functions subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2355,7 +2355,7 @@ Subroutines / functions subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2373,7 +2373,7 @@ Subroutines / functions subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2391,7 +2391,7 @@ Subroutines / functions subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2445,7 +2445,7 @@ Subroutines / functions subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2463,7 +2463,7 @@ Subroutines / functions subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2481,7 +2481,7 @@ Subroutines / functions subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2539,7 +2539,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_2(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2559,7 +2559,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_3(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2579,7 +2579,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_4(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2599,7 +2599,7 @@ Subroutines / functions subroutine get_all_spin_singles_and_doubles_N_int(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` @@ -2619,7 +2619,7 @@ Subroutines / functions subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) - File: :file:`spindeterminants.irp.f_template_1218` + File: :file:`spindeterminants.irp.f_template_1221` diff --git a/docs/source/modules/dft_utils_one_e.rst b/docs/source/modules/dft_utils_one_e.rst index 09708468..5ed535d1 100644 --- a/docs/source/modules/dft_utils_one_e.rst +++ b/docs/source/modules/dft_utils_one_e.rst @@ -1090,14 +1090,12 @@ Providers .. code:: text - double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range correlation alpha/beta potentials with LDA functional on the |AO| basis @@ -1122,14 +1120,12 @@ Providers .. code:: text - double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range correlation alpha/beta potentials with LDA functional on the |AO| basis @@ -1156,12 +1152,10 @@ Providers double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range exchange alpha/beta potentials with LDA functional on the |AO| basis @@ -1188,12 +1182,10 @@ Providers double precision, allocatable :: potential_sr_x_alpha_ao_lda (ao_num,ao_num,N_states) double precision, allocatable :: potential_sr_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_lda (ao_num,ao_num,N_states) File: :file:`sr_pot_ao.irp.f` - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + short range exchange alpha/beta potentials with LDA functional on the |AO| basis diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst index 35f79f49..d4dce0d8 100644 --- a/docs/source/modules/fci.rst +++ b/docs/source/modules/fci.rst @@ -36,6 +36,23 @@ EZFIO parameters +Providers +--------- + + +.. c:var:: nthreads_pt2 + + .. code:: text + + integer :: nthreads_pt2 + + File: :file:`environment.irp.f` + + Number of threads for Davidson + + + + Subroutines / functions ----------------------- diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst index 2005e9af..7ca55dfe 100644 --- a/docs/source/modules/hartree_fock.rst +++ b/docs/source/modules/hartree_fock.rst @@ -63,6 +63,79 @@ Providers --------- +.. c:var:: ao_two_e_integral_alpha + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: ao_two_e_integral_beta + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) + double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: extra_e_contrib_density + + .. code:: text + + double precision :: extra_e_contrib_density + + File: :file:`hf_energy.irp.f` + + Extra contribution to the SCF energy coming from the density. + + For a Hartree-Fock calculation: extra_e_contrib_density = 0 + + For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - trace of the V_xc potential + + + + +.. c:var:: fock_matrix_ao_alpha + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + +.. c:var:: fock_matrix_ao_beta + + .. code:: text + + double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) + double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) + + File: :file:`fock_matrix_hf.irp.f` + + Alpha Fock matrix in AO basis set + + + + .. c:var:: hf_energy .. code:: text @@ -113,6 +186,34 @@ Subroutines / functions +.. c:function:: create_guess + + .. code:: text + + subroutine create_guess + + File: :file:`scf.irp.f` + + Create a MO guess if no MOs are present in the EZFIO directory + + + + + +.. c:function:: run + + .. code:: text + + subroutine run + + File: :file:`scf.irp.f` + + Run SCF calculation + + + + + .. c:function:: scf .. code:: text diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst index 81b89008..ed35c921 100644 --- a/docs/source/modules/iterations.rst +++ b/docs/source/modules/iterations.rst @@ -91,7 +91,7 @@ Subroutines / functions .. code:: text - subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_) + subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_,n_st) File: :file:`print_summary.irp.f` diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst index 1dac5f0f..4710a3d8 100644 --- a/docs/source/modules/kohn_sham.rst +++ b/docs/source/modules/kohn_sham.rst @@ -52,178 +52,6 @@ Providers --------- -.. c:var:: ao_potential_alpha_xc - - .. code:: text - - double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) - double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: ao_potential_beta_xc - - .. code:: text - - double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) - double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: ao_two_e_integral_alpha - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) - double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: ao_two_e_integral_beta - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_alpha (ao_num,ao_num) - double precision, allocatable :: ao_two_e_integral_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: e_correlation_dft - - .. code:: text - - double precision :: e_correlation_dft - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: e_exchange_dft - - .. code:: text - - double precision :: e_exchange_dft - - File: :file:`pot_functionals.irp.f` - - - - - - -.. c:var:: extra_e_contrib_density - - .. code:: text - - double precision :: extra_e_contrib_density - - File: :file:`ks_enery.irp.f` - - Extra contribution to the SCF energy coming from the density. - - For a Hartree-Fock calculation: extra_e_contrib_density = 0 - - For a Kohn-Sham or Range-separated Kohn-Sham: the exchange/correlation - 1/2 trace of the V_xc potential - - - - -.. c:var:: fock_matrix_alpha_no_xc_ao - - .. code:: text - - double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) - double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Mono electronic an Coulomb matrix in ao basis set - - - - -.. c:var:: fock_matrix_ao_alpha - - .. code:: text - - double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) - double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: fock_matrix_ao_beta - - .. code:: text - - double precision, allocatable :: fock_matrix_ao_alpha (ao_num,ao_num) - double precision, allocatable :: fock_matrix_ao_beta (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Alpha Fock matrix in ao basis set - - - - -.. c:var:: fock_matrix_beta_no_xc_ao - - .. code:: text - - double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) - double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) - - File: :file:`fock_matrix_ks.irp.f` - - Mono electronic an Coulomb matrix in ao basis set - - - - -.. c:var:: fock_matrix_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - .. c:var:: ks_energy .. code:: text @@ -241,104 +69,11 @@ Providers -.. c:var:: one_electron_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: trace_potential_xc - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: two_electron_energy - - .. code:: text - - double precision :: ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`ks_enery.irp.f` - - Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - Subroutines / functions ----------------------- -.. c:function:: check_coherence_functional - - .. code:: text - - subroutine check_coherence_functional - - File: :file:`ks_scf.irp.f` - - - - - - - -.. c:function:: create_guess - - .. code:: text - - subroutine create_guess - - File: :file:`ks_scf.irp.f` - - Create a MO guess if no MOs are present in the EZFIO directory - - - - - -.. c:function:: run - - .. code:: text - - subroutine run - - File: :file:`ks_scf.irp.f` - - Run SCF calculation - - - - - .. c:function:: srs_ks_cf .. code:: text diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst index 9ab0aa5e..ca51ab5b 100644 --- a/docs/source/modules/kohn_sham_rs.rst +++ b/docs/source/modules/kohn_sham_rs.rst @@ -60,6 +60,122 @@ Providers --------- +.. c:var:: ao_potential_alpha_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: ao_potential_beta_xc + + .. code:: text + + double precision, allocatable :: ao_potential_alpha_xc (ao_num,ao_num) + double precision, allocatable :: ao_potential_beta_xc (ao_num,ao_num) + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_correlation_dft + + .. code:: text + + double precision :: e_correlation_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: e_exchange_dft + + .. code:: text + + double precision :: e_exchange_dft + + File: :file:`pot_functionals.irp.f` + + + + + + +.. c:var:: fock_matrix_alpha_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_beta_no_xc_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_alpha_no_xc_ao (ao_num,ao_num) + double precision, allocatable :: fock_matrix_beta_no_xc_ao (ao_num,ao_num) + + File: :file:`fock_matrix_rs_ks.irp.f` + + Mono electronic an Coulomb matrix in AO basis set + + + + +.. c:var:: fock_matrix_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: one_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + .. c:var:: rs_ks_energy .. code:: text @@ -77,11 +193,59 @@ Providers +.. c:var:: trace_potential_xc + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + +.. c:var:: two_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + Subroutines / functions ----------------------- +.. c:function:: check_coherence_functional + + .. code:: text + + subroutine check_coherence_functional + + File: :file:`rs_ks_scf.irp.f` + + + + + + + .. c:function:: rs_ks_scf .. code:: text diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst index bf647f5c..044702fe 100644 --- a/docs/source/modules/mo_basis.rst +++ b/docs/source/modules/mo_basis.rst @@ -329,15 +329,15 @@ Subroutines / functions -.. c:function:: reorder_active_orb +.. c:function:: reorder_core_orb .. code:: text - subroutine reorder_active_orb + subroutine reorder_core_orb File: :file:`track_orb.irp.f` - routines that takes the current :c:data:`mo_coef` and reorder the active orbitals (see :c:data:`list_act` and :c:data:`n_act_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` + routines that takes the current :c:data:`mo_coef` and reorder the core orbitals (see :c:data:`list_core` and :c:data:`n_core_orb`) according to the overlap with :c:data:`mo_coef_begin_iteration` diff --git a/docs/source/modules/scf_utils.rst b/docs/source/modules/scf_utils.rst index d9ec8f4f..8866bd75 100644 --- a/docs/source/modules/scf_utils.rst +++ b/docs/source/modules/scf_utils.rst @@ -97,9 +97,9 @@ EZFIO parameters Calculated HF energy -.. option:: no_oa_or_av_opt +.. option:: frozen_orb_scf - If true, leave the active orbitals untouched in the SCF procedure + If true, leave untouched all the orbitals defined as core and optimize all the orbitals defined as active with qp_set_mo_class Default: False diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index 01b305aa..5cdd700d 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -231,6 +231,7 @@ Index of Providers * :c:data:`fock_wee_closed_shell` * :c:data:`fps_spf_matrix_ao` * :c:data:`fps_spf_matrix_mo` +* :c:data:`frozen_orb_scf` * :c:data:`full_ijkl_bitmask` * :c:data:`full_ijkl_bitmask_4` * :c:data:`gauleg_t2` @@ -433,11 +434,11 @@ Index of Providers * :c:data:`n_virt_orb` * :c:data:`n_virt_orb_allocate` * :c:data:`no_ivvv_integrals` -* :c:data:`no_oa_or_av_opt` * :c:data:`no_vvv_integrals` * :c:data:`no_vvvv_integrals` * :c:data:`nproc` * :c:data:`nthreads_davidson` +* :c:data:`nthreads_pt2` * :c:data:`nucl_aos` * :c:data:`nucl_aos_transposed` * :c:data:`nucl_charge` @@ -1213,8 +1214,9 @@ Index of Subroutines/Functions * :c:func:`read_dets` * :c:func:`recentered_poly2` * :c:func:`remove_duplicates_in_psi_det` +* :c:func:`remove_duplicates_in_selection_buffer` * :c:func:`remove_small_contributions` -* :c:func:`reorder_active_orb` +* :c:func:`reorder_core_orb` * :c:func:`repeat_all_e_corr` * :c:func:`reset_zmq_addresses` * :c:func:`resident_memory` diff --git a/docs/source/users_guide/qp_plugins.rst b/docs/source/users_guide/qp_plugins.rst index 3d85421a..1eadb4fb 100644 --- a/docs/source/users_guide/qp_plugins.rst +++ b/docs/source/users_guide/qp_plugins.rst @@ -6,7 +6,7 @@ qp_plugins .. program:: qp_plugins -This command deals with all external plugings of |qp|. Plugin repositories can +This command deals with all external plugins of |qp|. Plugin repositories can be downloaded, and the plugins in these repositories can be installed/uninstalled of created. @@ -62,3 +62,41 @@ Usage Specify in which repository the new plugin will be created. + +Example +------- + +Let us download, install and compile some specific external plugins from ``_ . + + +First, download the git repo associated to these plugins. To do so, first go to the `plugins` directory in the |QP| and execute: + +.. code:: bash + + qp_plugins download https://gitlab.com/eginer/qp_plugins_eginer + + +This will create in the directory `plugins` a local copy of the git repo located at the URL you indicated. +Then, go in `qp_plugins_eginer/stable/` + +.. code:: bash + + cd qp_plugins_eginer/stable/ + + +In the directory `stable`, there are many directories which all correspond to a specific plugin that have been developed +by the person in charge of the git repo. All these plugins might use some global variables and routines contained +in the core modules of the |QP|. + + +Now let us install the plugin `rsdft_cipsi`: + +.. code:: bash + + qp_plugins install rsdft_cipsi + +This will link this directory to the |QP| which means that when the code will be compiled, this plugin will be compiled to and therefore +all the executables/scripts contained in this module will be available. + + + From 7bee6611660bb963cd3edcd35f547882b528b8fd Mon Sep 17 00:00:00 2001 From: eginer Date: Thu, 10 Jan 2019 17:54:30 +0100 Subject: [PATCH 4/6] merged --- docs/source/users_guide/qp_plugins.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/source/users_guide/qp_plugins.rst b/docs/source/users_guide/qp_plugins.rst index 1eadb4fb..f1c100f8 100644 --- a/docs/source/users_guide/qp_plugins.rst +++ b/docs/source/users_guide/qp_plugins.rst @@ -99,4 +99,11 @@ This will link this directory to the |QP| which means that when the code will be all the executables/scripts contained in this module will be available. +Then, to compile the new plugin, just recompile the |QP| as usual by going at the root of the |QP| directory: +.. code:: bash + + cd $QP_ROOT + ninja + +Then, when executing From b99d4ba7974e386ff2384b74d17d482a114491b7 Mon Sep 17 00:00:00 2001 From: eginer Date: Thu, 10 Jan 2019 18:57:58 +0100 Subject: [PATCH 5/6] modified the doc --- docs/source/index.rst | 1 + docs/source/modules/density_for_dft.rst | 80 +++++++ docs/source/modules/determinants.rst | 218 ++++++++++++++++-- docs/source/modules/dft_utils_in_r.rst | 120 ++++++++++ docs/source/modules/fci.rst | 14 -- docs/source/modules/hartree_fock.rst | 1 - docs/source/modules/kohn_sham_rs.rst | 51 ++-- docs/source/modules/tools.rst | 2 +- .../programmers_guide/index_providers.rst | 35 ++- docs/source/users_guide/configure.rst | 2 + docs/source/users_guide/plugins.rst | 4 +- docs/source/users_guide/qp_plugins.rst | 5 +- 12 files changed, 462 insertions(+), 71 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index 2d176985..4c9ad947 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,6 +26,7 @@ users_guide/excited_states users_guide/natural_orbitals users_guide/plugins + users_guide/qp_plugins users_guide/index diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst index ecae22f2..ecb217ac 100644 --- a/docs/source/modules/density_for_dft.rst +++ b/docs/source/modules/density_for_dft.rst @@ -39,6 +39,60 @@ Providers --------- +.. c:var:: one_body_dm_alpha_ao_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + File: :file:`density_for_dft.irp.f` + + one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: one_body_dm_average_mo_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_average_mo_for_dft (mo_num,mo_num) + + File: :file:`density_for_dft.irp.f` + + + + + + +.. c:var:: one_body_dm_beta_ao_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_ao_for_dft (ao_num,ao_num,N_states) + double precision, allocatable :: one_body_dm_beta_ao_for_dft (ao_num,ao_num,N_states) + + File: :file:`density_for_dft.irp.f` + + one body density matrix on the AO basis based on one_body_dm_mo_alpha_for_dft + + + + +.. c:var:: one_body_dm_mo_alpha_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + density matrix for alpha electrons in the MO basis used for all DFT calculations based on the density + + + + .. c:var:: one_body_dm_mo_alpha_one_det .. code:: text @@ -53,6 +107,19 @@ Providers +.. c:var:: one_body_dm_mo_beta_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_beta_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + density matrix for beta electrons in the MO basis used for all DFT calculations based on the density + + + + .. c:var:: one_body_dm_mo_beta_one_det .. code:: text @@ -67,6 +134,19 @@ Providers +.. c:var:: one_body_dm_mo_for_dft + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_for_dft (mo_num,mo_num,N_states) + + File: :file:`density_for_dft.irp.f` + + + + + + .. c:var:: one_e_dm_alpha_ao_for_dft .. code:: text diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst index 3839e24e..bc8d370a 100644 --- a/docs/source/modules/determinants.rst +++ b/docs/source/modules/determinants.rst @@ -550,6 +550,196 @@ Providers +.. c:var:: one_body_dm_ao_alpha + + .. code:: text + + double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + + + +.. c:var:: one_body_dm_ao_beta + + .. code:: text + + double precision, allocatable :: one_body_dm_ao_alpha (ao_num,ao_num) + double precision, allocatable :: one_body_dm_ao_beta (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha), \rho_{AO}(\beta)` . + + + + +.. c:var:: one_body_dm_dagger_mo_spin_index + + .. code:: text + + double precision, allocatable :: one_body_dm_dagger_mo_spin_index (mo_num,mo_num,N_states,2) + + File: :file:`density_matrix.irp.f` + + + + + + +.. c:var:: one_body_dm_mo + + .. code:: text + + double precision, allocatable :: one_body_dm_mo (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + One-body density matrix + + + + +.. c:var:: one_body_dm_mo_alpha + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_alpha_average + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_beta + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha (mo_num,mo_num,N_states) + double precision, allocatable :: one_body_dm_mo_beta (mo_num,mo_num,N_states) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_beta_average + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_alpha_average (mo_num,mo_num) + double precision, allocatable :: one_body_dm_mo_beta_average (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_dm_mo_diff + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_diff (mo_num,mo_num,2:N_states) + + File: :file:`density_matrix.irp.f` + + Difference of the one-body density matrix with respect to the ground state + + + + +.. c:var:: one_body_dm_mo_spin_index + + .. code:: text + + double precision, allocatable :: one_body_dm_mo_spin_index (mo_num,mo_num,N_states,2) + + File: :file:`density_matrix.irp.f` + + + + + + +.. c:var:: one_body_single_double_dm_mo_alpha + + .. code:: text + + double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) + double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_single_double_dm_mo_beta + + .. code:: text + + double precision, allocatable :: one_body_single_double_dm_mo_alpha (mo_num,mo_num) + double precision, allocatable :: one_body_single_double_dm_mo_beta (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\alpha` and :math:`\beta` one-body density matrix for each state + + + + +.. c:var:: one_body_spin_density_ao + + .. code:: text + + double precision, allocatable :: one_body_spin_density_ao (ao_num,ao_num) + + File: :file:`density_matrix.irp.f` + + One body spin density matrix on the |AO| basis : :math:`\rho_{AO}(\alpha) - \rho_{AO}(\beta)` + + + + +.. c:var:: one_body_spin_density_mo + + .. code:: text + + double precision, allocatable :: one_body_spin_density_mo (mo_num,mo_num) + + File: :file:`density_matrix.irp.f` + + :math:`\rho(\alpha) - \rho(\beta)` + + + + .. c:var:: one_e_dm_ao_alpha .. code:: text @@ -3245,20 +3435,6 @@ Subroutines / functions -.. c:function:: pouet - - .. code:: text - - subroutine pouet - - File: :file:`test.irp.f` - - - - - - - .. c:function:: pull_pt2 .. code:: text @@ -3579,6 +3755,20 @@ Subroutines / functions +.. c:function:: test_det + + .. code:: text + + subroutine test_det + + File: :file:`test_det.irp.f` + + + + + + + .. c:function:: u_0_s2_u_0 .. code:: text diff --git a/docs/source/modules/dft_utils_in_r.rst b/docs/source/modules/dft_utils_in_r.rst index 66fad90b..cc3eb5d7 100644 --- a/docs/source/modules/dft_utils_in_r.rst +++ b/docs/source/modules/dft_utils_in_r.rst @@ -195,6 +195,126 @@ Providers +.. c:var:: one_body_dm_alpha_at_r + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_dm_beta_at_r + + .. code:: text + + double precision, allocatable :: one_body_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_body_dm_alpha_at_r(i,istate) = n_alpha(r_i,istate) one_body_dm_beta_at_r(i,istate) = n_beta(r_i,istate) where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_grad_2_dm_alpha_at_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_body_grad_2_dm_beta_at_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_alpha_in_r + + .. code:: text + + double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + File: :file:`dm_in_r.irp.f` + + + + + + +.. c:var:: one_dm_and_grad_alpha_in_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_and_grad_beta_in_r + + .. code:: text + + double precision, allocatable :: one_dm_and_grad_alpha_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_dm_and_grad_beta_in_r (4,n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_alpha_at_r (n_points_final_grid,N_states) + double precision, allocatable :: one_body_grad_2_dm_beta_at_r (n_points_final_grid,N_states) + + File: :file:`dm_in_r.irp.f` + + one_dm_and_grad_alpha_in_r(1,i,i_state) = d\dx n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(2,i,i_state) = d\dy n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(3,i,i_state) = d\dz n_alpha(r_i,istate) one_dm_and_grad_alpha_in_r(4,i,i_state) = n_alpha(r_i,istate) one_body_grad_2_dm_alpha_at_r(i,istate) = d\dx n_alpha(r_i,istate)^2 + d\dy n_alpha(r_i,istate)^2 + d\dz n_alpha(r_i,istate)^2 where r_i is the ith point of the grid and istate is the state number + + + + +.. c:var:: one_dm_beta_in_r + + .. code:: text + + double precision, allocatable :: one_dm_alpha_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + double precision, allocatable :: one_dm_beta_in_r (n_points_integration_angular,n_points_radial_grid,nucl_num,N_states) + + File: :file:`dm_in_r.irp.f` + + + + + + .. c:var:: one_e_dm_alpha_at_r .. code:: text diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst index ce23a9b7..d4dce0d8 100644 --- a/docs/source/modules/fci.rst +++ b/docs/source/modules/fci.rst @@ -86,20 +86,6 @@ Subroutines / functions -.. c:function:: run - - .. code:: text - - subroutine run - - File: :file:`pt2.irp.f` - - - - - - - .. c:function:: save_energy .. code:: text diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst index 4c03fb3a..7ca55dfe 100644 --- a/docs/source/modules/hartree_fock.rst +++ b/docs/source/modules/hartree_fock.rst @@ -200,7 +200,6 @@ Subroutines / functions -<<<<<<< HEAD .. c:function:: run .. code:: text diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst index 6b2354f3..2d76c0f5 100644 --- a/docs/source/modules/kohn_sham_rs.rst +++ b/docs/source/modules/kohn_sham_rs.rst @@ -176,6 +176,23 @@ Providers +.. c:var:: one_electron_energy + + .. code:: text + + double precision :: rs_ks_energy + double precision :: two_electron_energy + double precision :: one_electron_energy + double precision :: fock_matrix_energy + double precision :: trace_potential_xc + + File: :file:`rs_ks_energy.irp.f` + + Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. + + + + .. c:var:: rs_ks_energy .. code:: text @@ -227,40 +244,6 @@ Providers -.. c:var:: trace_potential_xc - - .. code:: text - - double precision :: rs_ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`rs_ks_energy.irp.f` - - Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - -.. c:var:: two_electron_energy - - .. code:: text - - double precision :: rs_ks_energy - double precision :: two_electron_energy - double precision :: one_electron_energy - double precision :: fock_matrix_energy - double precision :: trace_potential_xc - - File: :file:`rs_ks_energy.irp.f` - - Range-separated Kohn-Sham energy containing the nuclear repulsion energy, and the various components of this quantity. - - - - Subroutines / functions ----------------------- diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst index 0322a156..821d1b50 100644 --- a/docs/source/modules/tools.rst +++ b/docs/source/modules/tools.rst @@ -145,7 +145,7 @@ Subroutines / functions programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. - Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read the density in a further calculation. + Then, the global variable data_one_body_alpha_dm_mo and data_one_body_beta_dm_mo will automatically read the density in a further calculation. This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index 42ddd368..68d15ea0 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -150,8 +150,8 @@ Index of Providers * :c:data:`damping_for_rs_dft` * :c:data:`data_energy_proj` * :c:data:`data_energy_var` -* :c:data:`data_one_body_dm_alpha_mo` -* :c:data:`data_one_body_dm_beta_mo` +* :c:data:`data_one_body_alpha_dm_mo` +* :c:data:`data_one_body_beta_dm_mo` * :c:data:`data_one_e_dm_alpha_mo` * :c:data:`data_one_e_dm_beta_mo` * :c:data:`davidson_criterion` @@ -459,8 +459,36 @@ Index of Providers * :c:data:`nucl_num` * :c:data:`nucl_num_shell_aos` * :c:data:`nuclear_repulsion` +* :c:data:`one_body_dm_alpha_ao_for_dft` +* :c:data:`one_body_dm_alpha_at_r` +* :c:data:`one_body_dm_ao_alpha` +* :c:data:`one_body_dm_ao_beta` +* :c:data:`one_body_dm_average_mo_for_dft` +* :c:data:`one_body_dm_beta_ao_for_dft` +* :c:data:`one_body_dm_beta_at_r` +* :c:data:`one_body_dm_dagger_mo_spin_index` +* :c:data:`one_body_dm_mo` +* :c:data:`one_body_dm_mo_alpha` +* :c:data:`one_body_dm_mo_alpha_average` +* :c:data:`one_body_dm_mo_alpha_for_dft` * :c:data:`one_body_dm_mo_alpha_one_det` +* :c:data:`one_body_dm_mo_beta` +* :c:data:`one_body_dm_mo_beta_average` +* :c:data:`one_body_dm_mo_beta_for_dft` * :c:data:`one_body_dm_mo_beta_one_det` +* :c:data:`one_body_dm_mo_diff` +* :c:data:`one_body_dm_mo_for_dft` +* :c:data:`one_body_dm_mo_spin_index` +* :c:data:`one_body_grad_2_dm_alpha_at_r` +* :c:data:`one_body_grad_2_dm_beta_at_r` +* :c:data:`one_body_single_double_dm_mo_alpha` +* :c:data:`one_body_single_double_dm_mo_beta` +* :c:data:`one_body_spin_density_ao` +* :c:data:`one_body_spin_density_mo` +* :c:data:`one_dm_alpha_in_r` +* :c:data:`one_dm_and_grad_alpha_in_r` +* :c:data:`one_dm_and_grad_beta_in_r` +* :c:data:`one_dm_beta_in_r` * :c:data:`one_e_dm_alpha_ao_for_dft` * :c:data:`one_e_dm_alpha_at_r` * :c:data:`one_e_dm_alpha_in_r` @@ -488,6 +516,7 @@ Index of Providers * :c:data:`one_e_grad_2_dm_beta_at_r` * :c:data:`one_e_spin_density_ao` * :c:data:`one_e_spin_density_mo` +* :c:data:`one_electron_energy` * :c:data:`only_expected_s2` * :c:data:`output_cpu_time_0` * :c:data:`output_wall_time_0` @@ -1173,7 +1202,6 @@ Index of Subroutines/Functions * :c:func:`perturb_buffer_moller_plesset` * :c:func:`perturb_buffer_moller_plesset_general` * :c:func:`perturb_buffer_qdpt` -* :c:func:`pouet` * :c:func:`primitive_value` * :c:func:`print_det` * :c:func:`print_e_conv` @@ -1298,6 +1326,7 @@ Index of Subroutines/Functions * :c:func:`tamiser` * :c:func:`task_done_to_taskserver` * :c:func:`tasks_done_to_taskserver` +* :c:func:`test_det` * :c:func:`testteethbuilding` * :c:func:`total_memory` * :c:func:`two_e_integrals_index` diff --git a/docs/source/users_guide/configure.rst b/docs/source/users_guide/configure.rst index 63e42b44..1863bbce 100644 --- a/docs/source/users_guide/configure.rst +++ b/docs/source/users_guide/configure.rst @@ -5,6 +5,8 @@ configure .. program:: configure +Program that can either configure the compilations options and download/install external dependencies (see the installation description). + Usage ----- diff --git a/docs/source/users_guide/plugins.rst b/docs/source/users_guide/plugins.rst index 953d0889..9f6ecb96 100644 --- a/docs/source/users_guide/plugins.rst +++ b/docs/source/users_guide/plugins.rst @@ -7,7 +7,7 @@ Working with external plugins plugins need to be downloaded and installed in the ``$QP_ROOT/plugins`` directory. -Plugins are usually hosted in external repositories. To dowload a plugin, +Plugins are usually hosted in external repositories. To download a plugin, the remote repository needs to be downloaded, and the plugins of the repository can be selected for installation. @@ -47,5 +47,5 @@ To remove the module, run qp_plugins uninstall ext_module - +For a more detailed explanation and an example, see :ref:`qp_plugins`. diff --git a/docs/source/users_guide/qp_plugins.rst b/docs/source/users_guide/qp_plugins.rst index f1c100f8..3f545ff5 100644 --- a/docs/source/users_guide/qp_plugins.rst +++ b/docs/source/users_guide/qp_plugins.rst @@ -96,7 +96,7 @@ Now let us install the plugin `rsdft_cipsi`: qp_plugins install rsdft_cipsi This will link this directory to the |QP| which means that when the code will be compiled, this plugin will be compiled to and therefore -all the executables/scripts contained in this module will be available. +all the executables/scripts/input keywords contained in this module will be available as if there were part of the core of the |QP|. Then, to compile the new plugin, just recompile the |QP| as usual by going at the root of the |QP| directory: @@ -106,4 +106,5 @@ Then, to compile the new plugin, just recompile the |QP| as usual by going at th cd $QP_ROOT ninja -Then, when executing +Then, if you go back to the plugin directory you just installed, you should see all the executables/scripts which have been created and +which are now available with the `qp_run` command. From 5cf9f81f4b70fbeb0c3d5d527a6cbc3a50e52599 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Fri, 11 Jan 2019 16:20:45 +0100 Subject: [PATCH 6/6] more detailed documentation on the doc of the programs --- REPLACE | 1 + src/cis/cis.irp.f | 35 ++++++++++++ src/cisd/cisd.irp.f | 35 ++++++++++++ src/dft_utils_in_r/ao_in_r.irp.f | 1 + src/dft_utils_one_e/pot_ao.irp.f | 88 +++++++++++++++-------------- src/fci/fci.irp.f | 34 +++++++++++ src/fci/pt2.irp.f | 9 ++- src/kohn_sham/ks_enery.irp.f | 8 +-- src/kohn_sham/ks_scf.irp.f | 3 +- src/kohn_sham_rs/rs_ks_energy.irp.f | 8 +-- src/kohn_sham_rs/rs_ks_scf.irp.f | 6 +- src/tools/diagonalize_h.irp.f | 2 +- src/tools/fcidump.irp.f | 12 +++- src/tools/four_idx_transform.irp.f | 6 +- src/tools/print_e_conv.irp.f | 8 ++- src/tools/print_wf.irp.f | 4 +- src/tools/save_natorb.irp.f | 8 +++ src/tools/save_one_e_dm.irp.f | 8 ++- src/tools/save_ortho_mos.irp.f | 6 ++ src/tools/write_integrals_erf.irp.f | 2 +- 20 files changed, 217 insertions(+), 67 deletions(-) diff --git a/REPLACE b/REPLACE index 0d464239..73d88bdc 100644 --- a/REPLACE +++ b/REPLACE @@ -180,3 +180,4 @@ qp_name data_one_body_dm_beta_mo -r data_one_e_dm_beta_mo qp_name save_one_body_dm -r save_one_e_dm qp_name ezfio_set_aux_quantities_data_one_e_alpha_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_alpha_mo qp_name ezfio_set_aux_quantities_data_one_e_beta_dm_mo -r ezfio_set_aux_quantities_data_one_e_dm_beta_mo +qp_name two_electron_energy -r two_e_energy diff --git a/src/cis/cis.irp.f b/src/cis/cis.irp.f index 244a2ae7..bdc62c52 100644 --- a/src/cis/cis.irp.f +++ b/src/cis/cis.irp.f @@ -2,6 +2,41 @@ program cis implicit none BEGIN_DOC ! Configuration Interaction with Single excitations. + ! + ! This program takes a reference Slater determinant of ROHF-like occupancy, + ! + ! and performs all single excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix. (see :option:`determinants n_states`) + ! + ! This program can be useful in many cases: + ! + ! * GROUND STATE CALCULATION: to be sure to have the lowest scf solution, perform an scf (see the :ref:`hartree_fock` module), then a cis, + ! + ! save the natural orbitals (see :ref:`save_natorb`) and reperform an scf optimization from this MO guess + ! + ! + ! + ! * EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single-excitations. + ! + ! Therefore, running a cis will save the "n_states" lowest states within the CIS space + ! + ! in the EZFIO folder, which can afterward be used as guess wave functions for a further + + ! + ! multi-state fci calculation if you specify "read_wf" = True before running the fci executable. + ! + ! Also, if you specify "s2_eig" = True, the cis will only retain states having the good value :math:`S^2` value (see expected_s2). + ! + ! If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are. + ! + ! + ! + ! Note: if you would like to discard some orbitals, use qp_set_mo_class to specify: + ! + ! * "core" orbitals which will be always doubly occupied + ! + ! * "act" orbitals where an electron can be either excited from or to + ! + ! * "del" orbitals which will be never occupied END_DOC read_wf = .False. SOFT_TOUCH read_wf diff --git a/src/cisd/cisd.irp.f b/src/cisd/cisd.irp.f index 0dc04d45..c94d1ee9 100644 --- a/src/cisd/cisd.irp.f +++ b/src/cisd/cisd.irp.f @@ -2,6 +2,41 @@ program cisd implicit none BEGIN_DOC ! Configuration Interaction with Single and Double excitations. +! + ! This program takes a reference Slater determinant of ROHF-like occupancy, + ! + ! and performs all single and double excitations on top of it, disregarding spatial symmetry and compute the "n_states" lowest eigenstates of that CI matrix. + ! + ! This program can be useful in many cases: + ! + ! * GROUND STATE CALCULATION: if even after a cis calculation, natural orbitals and then scf optimization, you are not sure to have the lowest scf solution, + + ! do the same strategy with the cisd executable to generate the natural orbitals as a guess for the scf. + ! + ! + ! + ! * EXCITED STATES CALCULATIONS: the lowest excited states are much likely to be dominanted by single- or double-excitations. + ! + ! Therefore, running a cis will save the "n_states" lowest states within the CISD space + ! + ! in the EZFIO folder, which can afterward be used as guess wave functions for a further + + ! + ! multi-state fci calculation if you specify "read_wf" = True before running the fci executable. + ! + ! Also, if you specify "s2_eig" = True, the cisd will only retain states having the good value :math:`S^2` value (see expected_s2). + ! + ! If "s2_eig" = False, it will take the lowest n_states, whatever multiplicity they are. + ! + ! + ! + ! Note: if you would like to discard some orbitals, use qp_set_mo_class to specify: + ! + ! * "core" orbitals which will be always doubly occupied + ! + ! * "act" orbitals where an electron can be either excited from or to + ! + ! * "del" orbitals which will be never occupied END_DOC read_wf = .False. SOFT_TOUCH read_wf diff --git a/src/dft_utils_in_r/ao_in_r.irp.f b/src/dft_utils_in_r/ao_in_r.irp.f index 332f3ad1..0063b8cd 100644 --- a/src/dft_utils_in_r/ao_in_r.irp.f +++ b/src/dft_utils_in_r/ao_in_r.irp.f @@ -22,6 +22,7 @@ BEGIN_PROVIDER[double precision, aos_grad_in_r_array, (ao_num,n_points_final_grid,3)] &BEGIN_PROVIDER[double precision, aos_grad_in_r_array_transp, (n_points_final_grid,ao_num,3)] +&BEGIN_PROVIDER[double precision, aos_grad_in_r_array_transp_xyz, (3,n_points_final_grid,ao_num)] implicit none BEGIN_DOC ! aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point diff --git a/src/dft_utils_one_e/pot_ao.irp.f b/src/dft_utils_one_e/pot_ao.irp.f index 2d05e9a8..fb9019b8 100644 --- a/src/dft_utils_one_e/pot_ao.irp.f +++ b/src/dft_utils_one_e/pot_ao.irp.f @@ -15,21 +15,21 @@ mu_local = 1.d-9 allocate(rhoa(N_states), rhob(N_states)) do istate = 1, N_states - do i = 1, n_points_final_grid - r(1) = final_grid_points(1,i) - r(2) = final_grid_points(2,i) - r(3) = final_grid_points(3,i) - weight = final_weight_at_r_vector(i) - rhoa(istate) = one_e_dm_alpha_at_r(i,istate) - rhob(istate) = one_e_dm_beta_at_r(i,istate) - call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) - call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) - do j =1, ao_num - aos_vc_alpha_LDA_w(i,j,istate) = vc_a * aos_in_r_array(j,i)*weight - aos_vc_beta_LDA_w(i,j,istate) = vc_b * aos_in_r_array(j,i)*weight - aos_vx_alpha_LDA_w(i,j,istate) = vx_a * aos_in_r_array(j,i)*weight - aos_vx_beta_LDA_w(i,j,istate) = vx_b * aos_in_r_array(j,i)*weight - enddo + do j =1, ao_num + do i = 1, n_points_final_grid + r(1) = final_grid_points(1,i) + r(2) = final_grid_points(2,i) + r(3) = final_grid_points(3,i) + weight = final_weight_at_r_vector(i) + rhoa(istate) = one_e_dm_alpha_at_r(i,istate) + rhob(istate) = one_e_dm_beta_at_r(i,istate) + call ec_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_c,vc_a,vc_b) + call ex_LDA_sr(mu_local,rhoa(istate),rhob(istate),e_x,vx_a,vx_b) + aos_vc_alpha_LDA_w(i,j,istate) = vc_a * aos_in_r_array_transp(i,j)*weight + aos_vc_beta_LDA_w(i,j,istate) = vc_b * aos_in_r_array_transp(i,j)*weight + aos_vx_alpha_LDA_w(i,j,istate) = vx_a * aos_in_r_array_transp(i,j)*weight + aos_vx_beta_LDA_w(i,j,istate) = vx_b * aos_in_r_array_transp(i,j)*weight + enddo enddo enddo @@ -58,10 +58,10 @@ END_PROVIDER - BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)] -&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] !(n_points_final_grid,ao_num,N_states)] -&BEGIN_PROVIDER[double precision, aos_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)]!(n_points_final_grid,ao_num,N_states)] + BEGIN_PROVIDER[double precision, aos_vc_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vc_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_alpha_PBE_w , (ao_num,n_points_final_grid,N_states)] +&BEGIN_PROVIDER[double precision, aos_vx_beta_PBE_w , (ao_num,n_points_final_grid,N_states)] &BEGIN_PROVIDER[double precision, aos_dvc_alpha_PBE_w , (ao_num,n_points_final_grid,3,N_states)] &BEGIN_PROVIDER[double precision, aos_dvc_beta_PBE_w , (ao_num,n_points_final_grid,3,N_states)] &BEGIN_PROVIDER[double precision, aos_dvx_alpha_PBE_w , (ao_num,n_points_final_grid,3,N_states)] @@ -112,33 +112,35 @@ call GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & ! outputs exchange ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & ! outputs correlation ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - vx_rho_a(istate) *= weight - vc_rho_a(istate) *= weight - vx_rho_b(istate) *= weight - vc_rho_b(istate) *= weight - do m= 1,3 - contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) - contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) - enddo + vx_rho_a(istate) *= weight + vc_rho_a(istate) *= weight + vx_rho_b(istate) *= weight + vc_rho_b(istate) *= weight + do m= 1,3 + contrib_grad_ca(m,istate) = weight * (2.d0 * vc_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_xa(m,istate) = weight * (2.d0 * vx_grad_rho_a_2(istate) * grad_rho_a(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_b(m,istate)) + contrib_grad_cb(m,istate) = weight * (2.d0 * vc_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vc_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + contrib_grad_xb(m,istate) = weight * (2.d0 * vx_grad_rho_b_2(istate) * grad_rho_b(m,istate) + vx_grad_rho_a_b(istate) * grad_rho_a(m,istate)) + enddo + do j = 1, ao_num + aos_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) + aos_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) + aos_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) + aos_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) + enddo + do m = 1,3 do j = 1, ao_num - aos_vc_alpha_PBE_w(j,i,istate) = vc_rho_a(istate) * aos_in_r_array(j,i) - aos_vc_beta_PBE_w (j,i,istate) = vc_rho_b(istate) * aos_in_r_array(j,i) - aos_vx_alpha_PBE_w(j,i,istate) = vx_rho_a(istate) * aos_in_r_array(j,i) - aos_vx_beta_PBE_w (j,i,istate) = vx_rho_b(istate) * aos_in_r_array(j,i) - do m = 1,3 - aos_dvc_alpha_PBE_w(j,i,m,istate) = contrib_grad_ca(m,istate) * aos_in_r_array(j,i) - aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_in_r_array(j,i) - aos_dvx_alpha_PBE_w(j,i,m,istate) = contrib_grad_xa(m,istate) * aos_in_r_array(j,i) - aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_in_r_array(j,i) + aos_dvc_alpha_PBE_w(j,i,m,istate) = contrib_grad_ca(m,istate) * aos_in_r_array(j,i) + aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_in_r_array(j,i) + aos_dvx_alpha_PBE_w(j,i,m,istate) = contrib_grad_xa(m,istate) * aos_in_r_array(j,i) + aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_in_r_array(j,i) - grad_aos_dvc_alpha_PBE_w (j,i,m,istate) = contrib_grad_ca(m,istate) * aos_grad_in_r_array(j,i,m) - grad_aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_grad_in_r_array(j,i,m) - grad_aos_dvx_alpha_PBE_w (j,i,m,istate) = contrib_grad_xa(m,istate) * aos_grad_in_r_array(j,i,m) - grad_aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_grad_in_r_array(j,i,m) - enddo + grad_aos_dvc_alpha_PBE_w (j,i,m,istate) = contrib_grad_ca(m,istate) * aos_grad_in_r_array(m,j,i) + grad_aos_dvc_beta_PBE_w (j,i,m,istate) = contrib_grad_cb(m,istate) * aos_grad_in_r_array(m,j,i) + grad_aos_dvx_alpha_PBE_w (j,i,m,istate) = contrib_grad_xa(m,istate) * aos_grad_in_r_array(m,j,i) + grad_aos_dvx_beta_PBE_w (j,i,m,istate) = contrib_grad_xb(m,istate) * aos_grad_in_r_array(m,j,i) enddo + enddo enddo enddo diff --git a/src/fci/fci.irp.f b/src/fci/fci.irp.f index f4587c75..63113c90 100644 --- a/src/fci/fci.irp.f +++ b/src/fci/fci.irp.f @@ -2,6 +2,40 @@ program fci implicit none BEGIN_DOC ! Selected Full Configuration Interaction with stochastic selection and PT2. +! +! This program performs a CIPSI-like selected CI using a stochastic scheme for both +! +! the selection of the important Slater determinants and the computation of the PT2 correction. +! +! This CIPSI-like algorithm will be performed for the "n_states" lowest states of the variational space (see :option:`determinants n_det_max`) +! +! The fci program will stop when reaching at least one the two following conditions: +! +! * number of Slater determinant > "n_det_max" (see :option:`determinants n_det_max`) +! +! * |PT2| < "pt2_max" (see :option:`perturbation pt2_max`) +! +! +! The following other options can be of interest: +! +! If "read_wf" = False, it starts with a ROHF-like Slater determinant as a guess wave function. +! +! If "read_wf" = True , it starts with the wave function(s) stored in the EZFIO folder as guess wave function(s). +! +! (see :option:`determinants read_wf`) +! +! If "s2_eig" = True, it will systematically add all necessary Slater determinants in order +! +! to have a pure spin wave function with an :math:`S^2` value corresponding to "expected_s2". +! +! (see :option:`determinants s2_eig` and :option:`determinants expected_s2`) +! +! +! +! +! For excited states calculations, it is recommended to start with a cis or cisd guess wave functions +! +! for the "n_states", and to set "s2_eig" = True. END_DOC if (.not.is_zmq_slave) then diff --git a/src/fci/pt2.irp.f b/src/fci/pt2.irp.f index deb6fdb1..3e65965d 100644 --- a/src/fci/pt2.irp.f +++ b/src/fci/pt2.irp.f @@ -1,8 +1,13 @@ program pt2 implicit none BEGIN_DOC - ! Second order perturbative correction to the wave function contained in the - ! EZFIO directory. + ! Second order perturbative correction to the wave function contained in the EZFIO directory. + ! + ! This programs runs the stochastic PT2 correction on all "n_states" wave function stored in the EZFIO folder (see :option:`determinant n_states`). + ! + ! The option for the PT2 correction are the "pt2_relative_error" which is the relative stochastic + ! + ! error on the PT2 to reach before stopping the stochastic sampling. (see :option:`perturbation pt2_relative_error`) END_DOC if (.not. is_zmq_slave) then read_wf = .True. diff --git a/src/kohn_sham/ks_enery.irp.f b/src/kohn_sham/ks_enery.irp.f index d482ee56..21b4f8d7 100644 --- a/src/kohn_sham/ks_enery.irp.f +++ b/src/kohn_sham/ks_enery.irp.f @@ -1,5 +1,5 @@ BEGIN_PROVIDER [ double precision, KS_energy] -&BEGIN_PROVIDER [ double precision, two_electron_energy] +&BEGIN_PROVIDER [ double precision, two_e_energy] &BEGIN_PROVIDER [ double precision, one_e_energy] &BEGIN_PROVIDER [ double precision, Fock_matrix_energy] &BEGIN_PROVIDER [ double precision, trace_potential_xc ] @@ -12,21 +12,21 @@ double precision :: accu_mono,accu_fock KS_energy = nuclear_repulsion one_e_energy = 0.d0 - two_electron_energy = 0.d0 + two_e_energy = 0.d0 Fock_matrix_energy = 0.d0 trace_potential_xc = 0.d0 do j=1,ao_num do i=1,ao_num Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + & Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) - two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & + two_e_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo - KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_electron_energy + KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_e_energy END_PROVIDER BEGIN_PROVIDER [double precision, extra_e_contrib_density] diff --git a/src/kohn_sham/ks_scf.irp.f b/src/kohn_sham/ks_scf.irp.f index b2dd0e82..77274219 100644 --- a/src/kohn_sham/ks_scf.irp.f +++ b/src/kohn_sham/ks_scf.irp.f @@ -86,11 +86,10 @@ subroutine run EHF = KS_energy - mo_label = "Canonical" + mo_label = "Orthonormalized" ! Choose SCF algorithm -! call damping_SCF ! Deprecated routine call Roothaan_Hall_SCF end diff --git a/src/kohn_sham_rs/rs_ks_energy.irp.f b/src/kohn_sham_rs/rs_ks_energy.irp.f index a557891f..ccca8d70 100644 --- a/src/kohn_sham_rs/rs_ks_energy.irp.f +++ b/src/kohn_sham_rs/rs_ks_energy.irp.f @@ -1,5 +1,5 @@ BEGIN_PROVIDER [ double precision, RS_KS_energy ] -&BEGIN_PROVIDER [ double precision, two_electron_energy] +&BEGIN_PROVIDER [ double precision, two_e_energy] &BEGIN_PROVIDER [ double precision, one_e_energy] &BEGIN_PROVIDER [ double precision, Fock_matrix_energy] &BEGIN_PROVIDER [ double precision, trace_potential_xc ] @@ -12,20 +12,20 @@ integer :: i,j double precision :: accu_mono,accu_fock one_e_energy = 0.d0 - two_electron_energy = 0.d0 + two_e_energy = 0.d0 Fock_matrix_energy = 0.d0 trace_potential_xc = 0.d0 do j=1,ao_num do i=1,ao_num Fock_matrix_energy += Fock_matrix_ao_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) + & Fock_matrix_ao_beta(i,j) * SCF_density_matrix_ao_beta(i,j) - two_electron_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & + two_e_energy += 0.5d0 * ( ao_two_e_integral_alpha(i,j) * SCF_density_matrix_ao_alpha(i,j) & +ao_two_e_integral_beta(i,j) * SCF_density_matrix_ao_beta(i,j) ) one_e_energy += ao_one_e_integrals(i,j) * (SCF_density_matrix_ao_alpha(i,j) + SCF_density_matrix_ao_beta (i,j) ) trace_potential_xc += ao_potential_alpha_xc(i,j) * SCF_density_matrix_ao_alpha(i,j) + ao_potential_beta_xc(i,j) * SCF_density_matrix_ao_beta (i,j) enddo enddo - RS_KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_electron_energy + RS_KS_energy += e_exchange_dft + e_correlation_dft + one_e_energy + two_e_energy END_PROVIDER BEGIN_PROVIDER [double precision, extra_e_contrib_density] diff --git a/src/kohn_sham_rs/rs_ks_scf.irp.f b/src/kohn_sham_rs/rs_ks_scf.irp.f index f89a1267..c227e63b 100644 --- a/src/kohn_sham_rs/rs_ks_scf.irp.f +++ b/src/kohn_sham_rs/rs_ks_scf.irp.f @@ -89,13 +89,15 @@ subroutine run EHF = RS_KS_energy - mo_label = "Canonical" + mo_label = "Orthonormalized" + level_shift += 1.d0 + touch level_shift call Roothaan_Hall_SCF call ezfio_set_kohn_sham_rs_energy(SCF_energy) write(*, '(A22,X,F16.10)') 'one_e_energy = ',one_e_energy - write(*, '(A22,X,F16.10)') 'two_electron_energy = ',two_electron_energy + write(*, '(A22,X,F16.10)') 'two_e_energy = ',two_e_energy write(*, '(A22,X,F16.10)') 'e_exchange_dft = ',e_exchange_dft write(*, '(A22,X,F16.10)') 'e_correlation_dft = ',e_correlation_dft write(*, '(A22,X,F16.10)') 'Fock_matrix_energy = ',Fock_matrix_energy diff --git a/src/tools/diagonalize_h.irp.f b/src/tools/diagonalize_h.irp.f index 8f564ca9..902ef0cd 100644 --- a/src/tools/diagonalize_h.irp.f +++ b/src/tools/diagonalize_h.irp.f @@ -1,7 +1,7 @@ program diagonalize_h implicit none BEGIN_DOC -! program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder +! program that extracts the `n_states` lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder END_DOC read_wf = .True. touch read_wf diff --git a/src/tools/fcidump.irp.f b/src/tools/fcidump.irp.f index a4a86092..3d97cb26 100644 --- a/src/tools/fcidump.irp.f +++ b/src/tools/fcidump.irp.f @@ -1,7 +1,17 @@ program fcidump implicit none BEGIN_DOC -! Produce a FCIDUMP file +! Produce a regular FCIDUMP file from the MOs stored in the EZFIO folder. +! +! To specify an active space, the class of the mos have to set in the EZFIO folder (see set_mo_class/qp_set_mo_class). +! +! The fcidump program supports 3 types of MO_class : +! +! * the "core" orbitals which are always doubly occupied in the calculation +! +! * the "del" orbitals that are never occupied in the calculation +! +! * the "act" orbitals that will be occupied by a varying number of electrons END_DOC character*(128) :: output integer :: i_unit_output,getUnitAndOpen diff --git a/src/tools/four_idx_transform.irp.f b/src/tools/four_idx_transform.irp.f index c2a595db..9b11be84 100644 --- a/src/tools/four_idx_transform.irp.f +++ b/src/tools/four_idx_transform.irp.f @@ -1,7 +1,11 @@ program four_idx_transform implicit none BEGIN_DOC -! 4-index transformation of two-electron integrals from AO to MO integrals +! 4-index transformation of two-electron integrals from AO to MO integrals. +! +! This program will compute the two-electron integrals on the MO basis and store it into the EZFIO folder. +! +! This program can be useful if the AO --> MO transformation is an expensive step by itself. END_DOC io_mo_two_e_integrals = 'Write' diff --git a/src/tools/print_e_conv.irp.f b/src/tools/print_e_conv.irp.f index 19d88e5c..64d5af8b 100644 --- a/src/tools/print_e_conv.irp.f +++ b/src/tools/print_e_conv.irp.f @@ -1,7 +1,13 @@ program print_e_conv implicit none BEGIN_DOC -! program that prints in a human readable format the convergence of the CIPSI algorithm +! program that prints in a human readable format the convergence of the CIPSI algorithm. +! +! for all istate, this program produces +! +! * a file "EZFIO.$istate.conv" containing the variational and var+PT2 energies as a function of N_det +! +! * for istate > 1, a file EZFIO.$istate.delta_e.conv containing the energy difference (both var and var+PT2) with the ground state as a function of N_det END_DOC provide ezfio_filename diff --git a/src/tools/print_wf.irp.f b/src/tools/print_wf.irp.f index 92b1d6af..a0e9c112 100644 --- a/src/tools/print_wf.irp.f +++ b/src/tools/print_wf.irp.f @@ -1,9 +1,9 @@ program print_wf implicit none BEGIN_DOC - ! print the wave function stored in the EZFIO folder in the intermediate normalization + ! print the wave function stored in the EZFIO folder in the intermediate normalization. ! - ! it also prints a lot of information regarding the excitation operators from the reference determinant + ! it also prints a lot of information regarding the excitation operators from the reference determinant ! ! and a first-order perturbative analysis of the wave function. ! diff --git a/src/tools/save_natorb.irp.f b/src/tools/save_natorb.irp.f index 750915af..c66bc77b 100644 --- a/src/tools/save_natorb.irp.f +++ b/src/tools/save_natorb.irp.f @@ -2,6 +2,14 @@ program save_natorb implicit none BEGIN_DOC ! Save natural MOs into the EZFIO +! +! This program reads the wave function stored in the EZFIO folder, +! +! extracts the corresponding natural orbitals and set them as the new MOs +! +! If this is a multi-state calculation, the density matrix that produces the natural orbitals +! +! is obtained from a state-averaged of the density matrices of each state with the corresponding state_average_weight (see the doc of state_average_weight). END_DOC read_wf = .True. touch read_wf diff --git a/src/tools/save_one_e_dm.irp.f b/src/tools/save_one_e_dm.irp.f index e51a97d1..1c54f31f 100644 --- a/src/tools/save_one_e_dm.irp.f +++ b/src/tools/save_one_e_dm.irp.f @@ -1,11 +1,13 @@ program save_one_e_dm implicit none BEGIN_DOC -! programs that computes the one body density on the mo basis for alpha and beta electrons from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. +! programs that computes the one body density on the mo basis for alpha and beta electrons + +! from the wave function stored in the EZFIO folder, and then save it into the EZFIO folder aux_quantities. ! -! Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read the density in a further calculation. +! Then, the global variable data_one_e_dm_alpha_mo and data_one_e_dm_beta_mo will automatically read this density in a further calculation. ! -! This can be used to perform dampin on the density in RS-DFT calculation (see the density_for_dft module). +! This can be used to perform damping on the density in RS-DFT calculation (see the density_for_dft module). END_DOC read_wf = .True. touch read_wf diff --git a/src/tools/save_ortho_mos.irp.f b/src/tools/save_ortho_mos.irp.f index 94cbd3c4..0b2ec7bb 100644 --- a/src/tools/save_ortho_mos.irp.f +++ b/src/tools/save_ortho_mos.irp.f @@ -2,6 +2,12 @@ program save_ortho_mos implicit none BEGIN_DOC ! Save orthonormalized MOs in the EZFIO. + ! + ! This program reads the current MOs, computes the corresponding overlap matrix in the MO basis + ! + ! and perform a Lowdin orthonormalization : :math:`MO_{new} = S^{-1/2} MO_{guess}`. + ! + ! Thanks to the Lowdin orthonormalization, the new MOs are the most similar to the guess MOs. END_DOC call orthonormalize_mos call save_mos diff --git a/src/tools/write_integrals_erf.irp.f b/src/tools/write_integrals_erf.irp.f index 6f350874..98d5691d 100644 --- a/src/tools/write_integrals_erf.irp.f +++ b/src/tools/write_integrals_erf.irp.f @@ -1,7 +1,7 @@ program write_integrals implicit none BEGIN_DOC - ! Saves the two-electron erf integrals into the EZFIO + ! Saves the two-electron integrals with the :math:`erf(\mu r_{12})/r_{12}` oprerator into the EZFIO folder END_DOC io_mo_two_e_integrals = 'None' touch io_mo_two_e_integrals