From 5cf9f81f4b70fbeb0c3d5d527a6cbc3a50e52599 Mon Sep 17 00:00:00 2001 From: Emmanuel Giner Date: Fri, 11 Jan 2019 16:20:45 +0100 Subject: [PATCH] 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