From e3a072279669d7db1008b45d205d06adf780441b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Sun, 6 Jan 2019 16:14:45 +0100 Subject: [PATCH 1/6] Stochastic selection work --- src/fci/fci.irp.f | 56 ++++++------ src/fci/pt2.irp.f | 3 +- src/fci/pt2_stoch_routines.irp.f | 59 +++++++++---- src/fci/run_pt2_slave.irp.f | 142 ++++++++++++++++++++++++------- src/fci/selection.irp.f | 26 +++++- src/fci/zmq_selection.irp.f | 2 +- 6 files changed, 207 insertions(+), 81 deletions(-) diff --git a/src/fci/fci.irp.f b/src/fci/fci.irp.f index 6562b080..2b53bf8b 100644 --- a/src/fci/fci.irp.f +++ b/src/fci/fci.irp.f @@ -66,17 +66,19 @@ program fci write(*,'(A)') '--------------------------------------------------------------------------------' - if (do_pt2) then - pt2 = 0.d0 - variance = 0.d0 - norm = 0.d0 - threshold_generators = 1.d0 - SOFT_TOUCH threshold_generators - call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, norm) ! Stochastic PT2 - threshold_generators = threshold_generators_save - SOFT_TOUCH threshold_generators - endif + n_det_before = N_det + to_select = N_det + to_select = max(N_states_diag, to_select) + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + threshold_generators = 1.d0 + SOFT_TOUCH threshold_generators + call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & + norm, to_select) ! Stochastic PT2 + threshold_generators = threshold_generators_save + SOFT_TOUCH threshold_generators correlation_energy_ratio = (psi_energy_with_nucl_rep(1) - hf_energy_ref) / & (psi_energy_with_nucl_rep(1) + pt2(1) - hf_energy_ref) @@ -94,11 +96,7 @@ program fci call print_extrapolated_energy(psi_energy_with_nucl_rep(1:N_states),rpt2) N_iter += 1 - n_det_before = N_det - to_select = N_det - to_select = max(N_states_diag, to_select) -! to_select = min(to_select, N_det_max-n_det_before) - call ZMQ_selection(to_select, pt2, variance, norm) +! call ZMQ_selection(to_select, pt2, variance, norm) PROVIDE psi_coef PROVIDE psi_det @@ -116,23 +114,17 @@ program fci call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep(1:N_states)+pt2) endif - if (do_pt2) then - pt2 = 0.d0 - variance = 0.d0 - norm = 0.d0 - threshold_generators = 1d0 - SOFT_TOUCH threshold_generators - call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,variance,norm) ! Stochastic PT2 - threshold_generators = threshold_generators_save - SOFT_TOUCH threshold_generators - call ezfio_set_fci_energy(psi_energy_with_nucl_rep(1:N_states)) - call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep(1:N_states)+pt2) - endif - print *, 'N_det = ', N_det - print *, 'N_sop = ', N_occ_pattern - print *, 'N_states = ', N_states - print*, 'correlation_ratio = ', correlation_energy_ratio - + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + threshold_generators = 1d0 + SOFT_TOUCH threshold_generators + call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,variance, & + norm,0) ! Stochastic PT2 + threshold_generators = threshold_generators_save + SOFT_TOUCH threshold_generators + call ezfio_set_fci_energy(psi_energy_with_nucl_rep(1:N_states)) + call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep(1:N_states)+pt2) do k=1,N_states rpt2(:) = pt2(:)/(1.d0 + norm(k)) diff --git a/src/fci/pt2.irp.f b/src/fci/pt2.irp.f index 94b05adf..e0d03aca 100644 --- a/src/fci/pt2.irp.f +++ b/src/fci/pt2.irp.f @@ -29,7 +29,8 @@ subroutine run E_CI_before(:) = psi_energy(:) + nuclear_repulsion relative_error=PT2_relative_error - call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, norm) ! Stochastic PT2 + call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & + norm,0) ! Stochastic PT2 do k=1,N_states rpt2(:) = pt2(:)/(1.d0 + norm(k)) enddo diff --git a/src/fci/pt2_stoch_routines.irp.f b/src/fci/pt2_stoch_routines.irp.f index ab72a80c..d100fc36 100644 --- a/src/fci/pt2_stoch_routines.irp.f +++ b/src/fci/pt2_stoch_routines.irp.f @@ -95,34 +95,42 @@ end function -subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) +subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in) use f77_zmq use selection_types implicit none integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_socket_pull + integer, intent(in) :: N_in integer, external :: omp_get_thread_num double precision, intent(in) :: relative_error, E(N_states) double precision, intent(out) :: pt2(N_states),error(N_states) double precision, intent(out) :: variance(N_states),norm(N_states) - integer :: i + integer :: i, N double precision, external :: omp_get_wtime double precision :: state_average_weight_save(N_states), w(N_states,4) integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket + type(selection_buffer) :: b + if (N_det < max(10,N_states)) then pt2=0.d0 variance=0.d0 norm=0.d0 - call ZMQ_selection(0, pt2, variance, norm) + call ZMQ_selection(N_in, pt2, variance, norm) error(:) = 0.d0 else + N = max(N_in,1) state_average_weight_save(:) = state_average_weight(:) + call create_selection_buffer(N, N*2, b) + ASSERT (associated(b%det)) + ASSERT (associated(b%val)) + do pt2_stoch_istate=1,N_states state_average_weight(:) = 0.d0 state_average_weight(pt2_stoch_istate) = 1.d0 @@ -159,9 +167,8 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) endif - integer, external :: add_task_to_taskserver - character(400000) :: task + character(300000) :: task integer :: j,k,ipos,ifirst ifirst=0 @@ -178,9 +185,9 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) ipos=1 do i= 1, N_det_generators do j=1,pt2_F(pt2_J(i)) - write(task(ipos:ipos+20),'(I9,1X,I9,''|'')') j, pt2_J(i) - ipos += 20 - if (ipos > 400000-20) then + write(task(ipos:ipos+30),'(I9,1X,I9,1X,I9,''|'')') j, pt2_J(i), N + ipos += 30 + if (ipos > 300000-30) then if (add_task_to_taskserver(zmq_to_qp_run_socket,trim(task(1:ipos))) == -1) then stop 'Unable to add task to task server' endif @@ -199,7 +206,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) stop 'Unable to add task to task server' endif endif - + integer, external :: zmq_set_running if (zmq_set_running(zmq_to_qp_run_socket) == -1) then print *, irp_here, ': Failed in zmq_set_running' @@ -228,7 +235,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) i = omp_get_thread_num() if (i==0) then - call pt2_collector(zmq_socket_pull, E(pt2_stoch_istate),relative_error, w(1,1), w(1,2), w(1,3), w(1,4)) + call pt2_collector(zmq_socket_pull, E(pt2_stoch_istate),relative_error, w(1,1), w(1,2), w(1,3), w(1,4), b, N) pt2(pt2_stoch_istate) = w(pt2_stoch_istate,1) error(pt2_stoch_istate) = w(pt2_stoch_istate,2) variance(pt2_stoch_istate) = w(pt2_stoch_istate,3) @@ -243,9 +250,18 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) print '(A)', '========== ================= =========== =============== =============== =================' enddo -! call omp_set_nested(.false.) - FREE pt2_stoch_istate + + if (N_in > 0) then + if (s2_eig) then + call make_selection_buffer_s2(b) + endif + call fill_H_apply_buffer_no_selection(b%cur,b%det,N_int,0) + call copy_H_apply_buffer_to_wf() + call save_wavefunction + endif + call delete_selection_buffer(b) + state_average_weight(:) = state_average_weight_save(:) TOUCH state_average_weight endif @@ -264,7 +280,8 @@ subroutine pt2_slave_inproc(i) end -subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, variance, norm) +subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, & + variance, norm, b, N_) use f77_zmq use selection_types use bitmasks @@ -272,9 +289,11 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc integer(ZMQ_PTR), intent(in) :: zmq_socket_pull - double precision, intent(in) :: relative_error, E + double precision, intent(in) :: relative_error, E double precision, intent(out) :: pt2(N_states), error(N_states) double precision, intent(out) :: variance(N_states), norm(N_states) + type(selection_buffer), intent(inout) :: b + integer, intent(in) :: N_ double precision, allocatable :: eI(:,:), eI_task(:,:), S(:), S2(:) @@ -297,6 +316,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc integer, allocatable :: f(:) logical, allocatable :: d(:) logical :: do_exit + type(selection_buffer) :: b2 double precision :: rss @@ -319,6 +339,8 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() + call create_selection_buffer(N_, N_*2, b2) + pt2(:) = -huge(1.) error(:) = huge(1.) @@ -417,7 +439,7 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc else if(more == 0) then exit else - call pull_pt2_results(zmq_socket_pull, index, eI_task, vI_task, nI_task, task_id, n_tasks) + call pull_pt2_results(zmq_socket_pull, index, eI_task, vI_task, nI_task, task_id, n_tasks, b2) if (zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) == -1) then stop 'Unable to delete tasks' endif @@ -427,9 +449,16 @@ subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, varianc nI(:, index(i)) += nI_task(:,i) f(index(i)) -= 1 end do + do i=1, b2%cur + call add_to_selection_buffer(b, b2%det(1,1,i), b2%val(i)) + if (b2%val(i) > b%mini) exit + end do end if end do + call delete_selection_buffer(b2) + call sort_selection_buffer(b) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + end subroutine diff --git a/src/fci/run_pt2_slave.irp.f b/src/fci/run_pt2_slave.irp.f index 33ee418e..ad27ec87 100644 --- a/src/fci/run_pt2_slave.irp.f +++ b/src/fci/run_pt2_slave.irp.f @@ -18,11 +18,11 @@ subroutine run_pt2_slave(thread,iproc,energy) integer(ZMQ_PTR), external :: new_zmq_push_socket integer(ZMQ_PTR) :: zmq_socket_push - type(selection_buffer) :: buf - logical :: done + type(selection_buffer) :: b, b2 + logical :: done, buffer_ready double precision,allocatable :: pt2(:,:), variance(:,:), norm(:,:) - integer :: n_tasks, k + integer :: n_tasks, k, N integer, allocatable :: i_generator(:), subset(:) double precision :: rss @@ -46,9 +46,9 @@ subroutine run_pt2_slave(thread,iproc,energy) zmq_socket_push = new_zmq_push_socket(thread) - buf%N = 0 + b%N = 0 + buffer_ready = .False. n_tasks = 1 - call create_selection_buffer(0, 0, buf) done = .False. n_tasks = 1 @@ -62,12 +62,22 @@ subroutine run_pt2_slave(thread,iproc,energy) exit endif done = task_id(n_tasks) == 0 - if (done) n_tasks = n_tasks-1 + if (done) then + n_tasks = n_tasks-1 + endif if (n_tasks == 0) exit do k=1,n_tasks - read (task(k),*) subset(k), i_generator(k) + read (task(k),*) subset(k), i_generator(k), N enddo + if (b%N == 0) then + ! Only first time + call create_selection_buffer(N, N*2, b) + call create_selection_buffer(N, N*2, b2) + buffer_ready = .True. + else + ASSERT (N == b%N) + endif double precision :: time0, time1 call wall_time(time0) @@ -75,10 +85,10 @@ subroutine run_pt2_slave(thread,iproc,energy) pt2(:,k) = 0.d0 variance(:,k) = 0.d0 norm(:,k) = 0.d0 - buf%cur = 0 + b%cur = 0 !double precision :: time2 !call wall_time(time2) - call select_connected(i_generator(k),energy,pt2(1,k),variance(1,k),norm(1,k),buf,subset(k),pt2_F(i_generator(k))) + call select_connected(i_generator(k),energy,pt2(1,k),variance(1,k),norm(1,k),b,subset(k),pt2_F(i_generator(k))) !call wall_time(time1) !print *, i_generator(1), time1-time2, n_tasks, pt2_F(i_generator(1)) enddo @@ -89,7 +99,11 @@ subroutine run_pt2_slave(thread,iproc,energy) if (tasks_done_to_taskserver(zmq_to_qp_run_socket,worker_id,task_id,n_tasks) == -1) then done = .true. endif - call push_pt2_results(zmq_socket_push, i_generator, pt2, variance, norm, task_id, n_tasks) + call sort_selection_buffer(b) + call merge_selection_buffers(b,b2) + call push_pt2_results(zmq_socket_push, i_generator, pt2, variance, norm, b, task_id, n_tasks) + b%mini = b2%mini + b%cur=0 ! Try to adjust n_tasks around nproc/8 seconds per job n_tasks = min(2*n_tasks,int( dble(n_tasks * nproc/8) / (time1 - time0 + 1.d0))) @@ -104,11 +118,14 @@ subroutine run_pt2_slave(thread,iproc,energy) call end_zmq_push_socket(zmq_socket_push,thread) call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) - call delete_selection_buffer(buf) + if (buffer_ready) then + call delete_selection_buffer(b) + call delete_selection_buffer(b2) + endif end subroutine -subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, task_id, n_tasks) +subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, b, task_id, n_tasks) use f77_zmq use selection_types implicit none @@ -118,45 +135,80 @@ subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, task_id double precision, intent(in) :: variance(N_states,n_tasks) double precision, intent(in) :: norm(N_states,n_tasks) integer, intent(in) :: n_tasks, index(n_tasks), task_id(n_tasks) + type(selection_buffer), intent(inout) :: b integer :: rc rc = f77_zmq_send( zmq_socket_push, n_tasks, 4, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 4) then + stop 'push' endif - if(rc /= 4) stop 'push' rc = f77_zmq_send( zmq_socket_push, index, 4*n_tasks, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 4*n_tasks) then + stop 'push' endif - if(rc /= 4*n_tasks) stop 'push' rc = f77_zmq_send( zmq_socket_push, pt2, 8*N_states*n_tasks, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 8*N_states*n_tasks) then + stop 'push' endif - if(rc /= 8*N_states*n_tasks) stop 'push' + rc = f77_zmq_send( zmq_socket_push, variance, 8*N_states*n_tasks, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 8*N_states*n_tasks) then + stop 'push' endif - if(rc /= 8*N_states*n_tasks) stop 'push' + rc = f77_zmq_send( zmq_socket_push, norm, 8*N_states*n_tasks, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 8*N_states*n_tasks) then + stop 'push' endif - if(rc /= 8*N_states*n_tasks) stop 'push' - rc = f77_zmq_send( zmq_socket_push, task_id, n_tasks*4, 0) + + rc = f77_zmq_send( zmq_socket_push, task_id, n_tasks*4, ZMQ_SNDMORE) if (rc == -1) then return + else if(rc /= 4*n_tasks) then + stop 'push' endif - if(rc /= 4*n_tasks) stop 'push' + + + rc = f77_zmq_send( zmq_socket_push, b%cur, 4, ZMQ_SNDMORE) + if (rc == -1) then + return + else if(rc /= 4) then + stop 'push' + endif + + + rc = f77_zmq_send( zmq_socket_push, b%val, 8*b%cur, ZMQ_SNDMORE) + if (rc == -1) then + return + else if(rc /= 8*b%cur) then + stop 'push' + endif + + + rc = f77_zmq_send( zmq_socket_push, b%det, bit_kind*N_int*2*b%cur, 0) + if (rc == -1) then + return + else if(rc /= N_int*2*8*b%cur) then + stop 'push' + endif + ! Activate is zmq_socket_push is a REQ IRP_IF ZMQ_PUSH @@ -165,8 +217,7 @@ IRP_ELSE rc = f77_zmq_recv( zmq_socket_push, ok, 2, 0) if (rc == -1) then return - endif - if ((rc /= 2).and.(ok(1:2) /= 'ok')) then + else if ((rc /= 2).and.(ok(1:2) /= 'ok')) then print *, irp_here//': error in receiving ok' stop -1 endif @@ -175,7 +226,7 @@ IRP_ENDIF end subroutine -subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks) +subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks, b) use f77_zmq use selection_types implicit none @@ -183,6 +234,7 @@ subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id double precision, intent(inout) :: pt2(N_states,*) double precision, intent(inout) :: variance(N_states,*) double precision, intent(inout) :: norm(N_states,*) + type(selection_buffer), intent(inout) :: b integer, intent(out) :: index(*) integer, intent(out) :: n_tasks, task_id(*) integer :: rc, rn, i @@ -191,43 +243,74 @@ subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 4) then + stop 'pull' endif - if(rc /= 4) stop 'pull' rc = f77_zmq_recv( zmq_socket_pull, index, 4*n_tasks, 0) if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 4*n_tasks) then + stop 'pull' endif - if(rc /= 4*n_tasks) stop 'pull' rc = f77_zmq_recv( zmq_socket_pull, pt2, N_states*8*n_tasks, 0) if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 8*N_states*n_tasks) then + stop 'pull' endif - if(rc /= 8*N_states*n_tasks) stop 'pull' rc = f77_zmq_recv( zmq_socket_pull, variance, N_states*8*n_tasks, 0) if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 8*N_states*n_tasks) then + stop 'pull' endif - if(rc /= 8*N_states*n_tasks) stop 'pull' rc = f77_zmq_recv( zmq_socket_pull, norm, N_states*8*n_tasks, 0) if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 8*N_states*n_tasks) then + stop 'pull' endif - if(rc /= 8*N_states*n_tasks) stop 'pull' rc = f77_zmq_recv( zmq_socket_pull, task_id, n_tasks*4, 0) if (rc == -1) then n_tasks = 1 task_id(1) = 0 + else if(rc /= 4*n_tasks) then + stop 'pull' endif - if(rc /= 4*n_tasks) stop 'pull' + + rc = f77_zmq_recv( zmq_socket_pull, b%cur, 4, 0) + if (rc == -1) then + n_tasks = 1 + task_id(1) = 0 + else if(rc /= 4) then + stop 'pull' + endif + + rc = f77_zmq_recv( zmq_socket_pull, b%val, 8*b%cur, 0) + if (rc == -1) then + n_tasks = 1 + task_id(1) = 0 + else if(rc /= 8*b%cur) then + stop 'pull' + endif + + rc = f77_zmq_recv( zmq_socket_pull, b%det, bit_kind*N_int*2*b%cur, 0) + if (rc == -1) then + n_tasks = 1 + task_id(1) = 0 + else if(rc /= N_int*2*8*b%cur) then + stop 'pull' + endif + ! Activate is zmq_socket_pull is a REP IRP_IF ZMQ_PUSH @@ -236,8 +319,7 @@ IRP_ELSE if (rc == -1) then n_tasks = 1 task_id(1) = 0 - endif - if (rc /= 2) then + else if (rc /= 2) then print *, irp_here//': error in sending ok' stop -1 endif diff --git a/src/fci/selection.irp.f b/src/fci/selection.irp.f index 84672b70..a89271d8 100644 --- a/src/fci/selection.irp.f +++ b/src/fci/selection.irp.f @@ -1,5 +1,27 @@ use bitmasks +BEGIN_PROVIDER [ double precision, selection_weight, (N_states) ] + implicit none + BEGIN_DOC + ! Weights in the state-average calculation of the density matrix + END_DOC + logical :: exists + + selection_weight(:) = 1.d0 + if (used_weight == 0) then + selection_weight(:) = c0_weight(:) + else if (used_weight == 1) then + selection_weight(:) = 1./N_states + else + call ezfio_has_determinants_state_average_weight(exists) + if (exists) then + call ezfio_get_determinants_state_average_weight(selection_weight) + endif + endif + selection_weight(:) = selection_weight(:)+1.d-31 + selection_weight(:) = selection_weight(:)/(sum(selection_weight(:))) +END_PROVIDER + subroutine get_mask_phase(det1, pm, Nint) use bitmasks @@ -719,9 +741,9 @@ subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_d norm(istate) = norm(istate) + coef * coef if (h0_type == "Variance") then - sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * state_average_weight(istate) + sum_e_pert = sum_e_pert - alpha_h_psi * alpha_h_psi * selection_weight(istate) else - sum_e_pert = sum_e_pert + e_pert * state_average_weight(istate) + sum_e_pert = sum_e_pert + e_pert * selection_weight(istate) endif end do diff --git a/src/fci/zmq_selection.irp.f b/src/fci/zmq_selection.irp.f index 44305baa..e39d7ac9 100644 --- a/src/fci/zmq_selection.irp.f +++ b/src/fci/zmq_selection.irp.f @@ -150,7 +150,7 @@ subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm) integer(ZMQ_PTR), intent(in) :: zmq_socket_pull type(selection_buffer), intent(inout) :: b - integer, intent(in) :: N + integer, intent(in) :: N double precision, intent(inout) :: pt2(N_states) double precision, intent(inout) :: variance(N_states) double precision, intent(inout) :: norm(N_states) From 61bc71a1c63f822cc3d198bb90f15a738485ebeb Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Jan 2019 00:25:08 +0100 Subject: [PATCH 2/6] Shortened tests for Travis --- TODO | 11 +- docs/source/modules/ao_basis.rst | 657 --- docs/source/modules/ao_one_e_ints.rst | 1040 ----- docs/source/modules/ao_two_e_erf_ints.rst | 425 -- docs/source/modules/ao_two_e_ints.rst | 619 --- docs/source/modules/aux_quantities.rst | 52 - docs/source/modules/becke_numerical_grid.rst | 454 -- docs/source/modules/bitmask.rst | 1272 ------ docs/source/modules/cis.rst | 117 - docs/source/modules/cisd.rst | 117 - docs/source/modules/davidson.rst | 720 ---- docs/source/modules/davidson_dressed.rst | 13 - docs/source/modules/davidson_undressed.rst | 45 - docs/source/modules/density_for_dft.rst | 119 - docs/source/modules/determinants.rst | 4072 ------------------ docs/source/modules/dft_keywords.rst | 59 - docs/source/modules/dft_utils_in_r.rst | 361 -- docs/source/modules/dft_utils_one_e.rst | 1951 --------- docs/source/modules/dressing.rst | 36 - docs/source/modules/electrons.rst | 76 - docs/source/modules/ezfio_files.rst | 151 - docs/source/modules/fci.rst | 921 ---- docs/source/modules/generators_cas.rst | 19 - docs/source/modules/generators_full.rst | 145 - docs/source/modules/hartree_fock.rst | 233 - docs/source/modules/iterations.rst | 114 - docs/source/modules/kohn_sham.rst | 87 - docs/source/modules/kohn_sham_rs.rst | 259 -- docs/source/modules/mo_basis.rst | 370 -- docs/source/modules/mo_guess.rst | 87 - docs/source/modules/mo_one_e_ints.rst | 287 -- docs/source/modules/mo_two_e_erf_ints.rst | 488 --- docs/source/modules/mo_two_e_ints.rst | 590 --- docs/source/modules/mpi.rst | 130 - docs/source/modules/nuclei.rst | 351 -- docs/source/modules/perturbation.rst | 560 --- docs/source/modules/pseudo.rst | 94 - docs/source/modules/psiref_cas.rst | 14 - docs/source/modules/psiref_utils.rst | 16 - docs/source/modules/scf_utils.rst | 390 -- docs/source/modules/selectors_cassd.rst | 13 - docs/source/modules/selectors_full.rst | 72 - docs/source/modules/selectors_utils.rst | 381 -- docs/source/modules/single_ref_method.rst | 14 - docs/source/modules/slave.rst | 73 - docs/source/modules/tools.rst | 222 - docs/source/modules/utils.rst | 1960 --------- docs/source/modules/zmq.rst | 885 ---- scripts/qp_mpirun | 2 +- scripts/qp_srun | 2 +- src/{slave => cipsi}/.gitignore | 0 src/cipsi/NEED | 5 + src/cipsi/README.rst | 128 + src/cipsi/cipsi.irp.f | 147 + src/{fci => cipsi}/energy.irp.f | 0 src/{fci => cipsi}/pt2_stoch_routines.irp.f | 0 src/{fci => cipsi}/run_pt2_slave.irp.f | 0 src/{fci => cipsi}/run_selection_slave.irp.f | 0 src/{fci => cipsi}/selection.irp.f | 0 src/{fci => cipsi}/selection_buffer.irp.f | 0 src/{fci => cipsi}/selection_types.f90 | 0 src/{slave => cipsi}/slave_cipsi.irp.f | 6 +- src/cipsi/stochastic_cipsi.irp.f | 130 + src/{fci => cipsi}/zmq_selection.irp.f | 0 src/cis/20.cis.bats | 147 +- src/cisd/30.cisd.bats | 167 +- src/dummy/NEED | 2 +- src/fci/NEED | 6 +- src/fci/README.rst | 111 +- src/fci/fci.irp.f | 137 +- src/fci/pt2.irp.f | 22 +- src/fci/save_energy.irp.f | 9 + src/hartree_fock/10.hf.bats | 162 +- src/iterations/print_extrapolation.irp.f | 3 +- src/iterations/print_summary.irp.f | 11 +- src/slave/NEED | 2 - src/slave/README.rst | 6 - src/slave/slave_eri.irp.f | 50 - src/zmq/utils.irp.f | 15 +- 79 files changed, 721 insertions(+), 21691 deletions(-) delete mode 100644 docs/source/modules/ao_basis.rst delete mode 100644 docs/source/modules/ao_one_e_ints.rst delete mode 100644 docs/source/modules/ao_two_e_erf_ints.rst delete mode 100644 docs/source/modules/ao_two_e_ints.rst delete mode 100644 docs/source/modules/aux_quantities.rst delete mode 100644 docs/source/modules/becke_numerical_grid.rst delete mode 100644 docs/source/modules/bitmask.rst delete mode 100644 docs/source/modules/cis.rst delete mode 100644 docs/source/modules/cisd.rst delete mode 100644 docs/source/modules/davidson.rst delete mode 100644 docs/source/modules/davidson_dressed.rst delete mode 100644 docs/source/modules/davidson_undressed.rst delete mode 100644 docs/source/modules/density_for_dft.rst delete mode 100644 docs/source/modules/determinants.rst delete mode 100644 docs/source/modules/dft_keywords.rst delete mode 100644 docs/source/modules/dft_utils_in_r.rst delete mode 100644 docs/source/modules/dft_utils_one_e.rst delete mode 100644 docs/source/modules/dressing.rst delete mode 100644 docs/source/modules/electrons.rst delete mode 100644 docs/source/modules/ezfio_files.rst delete mode 100644 docs/source/modules/fci.rst delete mode 100644 docs/source/modules/generators_cas.rst delete mode 100644 docs/source/modules/generators_full.rst delete mode 100644 docs/source/modules/hartree_fock.rst delete mode 100644 docs/source/modules/iterations.rst delete mode 100644 docs/source/modules/kohn_sham.rst delete mode 100644 docs/source/modules/kohn_sham_rs.rst delete mode 100644 docs/source/modules/mo_basis.rst delete mode 100644 docs/source/modules/mo_guess.rst delete mode 100644 docs/source/modules/mo_one_e_ints.rst delete mode 100644 docs/source/modules/mo_two_e_erf_ints.rst delete mode 100644 docs/source/modules/mo_two_e_ints.rst delete mode 100644 docs/source/modules/mpi.rst delete mode 100644 docs/source/modules/nuclei.rst delete mode 100644 docs/source/modules/perturbation.rst delete mode 100644 docs/source/modules/pseudo.rst delete mode 100644 docs/source/modules/psiref_cas.rst delete mode 100644 docs/source/modules/psiref_utils.rst delete mode 100644 docs/source/modules/scf_utils.rst delete mode 100644 docs/source/modules/selectors_cassd.rst delete mode 100644 docs/source/modules/selectors_full.rst delete mode 100644 docs/source/modules/selectors_utils.rst delete mode 100644 docs/source/modules/single_ref_method.rst delete mode 100644 docs/source/modules/slave.rst delete mode 100644 docs/source/modules/tools.rst delete mode 100644 docs/source/modules/utils.rst delete mode 100644 docs/source/modules/zmq.rst rename src/{slave => cipsi}/.gitignore (100%) create mode 100644 src/cipsi/NEED create mode 100644 src/cipsi/README.rst create mode 100644 src/cipsi/cipsi.irp.f rename src/{fci => cipsi}/energy.irp.f (100%) rename src/{fci => cipsi}/pt2_stoch_routines.irp.f (100%) rename src/{fci => cipsi}/run_pt2_slave.irp.f (100%) rename src/{fci => cipsi}/run_selection_slave.irp.f (100%) rename src/{fci => cipsi}/selection.irp.f (100%) rename src/{fci => cipsi}/selection_buffer.irp.f (100%) rename src/{fci => cipsi}/selection_types.f90 (100%) rename src/{slave => cipsi}/slave_cipsi.irp.f (99%) create mode 100644 src/cipsi/stochastic_cipsi.irp.f rename src/{fci => cipsi}/zmq_selection.irp.f (100%) create mode 100644 src/fci/save_energy.irp.f delete mode 100644 src/slave/NEED delete mode 100644 src/slave/README.rst delete mode 100644 src/slave/slave_eri.irp.f diff --git a/TODO b/TODO index 206e2f6b..dd076115 100644 --- a/TODO +++ b/TODO @@ -1,15 +1,14 @@ * Mettre le fichier LIB +* Faire que le slave de Hartree-fock est le calcul des integrales AO en parallele # Web/doc * Creer une page web pas trop degueu et la mettre ici : http://lcpq.github.io/quantum_package -* Pour les README.rst des modules, mettre un deuxième saut à la ligne pour la doc en ligne. -* Changer irpf90 pour creer de la doc en format rst # Exterieur -* Molden format : http://cheminf.cmbi.ru.nl/molden/molden_format.html : read+write +* Molden format : http://cheminf.cmbi.ru.nl/molden/molden_format.html : read+write. Thomas est dessus * Un module pour lire les integrales Moleculaires depuis un FCIDUMP * Un module pour lire des integrales Atomiques (voir module de Mimi pour lire les AO Slater) @@ -30,7 +29,6 @@ * Parameters for Hartree-Fock * Parameters for Davidson * Running in parallel - * Parameters for selection (Generators) # Programmers doc: @@ -41,7 +39,4 @@ # EZFIO sans fork -/home/scemama/quantum_package/docs/source/modules/perturbation.rst:216: WARNING -: script pour mettre des :math: dans les commentaires - -# Selection stochastique +Refaire les benchmarks diff --git a/docs/source/modules/ao_basis.rst b/docs/source/modules/ao_basis.rst deleted file mode 100644 index 863e9eec..00000000 --- a/docs/source/modules/ao_basis.rst +++ /dev/null @@ -1,657 +0,0 @@ -.. _ao_basis: - -.. program:: ao_basis - -.. default-role:: option - -======== -ao_basis -======== - -This module describes the atomic orbitals basis set. - -An |AO| :math:`\chi` centered on nucleus A is represented as: - -.. math:: - - \chi_i({\bf r}) = (x-X_A)^a (y-Y_A)^b (z-Z_A)^c \sum_k c_{ki} e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} - - -The |AO| coefficients are normalized as: - -.. math:: - - {\tilde c}_{ki} = \frac{c_{ki}}{ \int \left( (x-X_A)^a (y-Y_A)^b (z-Z_A)^c e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} \right)^2 dr} - -Warning: `ao_coef` contains the |AO| coefficients given in input. These do not -include the normalization constant of the |AO|. The `ao_coef_normalized` provider includes -this normalization factor. - -The |AOs| are also sorted by increasing exponent to accelerate the calculation of -the two electron integrals. - - - - - - -EZFIO parameters ----------------- - -.. option:: ao_basis - - Name of the |AO| basis set - - -.. option:: ao_num - - Number of |AOs| - - -.. option:: ao_prim_num - - Number of primitives per |AO| - - -.. option:: ao_prim_num_max - - Maximum number of primitives - - Default: =maxval(ao_basis.ao_prim_num) - -.. option:: ao_nucl - - Index of the nucleus on which the |AO| is centered - - -.. option:: ao_power - - Powers of x, y and z for each |AO| - - -.. option:: ao_coef - - Primitive coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. - - -.. option:: ao_expo - - Exponents for each primitive of each |AO| - - -.. option:: ao_md5 - - MD5 key, specific of the |AO| basis - - -.. option:: ao_cartesian - - If |true|, use |AOs| in Cartesian coordinates (6d,10f,...) - - Default: false - - -Providers ---------- - - -.. c:var:: ao_coef_normalization_factor - - .. code:: text - - double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) - double precision, allocatable :: ao_coef_normalization_factor (ao_num) - - File: :file:`aos.irp.f` - - Coefficients including the |AO| normalization - - - - -.. c:var:: ao_coef_normalization_libint_factor - - .. code:: text - - double precision, allocatable :: ao_coef_normalization_libint_factor (ao_num) - - File: :file:`aos.irp.f` - - |AO| normalization for interfacing with libint - - - - -.. c:var:: ao_coef_normalized - - .. code:: text - - double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) - double precision, allocatable :: ao_coef_normalization_factor (ao_num) - - File: :file:`aos.irp.f` - - Coefficients including the |AO| normalization - - - - -.. c:var:: ao_coef_normalized_ordered - - .. code:: text - - double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) - double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) - - File: :file:`aos.irp.f` - - Sorted primitives to accelerate 4 index |MO| transformation - - - - -.. c:var:: ao_coef_normalized_ordered_transp - - .. code:: text - - double precision, allocatable :: ao_coef_normalized_ordered_transp (ao_prim_num_max,ao_num) - - File: :file:`aos.irp.f` - - Transposed :c:data:`ao_coef_normalized_ordered` - - - - -.. c:var:: ao_coef_normalized_ordered_transp_per_nucl - - .. code:: text - - double precision, allocatable :: ao_coef_normalized_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) - - File: :file:`aos_transp.irp.f` - - - - - - -.. c:var:: ao_expo_ordered - - .. code:: text - - double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) - double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) - - File: :file:`aos.irp.f` - - Sorted primitives to accelerate 4 index |MO| transformation - - - - -.. c:var:: ao_expo_ordered_transp - - .. code:: text - - double precision, allocatable :: ao_expo_ordered_transp (ao_prim_num_max,ao_num) - - File: :file:`aos.irp.f` - - Transposed :c:data:`ao_expo_ordered` - - - - -.. c:var:: ao_expo_ordered_transp_per_nucl - - .. code:: text - - double precision, allocatable :: ao_expo_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) - - File: :file:`aos_transp.irp.f` - - - - - - -.. c:var:: ao_l - - .. code:: text - - integer, allocatable :: ao_l (ao_num) - integer :: ao_l_max - character*(128), allocatable :: ao_l_char (ao_num) - - File: :file:`aos.irp.f` - - :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` - - - - -.. c:var:: ao_l_char - - .. code:: text - - integer, allocatable :: ao_l (ao_num) - integer :: ao_l_max - character*(128), allocatable :: ao_l_char (ao_num) - - File: :file:`aos.irp.f` - - :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` - - - - -.. c:var:: ao_l_char_space - - .. code:: text - - character*(4), allocatable :: ao_l_char_space (ao_num) - - File: :file:`aos.irp.f` - - Converts an l value to a string - - - - -.. c:var:: ao_l_max - - .. code:: text - - integer, allocatable :: ao_l (ao_num) - integer :: ao_l_max - character*(128), allocatable :: ao_l_char (ao_num) - - File: :file:`aos.irp.f` - - :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` - - - - -.. c:var:: ao_power_ordered_transp_per_nucl - - .. code:: text - - integer, allocatable :: ao_power_ordered_transp_per_nucl (3,N_AOs_max,nucl_num) - - File: :file:`aos_transp.irp.f` - - - - - - -.. c:var:: ao_prim_num_max - - .. code:: text - - integer :: ao_prim_num_max - - File: :file:`aos.irp.f` - - Max number of primitives. - - - - -.. c:var:: cart_to_sphe_0 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_0 (1,1) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=0 - - - - -.. c:var:: cart_to_sphe_1 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_1 (3,3) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=1 - - - - -.. c:var:: cart_to_sphe_2 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_2 (6,5) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=2 - - - - -.. c:var:: cart_to_sphe_3 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_3 (10,7) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=3 - - - - -.. c:var:: cart_to_sphe_4 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_4 (15,9) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=4 - - - - -.. c:var:: cart_to_sphe_5 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_5 (21,11) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=5 - - - - -.. c:var:: cart_to_sphe_6 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_6 (28,13) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=6 - - - - -.. c:var:: cart_to_sphe_7 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_7 (36,15) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=7 - - - - -.. c:var:: cart_to_sphe_8 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_8 (45,17) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=8 - - - - -.. c:var:: cart_to_sphe_9 - - .. code:: text - - double precision, allocatable :: cart_to_sphe_9 (55,19) - - File: :file:`spherical_to_cartesian.irp.f` - - Spherical -> Cartesian Transformation matrix for l=9 - - - - -.. c:var:: l_to_charater - - .. code:: text - - character*(128), allocatable :: l_to_charater (0:7) - - File: :file:`aos.irp.f` - - Character corresponding to the "l" value of an |AO| - - - - -.. c:var:: n_aos_max - - .. code:: text - - integer, allocatable :: nucl_n_aos (nucl_num) - integer :: n_aos_max - - File: :file:`aos.irp.f` - - Number of |AOs| per atom - - - - -.. c:var:: n_pt_max_i_x - - .. code:: text - - integer :: n_pt_max_integrals - integer :: n_pt_max_i_x - - File: :file:`dimensions_integrals.irp.f` - - Number of points used in the numerical integrations. - - - - -.. c:var:: n_pt_max_integrals - - .. code:: text - - integer :: n_pt_max_integrals - integer :: n_pt_max_i_x - - File: :file:`dimensions_integrals.irp.f` - - Number of points used in the numerical integrations. - - - - -.. c:var:: nucl_aos - - .. code:: text - - integer, allocatable :: nucl_aos (nucl_num,N_AOs_max) - - File: :file:`aos.irp.f` - - List of |AOs| centered on each atom - - - - -.. c:var:: nucl_aos_transposed - - .. code:: text - - integer, allocatable :: nucl_aos_transposed (N_AOs_max,nucl_num) - - File: :file:`aos_transp.irp.f` - - List of AOs attached on each atom - - - - -.. c:var:: nucl_list_shell_aos - - .. code:: text - - integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) - integer, allocatable :: nucl_num_shell_aos (nucl_num) - - File: :file:`aos.irp.f` - - Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis - - - - -.. c:var:: nucl_n_aos - - .. code:: text - - integer, allocatable :: nucl_n_aos (nucl_num) - integer :: n_aos_max - - File: :file:`aos.irp.f` - - Number of |AOs| per atom - - - - -.. c:var:: nucl_num_shell_aos - - .. code:: text - - integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) - integer, allocatable :: nucl_num_shell_aos (nucl_num) - - File: :file:`aos.irp.f` - - Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: ao_power_index - - .. code:: text - - integer function ao_power_index(nx,ny,nz) - - File: :file:`aos.irp.f` - - Unique index given to a triplet of powers: - - :math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1` - - - - - -.. c:function:: ao_value - - .. code:: text - - double precision function ao_value(i,r) - - File: :file:`aos_value.irp.f` - - return the value of the ith ao at point r - - - - - -.. c:function:: give_all_aos_and_grad_and_lapl_at_r - - .. code:: text - - subroutine give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) - - File: :file:`aos_value.irp.f` - - input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r - - - - - -.. c:function:: give_all_aos_and_grad_at_r - - .. code:: text - - subroutine give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array) - - File: :file:`aos_value.irp.f` - - input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r - - - - - -.. c:function:: give_all_aos_at_r - - .. code:: text - - subroutine give_all_aos_at_r(r,aos_array) - - File: :file:`aos_value.irp.f` - - input : r == r(1) = x and so on aos_array(i) = aos(i) evaluated in r - - - - - -.. c:function:: give_all_aos_at_r_old - - .. code:: text - - subroutine give_all_aos_at_r_old(r,aos_array) - - File: :file:`aos_value.irp.f` - - gives the values of aos at a given point r - - - - - -.. c:function:: primitive_value - - .. code:: text - - double precision function primitive_value(i,j,r) - - File: :file:`aos_value.irp.f` - - return the value of the jth primitive of ith ao at point r WITHOUT THE COEF - - diff --git a/docs/source/modules/ao_one_e_ints.rst b/docs/source/modules/ao_one_e_ints.rst deleted file mode 100644 index f8691b5e..00000000 --- a/docs/source/modules/ao_one_e_ints.rst +++ /dev/null @@ -1,1040 +0,0 @@ -.. _ao_one_e_ints: - -.. program:: ao_one_e_ints - -.. default-role:: option - -================== -ao_one_e_integrals -================== - -All the one-electron integrals in the |AO| basis are here. - -The most important providers for usual quantum-chemistry calculation are: - -* `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) -* `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) -* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) - - -Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`. - - - -EZFIO parameters ----------------- - -.. option:: ao_integrals_e_n - - Nucleus-electron integrals in |AO| basis set - - -.. option:: io_ao_integrals_e_n - - Read/Write |AO| nucleus-electron attraction integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: ao_integrals_kinetic - - Kinetic energy integrals in |AO| basis set - - -.. option:: io_ao_integrals_kinetic - - Read/Write |AO| kinetic integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: ao_integrals_pseudo - - Pseudopotential integrals in |AO| basis set - - -.. option:: io_ao_integrals_pseudo - - Read/Write |AO| pseudopotential integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: ao_integrals_overlap - - Overlap integrals in |AO| basis set - - -.. option:: io_ao_integrals_overlap - - Read/Write |AO| overlap integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: ao_one_e_integrals - - Combined integrals in |AO| basis set - - -.. option:: io_ao_one_e_integrals - - Read/Write |AO| one-electron integrals from/to disk [ Write | Read | None ] - - Default: None - - -Providers ---------- - - -.. c:var:: ao_cart_to_sphe_coef - - .. code:: text - - double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) - integer :: ao_cart_to_sphe_num - - File: :file:`ao_ortho_canonical.irp.f` - - Coefficients to go from cartesian to spherical coordinates in the current basis set - - - - -.. c:var:: ao_cart_to_sphe_inv - - .. code:: text - - double precision, allocatable :: ao_cart_to_sphe_inv (ao_cart_to_sphe_num,ao_num) - - File: :file:`ao_ortho_canonical.irp.f` - - Inverse of :c:data:`ao_cart_to_sphe_coef` - - - - -.. c:var:: ao_cart_to_sphe_num - - .. code:: text - - double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) - integer :: ao_cart_to_sphe_num - - File: :file:`ao_ortho_canonical.irp.f` - - Coefficients to go from cartesian to spherical coordinates in the current basis set - - - - -.. c:var:: ao_cart_to_sphe_overlap - - .. code:: text - - double precision, allocatable :: ao_cart_to_sphe_overlap (ao_cart_to_sphe_num,ao_cart_to_sphe_num) - - File: :file:`ao_ortho_canonical.irp.f` - - |AO| overlap matrix in the spherical basis set - - - - -.. c:var:: ao_deriv2_x - - .. code:: text - - double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) - - File: :file:`kin_ao_ints.irp.f` - - Second derivative matrix elements in the |AO| basis. - - :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` - - - - - - -.. c:var:: ao_deriv2_y - - .. code:: text - - double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) - - File: :file:`kin_ao_ints.irp.f` - - Second derivative matrix elements in the |AO| basis. - - :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` - - - - - - -.. c:var:: ao_deriv2_z - - .. code:: text - - double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) - - File: :file:`kin_ao_ints.irp.f` - - Second derivative matrix elements in the |AO| basis. - - :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` - - - - - - -.. c:var:: ao_deriv_1_x - - .. code:: text - - double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * d/dx AO_j - - * array of the integrals of AO_i * d/dy AO_j - - * array of the integrals of AO_i * d/dz AO_j - - - - -.. c:var:: ao_deriv_1_y - - .. code:: text - - double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * d/dx AO_j - - * array of the integrals of AO_i * d/dy AO_j - - * array of the integrals of AO_i * d/dz AO_j - - - - -.. c:var:: ao_deriv_1_z - - .. code:: text - - double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) - double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * d/dx AO_j - - * array of the integrals of AO_i * d/dy AO_j - - * array of the integrals of AO_i * d/dz AO_j - - - - -.. c:var:: ao_dipole_x - - .. code:: text - - double precision, allocatable :: ao_dipole_x (ao_num,ao_num) - double precision, allocatable :: ao_dipole_y (ao_num,ao_num) - double precision, allocatable :: ao_dipole_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x AO_j - - * array of the integrals of AO_i * y AO_j - - * array of the integrals of AO_i * z AO_j - - - - -.. c:var:: ao_dipole_y - - .. code:: text - - double precision, allocatable :: ao_dipole_x (ao_num,ao_num) - double precision, allocatable :: ao_dipole_y (ao_num,ao_num) - double precision, allocatable :: ao_dipole_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x AO_j - - * array of the integrals of AO_i * y AO_j - - * array of the integrals of AO_i * z AO_j - - - - -.. c:var:: ao_dipole_z - - .. code:: text - - double precision, allocatable :: ao_dipole_x (ao_num,ao_num) - double precision, allocatable :: ao_dipole_y (ao_num,ao_num) - double precision, allocatable :: ao_dipole_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x AO_j - - * array of the integrals of AO_i * y AO_j - - * array of the integrals of AO_i * z AO_j - - - - -.. c:var:: ao_integrals_n_e - - .. code:: text - - double precision, allocatable :: ao_integrals_n_e (ao_num,ao_num) - - File: :file:`pot_ao_ints.irp.f` - - Nucleus-electron interaction, in the |AO| basis set. - - :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle` - - - - -.. c:var:: ao_integrals_n_e_per_atom - - .. code:: text - - double precision, allocatable :: ao_integrals_n_e_per_atom (ao_num,ao_num,nucl_num) - - File: :file:`pot_ao_ints.irp.f` - - Nucleus-electron interaction in the |AO| basis set, per atom A. - - :math:`\langle \chi_i | -\frac{1}{|r-R_A|} | \chi_j \rangle` - - - - -.. c:var:: ao_kinetic_integrals - - .. code:: text - - double precision, allocatable :: ao_kinetic_integrals (ao_num,ao_num) - - File: :file:`kin_ao_ints.irp.f` - - Kinetic energy integrals in the |AO| basis. - - :math:`\langle \chi_i |\hat{T}| \chi_j \rangle` - - - - -.. c:var:: ao_one_e_integrals - - .. code:: text - - double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) - double precision, allocatable :: ao_one_e_integrals_diag (ao_num) - - File: :file:`ao_one_e_ints.irp.f` - - One-electron Hamiltonian in the |AO| basis. - - - - -.. c:var:: ao_one_e_integrals_diag - - .. code:: text - - double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) - double precision, allocatable :: ao_one_e_integrals_diag (ao_num) - - File: :file:`ao_one_e_ints.irp.f` - - One-electron Hamiltonian in the |AO| basis. - - - - -.. c:var:: ao_ortho_canonical_coef - - .. code:: text - - double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) - integer :: ao_ortho_canonical_num - - File: :file:`ao_ortho_canonical.irp.f` - - matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital - - - - -.. c:var:: ao_ortho_canonical_coef_inv - - .. code:: text - - double precision, allocatable :: ao_ortho_canonical_coef_inv (ao_num,ao_num) - - File: :file:`ao_ortho_canonical.irp.f` - - ao_ortho_canonical_coef^(-1) - - - - -.. c:var:: ao_ortho_canonical_num - - .. code:: text - - double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) - integer :: ao_ortho_canonical_num - - File: :file:`ao_ortho_canonical.irp.f` - - matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital - - - - -.. c:var:: ao_ortho_canonical_overlap - - .. code:: text - - double precision, allocatable :: ao_ortho_canonical_overlap (ao_ortho_canonical_num,ao_ortho_canonical_num) - - File: :file:`ao_ortho_canonical.irp.f` - - overlap matrix of the ao_ortho_canonical. Expected to be the Identity - - - - -.. c:var:: ao_overlap - - .. code:: text - - double precision, allocatable :: ao_overlap (ao_num,ao_num) - double precision, allocatable :: ao_overlap_x (ao_num,ao_num) - double precision, allocatable :: ao_overlap_y (ao_num,ao_num) - double precision, allocatable :: ao_overlap_z (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Overlap between atomic basis functions: - - :math:`\int \chi_i(r) \chi_j(r) dr` - - - - -.. c:var:: ao_overlap_abs - - .. code:: text - - double precision, allocatable :: ao_overlap_abs (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Overlap between absolute values of atomic basis functions: - - :math:`\int |\chi_i(r)| |\chi_j(r)| dr` - - - - -.. c:var:: ao_overlap_x - - .. code:: text - - double precision, allocatable :: ao_overlap (ao_num,ao_num) - double precision, allocatable :: ao_overlap_x (ao_num,ao_num) - double precision, allocatable :: ao_overlap_y (ao_num,ao_num) - double precision, allocatable :: ao_overlap_z (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Overlap between atomic basis functions: - - :math:`\int \chi_i(r) \chi_j(r) dr` - - - - -.. c:var:: ao_overlap_y - - .. code:: text - - double precision, allocatable :: ao_overlap (ao_num,ao_num) - double precision, allocatable :: ao_overlap_x (ao_num,ao_num) - double precision, allocatable :: ao_overlap_y (ao_num,ao_num) - double precision, allocatable :: ao_overlap_z (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Overlap between atomic basis functions: - - :math:`\int \chi_i(r) \chi_j(r) dr` - - - - -.. c:var:: ao_overlap_z - - .. code:: text - - double precision, allocatable :: ao_overlap (ao_num,ao_num) - double precision, allocatable :: ao_overlap_x (ao_num,ao_num) - double precision, allocatable :: ao_overlap_y (ao_num,ao_num) - double precision, allocatable :: ao_overlap_z (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Overlap between atomic basis functions: - - :math:`\int \chi_i(r) \chi_j(r) dr` - - - - -.. c:var:: ao_pseudo_integrals - - .. code:: text - - double precision, allocatable :: ao_pseudo_integrals (ao_num,ao_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Pseudo-potential integrals in the |AO| basis set. - - - - -.. c:var:: ao_pseudo_integrals_local - - .. code:: text - - double precision, allocatable :: ao_pseudo_integrals_local (ao_num,ao_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Local pseudo-potential - - - - -.. c:var:: ao_pseudo_integrals_non_local - - .. code:: text - - double precision, allocatable :: ao_pseudo_integrals_non_local (ao_num,ao_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Non-local pseudo-potential - - - - -.. c:var:: ao_spread_x - - .. code:: text - - double precision, allocatable :: ao_spread_x (ao_num,ao_num) - double precision, allocatable :: ao_spread_y (ao_num,ao_num) - double precision, allocatable :: ao_spread_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x^2 AO_j - - * array of the integrals of AO_i * y^2 AO_j - - * array of the integrals of AO_i * z^2 AO_j - - - - -.. c:var:: ao_spread_y - - .. code:: text - - double precision, allocatable :: ao_spread_x (ao_num,ao_num) - double precision, allocatable :: ao_spread_y (ao_num,ao_num) - double precision, allocatable :: ao_spread_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x^2 AO_j - - * array of the integrals of AO_i * y^2 AO_j - - * array of the integrals of AO_i * z^2 AO_j - - - - -.. c:var:: ao_spread_z - - .. code:: text - - double precision, allocatable :: ao_spread_x (ao_num,ao_num) - double precision, allocatable :: ao_spread_y (ao_num,ao_num) - double precision, allocatable :: ao_spread_z (ao_num,ao_num) - - File: :file:`spread_dipole_ao.irp.f` - - * array of the integrals of AO_i * x^2 AO_j - - * array of the integrals of AO_i * y^2 AO_j - - * array of the integrals of AO_i * z^2 AO_j - - - - -.. c:var:: give_polynomial_mult_center_one_e_erf - - .. code:: text - - subroutine give_polynomial_mult_center_one_e_erf(A_center,B_center,alpha,beta,& - power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) - - File: :file:`pot_ao_erf_ints.irp.f` - - Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: - - :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . - - - - -.. c:var:: give_polynomial_mult_center_one_e_erf_opt - - .. code:: text - - subroutine give_polynomial_mult_center_one_e_erf_opt(A_center,B_center,alpha,beta,& - power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) - - File: :file:`pot_ao_erf_ints.irp.f` - - Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: - - :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . - - - - -.. c:var:: i_x1_pol_mult_one_e - - .. code:: text - - recursive subroutine I_x1_pol_mult_one_e(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) - - File: :file:`pot_ao_ints.irp.f` - - Recursive routine involved in the electron-nucleus potential - - - - -.. c:var:: i_x2_pol_mult_one_e - - .. code:: text - - recursive subroutine I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,dim) - - File: :file:`pot_ao_ints.irp.f` - - Recursive routine involved in the electron-nucleus potential - - - - -.. c:var:: pseudo_dz_k_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) - integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) - double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: pseudo_dz_kl_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: pseudo_n_k_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) - integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) - double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: pseudo_n_kl_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: pseudo_v_k_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) - integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) - double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: pseudo_v_kl_transp - - .. code:: text - - double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) - - File: :file:`pot_ao_pseudo_ints.irp.f` - - Transposed arrays for pseudopotentials - - - - -.. c:var:: s_half - - .. code:: text - - double precision, allocatable :: s_half (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - :math:`S^{1/2}` - - - - -.. c:var:: s_half_inv - - .. code:: text - - double precision, allocatable :: s_half_inv (AO_num,AO_num) - - File: :file:`ao_overlap.irp.f` - - :math:`X = S^{-1/2}` obtained by SVD - - - - -.. c:var:: s_inv - - .. code:: text - - double precision, allocatable :: s_inv (ao_num,ao_num) - - File: :file:`ao_overlap.irp.f` - - Inverse of the overlap matrix - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: give_all_erf_kl_ao - - .. code:: text - - subroutine give_all_erf_kl_ao(integrals_ao,mu_in,C_center) - - File: :file:`pot_ao_erf_ints.irp.f` - - Subroutine that returns all integrals over :math:`r` of type :math:`\frac{ \erf(\mu * |r-R_C|) }{ |r-R_C| }` - - - - - -.. c:function:: give_polynomial_mult_center_one_e - - .. code:: text - - subroutine give_polynomial_mult_center_one_e(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) - - File: :file:`pot_ao_ints.irp.f` - - Returns the explicit polynomial in terms of the "t" variable of the following - - :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . - - - - - -.. c:function:: int_gaus_pol - - .. code:: text - - double precision function int_gaus_pol(alpha,n) - - File: :file:`pot_ao_ints.irp.f` - - Computes the integral: - - :math:`\int_{-\infty}^{\infty} x^n \exp(-\alpha x^2) dx` . - - - - - -.. c:function:: nai_pol_mult - - .. code:: text - - double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in) - - File: :file:`pot_ao_ints.irp.f` - - Computes the electron-nucleus attraction with two primitves. - - :math:`\langle g_i | \frac{1}{|r-R_c|} | g_j \rangle` - - - - - -.. c:function:: nai_pol_mult_erf - - .. code:: text - - double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in,mu_in) - - File: :file:`pot_ao_erf_ints.irp.f` - - Computes the following integral : :math:`\int dr (x-A_x)^a (x-B_x)^b \exp(-\alpha (x-A_x)^2 - \beta (x-B_x)^2 ) \frac{\erf(\mu |r-R_C|)}{|r-R_c|}` . - - - - - -.. c:function:: nai_pol_mult_erf_ao - - .. code:: text - - double precision function NAI_pol_mult_erf_ao(i_ao,j_ao,mu_in,C_center) - - File: :file:`pot_ao_erf_ints.irp.f` - - Computes the following integral : :math:`\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) \frac{\erf(\mu |r-R_C|)}{|r-R_C|}` . - - - - - -.. c:function:: overlap_bourrin_deriv_x - - .. code:: text - - subroutine overlap_bourrin_deriv_x(i_component,A_center,B_center,alpha,beta,power_A,power_B,dx,lower_exp_val,overlap_x,nx) - - File: :file:`spread_dipole_ao.irp.f` - - - - - - - -.. c:function:: overlap_bourrin_dipole - - .. code:: text - - subroutine overlap_bourrin_dipole(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) - - File: :file:`spread_dipole_ao.irp.f` - - - - - - - -.. c:function:: overlap_bourrin_spread - - .. code:: text - - subroutine overlap_bourrin_spread(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) - - File: :file:`spread_dipole_ao.irp.f` - - Computes the following integral : int [-infty ; +infty] of [(x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) * x ] needed for the dipole and those things - - - - - -.. c:function:: overlap_bourrin_x - - .. code:: text - - subroutine overlap_bourrin_x(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) - - File: :file:`spread_dipole_ao.irp.f` - - - - - - - -.. c:function:: v_e_n - - .. code:: text - - double precision function V_e_n(a_x,a_y,a_z,b_x,b_y,b_z,alpha,beta) - - File: :file:`pot_ao_ints.irp.f` - - Primitve nuclear attraction between the two primitves centered on the same atom. - - :math:`p_1 = x^{a_x} y^{a_y} z^{a_z} \exp(-\alpha r^2)` - - :math:`p_2 = x^{b_x} y^{b_y} z^{b_z} \exp(-\beta r^2)` - - - - - -.. c:function:: v_phi - - .. code:: text - - double precision function V_phi(n,m) - - File: :file:`pot_ao_ints.irp.f` - - Computes the angular :math:`\phi` part of the nuclear attraction integral: - - :math:`\int_{0}^{2 \pi} \cos(\phi)^n \sin(\phi)^m d\phi` . - - - - - -.. c:function:: v_r - - .. code:: text - - double precision function V_r(n,alpha) - - File: :file:`pot_ao_ints.irp.f` - - Computes the radial part of the nuclear attraction integral: - - :math:`\int_{0}^{\infty} r^n \exp(-\alpha r^2) dr` - - - - - - - -.. c:function:: v_theta - - .. code:: text - - double precision function V_theta(n,m) - - File: :file:`pot_ao_ints.irp.f` - - Computes the angular :math:`\theta` part of the nuclear attraction integral: - - :math:`\int_{0}^{\pi} \cos(\theta)^n \sin(\theta)^m d\theta` - - - - - -.. c:function:: wallis - - .. code:: text - - double precision function Wallis(n) - - File: :file:`pot_ao_ints.irp.f` - - Wallis integral: - - :math:`\int_{0}^{\pi} \cos(\theta)^n d\theta` . - - diff --git a/docs/source/modules/ao_two_e_erf_ints.rst b/docs/source/modules/ao_two_e_erf_ints.rst deleted file mode 100644 index 0d91b17d..00000000 --- a/docs/source/modules/ao_two_e_erf_ints.rst +++ /dev/null @@ -1,425 +0,0 @@ -.. _ao_two_e_erf_ints: - -.. program:: ao_two_e_erf_ints - -.. default-role:: option - -====================== -ao_two_e_erf_ints -====================== - -Here, all two-electron integrals (:math:`erf(\mu r_{12})/r_{12}`) are computed. -As they have 4 indices and many are zero, they are stored in a map, as defined -in :file:`utils/map_module.f90`. - -The main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter. - -To fetch an |AO| integral, use the -`get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map)` function. - - -The conventions are: -* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> - - - - - - -EZFIO parameters ----------------- - -.. option:: io_ao_two_e_integrals_erf - - Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ] - - Default: None - -.. option:: mu_erf - - cutting of the interaction in the range separated model - - Default: 0.5 - - -Providers ---------- - - -.. c:var:: ao_integrals_erf_cache - - .. code:: text - - double precision, allocatable :: ao_integrals_erf_cache (0:64*64*64*64) - - File: :file:`map_integrals_erf.irp.f` - - Cache of |AO| integrals for fast access - - - - -.. c:var:: ao_integrals_erf_cache_max - - .. code:: text - - integer :: ao_integrals_erf_cache_min - integer :: ao_integrals_erf_cache_max - - File: :file:`map_integrals_erf.irp.f` - - Min and max values of the AOs for which the integrals are in the cache - - - - -.. c:var:: ao_integrals_erf_cache_min - - .. code:: text - - integer :: ao_integrals_erf_cache_min - integer :: ao_integrals_erf_cache_max - - File: :file:`map_integrals_erf.irp.f` - - Min and max values of the AOs for which the integrals are in the cache - - - - -.. c:var:: ao_integrals_erf_map - - .. code:: text - - type(map_type) :: ao_integrals_erf_map - - File: :file:`map_integrals_erf.irp.f` - - |AO| integrals - - - - -.. c:var:: ao_two_e_integral_erf_schwartz - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_erf_schwartz (ao_num,ao_num) - - File: :file:`providers_ao_erf.irp.f` - - Needed to compute Schwartz inequalities - - - - -.. c:var:: ao_two_e_integrals_erf_in_map - - .. code:: text - - logical :: ao_two_e_integrals_erf_in_map - - File: :file:`providers_ao_erf.irp.f` - - Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) - - - - -.. c:var:: general_primitive_integral_erf - - .. code:: text - - double precision function general_primitive_integral_erf(dim, & - P_new,P_center,fact_p,p,p_inv,iorder_p, & - Q_new,Q_center,fact_q,q,q_inv,iorder_q) - - File: :file:`two_e_integrals_erf.irp.f` - - Computes the integral where p,q,r,s are Gaussian primitives - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: ao_two_e_integral_erf - - .. code:: text - - double precision function ao_two_e_integral_erf(i,j,k,l) - - File: :file:`two_e_integrals_erf.irp.f` - - integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) - - - - - -.. c:function:: ao_two_e_integral_schwartz_accel_erf - - .. code:: text - - double precision function ao_two_e_integral_schwartz_accel_erf(i,j,k,l) - - File: :file:`two_e_integrals_erf.irp.f` - - integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) - - - - - -.. c:function:: ao_two_e_integrals_erf_in_map_collector - - .. code:: text - - subroutine ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) - - File: :file:`integrals_erf_in_map_slave.irp.f` - - Collects results from the AO integral calculation - - - - - -.. c:function:: ao_two_e_integrals_erf_in_map_slave - - .. code:: text - - subroutine ao_two_e_integrals_erf_in_map_slave(thread,iproc) - - File: :file:`integrals_erf_in_map_slave.irp.f` - - Computes a buffer of integrals - - - - - -.. c:function:: ao_two_e_integrals_erf_in_map_slave_inproc - - .. code:: text - - subroutine ao_two_e_integrals_erf_in_map_slave_inproc(i) - - File: :file:`integrals_erf_in_map_slave.irp.f` - - Computes a buffer of integrals. i is the ID of the current thread. - - - - - -.. c:function:: ao_two_e_integrals_erf_in_map_slave_tcp - - .. code:: text - - subroutine ao_two_e_integrals_erf_in_map_slave_tcp(i) - - File: :file:`integrals_erf_in_map_slave.irp.f` - - Computes a buffer of integrals. i is the ID of the current thread. - - - - - -.. c:function:: clear_ao_erf_map - - .. code:: text - - subroutine clear_ao_erf_map - - File: :file:`map_integrals_erf.irp.f` - - Frees the memory of the |AO| map - - - - - -.. c:function:: compute_ao_integrals_erf_jl - - .. code:: text - - subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) - - File: :file:`two_e_integrals_erf.irp.f` - - Parallel client for AO integrals - - - - - -.. c:function:: compute_ao_two_e_integrals_erf - - .. code:: text - - subroutine compute_ao_two_e_integrals_erf(j,k,l,sze,buffer_value) - - File: :file:`two_e_integrals_erf.irp.f` - - Compute AO 1/r12 integrals for all i and fixed j,k,l - - - - - -.. c:function:: dump_ao_integrals_erf - - .. code:: text - - subroutine dump_ao_integrals_erf(filename) - - File: :file:`map_integrals_erf.irp.f` - - Save to disk the |AO| erf integrals - - - - - -.. c:function:: eri_erf - - .. code:: text - - double precision function ERI_erf(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) - - File: :file:`two_e_integrals_erf.irp.f` - - ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) - - - - - -.. c:function:: get_ao_erf_map_size - - .. code:: text - - function get_ao_erf_map_size() - - File: :file:`map_integrals_erf.irp.f` - - Returns the number of elements in the |AO| map - - - - - -.. c:function:: get_ao_two_e_integral_erf - - .. code:: text - - double precision function get_ao_two_e_integral_erf(i,j,k,l,map) result(result) - - File: :file:`map_integrals_erf.irp.f` - - Gets one |AO| two-electron integral from the |AO| map - - - - - -.. c:function:: get_ao_two_e_integrals_erf - - .. code:: text - - subroutine get_ao_two_e_integrals_erf(j,k,l,sze,out_val) - - File: :file:`map_integrals_erf.irp.f` - - Gets multiple |AO| two-electron integral from the |AO| map . All i are retrieved for j,k,l fixed. - - - - - -.. c:function:: get_ao_two_e_integrals_erf_non_zero - - .. code:: text - - subroutine get_ao_two_e_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) - - File: :file:`map_integrals_erf.irp.f` - - Gets multiple |AO| two-electron integrals from the |AO| map . All non-zero i are retrieved for j,k,l fixed. - - - - - -.. c:function:: insert_into_ao_integrals_erf_map - - .. code:: text - - subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values) - - File: :file:`map_integrals_erf.irp.f` - - Create new entry into |AO| map - - - - - -.. c:function:: integrale_new_erf - - .. code:: text - - subroutine integrale_new_erf(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) - - File: :file:`two_e_integrals_erf.irp.f` - - calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) - - - - - -.. c:function:: load_ao_integrals_erf - - .. code:: text - - integer function load_ao_integrals_erf(filename) - - File: :file:`map_integrals_erf.irp.f` - - Read from disk the |AO| erf integrals - - - - - -.. c:function:: save_erf_two_e_integrals_ao - - .. code:: text - - subroutine save_erf_two_e_integrals_ao - - File: :file:`routines_save_integrals_erf.irp.f` - - - - - - - -.. c:function:: save_erf_two_e_ints_ao_into_ints_ao - - .. code:: text - - subroutine save_erf_two_e_ints_ao_into_ints_ao - - File: :file:`routines_save_integrals_erf.irp.f` - - - - diff --git a/docs/source/modules/ao_two_e_ints.rst b/docs/source/modules/ao_two_e_ints.rst deleted file mode 100644 index c9b9074a..00000000 --- a/docs/source/modules/ao_two_e_ints.rst +++ /dev/null @@ -1,619 +0,0 @@ -.. _ao_two_e_ints: - -.. program:: ao_two_e_ints - -.. default-role:: option - -================== -ao_two_e_ints -================== - -Here, all two-electron integrals (:math:`1/r_{12}`) are computed. -As they have 4 indices and many are zero, they are stored in a map, as defined -in :file:`utils/map_module.f90`. - -To fetch an |AO| integral, use the -`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function. - - -The conventions are: -* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> - - - - - - -EZFIO parameters ----------------- - -.. option:: io_ao_two_e_integrals - - Read/Write |AO| integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: ao_integrals_threshold - - If | (pq|rs) | < `ao_integrals_threshold` then (pq|rs) is zero - - Default: 1.e-15 - -.. option:: do_direct_integrals - - Compute integrals on the fly (very slow, only for debugging) - - Default: False - - -Providers ---------- - - -.. c:var:: ao_integrals_cache - - .. code:: text - - double precision, allocatable :: ao_integrals_cache (0:64*64*64*64) - - File: :file:`map_integrals.irp.f` - - Cache of AO integrals for fast access - - - - -.. c:var:: ao_integrals_cache_max - - .. code:: text - - integer :: ao_integrals_cache_min - integer :: ao_integrals_cache_max - - File: :file:`map_integrals.irp.f` - - Min and max values of the AOs for which the integrals are in the cache - - - - -.. c:var:: ao_integrals_cache_min - - .. code:: text - - integer :: ao_integrals_cache_min - integer :: ao_integrals_cache_max - - File: :file:`map_integrals.irp.f` - - Min and max values of the AOs for which the integrals are in the cache - - - - -.. c:var:: ao_integrals_map - - .. code:: text - - type(map_type) :: ao_integrals_map - - File: :file:`map_integrals.irp.f` - - AO integrals - - - - -.. c:var:: ao_two_e_integral_schwartz - - .. code:: text - - double precision, allocatable :: ao_two_e_integral_schwartz (ao_num,ao_num) - - File: :file:`two_e_integrals.irp.f` - - Needed to compute Schwartz inequalities - - - - -.. c:var:: ao_two_e_integrals_in_map - - .. code:: text - - logical :: ao_two_e_integrals_in_map - - File: :file:`two_e_integrals.irp.f` - - Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) - - - - -.. c:var:: gauleg_t2 - - .. code:: text - - double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) - double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) - - File: :file:`gauss_legendre.irp.f` - - t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) - - - - -.. c:var:: gauleg_w - - .. code:: text - - double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) - double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) - - File: :file:`gauss_legendre.irp.f` - - t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) - - - - -.. c:var:: general_primitive_integral - - .. code:: text - - double precision function general_primitive_integral(dim, & - P_new,P_center,fact_p,p,p_inv,iorder_p, & - Q_new,Q_center,fact_q,q,q_inv,iorder_q) - - File: :file:`two_e_integrals.irp.f` - - Computes the integral where p,q,r,s are Gaussian primitives - - - - -.. c:var:: i_x1_new - - .. code:: text - - recursive subroutine I_x1_new(a,c,B_10,B_01,B_00,res,n_pt) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -.. c:var:: i_x1_pol_mult_a1 - - .. code:: text - - recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -.. c:var:: i_x1_pol_mult_a2 - - .. code:: text - - recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -.. c:var:: i_x1_pol_mult_recurs - - .. code:: text - - recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -.. c:var:: i_x2_new - - .. code:: text - - recursive subroutine I_x2_new(c,B_10,B_01,B_00,res,n_pt) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -.. c:var:: i_x2_pol_mult - - .. code:: text - - recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: ao_l4 - - .. code:: text - - integer function ao_l4(i,j,k,l) - - File: :file:`two_e_integrals.irp.f` - - Computes the product of l values of i,j,k,and l - - - - - -.. c:function:: ao_two_e_integral - - .. code:: text - - double precision function ao_two_e_integral(i,j,k,l) - - File: :file:`two_e_integrals.irp.f` - - integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) - - - - - -.. c:function:: ao_two_e_integral_schwartz_accel - - .. code:: text - - double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) - - File: :file:`two_e_integrals.irp.f` - - integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) - - - - - -.. c:function:: ao_two_e_integrals_in_map_collector - - .. code:: text - - subroutine ao_two_e_integrals_in_map_collector(zmq_socket_pull) - - File: :file:`integrals_in_map_slave.irp.f` - - Collects results from the AO integral calculation - - - - - -.. c:function:: ao_two_e_integrals_in_map_slave - - .. code:: text - - subroutine ao_two_e_integrals_in_map_slave(thread,iproc) - - File: :file:`integrals_in_map_slave.irp.f` - - Computes a buffer of integrals - - - - - -.. c:function:: ao_two_e_integrals_in_map_slave_inproc - - .. code:: text - - subroutine ao_two_e_integrals_in_map_slave_inproc(i) - - File: :file:`integrals_in_map_slave.irp.f` - - Computes a buffer of integrals. i is the ID of the current thread. - - - - - -.. c:function:: ao_two_e_integrals_in_map_slave_tcp - - .. code:: text - - subroutine ao_two_e_integrals_in_map_slave_tcp(i) - - File: :file:`integrals_in_map_slave.irp.f` - - Computes a buffer of integrals. i is the ID of the current thread. - - - - - -.. c:function:: clear_ao_map - - .. code:: text - - subroutine clear_ao_map - - File: :file:`map_integrals.irp.f` - - Frees the memory of the AO map - - - - - -.. c:function:: compute_ao_integrals_jl - - .. code:: text - - subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) - - File: :file:`two_e_integrals.irp.f` - - Parallel client for AO integrals - - - - - -.. c:function:: compute_ao_two_e_integrals - - .. code:: text - - subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value) - - File: :file:`two_e_integrals.irp.f` - - Compute AO 1/r12 integrals for all i and fixed j,k,l - - - - - -.. c:function:: dump_ao_integrals - - .. code:: text - - subroutine dump_ao_integrals(filename) - - File: :file:`map_integrals.irp.f` - - Save to disk the |AO| integrals - - - - - -.. c:function:: eri - - .. code:: text - - double precision function ERI(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) - - File: :file:`two_e_integrals.irp.f` - - ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) - - - - - -.. c:function:: gauleg - - .. code:: text - - subroutine gauleg(x1,x2,x,w,n) - - File: :file:`gauss_legendre.irp.f` - - Gauss-Legendre - - - - - -.. c:function:: get_ao_map_size - - .. code:: text - - function get_ao_map_size() - - File: :file:`map_integrals.irp.f` - - Returns the number of elements in the AO map - - - - - -.. c:function:: get_ao_two_e_integral - - .. code:: text - - double precision function get_ao_two_e_integral(i,j,k,l,map) result(result) - - File: :file:`map_integrals.irp.f` - - Gets one AO bi-electronic integral from the AO map - - - - - -.. c:function:: get_ao_two_e_integrals - - .. code:: text - - subroutine get_ao_two_e_integrals(j,k,l,sze,out_val) - - File: :file:`map_integrals.irp.f` - - Gets multiple AO bi-electronic integral from the AO map . All i are retrieved for j,k,l fixed. - - - - - -.. c:function:: get_ao_two_e_integrals_non_zero - - .. code:: text - - subroutine get_ao_two_e_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) - - File: :file:`map_integrals.irp.f` - - Gets multiple AO bi-electronic integral from the AO map . All non-zero i are retrieved for j,k,l fixed. - - - - - -.. c:function:: give_polynom_mult_center_x - - .. code:: text - - subroutine give_polynom_mult_center_x(P_center,Q_center,a_x,d_x,p,q,n_pt_in,pq_inv,pq_inv_2,p10_1,p01_1,p10_2,p01_2,d,n_pt_out) - - File: :file:`two_e_integrals.irp.f` - - subroutine that returns the explicit polynom in term of the "t" variable of the following polynomw : I_x1(a_x, d_x,p,q) * I_x1(a_y, d_y,p,q) * I_x1(a_z, d_z,p,q) - - - - - -.. c:function:: i_x1_pol_mult - - .. code:: text - - subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) - - File: :file:`two_e_integrals.irp.f` - - recursive function involved in the two-electron integral - - - - - -.. c:function:: insert_into_ao_integrals_map - - .. code:: text - - subroutine insert_into_ao_integrals_map(n_integrals,buffer_i, buffer_values) - - File: :file:`map_integrals.irp.f` - - Create new entry into AO map - - - - - -.. c:function:: integrale_new - - .. code:: text - - subroutine integrale_new(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) - - File: :file:`two_e_integrals.irp.f` - - calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) - - - - - -.. c:function:: load_ao_integrals - - .. code:: text - - integer function load_ao_integrals(filename) - - File: :file:`map_integrals.irp.f` - - Read from disk the |AO| integrals - - - - - -.. c:function:: n_pt_sup - - .. code:: text - - integer function n_pt_sup(a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) - - File: :file:`two_e_integrals.irp.f` - - Returns the upper boundary of the degree of the polynomial involved in the bielctronic integral : Ix(a_x,b_x,c_x,d_x) * Iy(a_y,b_y,c_y,d_y) * Iz(a_z,b_z,c_z,d_z) - - - - - -.. c:function:: push_integrals - - .. code:: text - - subroutine push_integrals(zmq_socket_push, n_integrals, buffer_i, buffer_value, task_id) - - File: :file:`integrals_in_map_slave.irp.f` - - Push integrals in the push socket - - - - - -.. c:function:: two_e_integrals_index - - .. code:: text - - subroutine two_e_integrals_index(i,j,k,l,i1) - - File: :file:`map_integrals.irp.f` - - - - - - - -.. c:function:: two_e_integrals_index_reverse - - .. code:: text - - subroutine two_e_integrals_index_reverse(i,j,k,l,i1) - - File: :file:`map_integrals.irp.f` - - - - diff --git a/docs/source/modules/aux_quantities.rst b/docs/source/modules/aux_quantities.rst deleted file mode 100644 index ba56eac3..00000000 --- a/docs/source/modules/aux_quantities.rst +++ /dev/null @@ -1,52 +0,0 @@ -.. _aux_quantities: - -.. program:: aux_quantities - -.. default-role:: option - -============== -aux_quantities -============== - - -This module contains some global variables (such as densities and energies) -which are stored in the EZFIO folder in a different place than determinants. -This is used in practice to store density matrices which can be obtained from -any methods, as long as they are stored in the same MO basis which is used for -the calculations. In |RSDFT| calculations, this can be done to perform damping -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 - one-body alpha and beta densities which are necessary read from the EZFIO - folder. - - -Thanks to these providers you can use any density matrix that does not -necessary corresponds to that of the current wave function. - - - -EZFIO parameters ----------------- - -.. option:: data_energy_var - - Variational energy computed with the wave function - - -.. option:: data_energy_proj - - Projected energy computed with the wave function - - -.. option:: data_one_body_alpha_dm_mo - - Alpha one body density matrix on the MO basis computed with the wave function - - -.. option:: data_one_body_beta_dm_mo - - Beta one body density matrix on the MO basis computed with the wave function - diff --git a/docs/source/modules/becke_numerical_grid.rst b/docs/source/modules/becke_numerical_grid.rst deleted file mode 100644 index 1c77b50d..00000000 --- a/docs/source/modules/becke_numerical_grid.rst +++ /dev/null @@ -1,454 +0,0 @@ -.. _becke_numerical_grid: - -.. program:: becke_numerical_grid - -.. default-role:: option - -==================== -becke_numerical_grid -==================== - -This module contains all quantities needed to build the Becke's grid used in general for DFT integration. Note that it can be used for whatever integration in R^3 as long as the functions to be integrated are mostly concentrated near the atomic regions. - -This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains -a certain number of radial and angular points. No pruning is done on the angular part of the grid. - -The main keyword for that modue is: - -* :option:`becke_numerical_grid grid_type_sgn` which controls the precision of the grid according the standard **SG-n** grids. This keyword controls the two providers `n_points_integration_angular` `n_points_radial_grid`. - -The main providers of that module are: - -* `n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 170 | 194 | 266 | 302 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details. -* `n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary. -* `final_grid_points` which are the (x,y,z) coordinates of the grid points. -* `final_weight_at_r_vector` which are the weights at each grid point - - -For a simple example of how to use the grid, see :file:`example.irp.f`. - -The spherical integration uses Lebedev-Laikov grids, which was used from the code distributed through CCL (http://www.ccl.net/). -See next section for explanations and citation policies. - -.. code-block:: text - - This subroutine is part of a set of subroutines that generate - Lebedev grids [1-6] for integration on a sphere. The original - C-code [1] was kindly provided by Dr. Dmitri N. Laikov and - translated into fortran by Dr. Christoph van Wuellen. - This subroutine was translated using a C to fortran77 conversion - tool written by Dr. Christoph van Wuellen. - - Users of this code are asked to include reference [1] in their - publications, and in the user- and programmers-manuals - describing their codes. - - This code was distributed through CCL (http://www.ccl.net/). - - [1] V.I. Lebedev, and D.N. Laikov - "A quadrature formula for the sphere of the 131st - algebraic order of accuracy" - Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481. - - [2] V.I. Lebedev - "A quadrature formula for the sphere of 59th algebraic - order of accuracy" - Russian Acad. Sci. Dokl. Math., Vol. 50, 1995, pp. 283-286. - - [3] V.I. Lebedev, and A.L. Skorokhodov - "Quadrature formulas of orders 41, 47, and 53 for the sphere" - Russian Acad. Sci. Dokl. Math., Vol. 45, 1992, pp. 587-592. - - [4] V.I. Lebedev - "Spherical quadrature formulas exact to orders 25-29" - Siberian Mathematical Journal, Vol. 18, 1977, pp. 99-107. - - [5] V.I. Lebedev - "Quadratures on a sphere" - Computational Mathematics and Mathematical Physics, Vol. 16, - 1976, pp. 10-24. - - [6] V.I. Lebedev - "Values of the nodes and weights of ninth to seventeenth - order Gauss-Markov quadrature formulae invariant under the - octahedron group with inversion" - Computational Mathematics and Mathematical Physics, Vol. 15, - 1975, pp. 44-51. - - - - - -EZFIO parameters ----------------- - -.. option:: grid_type_sgn - - Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ] - - Default: 2 - - -Providers ---------- - - -.. c:var:: alpha_knowles - - .. code:: text - - double precision, allocatable :: alpha_knowles (100) - - File: :file:`integration_radial.irp.f` - - Recommended values for the alpha parameters according to the paper of Knowles (JCP, 104, 1996) as a function of the nuclear charge - - - - -.. c:var:: angular_quadrature_points - - .. code:: text - - double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) - double precision, allocatable :: weights_angular_points (n_points_integration_angular) - - File: :file:`grid_becke.irp.f` - - weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme - - - - -.. c:var:: dr_radial_integral - - .. code:: text - - double precision, allocatable :: grid_points_radial (n_points_radial_grid) - double precision :: dr_radial_integral - - File: :file:`grid_becke.irp.f` - - points in [0,1] to map the radial integral [0,\infty] - - - - -.. c:var:: final_grid_points - - .. code:: text - - double precision, allocatable :: final_grid_points (3,n_points_final_grid) - double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) - integer, allocatable :: index_final_points (3,n_points_final_grid) - integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke_vector.irp.f` - - final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point - - final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions - - index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point - - index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices - - - - -.. c:var:: final_weight_at_r - - .. code:: text - - double precision, allocatable :: final_weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke.irp.f` - - Total weight on each grid point which takes into account all Lebedev, Voronoi and radial weights. - - - - -.. c:var:: final_weight_at_r_vector - - .. code:: text - - double precision, allocatable :: final_grid_points (3,n_points_final_grid) - double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) - integer, allocatable :: index_final_points (3,n_points_final_grid) - integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke_vector.irp.f` - - final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point - - final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions - - index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point - - index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices - - - - -.. c:var:: grid_points_per_atom - - .. code:: text - - double precision, allocatable :: grid_points_per_atom (3,n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke.irp.f` - - x,y,z coordinates of grid points used for integration in 3d space - - - - -.. c:var:: grid_points_radial - - .. code:: text - - double precision, allocatable :: grid_points_radial (n_points_radial_grid) - double precision :: dr_radial_integral - - File: :file:`grid_becke.irp.f` - - points in [0,1] to map the radial integral [0,\infty] - - - - -.. c:var:: index_final_points - - .. code:: text - - double precision, allocatable :: final_grid_points (3,n_points_final_grid) - double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) - integer, allocatable :: index_final_points (3,n_points_final_grid) - integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke_vector.irp.f` - - final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point - - final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions - - index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point - - index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices - - - - -.. c:var:: index_final_points_reverse - - .. code:: text - - double precision, allocatable :: final_grid_points (3,n_points_final_grid) - double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) - integer, allocatable :: index_final_points (3,n_points_final_grid) - integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke_vector.irp.f` - - final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point - - final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions - - index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point - - index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices - - - - -.. c:var:: m_knowles - - .. code:: text - - integer :: m_knowles - - File: :file:`grid_becke.irp.f` - - value of the "m" parameter in the equation (7) of the paper of Knowles (JCP, 104, 1996) - - - - -.. c:var:: n_points_final_grid - - .. code:: text - - integer :: n_points_final_grid - - File: :file:`grid_becke_vector.irp.f` - - Number of points which are non zero - - - - -.. c:var:: n_points_grid_per_atom - - .. code:: text - - integer :: n_points_grid_per_atom - - File: :file:`grid_becke.irp.f` - - Number of grid points per atom - - - - -.. c:var:: n_points_integration_angular - - .. code:: text - - integer :: n_points_radial_grid - integer :: n_points_integration_angular - - File: :file:`grid_becke.irp.f` - - n_points_radial_grid = number of radial grid points per atom - - n_points_integration_angular = number of angular grid points per atom - - These numbers are automatically set by setting the grid_type_sgn parameter - - - - -.. c:var:: n_points_radial_grid - - .. code:: text - - integer :: n_points_radial_grid - integer :: n_points_integration_angular - - File: :file:`grid_becke.irp.f` - - n_points_radial_grid = number of radial grid points per atom - - n_points_integration_angular = number of angular grid points per atom - - These numbers are automatically set by setting the grid_type_sgn parameter - - - - -.. c:var:: weight_at_r - - .. code:: text - - double precision, allocatable :: weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) - - File: :file:`grid_becke.irp.f` - - Weight function at grid points : w_n(r) according to the equation (22) of Becke original paper (JCP, 88, 1988) - - The "n" discrete variable represents the nucleis which in this array is represented by the last dimension and the points are labelled by the other dimensions. - - - - -.. c:var:: weights_angular_points - - .. code:: text - - double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) - double precision, allocatable :: weights_angular_points (n_points_integration_angular) - - File: :file:`grid_becke.irp.f` - - weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: cell_function_becke - - .. code:: text - - double precision function cell_function_becke(r,atom_number) - - File: :file:`step_function_becke.irp.f` - - atom_number :: atom on which the cell function of Becke (1988, JCP,88(4)) r(1:3) :: x,y,z coordinantes of the current point - - - - - -.. c:function:: derivative_knowles_function - - .. code:: text - - double precision function derivative_knowles_function(alpha,m,x) - - File: :file:`integration_radial.irp.f` - - Derivative of the function proposed by Knowles (JCP, 104, 1996) for distributing the radial points - - - - - -.. c:function:: example_becke_numerical_grid - - .. code:: text - - subroutine example_becke_numerical_grid - - File: :file:`example.irp.f` - - subroutine that illustrates the main features available in becke_numerical_grid - - - - - -.. c:function:: f_function_becke - - .. code:: text - - double precision function f_function_becke(x) - - File: :file:`step_function_becke.irp.f` - - - - - - - -.. c:function:: knowles_function - - .. code:: text - - double precision function knowles_function(alpha,m,x) - - File: :file:`integration_radial.irp.f` - - Function proposed by Knowles (JCP, 104, 1996) for distributing the radial points : the Log "m" function ( equation (7) in the paper ) - - - - - -.. c:function:: step_function_becke - - .. code:: text - - double precision function step_function_becke(x) - - File: :file:`step_function_becke.irp.f` - - Step function of the Becke paper (1988, JCP,88(4)) - - diff --git a/docs/source/modules/bitmask.rst b/docs/source/modules/bitmask.rst deleted file mode 100644 index 9cf72275..00000000 --- a/docs/source/modules/bitmask.rst +++ /dev/null @@ -1,1272 +0,0 @@ -.. _bitmask: - -.. program:: bitmask - -.. default-role:: option - -============== -bitmask module -============== - -The central part of this module is the :file:`bitmasks_module.f90` file. It contains -the constants that will be used to define on which kind of integer the bitmasks -will be defined. - -In the program, to represent a determinant as a pair of bitstrings, -the determinant should be defined as - -.. code-block:: fortran - - use bitmasks - integer(bit_kind) :: determinant(N_int,2) - - -:file:`bitmasks_routines.irp.f` contains helper routines to manipulate bitmask, like -transforming a bit string to a list of integers for example. - - -`bit_kind_shift`, `bit_kind_size` and `bit_kind` are supposed to be consistent:: - - 2**bit_kind_shift = bit_kind_size - bit_kind = bit_kind_size / 8 - - -For an example of how to use the bitmaks, see the file :file:`example.irp.f`. - - - -Providers ---------- - - -.. c:var:: cas_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: cas_bitmask (N_int,2,N_cas_bitmask) - - File: :file:`bitmasks.irp.f` - - Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference) - - - - -.. c:var:: closed_shell_ref_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: closed_shell_ref_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: core_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: core_bitmask (N_int,2) - integer :: n_core_orb - - File: :file:`bitmasks.irp.f` - - Core + deleted orbitals bitmask - - - - -.. c:var:: core_inact_act_bitmask_4 - - .. code:: text - - integer(bit_kind), allocatable :: core_inact_act_bitmask_4 (N_int,4) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: core_inact_virt_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) - integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reunion of the inactive and virtual bitmasks - - - - -.. c:var:: full_ijkl_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: full_ijkl_bitmask (N_int) - - File: :file:`bitmasks.irp.f` - - Bitmask to include all possible MOs - - - - -.. c:var:: full_ijkl_bitmask_4 - - .. code:: text - - integer(bit_kind), allocatable :: full_ijkl_bitmask_4 (N_int,4) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: generators_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: generators_bitmask (N_int,2,6,N_generators_bitmask) - - File: :file:`bitmasks.irp.f` - - Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). - - 3rd index is : - - * 1 : hole for single exc - - * 2 : particle for single exc - - * 3 : hole for 1st exc of double - - * 4 : particle for 1st exc of double - - * 5 : hole for 2nd exc of double - - * 6 : particle for 2nd exc of double - - - - - - -.. c:var:: generators_bitmask_restart - - .. code:: text - - integer(bit_kind), allocatable :: generators_bitmask_restart (N_int,2,6,N_generators_bitmask_restart) - - File: :file:`bitmasks.irp.f` - - Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). - - 3rd index is : - - * 1 : hole for single exc - - * 2 : particle for single exc - - * 3 : hole for 1st exc of double - - * 4 : particle for 1st exc of double - - * 5 : hole for 2nd exc of double - - * 6 : particle for 2nd exc of double - - - - - - -.. c:var:: hf_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: hf_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Hartree Fock bit mask - - - - -.. c:var:: i_bitmask_gen - - .. code:: text - - integer :: i_bitmask_gen - - File: :file:`bitmasks.irp.f` - - Current bitmask for the generators - - - - -.. c:var:: inact_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: inact_bitmask (N_int,2) - integer(bit_kind), allocatable :: virt_bitmask (N_int,2) - integer :: n_inact_orb - integer :: n_virt_orb - - File: :file:`bitmasks.irp.f` - - inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals - - - - -.. c:var:: inact_virt_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) - integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reunion of the inactive and virtual bitmasks - - - - -.. c:var:: index_holes_bitmask - - .. code:: text - - integer, allocatable :: index_holes_bitmask (3) - - File: :file:`modify_bitmasks.irp.f` - - Index of the holes in the generators_bitmasks - - - - -.. c:var:: index_particl_bitmask - - .. code:: text - - integer, allocatable :: index_particl_bitmask (3) - - File: :file:`modify_bitmasks.irp.f` - - Index of the holes in the generators_bitmasks - - - - -.. c:var:: list_act - - .. code:: text - - integer, allocatable :: list_act (n_act_orb) - integer, allocatable :: list_act_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_act(i) = index of the ith active orbital - - list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital - - - - -.. c:var:: list_act_reverse - - .. code:: text - - integer, allocatable :: list_act (n_act_orb) - integer, allocatable :: list_act_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_act(i) = index of the ith active orbital - - list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital - - - - -.. c:var:: list_core - - .. code:: text - - integer, allocatable :: list_core (n_core_orb) - integer, allocatable :: list_core_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - List of the core orbitals that are never excited in post CAS method - - - - -.. c:var:: list_core_inact - - .. code:: text - - integer, allocatable :: list_core_inact (n_core_inact_orb) - integer, allocatable :: list_core_inact_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: list_core_inact_act - - .. code:: text - - integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) - integer, allocatable :: list_core_inact_act_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: list_core_inact_act_reverse - - .. code:: text - - integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) - integer, allocatable :: list_core_inact_act_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: list_core_inact_reverse - - .. code:: text - - integer, allocatable :: list_core_inact (n_core_inact_orb) - integer, allocatable :: list_core_inact_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: list_core_reverse - - .. code:: text - - integer, allocatable :: list_core (n_core_orb) - integer, allocatable :: list_core_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - List of the core orbitals that are never excited in post CAS method - - - - -.. c:var:: list_inact - - .. code:: text - - integer, allocatable :: list_inact (n_inact_orb) - integer, allocatable :: list_virt (n_virt_orb) - integer, allocatable :: list_inact_reverse (mo_num) - integer, allocatable :: list_virt_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual - - - - -.. c:var:: list_inact_reverse - - .. code:: text - - integer, allocatable :: list_inact (n_inact_orb) - integer, allocatable :: list_virt (n_virt_orb) - integer, allocatable :: list_inact_reverse (mo_num) - integer, allocatable :: list_virt_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual - - - - -.. c:var:: list_virt - - .. code:: text - - integer, allocatable :: list_inact (n_inact_orb) - integer, allocatable :: list_virt (n_virt_orb) - integer, allocatable :: list_inact_reverse (mo_num) - integer, allocatable :: list_virt_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual - - - - -.. c:var:: list_virt_reverse - - .. code:: text - - integer, allocatable :: list_inact (n_inact_orb) - integer, allocatable :: list_virt (n_virt_orb) - integer, allocatable :: list_inact_reverse (mo_num) - integer, allocatable :: list_virt_reverse (mo_num) - - File: :file:`bitmasks.irp.f` - - list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual - - - - -.. c:var:: mpi_bit_kind - - .. code:: text - - integer :: mpi_bit_kind - - File: :file:`mpi.irp.f` - - MPI bit kind type - - - - -.. c:var:: n_act_orb - - .. code:: text - - integer :: n_act_orb - - File: :file:`bitmasks.irp.f` - - number of active orbitals - - - - -.. c:var:: n_cas_bitmask - - .. code:: text - - integer :: n_cas_bitmask - - File: :file:`bitmasks.irp.f` - - Number of bitmasks for CAS - - - - -.. c:var:: n_core_inact_act_orb - - .. code:: text - - integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) - integer :: n_core_inact_act_orb - - File: :file:`bitmasks.irp.f` - - Reunion of the core, inactive and active bitmasks - - - - -.. c:var:: n_core_inact_orb - - .. code:: text - - integer :: n_core_inact_orb - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: n_core_orb - - .. code:: text - - integer(bit_kind), allocatable :: core_bitmask (N_int,2) - integer :: n_core_orb - - File: :file:`bitmasks.irp.f` - - Core + deleted orbitals bitmask - - - - -.. c:var:: n_core_orb_allocate - - .. code:: text - - integer :: n_core_orb_allocate - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: n_generators_bitmask - - .. code:: text - - integer :: n_generators_bitmask - - File: :file:`bitmasks.irp.f` - - Number of bitmasks for generators - - - - -.. c:var:: n_generators_bitmask_restart - - .. code:: text - - integer :: n_generators_bitmask_restart - - File: :file:`bitmasks.irp.f` - - Number of bitmasks for generators - - - - -.. c:var:: n_inact_orb - - .. code:: text - - integer(bit_kind), allocatable :: inact_bitmask (N_int,2) - integer(bit_kind), allocatable :: virt_bitmask (N_int,2) - integer :: n_inact_orb - integer :: n_virt_orb - - File: :file:`bitmasks.irp.f` - - inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals - - - - -.. c:var:: n_inact_orb_allocate - - .. code:: text - - integer :: n_inact_orb_allocate - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: n_int - - .. code:: text - - integer :: n_int - - File: :file:`bitmasks.irp.f` - - Number of 64-bit integers needed to represent determinants as binary strings - - - - -.. c:var:: n_virt_orb - - .. code:: text - - integer(bit_kind), allocatable :: inact_bitmask (N_int,2) - integer(bit_kind), allocatable :: virt_bitmask (N_int,2) - integer :: n_inact_orb - integer :: n_virt_orb - - File: :file:`bitmasks.irp.f` - - inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals - - - - -.. c:var:: n_virt_orb_allocate - - .. code:: text - - integer :: n_virt_orb_allocate - - File: :file:`bitmasks.irp.f` - - - - - - -.. c:var:: ref_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: ref_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask - - - - -.. c:var:: reunion_of_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: reunion_of_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reunion of the inactive, active and virtual bitmasks - - - - -.. c:var:: reunion_of_cas_inact_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: reunion_of_cas_inact_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reunion of the inactive, active and virtual bitmasks - - - - -.. c:var:: reunion_of_core_inact_act_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) - integer :: n_core_inact_act_orb - - File: :file:`bitmasks.irp.f` - - Reunion of the core, inactive and active bitmasks - - - - -.. c:var:: reunion_of_core_inact_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: reunion_of_core_inact_bitmask (N_int,2) - - File: :file:`bitmasks.irp.f` - - Reunion of the core and inactive and virtual bitmasks - - - - -.. c:var:: unpaired_alpha_electrons - - .. code:: text - - integer(bit_kind), allocatable :: unpaired_alpha_electrons (N_int) - - File: :file:`bitmasks.irp.f` - - Bitmask reprenting the unpaired alpha electrons in the HF_bitmask - - - - -.. c:var:: virt_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: inact_bitmask (N_int,2) - integer(bit_kind), allocatable :: virt_bitmask (N_int,2) - integer :: n_inact_orb - integer :: n_virt_orb - - File: :file:`bitmasks.irp.f` - - inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals - - - - -.. c:var:: virt_bitmask_4 - - .. code:: text - - integer(bit_kind), allocatable :: virt_bitmask_4 (N_int,4) - - File: :file:`bitmasks.irp.f` - - - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: bitstring_to_hexa - - .. code:: text - - subroutine bitstring_to_hexa( output, string, Nint ) - - File: :file:`bitmasks_routines.irp.f` - - Transform a bit string to a string in hexadecimal format for printing - - - - - -.. c:function:: bitstring_to_list - - .. code:: text - - subroutine bitstring_to_list( string, list, n_elements, Nint) - - File: :file:`bitmasks_routines.irp.f` - - Gives the inidices(+1) of the bits set to 1 in the bit string - - - - - -.. c:function:: bitstring_to_str - - .. code:: text - - subroutine bitstring_to_str( output, string, Nint ) - - File: :file:`bitmasks_routines.irp.f` - - Transform a bit string to a string for printing - - - - - -.. c:function:: broadcast_chunks_bit_kind - - .. code:: text - - subroutine broadcast_chunks_bit_kind(A, LDA) - - File: :file:`mpi.irp.f` - - Broadcast with chunks of ~2GB - - - - - -.. c:function:: clear_bit_to_integer - - .. code:: text - - subroutine clear_bit_to_integer(i_physical,key,Nint) - - File: :file:`bitmasks_routines.irp.f` - - set to 0 the bit number i_physical in the bitstring key - - - - - -.. c:function:: debug_det - - .. code:: text - - subroutine debug_det(string,Nint) - - File: :file:`bitmasks_routines.irp.f` - - Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. - - - - - -.. c:function:: debug_spindet - - .. code:: text - - subroutine debug_spindet(string,Nint) - - File: :file:`bitmasks_routines.irp.f` - - Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. - - - - - -.. c:function:: example_bitmask - - .. code:: text - - subroutine example_bitmask - - File: :file:`example.irp.f` - - subroutine that illustrates the main features available in bitmask - - - - - -.. c:function:: initialize_bitmask_to_restart_ones - - .. code:: text - - subroutine initialize_bitmask_to_restart_ones - - File: :file:`modify_bitmasks.irp.f` - - Initialization of the generators_bitmask to the restart bitmask - - - - - -.. c:function:: is_a_1h - - .. code:: text - - logical function is_a_1h(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_1h1p - - .. code:: text - - logical function is_a_1h1p(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_1h2p - - .. code:: text - - logical function is_a_1h2p(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_1p - - .. code:: text - - logical function is_a_1p(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_2h - - .. code:: text - - logical function is_a_2h(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_2h1p - - .. code:: text - - logical function is_a_2h1p(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_2p - - .. code:: text - - logical function is_a_2p(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_a_two_holes_two_particles - - .. code:: text - - logical function is_a_two_holes_two_particles(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - logical function that returns True if the determinant 'key_in' belongs to the 2h-2p excitation class of the DDCI space this is calculated using the CAS_bitmask that defines the active orbital space, the inact_bitmasl that defines the inactive oribital space and the virt_bitmask that defines the virtual orbital space - - - - - -.. c:function:: is_i_in_virtual - - .. code:: text - - logical function is_i_in_virtual(i) - - File: :file:`bitmask_cas_routines.irp.f` - - - - - - - -.. c:function:: is_the_hole_in_det - - .. code:: text - - logical function is_the_hole_in_det(key_in,ispin,i_hole) - - File: :file:`find_hole.irp.f` - - - - - - - -.. c:function:: is_the_particl_in_det - - .. code:: text - - logical function is_the_particl_in_det(key_in,ispin,i_particl) - - File: :file:`find_hole.irp.f` - - - - - - - -.. c:function:: list_to_bitstring - - .. code:: text - - subroutine list_to_bitstring( string, list, n_elements, Nint) - - File: :file:`bitmasks_routines.irp.f` - - Returns the physical string "string(N_int,2)" from the array of occupations "list(N_int*bit_kind_size,2) - - - - - -.. c:function:: modify_bitmasks_for_hole - - .. code:: text - - subroutine modify_bitmasks_for_hole(i_hole) - - File: :file:`modify_bitmasks.irp.f` - - modify the generators_bitmask in order that one can only excite the electrons occupying i_hole - - - - - -.. c:function:: modify_bitmasks_for_hole_in_out - - .. code:: text - - subroutine modify_bitmasks_for_hole_in_out(i_hole) - - File: :file:`modify_bitmasks.irp.f` - - modify the generators_bitmask in order that one can only excite the electrons occupying i_hole - - - - - -.. c:function:: modify_bitmasks_for_particl - - .. code:: text - - subroutine modify_bitmasks_for_particl(i_part) - - File: :file:`modify_bitmasks.irp.f` - - modify the generators_bitmask in order that one can only excite the electrons to the orbital i_part - - - - - -.. c:function:: number_of_holes - - .. code:: text - - integer function number_of_holes(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - Function that returns the number of holes in the inact space - - - - - -.. c:function:: number_of_holes_verbose - - .. code:: text - - integer function number_of_holes_verbose(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - function that returns the number of holes in the inact space - - - - - -.. c:function:: number_of_particles - - .. code:: text - - integer function number_of_particles(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - function that returns the number of particles in the virtual space - - - - - -.. c:function:: number_of_particles_verbose - - .. code:: text - - integer function number_of_particles_verbose(key_in) - - File: :file:`bitmask_cas_routines.irp.f` - - function that returns the number of particles in the inact space - - - - - -.. c:function:: print_det - - .. code:: text - - subroutine print_det(string,Nint) - - File: :file:`bitmasks_routines.irp.f` - - Subroutine to print the content of a determinant using the '+-' notation - - - - - -.. c:function:: print_generators_bitmasks_holes - - .. code:: text - - subroutine print_generators_bitmasks_holes - - File: :file:`modify_bitmasks.irp.f` - - - - - - - -.. c:function:: print_generators_bitmasks_holes_for_one_generator - - .. code:: text - - subroutine print_generators_bitmasks_holes_for_one_generator(i_gen) - - File: :file:`modify_bitmasks.irp.f` - - - - - - - -.. c:function:: print_generators_bitmasks_particles - - .. code:: text - - subroutine print_generators_bitmasks_particles - - File: :file:`modify_bitmasks.irp.f` - - - - - - - -.. c:function:: print_generators_bitmasks_particles_for_one_generator - - .. code:: text - - subroutine print_generators_bitmasks_particles_for_one_generator(i_gen) - - File: :file:`modify_bitmasks.irp.f` - - - - - - - -.. c:function:: print_spindet - - .. code:: text - - subroutine print_spindet(string,Nint) - - File: :file:`bitmasks_routines.irp.f` - - Subroutine to print the content of a determinant using the '+-' notation - - - - - -.. c:function:: set_bit_to_integer - - .. code:: text - - subroutine set_bit_to_integer(i_physical,key,Nint) - - File: :file:`bitmasks_routines.irp.f` - - set to 1 the bit number i_physical in the bitstring key - - - - - -.. c:function:: set_bitmask_hole_as_input - - .. code:: text - - subroutine set_bitmask_hole_as_input(input_bimask) - - File: :file:`modify_bitmasks.irp.f` - - set the generators_bitmask for the holes as the input_bimask - - - - - -.. c:function:: set_bitmask_particl_as_input - - .. code:: text - - subroutine set_bitmask_particl_as_input(input_bimask) - - File: :file:`modify_bitmasks.irp.f` - - set the generators_bitmask for the particles as the input_bimask - - diff --git a/docs/source/modules/cis.rst b/docs/source/modules/cis.rst deleted file mode 100644 index 9ba5c4c7..00000000 --- a/docs/source/modules/cis.rst +++ /dev/null @@ -1,117 +0,0 @@ -.. _cis: - -.. program:: cis - -.. default-role:: option - -=== -cis -=== - -This module contains a CIS program, built by setting the following rules: - -* The only generator determinant is the Hartree-Fock (single-reference method) -* All generated singly excited determinants are included in the wave function (no perturbative - selection) - -These rules are set in the ``H_apply.irp.f`` file. - - - - - -EZFIO parameters ----------------- - -.. option:: energy - - Variational |CIS| energy - - - -Subroutines / functions ------------------------ - - - -.. c:function:: cis - - .. code:: text - - subroutine cis - - File: :file:`cis.irp.f` - - Configuration Interaction with Single excitations. - - - - - -.. c:function:: h_apply_cis - - .. code:: text - - subroutine H_apply_cis() - - File: :file:`h_apply.irp.f_shell_8` - - Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - - - - -.. c:function:: h_apply_cis_diexc - - .. code:: text - - subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - - - - - - -.. c:function:: h_apply_cis_diexcorg - - .. code:: text - - subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. - - - - - -.. c:function:: h_apply_cis_diexcp - - .. code:: text - - subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - - - - - - -.. c:function:: h_apply_cis_monoexc - - .. code:: text - - subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. - - diff --git a/docs/source/modules/cisd.rst b/docs/source/modules/cisd.rst deleted file mode 100644 index d1cc56d7..00000000 --- a/docs/source/modules/cisd.rst +++ /dev/null @@ -1,117 +0,0 @@ -.. _cisd: - -.. program:: cisd - -.. default-role:: option - -==== -cisd -==== - -This module contains a CISD program, built by setting the following rules: - -* The only generator determinant is the Hartree-Fock (single-reference method) -* All generated determinants are included in the wave function (no perturbative - selection) - -These rules are set in the ``H_apply.irp.f`` file. - - - - - -EZFIO parameters ----------------- - -.. option:: energy - - Variational |CISD| energy - - - -Subroutines / functions ------------------------ - - - -.. c:function:: cisd - - .. code:: text - - subroutine cisd - - File: :file:`cisd.irp.f` - - Configuration Interaction with Single and Double excitations. - - - - - -.. c:function:: h_apply_cisd - - .. code:: text - - subroutine H_apply_cisd() - - File: :file:`h_apply.irp.f_shell_8` - - Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - - - - -.. c:function:: h_apply_cisd_diexc - - .. code:: text - - subroutine H_apply_cisd_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - - - - - - -.. c:function:: h_apply_cisd_diexcorg - - .. code:: text - - subroutine H_apply_cisd_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. - - - - - -.. c:function:: h_apply_cisd_diexcp - - .. code:: text - - subroutine H_apply_cisd_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - - - - - - -.. c:function:: h_apply_cisd_monoexc - - .. code:: text - - subroutine H_apply_cisd_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) - - File: :file:`h_apply.irp.f_shell_8` - - Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. - - diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst deleted file mode 100644 index dbc7f628..00000000 --- a/docs/source/modules/davidson.rst +++ /dev/null @@ -1,720 +0,0 @@ -.. _davidson: - -.. program:: davidson - -.. default-role:: option - -======== -davidson -======== - -Abstract module for Davidson's diagonalization. -It contains everything required for the Davidson algorithm, dressed or not. If -a dressing is used, the dressing column should be defined and the -:ref:`davidson_dressed` module should be used. If no dressing is required, -the :ref:`davidson` module should be used, and it has a default zero dressing vector. - -The important providers for that module are: - -# `psi_energy` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the Hamiltonian, dressed or not. It uses the general subroutine `u_0_H_u_0`. -# `psi_energy_two_e` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_two_e`. - - - -EZFIO parameters ----------------- - -.. option:: threshold_davidson - - Thresholds of Davidson's algorithm - - Default: 1.e-10 - -.. option:: n_states_diag - - Number of states to consider during the Davdison diagonalization - - Default: 4 - -.. option:: davidson_sze_max - - Number of micro-iterations before re-contracting - - Default: 8 - -.. option:: state_following - - If |true|, the states are re-ordered to match the input states - - Default: False - -.. option:: disk_based_davidson - - If |true|, disk space is used to store the vectors - - Default: False - -.. option:: distributed_davidson - - If |true|, use the distributed algorithm - - Default: True - -.. option:: only_expected_s2 - - If |true|, use filter out all vectors with bad |S^2| values - - Default: True - - -Providers ---------- - - -.. c:var:: ci_eigenvectors - - .. code:: text - - double precision, allocatable :: ci_electronic_energy (N_states_diag) - double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) - double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) - - File: :file:`diagonalize_ci.irp.f` - - Eigenvectors/values of the |CI| matrix - - - - -.. c:var:: ci_eigenvectors_s2 - - .. code:: text - - double precision, allocatable :: ci_electronic_energy (N_states_diag) - double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) - double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) - - File: :file:`diagonalize_ci.irp.f` - - Eigenvectors/values of the |CI| matrix - - - - -.. c:var:: ci_electronic_energy - - .. code:: text - - double precision, allocatable :: ci_electronic_energy (N_states_diag) - double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) - double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) - - File: :file:`diagonalize_ci.irp.f` - - Eigenvectors/values of the |CI| matrix - - - - -.. c:var:: ci_energy - - .. code:: text - - double precision, allocatable :: ci_energy (N_states_diag) - - File: :file:`diagonalize_ci.irp.f` - - :c:data:`n_states` lowest eigenvalues of the |CI| matrix - - - - -.. c:var:: davidson_criterion - - .. code:: text - - character(64) :: davidson_criterion - - File: :file:`parameters.irp.f` - - Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] - - - - -.. c:var:: dressed_column_idx - - .. code:: text - - integer, allocatable :: dressed_column_idx (N_states) - - File: :file:`diagonalization_hs2_dressed.irp.f` - - Index of the dressed columns - - - - -.. c:var:: n_states_diag - - .. code:: text - - integer :: n_states_diag - - File: :file:`input.irp.f` - - Number of states to consider during the Davdison diagonalization - - - - -.. c:var:: nthreads_davidson - - .. code:: text - - integer :: nthreads_davidson - - File: :file:`davidson_parallel.irp.f` - - Number of threads for Davidson - - - - -.. c:var:: psi_energy - - .. code:: text - - double precision, allocatable :: psi_energy (N_states) - - File: :file:`u0_h_u0.irp.f` - - Electronic energy of the current wave function - - - - -.. c:var:: psi_energy_two_e - - .. code:: text - - double precision, allocatable :: psi_energy_two_e (N_states) - - File: :file:`u0_wee_u0.irp.f` - - Energy of the current wave function - - - - -.. c:var:: psi_energy_with_nucl_rep - - .. code:: text - - double precision, allocatable :: psi_energy_with_nucl_rep (N_states) - - File: :file:`u0_h_u0.irp.f` - - Energy of the wave function with the nuclear repulsion energy. - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: davidson_collector - - .. code:: text - - subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze, N_st) - - File: :file:`davidson_parallel.irp.f` - - Routine collecting the results of the workers in Davidson's algorithm. - - - - - -.. c:function:: davidson_converged - - .. code:: text - - subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged) - - File: :file:`parameters.irp.f` - - True if the Davidson algorithm is converged - - - - - -.. c:function:: davidson_diag_hjj_sjj - - .. code:: text - - subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged) - - File: :file:`diagonalization_hs2_dressed.irp.f` - - Davidson diagonalization with specific diagonal elements of the H matrix - - H_jj : specific diagonal H matrix elements to diagonalize de Davidson - - S2_out : Output : s^2 - - dets_in : bitmasks corresponding to determinants - - u_in : guess coefficients on the various states. Overwritten on exit - - dim_in : leftmost dimension of u_in - - sze : Number of determinants - - N_st : Number of eigenstates - - N_st_diag : Number of states in which H is diagonalized. Assumed > sze - - Initial guess vectors are not necessarily orthonormal - - - - - -.. c:function:: davidson_diag_hs2 - - .. code:: text - - subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_diag,Nint,dressing_state,converged) - - File: :file:`diagonalization_hs2_dressed.irp.f` - - Davidson diagonalization. - - dets_in : bitmasks corresponding to determinants - - u_in : guess coefficients on the various states. Overwritten on exit - - dim_in : leftmost dimension of u_in - - sze : Number of determinants - - N_st : Number of eigenstates - - Initial guess vectors are not necessarily orthonormal - - - - - -.. c:function:: davidson_pull_results - - .. code:: text - - subroutine davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id) - - File: :file:`davidson_parallel.irp.f` - - Pull the results of :math:`H|U \rangle` on the master. - - - - - -.. c:function:: davidson_push_results - - .. code:: text - - subroutine davidson_push_results(zmq_socket_push, v_t, s_t, imin, imax, task_id) - - File: :file:`davidson_parallel.irp.f` - - Push the results of :math:`H|U \rangle` from a worker to the master. - - - - - -.. c:function:: davidson_run_slave - - .. code:: text - - subroutine davidson_run_slave(thread,iproc) - - File: :file:`davidson_parallel.irp.f` - - Slave routine for Davidson's diagonalization. - - - - - -.. c:function:: davidson_slave_inproc - - .. code:: text - - subroutine davidson_slave_inproc(i) - - File: :file:`davidson_parallel.irp.f` - - - - - - - -.. c:function:: davidson_slave_tcp - - .. code:: text - - subroutine davidson_slave_tcp(i) - - File: :file:`davidson_parallel.irp.f` - - - - - - - -.. c:function:: davidson_slave_work - - .. code:: text - - subroutine davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_st, sze, worker_id) - - File: :file:`davidson_parallel.irp.f` - - - - - - - -.. c:function:: diagonalize_ci - - .. code:: text - - subroutine diagonalize_CI - - File: :file:`diagonalize_ci.irp.f` - - Replace the coefficients of the |CI| states by the coefficients of the eigenstates of the |CI| matrix. - - - - - -.. c:function:: h_s2_u_0_nstates_openmp - - .. code:: text - - subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) - - File: :file:`u0_h_u0.irp.f` - - Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` . - - Assumes that the determinants are in psi_det - - istart, iend, ishift, istep are used in ZMQ parallelization. - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work - - .. code:: text - - subroutine H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_h_u0.irp.f` - - Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work_1 - - .. code:: text - - 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` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work_2 - - .. code:: text - - 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` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work_3 - - .. code:: text - - 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` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work_4 - - .. code:: text - - 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` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_openmp_work_n_int - - .. code:: text - - 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` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_nstates_zmq - - .. code:: text - - subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze) - - File: :file:`davidson_parallel.irp.f` - - Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` - - n : number of determinants - - H_jj : array of :math:`\langle j|H|j \rangle` - - S2_jj : array of :math:`\langle j|S^2|j \rangle` - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_0,N_st,sze) - - File: :file:`u0_wee_u0.irp.f` - - Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` - - Assumes that the determinants are in psi_det - - istart, iend, ishift, istep are used in ZMQ parallelization. - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f` - - Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_1 - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f_template_457` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_2 - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f_template_457` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_3 - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f_template_457` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_4 - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f_template_457` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_n_int - - .. code:: text - - subroutine H_S2_u_0_two_e_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) - - File: :file:`u0_wee_u0.irp.f_template_457` - - Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` - - Default should be 1,N_det,0,1 - - - - - -.. c:function:: u_0_h_u_0 - - .. code:: text - - subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze) - - File: :file:`u0_h_u0.irp.f` - - Computes :math:`E_0 = \frac{\langle u_0|H|u_0 \rangle}{\langle u_0|u_0 \rangle}` - - n : number of determinants - - - - - - - -.. c:function:: u_0_h_u_0_two_e - - .. code:: text - - subroutine u_0_H_u_0_two_e(e_0,u_0,n,keys_tmp,Nint,N_st,sze) - - File: :file:`u0_wee_u0.irp.f` - - Computes :math:`E_0 = \frac{ \langle u_0|H|u_0\rangle}{\langle u_0|u_0 \rangle}` . - - n : number of determinants - - - - - - - -.. c:function:: zmq_get_n_states_diag - - .. code:: text - - integer function zmq_get_N_states_diag(zmq_to_qp_run_socket, worker_id) - - File: :file:`davidson_parallel.irp.f` - - Get N_states_diag from the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_states_diag - - .. code:: text - - integer function zmq_put_N_states_diag(zmq_to_qp_run_socket,worker_id) - - File: :file:`davidson_parallel.irp.f` - - Put N_states_diag on the qp_run scheduler - - diff --git a/docs/source/modules/davidson_dressed.rst b/docs/source/modules/davidson_dressed.rst deleted file mode 100644 index 4697104f..00000000 --- a/docs/source/modules/davidson_dressed.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. _davidson_dressed: - -.. program:: davidson_dressed - -.. default-role:: option - -================ -davidson_dressed -================ - -Davidson with single-column dressing. - - diff --git a/docs/source/modules/davidson_undressed.rst b/docs/source/modules/davidson_undressed.rst deleted file mode 100644 index e785b4ca..00000000 --- a/docs/source/modules/davidson_undressed.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. _davidson_undressed: - -.. program:: davidson_undressed - -.. default-role:: option - -================== -davidson_undressed -================== - -Module for main files Davidson's algorithm with no dressing. - - - - -Providers ---------- - - -.. c:var:: dressing_column_h - - .. code:: text - - double precision, allocatable :: dressing_column_h (N_det,N_states) - double precision, allocatable :: dressing_column_s (N_det,N_states) - - File: :file:`null_dressing_vector.irp.f` - - Null dressing vectors - - - - -.. c:var:: dressing_column_s - - .. code:: text - - double precision, allocatable :: dressing_column_h (N_det,N_states) - double precision, allocatable :: dressing_column_s (N_det,N_states) - - File: :file:`null_dressing_vector.irp.f` - - Null dressing vectors - - diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst deleted file mode 100644 index 2c5db607..00000000 --- a/docs/source/modules/density_for_dft.rst +++ /dev/null @@ -1,119 +0,0 @@ -.. _density_for_dft: - -.. program:: density_for_dft - -.. default-role:: option - -=============== -density_for_dft -=============== - - -This module defines the *provider* of the density used for the DFT related calculations. -This definition is done through the keyword :option:`density_for_dft density_for_dft`. -The density can be: - -* WFT : the density is computed with a potentially multi determinant wave function (see variables `psi_det` and `psi_det`)# input_density : the density is set to a density previously stored in the |EZFIO| folder (see ``aux_quantities``) -* damping_rs_dft : the density is damped between the input_density and the WFT density, with a damping factor of :option:`density_for_dft damping_for_rs_dft` - - - - -EZFIO parameters ----------------- - -.. option:: density_for_dft - - Type of density used for DFT calculation. If set to WFT , it uses the density of the wave function stored in (psi_det,psi_coef). If set to input_density it uses the one-body dm stored in aux_quantities/ . If set to damping_rs_dft it uses the damped density between WFT and input_density. In the ks_scf and rs_ks_scf programs, it is set to WFT. - - Default: WFT - -.. option:: damping_for_rs_dft - - damping factor for the density used in RSFT. - - Default: 0.5 - - -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_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_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` - - - - diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst deleted file mode 100644 index c2d56042..00000000 --- a/docs/source/modules/determinants.rst +++ /dev/null @@ -1,4072 +0,0 @@ -.. _determinants: - -.. program:: determinants - -.. default-role:: option - -============ -determinants -============ - -Contains everything for the computation of the Hamiltonian matrix elements in the basis of orthogonal Slater determinants built on a restricted spin-orbitals basis. - -The main providers for this module are: - -* :option:`determinants n_states`: number of states to be computed -* `psi_det`: list of determinants in the wave function used in many routines/providers of the |QP|. -* `psi_coef`: list of coefficients, for all :option:`determinants n_states` states, and all determinants. - -The main routines for this module are: - -* `i_H_j`: computes the Hamiltonian matrix element between two arbitrary Slater determinants. -* `i_H_j_s2`: computes the Hamiltonian and (:math:`S^2`) matrix element between two arbitrary Slater determinants. -* `i_H_j_verbose`: returns the decomposition in terms of one- and two-body components of the Hamiltonian matrix elements between two arbitrary Slater determinants. Also return the fermionic phase factor. -* `i_H_psi`: computes the Hamiltonian matrix element between an arbitrary Slater determinant and a wave function composed of a sum of arbitrary Slater determinants. - - -For an example of how to use these routines and providers, take a look at :file:`example.irp.f`. - - - -EZFIO parameters ----------------- - -.. option:: n_det_max - - Maximum number of determinants in the wave function - - Default: 1000000 - -.. option:: n_det_print_wf - - Maximum number of determinants to be printed with the program print_wf - - Default: 10000 - -.. option:: n_det_max_full - - Maximum number of determinants where |H| is fully diagonalized - - Default: 1000 - -.. option:: n_states - - Number of states to consider - - Default: 1 - -.. option:: read_wf - - If |true|, read the wave function from the |EZFIO| file - - Default: False - -.. option:: s2_eig - - Force the wave function to be an eigenfunction of |S^2| - - Default: True - -.. option:: used_weight - - 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi)) - - Default: 0 - -.. option:: threshold_generators - - Thresholds on generators (fraction of the square of the norm) - - Default: 0.99 - -.. option:: n_int - - Number of integers required to represent bitstrings (set in module :ref:`bitmask`) - - -.. option:: bit_kind - - (set in module :ref:`bitmask`) - - -.. option:: mo_label - - Label of the |MOs| on which the determinants are expressed - - -.. option:: n_det - - Number of determinants in the current wave function - - -.. option:: psi_coef - - Coefficients of the wave function - - -.. option:: psi_det - - Determinants of the variational space - - -.. option:: expected_s2 - - Expected value of |S^2| - - -.. option:: target_energy - - Energy that should be obtained when truncating the wave function (optional) - - Default: 0. - -.. option:: state_average_weight - - Weight of the states in state-average calculations. - - - -Providers ---------- - - -.. c:var:: abs_psi_coef_max - - .. code:: text - - double precision, allocatable :: psi_coef_max (N_states) - double precision, allocatable :: psi_coef_min (N_states) - double precision, allocatable :: abs_psi_coef_max (N_states) - double precision, allocatable :: abs_psi_coef_min (N_states) - - File: :file:`determinants.irp.f` - - Max and min values of the coefficients - - - - -.. c:var:: abs_psi_coef_min - - .. code:: text - - double precision, allocatable :: psi_coef_max (N_states) - double precision, allocatable :: psi_coef_min (N_states) - double precision, allocatable :: abs_psi_coef_max (N_states) - double precision, allocatable :: abs_psi_coef_min (N_states) - - File: :file:`determinants.irp.f` - - Max and min values of the coefficients - - - - -.. c:var:: barycentric_electronic_energy - - .. code:: text - - double precision, allocatable :: barycentric_electronic_energy (N_states) - - File: :file:`energy.irp.f` - - :math:`E_n = \sum_i {c_i^{(n)}}^2 H_{ii}` - - - - -.. c:var:: c0_weight - - .. code:: text - - double precision, allocatable :: c0_weight (N_states) - - File: :file:`density_matrix.irp.f` - - Weight of the states in the selection : :math:`\frac{1}{c_0^2}` . - - - - -.. c:var:: det_alpha_norm - - .. code:: text - - double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) - double precision, allocatable :: det_beta_norm (N_det_beta_unique) - - File: :file:`spindeterminants.irp.f` - - Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: - - ||Da||_i \sum_j C_{ij}**2 - - - - -.. c:var:: det_beta_norm - - .. code:: text - - double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) - double precision, allocatable :: det_beta_norm (N_det_beta_unique) - - File: :file:`spindeterminants.irp.f` - - Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: - - ||Da||_i \sum_j C_{ij}**2 - - - - -.. c:var:: det_to_occ_pattern - - .. code:: text - - integer, allocatable :: det_to_occ_pattern (N_det) - - File: :file:`occ_pattern.irp.f` - - Returns the index of the occupation pattern for each determinant - - - - -.. c:var:: diag_algorithm - - .. code:: text - - character*(64) :: diag_algorithm - - File: :file:`determinants.irp.f` - - Diagonalization algorithm (Davidson or Lapack) - - - - -.. c:var:: diagonal_h_matrix_on_psi_det - - .. code:: text - - double precision, allocatable :: diagonal_h_matrix_on_psi_det (N_det) - - File: :file:`energy.irp.f` - - Diagonal of the Hamiltonian ordered as psi_det - - - - -.. c:var:: double_exc_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: double_exc_bitmask (N_int,4,N_double_exc_bitmasks) - - File: :file:`determinants_bitmasks.irp.f` - - double_exc_bitmask(:,1,i) is the bitmask for holes of excitation 1 - - double_exc_bitmask(:,2,i) is the bitmask for particles of excitation 1 - - double_exc_bitmask(:,3,i) is the bitmask for holes of excitation 2 - - double_exc_bitmask(:,4,i) is the bitmask for particles of excitation 2 - - for a given couple of hole/particle excitations i. - - - - -.. c:var:: expected_s2 - - .. code:: text - - double precision :: expected_s2 - - File: :file:`s2.irp.f` - - Expected value of |S^2| : S*(S+1) - - - - -.. c:var:: fock_operator_closed_shell_ref_bitmask - - .. code:: text - - double precision, allocatable :: fock_operator_closed_shell_ref_bitmask (mo_num,mo_num) - - File: :file:`single_excitations.irp.f` - - - - - - -.. c:var:: fock_wee_closed_shell - - .. code:: text - - double precision, allocatable :: fock_wee_closed_shell (mo_num,mo_num) - - File: :file:`mono_excitations_bielec.irp.f` - - - - - - -.. c:var:: h_apply_buffer_allocated - - .. code:: text - - logical :: h_apply_buffer_allocated - integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) - - File: :file:`h_apply.irp.f` - - Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. - - - - -.. c:var:: h_apply_buffer_lock - - .. code:: text - - logical :: h_apply_buffer_allocated - integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) - - File: :file:`h_apply.irp.f` - - Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. - - - - -.. c:var:: h_matrix_all_dets - - .. code:: text - - double precision, allocatable :: h_matrix_all_dets (N_det,N_det) - - File: :file:`utils.irp.f` - - |H| matrix on the basis of the Slater determinants defined by psi_det - - - - -.. c:var:: h_matrix_cas - - .. code:: text - - double precision, allocatable :: h_matrix_cas (N_det_cas,N_det_cas) - - File: :file:`psi_cas.irp.f` - - - - - - -.. c:var:: idx_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_cas (psi_det_size) - integer :: n_det_cas - - File: :file:`psi_cas.irp.f` - - |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. - - - - -.. c:var:: idx_non_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_non_cas (psi_det_size) - integer :: n_det_non_cas - - File: :file:`psi_cas.irp.f` - - Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. - - - - -.. c:var:: max_degree_exc - - .. code:: text - - integer :: max_degree_exc - - File: :file:`determinants.irp.f` - - Maximum degree of excitation in the wave function with respect to the Hartree-Fock determinant. - - - - -.. c:var:: mo_energy_expval - - .. code:: text - - double precision, allocatable :: mo_energy_expval (N_states,mo_num,2,2) - - File: :file:`mo_energy_expval.irp.f` - - Third index is spin. Fourth index is 1:creation, 2:annihilation - - - - -.. c:var:: n_det - - .. code:: text - - integer :: n_det - - File: :file:`determinants.irp.f` - - Number of determinants in the wave function - - - - -.. c:var:: n_det_alpha_unique - - .. code:: text - - 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` - - Unique :math:`\alpha` determinants - - - - -.. c:var:: n_det_beta_unique - - .. code:: text - - 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` - - Unique :math:`\beta` determinants - - - - -.. c:var:: n_det_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_cas (psi_det_size) - integer :: n_det_cas - - File: :file:`psi_cas.irp.f` - - |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. - - - - -.. c:var:: n_det_non_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_non_cas (psi_det_size) - integer :: n_det_non_cas - - File: :file:`psi_cas.irp.f` - - Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. - - - - -.. c:var:: n_double_exc_bitmasks - - .. code:: text - - integer :: n_double_exc_bitmasks - - File: :file:`determinants_bitmasks.irp.f` - - Number of double excitation bitmasks - - - - -.. c:var:: n_occ_pattern - - .. code:: text - - integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) - integer :: n_occ_pattern - - File: :file:`occ_pattern.irp.f` - - Array of the occ_patterns present in the wave function. - - psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations - - psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations - - The occ patterns are sorted by :c:func:`occ_pattern_search_key` - - - - -.. c:var:: n_single_exc_bitmasks - - .. code:: text - - integer :: n_single_exc_bitmasks - - File: :file:`determinants_bitmasks.irp.f` - - Number of single excitation bitmasks - - - - -.. 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:: psi_average_norm_contrib - - .. code:: text - - double precision, allocatable :: psi_average_norm_contrib (psi_det_size) - - File: :file:`determinants.irp.f` - - Contribution of determinants to the state-averaged density. - - - - -.. c:var:: psi_average_norm_contrib_sorted - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) - double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) - integer, allocatable :: psi_det_sorted_order (psi_det_size) - - File: :file:`determinants.irp.f` - - Wave function sorted by determinants contribution to the norm (state-averaged) - - psi_det_sorted_order(i) -> k : index in psi_det - - - - -.. c:var:: psi_bilinear_matrix - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix (N_det_alpha_unique,N_det_beta_unique,N_states) - - File: :file:`spindeterminants.irp.f` - - Coefficient matrix if the wave function is expressed in a bilinear form : - - :math:`D_\alpha^\dagger.C.D_\beta` - - - - -.. c:var:: psi_bilinear_matrix_columns - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b - - Rows are :math:`\alpha` determinants and columns are :math:`\beta.` - - Order refers to psi_det - - - - -.. c:var:: psi_bilinear_matrix_columns_loc - - .. code:: text - - integer, allocatable :: psi_bilinear_matrix_columns_loc (N_det_beta_unique+1) - - File: :file:`spindeterminants.irp.f` - - Sparse coefficient matrix if the wave function is expressed in a bilinear form : - - :math:`D_\alpha^\dagger.C.D_\beta` - - Rows are :math:`\alpha` determinants and columns are :math:`\beta.` - - Order refers to psi_det - - - - -.. c:var:: psi_bilinear_matrix_order - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b - - Rows are :math:`\alpha` determinants and columns are :math:`\beta.` - - Order refers to psi_det - - - - -.. c:var:: psi_bilinear_matrix_order_reverse - - .. code:: text - - integer, allocatable :: psi_bilinear_matrix_order_reverse (N_det) - - File: :file:`spindeterminants.irp.f` - - Order which allows to go from psi_bilinear_matrix to psi_det - - - - -.. c:var:: psi_bilinear_matrix_order_transp_reverse - - .. code:: text - - integer, allocatable :: psi_bilinear_matrix_order_transp_reverse (N_det) - - File: :file:`spindeterminants.irp.f` - - Order which allows to go from psi_bilinear_matrix_order_transp to psi_bilinear_matrix - - - - -.. c:var:: psi_bilinear_matrix_rows - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b - - Rows are :math:`\alpha` determinants and columns are :math:`\beta.` - - Order refers to psi_det - - - - -.. c:var:: psi_bilinear_matrix_transp_columns - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Transpose of psi_bilinear_matrix - - :math:`D_\beta^\dagger.C^\dagger.D_\alpha` - - Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format - - - - -.. c:var:: psi_bilinear_matrix_transp_order - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Transpose of psi_bilinear_matrix - - :math:`D_\beta^\dagger.C^\dagger.D_\alpha` - - Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format - - - - -.. c:var:: psi_bilinear_matrix_transp_rows - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Transpose of psi_bilinear_matrix - - :math:`D_\beta^\dagger.C^\dagger.D_\alpha` - - Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format - - - - -.. c:var:: psi_bilinear_matrix_transp_rows_loc - - .. code:: text - - integer, allocatable :: psi_bilinear_matrix_transp_rows_loc (N_det_alpha_unique+1) - - File: :file:`spindeterminants.irp.f` - - Location of the columns in the psi_bilinear_matrix - - - - -.. c:var:: psi_bilinear_matrix_transp_values - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Transpose of psi_bilinear_matrix - - :math:`D_\beta^\dagger.C^\dagger.D_\alpha` - - Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format - - - - -.. c:var:: psi_bilinear_matrix_values - - .. code:: text - - double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) - integer, allocatable :: psi_bilinear_matrix_rows (N_det) - integer, allocatable :: psi_bilinear_matrix_columns (N_det) - integer, allocatable :: psi_bilinear_matrix_order (N_det) - - File: :file:`spindeterminants.irp.f` - - Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b - - Rows are :math:`\alpha` determinants and columns are :math:`\beta.` - - Order refers to psi_det - - - - -.. c:var:: psi_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_cas (psi_det_size) - integer :: n_det_cas - - File: :file:`psi_cas.irp.f` - - |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. - - - - -.. c:var:: psi_cas_coef - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_cas (psi_det_size) - integer :: n_det_cas - - File: :file:`psi_cas.irp.f` - - |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. - - - - -.. c:var:: psi_cas_coef_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`psi_cas.irp.f` - - |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_cas_energy - - .. code:: text - - double precision, allocatable :: psi_cas_energy (N_states) - - File: :file:`psi_cas.irp.f` - - Variational energy of :math:`\Psi_{CAS}` , where :math:`\Psi_{CAS} = \sum_{I \in CAS} \I \rangle \langle I | \Psi \rangle` . - - - - -.. c:var:: psi_cas_energy_diagonalized - - .. code:: text - - double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) - double precision, allocatable :: psi_cas_energy_diagonalized (N_states) - - File: :file:`psi_cas.irp.f` - - - - - - -.. c:var:: psi_cas_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`psi_cas.irp.f` - - |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_coef - - .. code:: text - - double precision, allocatable :: psi_coef (psi_det_size,N_states) - - File: :file:`determinants.irp.f` - - The wave function coefficients. Initialized with Hartree-Fock if the |EZFIO| file is empty. - - - - -.. c:var:: psi_coef_cas_diagonalized - - .. code:: text - - double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) - double precision, allocatable :: psi_cas_energy_diagonalized (N_states) - - File: :file:`psi_cas.irp.f` - - - - - - -.. c:var:: psi_coef_max - - .. code:: text - - double precision, allocatable :: psi_coef_max (N_states) - double precision, allocatable :: psi_coef_min (N_states) - double precision, allocatable :: abs_psi_coef_max (N_states) - double precision, allocatable :: abs_psi_coef_min (N_states) - - File: :file:`determinants.irp.f` - - Max and min values of the coefficients - - - - -.. c:var:: psi_coef_min - - .. code:: text - - double precision, allocatable :: psi_coef_max (N_states) - double precision, allocatable :: psi_coef_min (N_states) - double precision, allocatable :: abs_psi_coef_max (N_states) - double precision, allocatable :: abs_psi_coef_min (N_states) - - File: :file:`determinants.irp.f` - - Max and min values of the coefficients - - - - -.. c:var:: psi_coef_sorted - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) - double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) - integer, allocatable :: psi_det_sorted_order (psi_det_size) - - File: :file:`determinants.irp.f` - - Wave function sorted by determinants contribution to the norm (state-averaged) - - psi_det_sorted_order(i) -> k : index in psi_det - - - - -.. c:var:: psi_coef_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`determinants.irp.f` - - Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_det - - .. code:: text - - integer(bit_kind), allocatable :: psi_det (N_int,2,psi_det_size) - - File: :file:`determinants.irp.f` - - The determinants of the wave function. Initialized with Hartree-Fock if the |EZFIO| file is empty. - - - - -.. c:var:: psi_det_alpha - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_alpha (N_int,psi_det_size) - - File: :file:`spindeterminants.irp.f` - - List of :math:`\alpha` determinants of psi_det - - - - -.. c:var:: psi_det_alpha_unique - - .. code:: text - - 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` - - Unique :math:`\alpha` determinants - - - - -.. c:var:: psi_det_beta - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_beta (N_int,psi_det_size) - - File: :file:`spindeterminants.irp.f` - - List of :math:`\beta` determinants of psi_det - - - - -.. c:var:: psi_det_beta_unique - - .. code:: text - - 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` - - Unique :math:`\beta` determinants - - - - -.. c:var:: psi_det_hii - - .. code:: text - - double precision, allocatable :: psi_det_hii (N_det) - - File: :file:`determinants.irp.f` - - :math:`\langle i|h|i \rangle` for all determinants. - - - - -.. c:var:: psi_det_size - - .. code:: text - - integer :: psi_det_size - - File: :file:`determinants.irp.f` - - Size of the psi_det and psi_coef arrays - - - - -.. c:var:: psi_det_sorted - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) - double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) - integer, allocatable :: psi_det_sorted_order (psi_det_size) - - File: :file:`determinants.irp.f` - - Wave function sorted by determinants contribution to the norm (state-averaged) - - psi_det_sorted_order(i) -> k : index in psi_det - - - - -.. c:var:: psi_det_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`determinants.irp.f` - - Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_det_sorted_order - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) - double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) - integer, allocatable :: psi_det_sorted_order (psi_det_size) - - File: :file:`determinants.irp.f` - - Wave function sorted by determinants contribution to the norm (state-averaged) - - psi_det_sorted_order(i) -> k : index in psi_det - - - - -.. c:var:: psi_energy_h_core - - .. code:: text - - double precision, allocatable :: psi_energy_h_core (N_states) - - File: :file:`psi_energy_mono_elec.irp.f` - - 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` - - - - -.. c:var:: psi_non_cas - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_non_cas (psi_det_size) - integer :: n_det_non_cas - - File: :file:`psi_cas.irp.f` - - Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. - - - - -.. c:var:: psi_non_cas_coef - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) - integer, allocatable :: idx_non_cas (psi_det_size) - integer :: n_det_non_cas - - File: :file:`psi_cas.irp.f` - - Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. - - - - -.. c:var:: psi_non_cas_coef_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`psi_cas.irp.f` - - |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_non_cas_sorted_bit - - .. code:: text - - integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) - double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) - - File: :file:`psi_cas.irp.f` - - |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. - - - - -.. c:var:: psi_occ_pattern - - .. code:: text - - integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) - integer :: n_occ_pattern - - File: :file:`occ_pattern.irp.f` - - Array of the occ_patterns present in the wave function. - - psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations - - psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations - - The occ patterns are sorted by :c:func:`occ_pattern_search_key` - - - - -.. c:var:: psi_occ_pattern_hii - - .. code:: text - - double precision, allocatable :: psi_occ_pattern_hii (N_occ_pattern) - - File: :file:`occ_pattern.irp.f` - - :math:`\langle I|H|I \rangle` where :math:`|I\rangle` is an occupation pattern. This is the minimum :math:`H_{ii}` , where the :math:`|i\rangle` are the determinants of :math:`|I\rangle` . - - - - -.. c:var:: ref_bitmask_e_n_energy - - .. code:: text - - double precision :: ref_bitmask_energy - double precision :: ref_bitmask_one_e_energy - double precision :: ref_bitmask_kinetic_energy - double precision :: ref_bitmask_e_n_energy - double precision :: ref_bitmask_two_e_energy - - File: :file:`ref_bitmask.irp.f` - - Energy of the reference bitmask used in Slater rules - - - - -.. c:var:: ref_bitmask_energy - - .. code:: text - - double precision :: ref_bitmask_energy - double precision :: ref_bitmask_one_e_energy - double precision :: ref_bitmask_kinetic_energy - double precision :: ref_bitmask_e_n_energy - double precision :: ref_bitmask_two_e_energy - - File: :file:`ref_bitmask.irp.f` - - Energy of the reference bitmask used in Slater rules - - - - -.. c:var:: ref_bitmask_kinetic_energy - - .. code:: text - - double precision :: ref_bitmask_energy - double precision :: ref_bitmask_one_e_energy - double precision :: ref_bitmask_kinetic_energy - double precision :: ref_bitmask_e_n_energy - double precision :: ref_bitmask_two_e_energy - - File: :file:`ref_bitmask.irp.f` - - Energy of the reference bitmask used in Slater rules - - - - -.. c:var:: ref_bitmask_one_e_energy - - .. code:: text - - double precision :: ref_bitmask_energy - double precision :: ref_bitmask_one_e_energy - double precision :: ref_bitmask_kinetic_energy - double precision :: ref_bitmask_e_n_energy - double precision :: ref_bitmask_two_e_energy - - File: :file:`ref_bitmask.irp.f` - - Energy of the reference bitmask used in Slater rules - - - - -.. c:var:: ref_bitmask_two_e_energy - - .. code:: text - - double precision :: ref_bitmask_energy - double precision :: ref_bitmask_one_e_energy - double precision :: ref_bitmask_kinetic_energy - double precision :: ref_bitmask_e_n_energy - double precision :: ref_bitmask_two_e_energy - - File: :file:`ref_bitmask.irp.f` - - Energy of the reference bitmask used in Slater rules - - - - -.. c:var:: ref_closed_shell_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: ref_closed_shell_bitmask (N_int,2) - - File: :file:`single_excitations.irp.f` - - - - - - -.. c:var:: s2_matrix_all_dets - - .. code:: text - - double precision, allocatable :: s2_matrix_all_dets (N_det,N_det) - - File: :file:`utils.irp.f` - - |S^2| matrix on the basis of the Slater determinants defined by psi_det - - - - -.. c:var:: s2_values - - .. code:: text - - double precision, allocatable :: s2_values (N_states) - - File: :file:`s2.irp.f` - - array of the averaged values of the S^2 operator on the various states - - - - -.. c:var:: s_z - - .. code:: text - - double precision :: s_z - double precision :: s_z2_sz - - File: :file:`s2.irp.f` - - z component of the Spin - - - - -.. c:var:: s_z2_sz - - .. code:: text - - double precision :: s_z - double precision :: s_z2_sz - - File: :file:`s2.irp.f` - - z component of the Spin - - - - -.. c:var:: single_exc_bitmask - - .. code:: text - - integer(bit_kind), allocatable :: single_exc_bitmask (N_int,2,N_single_exc_bitmasks) - - File: :file:`determinants_bitmasks.irp.f` - - single_exc_bitmask(:,1,i) is the bitmask for holes - - single_exc_bitmask(:,2,i) is the bitmask for particles - - for a given couple of hole/particle excitations i. - - - - -.. c:var:: singles_alpha_csc - - .. code:: text - - integer, allocatable :: singles_alpha_csc (singles_alpha_csc_size) - - File: :file:`spindeterminants.irp.f` - - Dimension of the singles_alpha array - - - - -.. c:var:: singles_alpha_csc_idx - - .. code:: text - - integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) - integer*8 :: singles_alpha_csc_size - - File: :file:`spindeterminants.irp.f` - - Dimension of the singles_alpha array - - - - -.. c:var:: singles_alpha_csc_size - - .. code:: text - - integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) - integer*8 :: singles_alpha_csc_size - - File: :file:`spindeterminants.irp.f` - - Dimension of the singles_alpha array - - - - -.. c:var:: singles_alpha_size - - .. code:: text - - integer :: singles_alpha_size - - File: :file:`spindeterminants.irp.f` - - Dimension of the singles_alpha array - - - - -.. c:var:: state_average_weight - - .. code:: text - - double precision, allocatable :: state_average_weight (N_states) - - File: :file:`density_matrix.irp.f` - - Weights in the state-average calculation of the density matrix - - - - -.. c:var:: weight_occ_pattern - - .. code:: text - - double precision, allocatable :: weight_occ_pattern (N_occ_pattern,N_states) - - File: :file:`occ_pattern.irp.f` - - Weight of the occupation patterns in the wave function - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: a_operator - - .. code:: text - - subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb) - - File: :file:`slater_rules.irp.f` - - Needed for :c:func:`diag_H_mat_elem`. - - - - - -.. c:function:: a_operator_two_e - - .. code:: text - - subroutine a_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) - - File: :file:`slater_rules_wee_mono.irp.f` - - Needed for :c:func:`diag_Wee_mat_elem`. - - - - - -.. c:function:: ac_operator - - .. code:: text - - subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb) - - File: :file:`slater_rules.irp.f` - - Needed for :c:func:`diag_H_mat_elem`. - - - - - -.. c:function:: ac_operator_two_e - - .. code:: text - - subroutine ac_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) - - File: :file:`slater_rules_wee_mono.irp.f` - - Needed for :c:func:`diag_Wee_mat_elem`. - - - - - -.. c:function:: apply_excitation - - .. code:: text - - subroutine apply_excitation(det, exc, res, ok, Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: apply_hole - - .. code:: text - - subroutine apply_hole(det, s1, h1, res, ok, Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: apply_holes - - .. code:: text - - subroutine apply_holes(det, s1, h1, s2, h2, res, ok, Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: apply_particle - - .. code:: text - - subroutine apply_particle(det, s1, p1, res, ok, Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: apply_particles - - .. code:: text - - subroutine apply_particles(det, s1, p1, s2, p2, res, ok, Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: au0_h_au0 - - .. code:: text - - subroutine au0_h_au0(energies,psi_in,psi_in_coef,ndet,dim_psi_coef) - - File: :file:`mo_energy_expval.irp.f` - - - - - - - -.. c:function:: bitstring_to_list_ab - - .. code:: text - - subroutine bitstring_to_list_ab( string, list, n_elements, Nint) - - File: :file:`slater_rules.irp.f` - - Gives the inidices(+1) of the bits set to 1 in the bit string For alpha/beta determinants. - - - - - -.. c:function:: build_fock_tmp - - .. code:: text - - subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) - - File: :file:`fock_diag.irp.f` - - Build the diagonal of the Fock matrix corresponding to a generator determinant. :math:`F_{00}` is :math:`\langle i|H|i \rangle = E_0` . - - - - - -.. c:function:: connected_to_ref - - .. code:: text - - integer function connected_to_ref(key,keys,Nint,N_past_in,Ndet) - - File: :file:`connected_to_ref.irp.f` - - input : key : a given Slater determinant - - : keys: a list of Slater determinants - - : Ndet: the number of Slater determinants in keys - - : N_past_in the number of Slater determinants for the connectivity research - - output : 0 : key not connected to the N_past_in first Slater determinants in keys - - i : key is connected to determinant i of keys - - -i : key is the ith determinant of the reference wf keys - - - - - -.. c:function:: connected_to_ref_by_mono - - .. code:: text - - integer function connected_to_ref_by_mono(key,keys,Nint,N_past_in,Ndet) - - File: :file:`connected_to_ref.irp.f` - - Returns |true| is ``key`` is connected to the reference by a single excitation. input : key : a given Slater determinant - - : keys: a list of Slater determinants - - : Ndet: the number of Slater determinants in keys - - : N_past_in the number of Slater determinants for the connectivity research - - output : 0 : key not connected by a MONO EXCITATION to the N_past_in first Slater determinants in keys - - i : key is connected by a MONO EXCITATION to determinant i of keys - - -i : key is the ith determinant of the reference wf keys - - - - - -.. c:function:: copy_h_apply_buffer_to_wf - - .. code:: text - - subroutine copy_H_apply_buffer_to_wf - - File: :file:`h_apply.irp.f` - - Copies the H_apply buffer to psi_coef. After calling this subroutine, N_det, psi_det and psi_coef need to be touched - - - - - -.. c:function:: copy_psi_bilinear_to_psi - - .. code:: text - - subroutine copy_psi_bilinear_to_psi(psi, isize) - - File: :file:`spindeterminants.irp.f` - - Overwrites psi_det and psi_coef with the wf in bilinear order - - - - - -.. c:function:: create_microlist - - .. code:: text - - subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) - - File: :file:`filter_connected.irp.f` - - - - - - - -.. c:function:: create_minilist - - .. code:: text - - subroutine create_minilist(key_mask, fullList, miniList, idx_miniList, N_fullList, N_miniList, Nint) - - File: :file:`slater_rules.irp.f` - - - - - - - -.. c:function:: create_minilist_find_previous - - .. code:: text - - subroutine create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint) - - File: :file:`slater_rules.irp.f` - - - - - - - -.. c:function:: create_wf_of_psi_bilinear_matrix - - .. code:: text - - subroutine create_wf_of_psi_bilinear_matrix(truncate) - - File: :file:`spindeterminants.irp.f` - - Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants - - - - - -.. c:function:: decode_exc - - .. code:: text - - subroutine decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) - - File: :file:`slater_rules.irp.f` - - Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles s1,s2 : Spins (1:alpha, 2:beta) degree : Degree of excitation - - - - - -.. c:function:: decode_exc_spin - - .. code:: text - - subroutine decode_exc_spin(exc,h1,p1,h2,p2) - - File: :file:`slater_rules.irp.f` - - Decodes the exc arrays returned by get_excitation. - - h1,h2 : Holes - - p1,p2 : Particles - - - - - -.. c:function:: det_inf - - .. code:: text - - logical function det_inf(key1, key2, Nint) - - File: :file:`sort_dets_ab.irp.f` - - Ordering function for determinants. - - - - - -.. c:function:: det_search_key - - .. code:: text - - integer*8 function det_search_key(det,Nint) - - File: :file:`connected_to_ref.irp.f` - - Return an integer*8 corresponding to a determinant index for searching - - - - - -.. c:function:: detcmp - - .. code:: text - - integer function detCmp(a,b,Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: deteq - - .. code:: text - - logical function detEq(a,b,Nint) - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: diag_h_mat_elem - - .. code:: text - - double precision function diag_H_mat_elem(det_in,Nint) - - File: :file:`slater_rules.irp.f` - - Computes :math:`\langle i|H|i \rangle` . - - - - - -.. c:function:: diag_h_mat_elem_au0_h_au0 - - .. code:: text - - subroutine diag_H_mat_elem_au0_h_au0(det_in,Nint,hii) - - File: :file:`mo_energy_expval.irp.f` - - Computes :math:`\langle i|H|i \rangle` for any determinant :math:`|i\rangle` . Used for wave functions with an additional electron. - - - - - -.. c:function:: diag_h_mat_elem_fock - - .. code:: text - - double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Nint) - - File: :file:`slater_rules.irp.f` - - Computes :math:`\langle i|H|i \rangle` when :math:`i` is at most a double excitation from a reference. - - - - - -.. c:function:: diag_h_mat_elem_one_e - - .. code:: text - - double precision function diag_H_mat_elem_one_e(det_in,Nint) - - File: :file:`slater_rules_wee_mono.irp.f` - - Computes :math:`\langle i|H|i \rangle` . - - - - - -.. c:function:: diag_s_mat_elem - - .. code:: text - - double precision function diag_S_mat_elem(key_i,Nint) - - File: :file:`s2.irp.f` - - Returns - - - - - -.. c:function:: diag_wee_mat_elem - - .. code:: text - - double precision function diag_wee_mat_elem(det_in,Nint) - - File: :file:`slater_rules_wee_mono.irp.f` - - Computes :math:`\langle i|H|i \rangle` . - - - - - -.. c:function:: do_mono_excitation - - .. code:: text - - subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok) - - File: :file:`create_excitations.irp.f` - - Apply the single excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin on key_in ispin = 1 == alpha ispin = 2 == beta i_ok = 1 == the excitation is possible i_ok = -1 == the excitation is not possible - - - - - -.. c:function:: example_determinants - - .. code:: text - - subroutine example_determinants - - File: :file:`example.irp.f` - - subroutine that illustrates the main features available in determinants - - - - - -.. c:function:: example_determinants_psi_det - - .. code:: text - - subroutine example_determinants_psi_det - - File: :file:`example.irp.f` - - subroutine that illustrates the main features available in determinants using the psi_det/psi_coef - - - - - -.. c:function:: fill_h_apply_buffer_no_selection - - .. code:: text - - subroutine fill_H_apply_buffer_no_selection(n_selected,det_buffer,Nint,iproc) - - File: :file:`h_apply.irp.f` - - Fill the H_apply buffer with determiants for |CISD| - - - - - -.. c:function:: filter_connected - - .. code:: text - - subroutine filter_connected(key1,key2,Nint,sze,idx) - - File: :file:`filter_connected.irp.f` - - Filters out the determinants that are not connected by H - - returns the array idx which contains the index of the - - determinants in the array key1 that interact - - via the H operator with key2. - - idx(0) is the number of determinants that interact with key1 - - - - - -.. c:function:: filter_connected_i_h_psi0 - - .. code:: text - - subroutine filter_connected_i_H_psi0(key1,key2,Nint,sze,idx) - - File: :file:`filter_connected.irp.f` - - Returns the array idx which contains the index of the - - determinants in the array key1 that interact - - via the H operator with key2. - - idx(0) is the number of determinants that interact with key1 - - - - - -.. c:function:: filter_not_connected - - .. code:: text - - subroutine filter_not_connected(key1,key2,Nint,sze,idx) - - File: :file:`filter_connected.irp.f` - - Returns the array idx which contains the index of the - - determinants in the array key1 that DO NOT interact - - via the H operator with key2. - - idx(0) is the number of determinants that DO NOT interact with key1 - - - - - -.. c:function:: generate_all_alpha_beta_det_products - - .. code:: text - - subroutine generate_all_alpha_beta_det_products - - File: :file:`spindeterminants.irp.f` - - Create a wave function from all possible :math:`\alpha \times \beta` determinants - - - - - -.. c:function:: get_all_spin_doubles - - .. code:: text - - subroutine get_all_spin_doubles(buffer, idx, spindet, Nint, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. - - - - - - - -.. c:function:: get_all_spin_doubles_1 - - .. code:: text - - subroutine get_all_spin_doubles_1(buffer, idx, spindet, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. - - - - - - - -.. c:function:: get_all_spin_doubles_2 - - .. code:: text - - subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_doubles_3 - - .. code:: text - - subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_doubles_4 - - .. code:: text - - subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_doubles_n_int - - .. code:: text - - subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles - - .. code:: text - - subroutine get_all_spin_singles(buffer, idx, spindet, Nint, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles_1 - - .. code:: text - - subroutine get_all_spin_singles_1(buffer, idx, spindet, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles_2 - - .. code:: text - - subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles_3 - - .. code:: text - - subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles_4 - - .. code:: text - - subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles - - .. code:: text - - subroutine get_all_spin_singles_and_doubles(buffer, idx, spindet, Nint, size_buffer, singles, doubles, n_singles, n_doubles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles_1 - - .. code:: text - - subroutine get_all_spin_singles_and_doubles_1(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) - - File: :file:`spindeterminants.irp.f` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles_2 - - .. code:: text - - 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` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles_3 - - .. code:: text - - 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` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles_4 - - .. code:: text - - 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` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_and_doubles_n_int - - .. code:: text - - 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` - - - - Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. - - /!\ : The buffer is transposed ! - - - - - - - -.. c:function:: get_all_spin_singles_n_int - - .. code:: text - - subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) - - File: :file:`spindeterminants.irp.f_template_1218` - - - - Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. - - - - - - - -.. c:function:: get_double_excitation - - .. code:: text - - subroutine get_double_excitation(det1,det2,exc,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the two excitation operators between two doubly excited determinants and the phase. - - - - - -.. c:function:: get_double_excitation_spin - - .. code:: text - - subroutine get_double_excitation_spin(det1,det2,exc,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the two excitation operators between two doubly excited spin-determinants and the phase. - - - - - -.. c:function:: get_excitation - - .. code:: text - - subroutine get_excitation(det1,det2,exc,degree,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation operators between two determinants and the phase. - - - - - -.. c:function:: get_excitation_degree - - .. code:: text - - subroutine get_excitation_degree(key1,key2,degree,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation degree between two determinants. - - - - - -.. c:function:: get_excitation_degree_spin - - .. code:: text - - subroutine get_excitation_degree_spin(key1,key2,degree,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation degree between two determinants. - - - - - -.. c:function:: get_excitation_degree_vector - - .. code:: text - - subroutine get_excitation_degree_vector(key1,key2,degree,Nint,sze,idx) - - File: :file:`slater_rules.irp.f` - - Applies get_excitation_degree to an array of determinants. - - - - - -.. c:function:: get_excitation_degree_vector_double_alpha_beta - - .. code:: text - - subroutine get_excitation_degree_vector_double_alpha_beta(key1,key2,degree,Nint,sze,idx) - - File: :file:`slater_rules.irp.f` - - Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. - - - - - -.. c:function:: get_excitation_degree_vector_mono - - .. code:: text - - subroutine get_excitation_degree_vector_mono(key1,key2,degree,Nint,sze,idx) - - File: :file:`slater_rules.irp.f` - - Applies get_excitation_degree to an array of determinants and returns only the single excitations. - - - - - -.. c:function:: get_excitation_degree_vector_mono_or_exchange - - .. code:: text - - subroutine get_excitation_degree_vector_mono_or_exchange(key1,key2,degree,Nint,sze,idx) - - File: :file:`slater_rules.irp.f` - - Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. - - - - - -.. c:function:: get_excitation_degree_vector_mono_or_exchange_verbose - - .. code:: text - - subroutine get_excitation_degree_vector_mono_or_exchange_verbose(key1,key2,degree,Nint,sze,idx) - - File: :file:`slater_rules.irp.f` - - Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. - - - - - -.. c:function:: get_excitation_spin - - .. code:: text - - subroutine get_excitation_spin(det1,det2,exc,degree,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation operators between two determinants and the phase. - - - - - -.. c:function:: get_index_in_psi_det_alpha_unique - - .. code:: text - - integer function get_index_in_psi_det_alpha_unique(key,Nint) - - File: :file:`spindeterminants.irp.f` - - Returns the index of the determinant in the ``psi_det_alpha_unique`` array - - - - - -.. c:function:: get_index_in_psi_det_beta_unique - - .. code:: text - - integer function get_index_in_psi_det_beta_unique(key,Nint) - - File: :file:`spindeterminants.irp.f` - - Returns the index of the determinant in the ``psi_det_beta_unique`` array - - - - - -.. c:function:: get_index_in_psi_det_sorted_bit - - .. code:: text - - integer function get_index_in_psi_det_sorted_bit(key,Nint) - - File: :file:`connected_to_ref.irp.f` - - Returns the index of the determinant in the ``psi_det_sorted_bit`` array - - - - - -.. c:function:: get_mono_excitation - - .. code:: text - - subroutine get_mono_excitation(det1,det2,exc,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation operator between two singly excited determinants and the phase. - - - - - -.. c:function:: get_mono_excitation_from_fock - - .. code:: text - - subroutine get_mono_excitation_from_fock(det_1,det_2,h,p,spin,phase,hij) - - File: :file:`single_excitations.irp.f` - - - - - - - -.. c:function:: get_mono_excitation_spin - - .. code:: text - - subroutine get_mono_excitation_spin(det1,det2,exc,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the excitation operator between two singly excited determinants and the phase. - - - - - -.. c:function:: get_phase - - .. code:: text - - subroutine get_phase(key1,key2,phase,Nint) - - File: :file:`slater_rules.irp.f` - - Returns the phase between key1 and key2. - - - - - -.. c:function:: get_phasemask_bit - - .. code:: text - - subroutine get_phasemask_bit(det1, pm, Nint) - - File: :file:`slater_rules.irp.f` - - - - - - - -.. c:function:: get_s2 - - .. code:: text - - subroutine get_s2(key_i,key_j,Nint,s2) - - File: :file:`s2.irp.f` - - Returns - - - - - -.. c:function:: get_uj_s2_ui - - .. code:: text - - subroutine get_uJ_s2_uI(psi_keys_tmp,psi_coefs_tmp,n,nmax_coefs,nmax_keys,s2,nstates) - - File: :file:`s2.irp.f` - - returns the matrix elements of S^2 "s2(i,j)" between the "nstates" states psi_coefs_tmp(:,i) and psi_coefs_tmp(:,j) - - - - - -.. c:function:: getmobiles - - .. code:: text - - subroutine getMobiles(key,key_mask, mobiles,Nint) - - File: :file:`filter_connected.irp.f` - - - - - - - -.. c:function:: i_h_j - - .. code:: text - - subroutine i_H_j(key_i,key_j,Nint,hij) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. - - - - - -.. c:function:: i_h_j_double_alpha_beta - - .. code:: text - - subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by an opposite-spin double excitation. - - - - - -.. c:function:: i_h_j_double_spin - - .. code:: text - - subroutine i_H_j_double_spin(key_i,key_j,Nint,hij) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a same-spin double excitation. - - - - - -.. c:function:: i_h_j_mono_spin - - .. code:: text - - subroutine i_H_j_mono_spin(key_i,key_j,Nint,spin,hij) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. - - - - - -.. c:function:: i_h_j_mono_spin_one_e - - .. code:: text - - subroutine i_H_j_mono_spin_one_e(key_i,key_j,Nint,spin,hij) - - File: :file:`slater_rules_wee_mono.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. - - - - - -.. c:function:: i_h_j_one_e - - .. code:: text - - subroutine i_H_j_one_e(key_i,key_j,Nint,hij) - - File: :file:`slater_rules_wee_mono.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. - - - - - -.. c:function:: i_h_j_s2 - - .. code:: text - - subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` and :math:`\langle i|S^2|j \rangle` where :math:`i` and :math:`j` are determinants. - - - - - -.. c:function:: i_h_j_two_e - - .. code:: text - - subroutine i_H_j_two_e(key_i,key_j,Nint,hij) - - File: :file:`slater_rules_wee_mono.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. - - - - - -.. c:function:: i_h_j_verbose - - .. code:: text - - subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) - - File: :file:`slater_rules.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. - - - - - -.. c:function:: i_h_psi - - .. code:: text - - subroutine i_H_psi(key,keys,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) - - File: :file:`slater_rules.irp.f` - - Computes :math:`\langle i|H|Psi \rangle = \sum_J c_J \langle i | H | J \rangle` . - - Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The i_H_psi_minilist is much faster but requires to build the minilists. - - - - - -.. c:function:: i_h_psi_minilist - - .. code:: text - - subroutine i_H_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) - - File: :file:`slater_rules.irp.f` - - Computes :math:`\langle i|H|\Psi \rangle = \sum_J c_J \langle i|H|J\rangle` . - - Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. - - - - - -.. c:function:: i_s2_psi_minilist - - .. code:: text - - subroutine i_S2_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_S2_psi_array) - - File: :file:`s2.irp.f` - - Computes :math:`\langle i|S^2|\Psi \rangle = \sum_J c_J \langle i|S^2|J \rangle` . - - Uses filter_connected_i_H_psi0 to get all the :math:`|J\rangle` to which :math:`|i\rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. - - - - - -.. c:function:: i_wee_j_mono - - .. code:: text - - subroutine i_Wee_j_mono(key_i,key_j,Nint,spin,hij) - - File: :file:`slater_rules_wee_mono.irp.f` - - Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. - - - - - -.. c:function:: is_connected_to - - .. code:: text - - logical function is_connected_to(key,keys,Nint,Ndet) - - File: :file:`connected_to_ref.irp.f` - - Returns |true| if determinant ``key`` is connected to ``keys`` - - - - - -.. c:function:: is_connected_to_by_mono - - .. code:: text - - logical function is_connected_to_by_mono(key,keys,Nint,Ndet) - - File: :file:`connected_to_ref.irp.f` - - Returns |true| is ``key`` is connected to ``keys`` by a single excitation. - - - - - -.. c:function:: is_in_wavefunction - - .. code:: text - - logical function is_in_wavefunction(key,Nint) - - File: :file:`connected_to_ref.irp.f` - - |true| if the determinant ``det`` is in the wave function - - - - - -.. c:function:: is_spin_flip_possible - - .. code:: text - - logical function is_spin_flip_possible(key_in,i_flip,ispin) - - File: :file:`create_excitations.irp.f` - - returns |true| if the spin-flip of spin ispin in the orbital i_flip is possible on key_in - - - - - -.. c:function:: make_s2_eigenfunction - - .. code:: text - - subroutine make_s2_eigenfunction - - File: :file:`occ_pattern.irp.f` - - - - - - - -.. c:function:: mono_excitation_wee - - .. code:: text - - subroutine mono_excitation_wee(det_1,det_2,h,p,spin,phase,hij) - - File: :file:`mono_excitations_bielec.irp.f` - - - - - - - -.. c:function:: occ_pattern_of_det - - .. code:: text - - subroutine occ_pattern_of_det(d,o,Nint) - - File: :file:`occ_pattern.irp.f` - - Transforms a determinant to an occupation pattern - - occ(:,1) : Single occupations - - occ(:,2) : Double occupations - - - - - - - -.. c:function:: occ_pattern_search_key - - .. code:: text - - integer*8 function occ_pattern_search_key(det,Nint) - - File: :file:`connected_to_ref.irp.f` - - Return an integer*8 corresponding to a determinant index for searching - - - - - -.. c:function:: occ_pattern_to_dets - - .. code:: text - - subroutine occ_pattern_to_dets(o,d,sze,n_alpha,Nint) - - File: :file:`occ_pattern.irp.f` - - Generate all possible determinants for a give occ_pattern - - - - - -.. c:function:: occ_pattern_to_dets_size - - .. code:: text - - subroutine occ_pattern_to_dets_size(o,sze,n_alpha,Nint) - - File: :file:`occ_pattern.irp.f` - - Number of possible determinants for a given occ_pattern - - - - - -.. c:function:: pull_pt2 - - .. code:: text - - subroutine pull_pt2(zmq_socket_pull,pt2,norm_pert,H_pert_diag,i_generator,N_st,n,task_id) - - File: :file:`h_apply.irp.f` - - Pull |PT2| calculation in the collector - - - - - -.. c:function:: push_pt2 - - .. code:: text - - subroutine push_pt2(zmq_socket_push,pt2,norm_pert,H_pert_diag,i_generator,N_st,task_id) - - File: :file:`h_apply.irp.f` - - Push |PT2| calculation to the collector - - - - - -.. c:function:: read_dets - - .. code:: text - - subroutine read_dets(det,Nint,Ndet) - - File: :file:`determinants.irp.f` - - Reads the determinants from the |EZFIO| file - - - - - -.. c:function:: remove_duplicates_in_psi_det - - .. code:: text - - subroutine remove_duplicates_in_psi_det(found_duplicates) - - File: :file:`h_apply.irp.f` - - Removes duplicate determinants in the wave function. - - - - - -.. c:function:: resize_h_apply_buffer - - .. code:: text - - subroutine resize_H_apply_buffer(new_size,iproc) - - File: :file:`h_apply.irp.f` - - Resizes the H_apply buffer of proc iproc. The buffer lock should be set before calling this function. - - - - - -.. c:function:: routine_example_psi_det - - .. code:: text - - subroutine routine_example_psi_det - - File: :file:`example.irp.f` - - subroutine that illustrates the main features available in determinants using many determinants - - - - - -.. c:function:: s2_u_0 - - .. code:: text - - subroutine S2_u_0(v_0,u_0,n,keys_tmp,Nint) - - File: :file:`s2.irp.f` - - Computes v_0 = S^2|u_0> - - n : number of determinants - - - - - - - -.. c:function:: s2_u_0_nstates - - .. code:: text - - subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) - - File: :file:`s2.irp.f` - - Computes v_0 = S^2|u_0> - - n : number of determinants - - - - - - - -.. c:function:: save_natural_mos - - .. code:: text - - subroutine save_natural_mos - - File: :file:`density_matrix.irp.f` - - Save natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis - - - - - -.. c:function:: save_ref_determinant - - .. code:: text - - subroutine save_ref_determinant - - File: :file:`determinants.irp.f` - - - - - - - -.. c:function:: save_wavefunction - - .. code:: text - - subroutine save_wavefunction - - File: :file:`determinants.irp.f` - - Save the wave function into the |EZFIO| file - - - - - -.. c:function:: save_wavefunction_general - - .. code:: text - - subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) - - File: :file:`determinants.irp.f` - - Save the wave function into the |EZFIO| file - - - - - -.. c:function:: save_wavefunction_specified - - .. code:: text - - subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,index_det_save) - - File: :file:`determinants.irp.f` - - Save the wave function into the |EZFIO| file - - - - - -.. c:function:: save_wavefunction_truncated - - .. code:: text - - subroutine save_wavefunction_truncated(thr) - - File: :file:`determinants.irp.f` - - Save the wave function into the |EZFIO| file - - - - - -.. c:function:: save_wavefunction_unsorted - - .. code:: text - - subroutine save_wavefunction_unsorted - - File: :file:`determinants.irp.f` - - Save the wave function into the |EZFIO| file - - - - - -.. c:function:: set_natural_mos - - .. code:: text - - subroutine set_natural_mos - - File: :file:`density_matrix.irp.f` - - Set natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis - - - - - -.. c:function:: sort_dets_ab - - .. code:: text - - subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) - - File: :file:`sort_dets_ab.irp.f` - - Deprecated routine - - - - - -.. c:function:: sort_dets_ab_v - - .. code:: text - - subroutine sort_dets_ab_v(key_in, key_out, idx, shortcut, version, N_key, Nint) - - File: :file:`sort_dets_ab.irp.f` - - Deprecated routine - - - - - -.. c:function:: sort_dets_ba_v - - .. code:: text - - subroutine sort_dets_ba_v(key_in, key_out, idx, shortcut, version, N_key, Nint) - - File: :file:`sort_dets_ab.irp.f` - - Deprecated routine - - - - - -.. c:function:: sort_dets_by_det_search_key - - .. code:: text - - subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, sze, det_out, coef_out, N_st) - - File: :file:`determinants.irp.f` - - Determinants are sorted according to their :c:func:`det_search_key`. Useful to accelerate the search of a random determinant in the wave function. - - /!\ The first dimension of coef_out and coef_in need to be psi_det_size - - - - - - - -.. c:function:: spin_det_search_key - - .. code:: text - - integer*8 function spin_det_search_key(det,Nint) - - File: :file:`spindeterminants.irp.f` - - Return an integer(8) corresponding to a determinant index for searching - - - - - -.. c:function:: tamiser - - .. code:: text - - subroutine tamiser(key, idx, no, n, Nint, N_key) - - File: :file:`sort_dets_ab.irp.f` - - - - - - - -.. c:function:: u_0_s2_u_0 - - .. code:: text - - subroutine u_0_S2_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) - - File: :file:`s2.irp.f` - - Computes e_0 = / - - n : number of determinants - - - - - - - -.. c:function:: wf_of_psi_bilinear_matrix - - .. code:: text - - subroutine wf_of_psi_bilinear_matrix(truncate) - - File: :file:`spindeterminants.irp.f` - - Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants - - - - - -.. c:function:: write_spindeterminants - - .. code:: text - - subroutine write_spindeterminants - - File: :file:`spindeterminants.irp.f` - - - - - - - -.. c:function:: zmq_get_n_det - - .. code:: text - - integer function zmq_get_N_det(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_379` - - Get N_det from the qp_run scheduler - - - - - -.. c:function:: zmq_get_n_det_alpha_unique - - .. code:: text - - integer function zmq_get_N_det_alpha_unique(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_379` - - Get N_det_alpha_unique from the qp_run scheduler - - - - - -.. c:function:: zmq_get_n_det_beta_unique - - .. code:: text - - integer function zmq_get_N_det_beta_unique(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_379` - - Get N_det_beta_unique from the qp_run scheduler - - - - - -.. c:function:: zmq_get_n_states - - .. code:: text - - integer function zmq_get_N_states(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_379` - - Get N_states from the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi - - .. code:: text - - integer function zmq_get_psi(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f` - - Get the wave function from the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_bilinear - - .. code:: text - - integer function zmq_get_psi_bilinear(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f` - - Get the wave function from the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_bilinear_matrix_columns - - .. code:: text - - integer*8 function zmq_get_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Get psi_bilinear_matrix_columns on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_bilinear_matrix_order - - .. code:: text - - integer*8 function zmq_get_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Get psi_bilinear_matrix_order on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_bilinear_matrix_rows - - .. code:: text - - integer*8 function zmq_get_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Get psi_bilinear_matrix_rows on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_bilinear_matrix_values - - .. code:: text - - integer*8 function zmq_get_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_564` - - get psi_bilinear_matrix_values on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_coef - - .. code:: text - - integer*8 function zmq_get_psi_coef(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_564` - - get psi_coef on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_det - - .. code:: text - - integer*8 function zmq_get_psi_det(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Get psi_det on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_det_alpha_unique - - .. code:: text - - integer*8 function zmq_get_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Get psi_det_alpha_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_det_beta_unique - - .. code:: text - - integer*8 function zmq_get_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Get psi_det_beta_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_det_size - - .. code:: text - - integer function zmq_get_psi_det_size(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_379` - - Get psi_det_size from the qp_run scheduler - - - - - -.. c:function:: zmq_get_psi_notouch - - .. code:: text - - integer function zmq_get_psi_notouch(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f` - - Get the wave function from the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_det - - .. code:: text - - integer function zmq_put_N_det(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_379` - - Put N_det on the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_det_alpha_unique - - .. code:: text - - integer function zmq_put_N_det_alpha_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_379` - - Put N_det_alpha_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_det_beta_unique - - .. code:: text - - integer function zmq_put_N_det_beta_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_379` - - Put N_det_beta_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_states - - .. code:: text - - integer function zmq_put_N_states(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_379` - - Put N_states on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi - - .. code:: text - - integer function zmq_put_psi(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f` - - Put the wave function on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_bilinear - - .. code:: text - - integer function zmq_put_psi_bilinear(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f` - - Put the wave function on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_bilinear_matrix_columns - - .. code:: text - - integer*8 function zmq_put_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Put psi_bilinear_matrix_columns on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_bilinear_matrix_order - - .. code:: text - - integer*8 function zmq_put_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Put psi_bilinear_matrix_order on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_bilinear_matrix_rows - - .. code:: text - - integer*8 function zmq_put_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_500` - - Put psi_bilinear_matrix_rows on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_bilinear_matrix_values - - .. code:: text - - integer*8 function zmq_put_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_564` - - Put psi_bilinear_matrix_values on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_coef - - .. code:: text - - integer*8 function zmq_put_psi_coef(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_564` - - Put psi_coef on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_det - - .. code:: text - - integer*8 function zmq_put_psi_det(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Put psi_det on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_det_alpha_unique - - .. code:: text - - integer*8 function zmq_put_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Put psi_det_alpha_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_det_beta_unique - - .. code:: text - - integer*8 function zmq_put_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_440` - - Put psi_det_beta_unique on the qp_run scheduler - - - - - -.. c:function:: zmq_put_psi_det_size - - .. code:: text - - integer function zmq_put_psi_det_size(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_379` - - Put psi_det_size on the qp_run scheduler - - diff --git a/docs/source/modules/dft_keywords.rst b/docs/source/modules/dft_keywords.rst deleted file mode 100644 index 8a5fe1a5..00000000 --- a/docs/source/modules/dft_keywords.rst +++ /dev/null @@ -1,59 +0,0 @@ -.. _dft_keywords: - -.. program:: dft_keywords - -.. default-role:: option - -============ -dft_keywords -============ - -This module contains the main keywords related to a DFT calculation or RS-DFT calculation, such as: - -* :option:`dft_keywords exchange_functional` -* :option:`dft_keywords correlation_functional` -* :option:`dft_keywords HF_exchange` : only relevent for the :c:func:`rs_ks_scf` program - -The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_ints mu_erf` keyword. - -The keyword for the type of density used in RS-DFT calculation with a multi-configurational wave function is the :option:`density_for_dft density_for_dft` keyword. - - - -EZFIO parameters ----------------- - -.. option:: exchange_functional - - name of the exchange functional - - Default: short_range_LDA - -.. option:: correlation_functional - - name of the correlation functional - - Default: short_range_LDA - -.. option:: HF_exchange - - Percentage of HF exchange in the DFT model - - Default: 0. - - -Providers ---------- - - -.. c:var:: dft_type - - .. code:: text - - character*(32) :: dft_type - - File: :file:`keywords.irp.f` - - defines the type of DFT applied: LDA, GGA etc ... - - diff --git a/docs/source/modules/dft_utils_in_r.rst b/docs/source/modules/dft_utils_in_r.rst deleted file mode 100644 index bf815025..00000000 --- a/docs/source/modules/dft_utils_in_r.rst +++ /dev/null @@ -1,361 +0,0 @@ -.. _dft_utils_in_r: - -.. program:: dft_utils_in_r - -.. default-role:: option - -============== -dft_utils_in_r -============== - -This module contains most of the fundamental quantities (AOs, MOs or density derivatives) evaluated in real-space representation that are needed for the various DFT modules. - -As these quantities might be used and re-used, the values at each point of the grid are stored (see ``becke_numerical_grid`` for more information on the grid). - -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. - - - - -Providers ---------- - - -.. c:var:: aos_grad_in_r_array - - .. code:: text - - double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) - double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) - - File: :file:`ao_in_r.irp.f` - - aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point - - aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. c:var:: aos_grad_in_r_array_transp - - .. code:: text - - double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) - double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) - - File: :file:`ao_in_r.irp.f` - - aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point - - aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. c:var:: aos_in_r_array - - .. code:: text - - double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) - double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) - - File: :file:`ao_in_r.irp.f` - - aos_in_r_array(i,j) = value of the ith ao on the jth grid point - - aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point - - - - -.. c:var:: aos_in_r_array_transp - - .. code:: text - - double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) - double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) - - File: :file:`ao_in_r.irp.f` - - aos_in_r_array(i,j) = value of the ith ao on the jth grid point - - aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point - - - - -.. c:var:: aos_lapl_in_r_array - - .. code:: text - - double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) - double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) - - File: :file:`ao_in_r.irp.f` - - aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point - - aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. c:var:: aos_lapl_in_r_array_transp - - .. code:: text - - double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) - double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) - - File: :file:`ao_in_r.irp.f` - - aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point - - aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. c:var:: mos_grad_in_r_array - - .. code:: text - - double precision, allocatable :: mos_grad_in_r_array (mo_num,n_points_final_grid,3) - - File: :file:`mo_in_r.irp.f` - - mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point - - mos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth mo on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. c:var:: mos_in_r_array - - .. code:: text - - double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) - double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) - - File: :file:`mo_in_r.irp.f` - - mos_in_r_array(i,j) = value of the ith mo on the jth grid point - - mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point - - - - -.. c:var:: mos_in_r_array_transp - - .. code:: text - - double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) - double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) - - File: :file:`mo_in_r.irp.f` - - mos_in_r_array(i,j) = value of the ith mo on the jth grid point - - mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point - - - - -.. c:var:: mos_lapl_in_r_array - - .. code:: text - - double precision, allocatable :: mos_lapl_in_r_array (mo_num,n_points_final_grid,3) - - File: :file:`mo_in_r.irp.f` - - mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point - - mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth mo on the ith grid point - - k = 1 : x, k= 2, y, k 3, z - - - - -.. 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` - - - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r - - .. code:: text - - subroutine density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, grad_dm_a, grad_dm_b, aos_array, grad_aos_array) - - File: :file:`dm_in_r.irp.f` - - input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r : dm_b = beta density evaluated at r : aos_array(i) = ao(i) evaluated at r : grad_dm_a(1) = X gradient of the alpha density evaluated in r : grad_dm_a(1) = X gradient of the beta density evaluated in r : grad_aos_array(1) = X gradient of the aos(i) evaluated at r - - - - - -.. c:function:: dm_dft_alpha_beta_and_all_aos_at_r - - .. code:: text - - subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array) - - File: :file:`dm_in_r.irp.f` - - input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r output : dm_b = beta density evaluated at r output : aos_array(i) = ao(i) evaluated at r - - - - - -.. c:function:: dm_dft_alpha_beta_at_r - - .. code:: text - - subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b) - - File: :file:`dm_in_r.irp.f` - - input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r(3) output : dm_b = beta density evaluated at r(3) - - diff --git a/docs/source/modules/dft_utils_one_e.rst b/docs/source/modules/dft_utils_one_e.rst deleted file mode 100644 index 09708468..00000000 --- a/docs/source/modules/dft_utils_one_e.rst +++ /dev/null @@ -1,1951 +0,0 @@ -.. _dft_utils_one_e: - -.. program:: dft_utils_one_e - -.. default-role:: option - -=============== -dft_utils_one_e -=============== - -This module contains all the one-body related quantities needed to perform DFT or RS-DFT calculations. -Therefore, it contains most of the properties which depends on the one-body density and density matrix. - -The most important files and variables are: - -* The general *providers* for the x/c energies in :file:`e_xc_general.irp.f` -* The general *providers* for the x/c potentials in :file:`pot_general.irp.f` -* The short-range hartree operator and all related quantities in :file:`sr_coulomb.irp.f` - -These *providers* will be used in many DFT-related programs, such as :file:`ks_scf.irp.f` or :file:`rs_ks_scf.irp.f`. -It is also needed to compute the effective one-body operator needed in multi-determinant RS-DFT (see plugins by eginer). - -Some other interesting quantities: - -* The LDA and PBE *providers* for the x/c energies in :file:`e_xc.irp.f` and :file:`sr_exc.irp.f` -* The LDA and PBE *providers* for the x/c potentials on the AO basis in :file:`pot_ao.irp.f` and :file:`sr_pot_ao.irp.f` -* The :math:`h_{core}` energy computed directly with the one-body density matrix in :file:`one_e_energy_dft.irp.f` -* LDA and PBE short-range functionals *subroutines* in :file:`exc_sr_lda.irp.f` and :file:`exc_sr_pbe.irp.f` - - - - - -Providers ---------- - - -.. c:var:: aos_dsr_vc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dsr_vc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dsr_vx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dsr_vx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dvc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dvc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dvx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_dvx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vc_alpha_lda_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vc_beta_lda_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vx_alpha_lda_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vx_beta_lda_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_sr_vx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vc_alpha_lda_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vc_beta_lda_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vx_alpha_lda_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vx_beta_lda_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) - double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: aos_vx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: effective_one_e_potential - - .. code:: text - - double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) - double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) - - File: :file:`sr_coulomb.irp.f` - - Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` - - Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. - - shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal - - - - -.. c:var:: effective_one_e_potential_without_kin - - .. code:: text - - double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) - double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) - - File: :file:`sr_coulomb.irp.f` - - Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` - - Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. - - shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal - - - - -.. c:var:: energy_c - - .. code:: text - - double precision, allocatable :: energy_x (N_states) - double precision, allocatable :: energy_c (N_states) - - File: :file:`e_xc_general.irp.f` - - correlation and exchange energies general providers. - - - - -.. c:var:: energy_c_lda - - .. code:: text - - double precision, allocatable :: energy_x_lda (N_states) - double precision, allocatable :: energy_c_lda (N_states) - - File: :file:`e_xc.irp.f` - - exchange/correlation energy with the short range LDA functional - - - - -.. c:var:: energy_c_pbe - - .. code:: text - - double precision, allocatable :: energy_x_pbe (N_states) - double precision, allocatable :: energy_c_pbe (N_states) - - File: :file:`e_xc.irp.f` - - exchange/correlation energy with the short range PBE functional - - - - -.. c:var:: energy_sr_c_lda - - .. code:: text - - double precision, allocatable :: energy_sr_x_lda (N_states) - double precision, allocatable :: energy_sr_c_lda (N_states) - - File: :file:`sr_exc.irp.f` - - exchange/correlation energy with the short range LDA functional - - - - -.. c:var:: energy_sr_c_pbe - - .. code:: text - - double precision, allocatable :: energy_sr_x_pbe (N_states) - double precision, allocatable :: energy_sr_c_pbe (N_states) - - File: :file:`sr_exc.irp.f` - - exchange/correlation energy with the short range PBE functional - - - - -.. c:var:: energy_sr_x_lda - - .. code:: text - - double precision, allocatable :: energy_sr_x_lda (N_states) - double precision, allocatable :: energy_sr_c_lda (N_states) - - File: :file:`sr_exc.irp.f` - - exchange/correlation energy with the short range LDA functional - - - - -.. c:var:: energy_sr_x_pbe - - .. code:: text - - double precision, allocatable :: energy_sr_x_pbe (N_states) - double precision, allocatable :: energy_sr_c_pbe (N_states) - - File: :file:`sr_exc.irp.f` - - exchange/correlation energy with the short range PBE functional - - - - -.. c:var:: energy_x - - .. code:: text - - double precision, allocatable :: energy_x (N_states) - double precision, allocatable :: energy_c (N_states) - - File: :file:`e_xc_general.irp.f` - - correlation and exchange energies general providers. - - - - -.. c:var:: energy_x_lda - - .. code:: text - - double precision, allocatable :: energy_x_lda (N_states) - double precision, allocatable :: energy_c_lda (N_states) - - File: :file:`e_xc.irp.f` - - exchange/correlation energy with the short range LDA functional - - - - -.. c:var:: energy_x_pbe - - .. code:: text - - double precision, allocatable :: energy_x_pbe (N_states) - double precision, allocatable :: energy_c_pbe (N_states) - - File: :file:`e_xc.irp.f` - - exchange/correlation energy with the short range PBE functional - - - - -.. c:var:: gga_sr_type_functionals - - .. code:: text - - subroutine GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - - File: :file:`utils.irp.f` - - routine that helps in building the x/c potentials on the AO basis for a GGA functional with a short-range interaction - - - - -.. c:var:: gga_type_functionals - - .. code:: text - - subroutine GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & - ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & - ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) - - File: :file:`utils.irp.f` - - routine that helps in building the x/c potentials on the AO basis for a GGA functional - - - - -.. c:var:: grad_aos_dsr_vc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dsr_vc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dsr_vx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dsr_vx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`sr_pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dvc_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dvc_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dvx_alpha_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: grad_aos_dvx_beta_pbe_w - - .. code:: text - - double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) - double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) - double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) - - File: :file:`pot_ao.irp.f` - - aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) - - - - -.. c:var:: mu_erf_dft - - .. code:: text - - double precision :: mu_erf_dft - - File: :file:`mu_erf_dft.irp.f` - - range separation parameter used in RS-DFT. It is set to mu_erf in order to be consistent with the two electrons integrals erf - - - - -.. c:var:: potential_c_alpha_ao - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the AO basis - - - - -.. c:var:: potential_c_alpha_ao_lda - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - - - - -.. c:var:: potential_c_alpha_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_c_alpha_mo - - .. code:: text - - double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the MO basis - - - - -.. c:var:: potential_c_beta_ao - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the AO basis - - - - -.. c:var:: potential_c_beta_ao_lda - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - - - - -.. c:var:: potential_c_beta_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_c_beta_mo - - .. code:: text - - double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the MO basis - - - - -.. c:var:: potential_sr_c_alpha_ao_lda - - .. 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 - - - - -.. c:var:: potential_sr_c_alpha_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_sr_c_beta_ao_lda - - .. 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 - - - - -.. c:var:: potential_sr_c_beta_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_sr_x_alpha_ao_lda - - .. 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 - - - - -.. c:var:: potential_sr_x_alpha_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_sr_x_beta_ao_lda - - .. 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 - - - - -.. c:var:: potential_sr_x_beta_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`sr_pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_x_alpha_ao - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the AO basis - - - - -.. c:var:: potential_x_alpha_ao_lda - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - - - - -.. c:var:: potential_x_alpha_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_x_alpha_mo - - .. code:: text - - double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the MO basis - - - - -.. c:var:: potential_x_beta_ao - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the AO basis - - - - -.. c:var:: potential_x_beta_ao_lda - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis - - - - -.. c:var:: potential_x_beta_ao_pbe - - .. code:: text - - double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) - double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) - - File: :file:`pot_ao.irp.f` - - exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis - - - - -.. c:var:: potential_x_beta_mo - - .. code:: text - - double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) - double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) - - File: :file:`pot_general.irp.f` - - general providers for the alpha/beta exchange/correlation potentials on the MO basis - - - - -.. c:var:: psi_dft_energy_h_core - - .. code:: text - - double precision, allocatable :: psi_dft_energy_kinetic (N_states) - double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) - double precision, allocatable :: psi_dft_energy_h_core (N_states) - - 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 - - - - -.. c:var:: psi_dft_energy_kinetic - - .. code:: text - - double precision, allocatable :: psi_dft_energy_kinetic (N_states) - double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) - double precision, allocatable :: psi_dft_energy_h_core (N_states) - - 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 - - - - -.. c:var:: psi_dft_energy_nuclear_elec - - .. code:: text - - double precision, allocatable :: psi_dft_energy_kinetic (N_states) - double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) - double precision, allocatable :: psi_dft_energy_h_core (N_states) - - 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 - - - - -.. c:var:: shifting_constant - - .. code:: text - - double precision, allocatable :: shifting_constant (N_states) - - File: :file:`shifted_potential.irp.f` - - shifting_constant = (E_{Hxc} - <\Psi | V_{Hxc} | \Psi>) / N_elec constant to add to the potential in order to obtain the variational energy as the eigenvalue of the effective long-range Hamiltonian (see original paper of Levy PRL 113, 113002 (2014), equation (17) ) - - - - -.. c:var:: short_range_hartree - - .. code:: text - - double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) - double precision, allocatable :: short_range_hartree (N_states) - - File: :file:`sr_coulomb.irp.f` - - short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` - - short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` - - = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` - - - - -.. c:var:: short_range_hartree_operator - - .. code:: text - - double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) - double precision, allocatable :: short_range_hartree (N_states) - - File: :file:`sr_coulomb.irp.f` - - short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` - - short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` - - = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` - - - - -.. c:var:: trace_v_h - - .. code:: text - - double precision, allocatable :: trace_v_xc (N_states) - double precision, allocatable :: trace_v_h (N_states) - double precision, allocatable :: trace_v_hxc (N_states) - - File: :file:`pot_general.irp.f` - - Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} - - - - -.. c:var:: trace_v_hxc - - .. code:: text - - double precision, allocatable :: trace_v_xc (N_states) - double precision, allocatable :: trace_v_h (N_states) - double precision, allocatable :: trace_v_hxc (N_states) - - File: :file:`pot_general.irp.f` - - Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} - - - - -.. c:var:: trace_v_xc - - .. code:: text - - double precision, allocatable :: trace_v_xc (N_states) - double precision, allocatable :: trace_v_h (N_states) - double precision, allocatable :: trace_v_hxc (N_states) - - File: :file:`pot_general.irp.f` - - Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: berf - - .. code:: text - - function berf(a) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: dberfda - - .. code:: text - - function dberfda(a) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: dpol - - .. code:: text - - double precision function dpol(rs) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: dpold - - .. code:: text - - double precision function dpold(rs) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: dpoldd - - .. code:: text - - double precision function dpoldd(rs) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ec_lda - - .. code:: text - - subroutine ec_lda(rho_a,rho_b,ec,vc_a,vc_b) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ec_lda_sr - - .. code:: text - - subroutine ec_lda_sr(mu,rho_a,rho_b,ec,vc_a,vc_b) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ec_only_lda_sr - - .. code:: text - - subroutine ec_only_lda_sr(mu,rho_a,rho_b,ec) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ec_pbe_only - - .. code:: text - - subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) - - File: :file:`exc_sr_pbe.irp.f` - - Short-range PBE correlation energy functional for erf interaction - - input : ========== - - mu = range separated parameter - - rhoc, rhoo = total density and spin density - - sigmacc = square of the gradient of the total density - - sigmaco = square of the gradient of the spin density - - sigmaoo = scalar product between the gradient of the total density and the one of the spin density - - output: ========== - - ec = correlation energy - - - - - - - -.. c:function:: ec_pbe_sr - - .. code:: text - - subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo) - - File: :file:`exc_sr_pbe.irp.f` - - Short-range PBE correlation energy functional for erf interaction - - input : ========== - - mu = range separated parameter - - rhoc, rhoo = total density and spin density - - sigmacc = square of the gradient of the total density - - sigmaco = square of the gradient of the spin density - - sigmaoo = scalar product between the gradient of the total density and the one of the spin density - - output: ========== - - ec = correlation energy - - all variables v** are energy derivatives with respect to components of the density - - vrhoc = derivative with respect to the total density - - vrhoo = derivative with respect to spin density - - vsigmacc = derivative with respect to the square of the gradient of the total density - - vsigmaco = derivative with respect to scalar product between the gradients of total and spin densities - - vsigmaoo = derivative with respect to the square of the gradient of the psin density - - - - - -.. c:function:: ecorrlr - - .. code:: text - - subroutine ecorrlr(rs,z,mu,eclr) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ecpw - - .. code:: text - - subroutine ecPW(x,y,ec,ecd,ecz,ecdd,eczd) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ex_lda - - .. code:: text - - subroutine ex_lda(rho_a,rho_b,ex,vx_a,vx_b) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ex_lda_sr - - .. code:: text - - subroutine ex_lda_sr(mu,rho_a,rho_b,ex,vx_a,vx_b) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: ex_pbe_sr - - .. code:: text - - subroutine ex_pbe_sr(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex,vx_rho_a,vx_rho_b,vx_grd_rho_a_2,vx_grd_rho_b_2,vx_grd_rho_a_b) - - File: :file:`exc_sr_pbe.irp.f` - - mu = range separation parameter rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at the density and corresponding gradients of the density vx_rho_a = d ex / d rho_a vx_rho_b = d ex / d rho_b vx_grd_rho_a_2 = d ex / d grd_rho_a_2 vx_grd_rho_b_2 = d ex / d grd_rho_b_2 vx_grd_rho_a_b = d ex / d grd_rho_a_b - - - - - -.. c:function:: ex_pbe_sr_only - - .. code:: text - - subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) - - File: :file:`exc_sr_pbe.irp.f` - - rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at point r - - - - - -.. c:function:: g0d - - .. code:: text - - double precision function g0d(rs) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: g0dd - - .. code:: text - - double precision function g0dd(rs) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: g0f - - .. code:: text - - double precision function g0f(x) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: gpw - - .. code:: text - - subroutine GPW(x,Ac,alfa1,beta1,beta2,beta3,beta4,G,Gd,Gdd) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: grad_rho_ab_to_grad_rho_oc - - .. code:: text - - subroutine grad_rho_ab_to_grad_rho_oc(grad_rho_a_2,grad_rho_b_2,grad_rho_a_b,grad_rho_o_2,grad_rho_c_2,grad_rho_o_c) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: qrpa - - .. code:: text - - double precision function Qrpa(x) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: qrpad - - .. code:: text - - double precision function Qrpad(x) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: qrpadd - - .. code:: text - - double precision function Qrpadd(x) - - File: :file:`exc_sr_lda.irp.f` - - - - - - - -.. c:function:: rho_ab_to_rho_oc - - .. code:: text - - subroutine rho_ab_to_rho_oc(rho_a,rho_b,rho_o,rho_c) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: rho_oc_to_rho_ab - - .. code:: text - - subroutine rho_oc_to_rho_ab(rho_o,rho_c,rho_a,rho_b) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: v_grad_rho_oc_to_v_grad_rho_ab - - .. code:: text - - subroutine v_grad_rho_oc_to_v_grad_rho_ab(v_grad_rho_o_2,v_grad_rho_c_2,v_grad_rho_o_c,v_grad_rho_a_2,v_grad_rho_b_2,v_grad_rho_a_b) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: v_rho_ab_to_v_rho_oc - - .. code:: text - - subroutine v_rho_ab_to_v_rho_oc(v_rho_a,v_rho_b,v_rho_o,v_rho_c) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: v_rho_oc_to_v_rho_ab - - .. code:: text - - subroutine v_rho_oc_to_v_rho_ab(v_rho_o,v_rho_c,v_rho_a,v_rho_b) - - File: :file:`rho_ab_to_rho_tot.irp.f` - - - - - - - -.. c:function:: vcorrlr - - .. code:: text - - subroutine vcorrlr(rs,z,mu,vclrup,vclrdown,vclrupd,vclrdownd) - - File: :file:`exc_sr_lda.irp.f` - - - - diff --git a/docs/source/modules/dressing.rst b/docs/source/modules/dressing.rst deleted file mode 100644 index a4b3285d..00000000 --- a/docs/source/modules/dressing.rst +++ /dev/null @@ -1,36 +0,0 @@ -.. _dressing: - -.. program:: dressing - -.. default-role:: option - -========= -dress_zmq -========= - -Module to facilitate the construction of modules using dressed -Hamiltonians, parallelized with |ZeroMQ|. - - - - -EZFIO parameters ----------------- - -.. option:: thresh_dressed_ci - - Threshold on the convergence of the dressed |CI| energy - - Default: 1.e-5 - -.. option:: n_it_max_dressed_ci - - Maximum number of dressed |CI| iterations - - Default: 10 - -.. option:: dress_relative_error - - Stop stochastic dressing when the relative error is smaller than :option:`perturbation PT2_relative_error` - - Default: 0.001 diff --git a/docs/source/modules/electrons.rst b/docs/source/modules/electrons.rst deleted file mode 100644 index 97fee97c..00000000 --- a/docs/source/modules/electrons.rst +++ /dev/null @@ -1,76 +0,0 @@ -.. _electrons: - -.. program:: electrons - -.. default-role:: option - -========= -electrons -========= - -Describes the electrons. For the moment, only the number of alpha -and beta electrons are provided by this module. - - -Assumptions -=========== - -* `elec_num` >= 0 -* `elec_alpha_num` >= 0 -* `elec_beta_num` >= 0 -* `elec_alpha_num` >= `elec_beta_num` - - - - - -EZFIO parameters ----------------- - -.. option:: elec_alpha_num - - Numbers of electrons alpha ("up") - - -.. option:: elec_beta_num - - Numbers of electrons beta ("down") - - -.. option:: elec_num - - Numbers total of electrons (alpha + beta) - - Default: = electrons.elec_alpha_num + electrons.elec_beta_num - - -Providers ---------- - - -.. c:var:: elec_num - - .. code:: text - - integer :: elec_num - integer, allocatable :: elec_num_tab (2) - - File: :file:`electrons.irp.f` - - Numbers of alpha ("up") , beta ("down") and total electrons - - - - -.. c:var:: elec_num_tab - - .. code:: text - - integer :: elec_num - integer, allocatable :: elec_num_tab (2) - - File: :file:`electrons.irp.f` - - Numbers of alpha ("up") , beta ("down") and total electrons - - diff --git a/docs/source/modules/ezfio_files.rst b/docs/source/modules/ezfio_files.rst deleted file mode 100644 index 7bfdc840..00000000 --- a/docs/source/modules/ezfio_files.rst +++ /dev/null @@ -1,151 +0,0 @@ -.. _ezfio_files: - -.. program:: ezfio_files - -.. default-role:: option - -=========== -ezfio_files -=========== - -This modules essentially contains the name of the |EZFIO| directory in the -:c:data:`ezfio_filename` variable. This is read as the first argument of the -command-line, or as the :envvar:`QP_INPUT` environment variable. - - - - -Providers ---------- - - -.. c:var:: ezfio_filename - - .. code:: text - - character*(128) :: ezfio_filename - - File: :file:`ezfio.irp.f` - - Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment variable if it is set, or as the 1st argument of the command line. - - - - -.. c:var:: ezfio_work_dir - - .. code:: text - - character*(128) :: ezfio_work_dir - - File: :file:`ezfio.irp.f` - - EZFIO/work/ - - - - -.. c:var:: output_cpu_time_0 - - .. code:: text - - double precision :: output_wall_time_0 - double precision :: output_cpu_time_0 - - File: :file:`output.irp.f` - - Initial CPU and wall times when printing in the output files - - - - -.. c:var:: output_wall_time_0 - - .. code:: text - - double precision :: output_wall_time_0 - double precision :: output_cpu_time_0 - - File: :file:`output.irp.f` - - Initial CPU and wall times when printing in the output files - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: getunitandopen - - .. code:: text - - integer function getUnitAndOpen(f,mode) - - File: :file:`get_unit_and_open.irp.f` - - :f: file name - - :mode: 'R' : READ, UNFORMATTED 'W' : WRITE, UNFORMATTED 'r' : READ, FORMATTED 'w' : WRITE, FORMATTED 'a' : APPEND, FORMATTED 'x' : READ/WRITE, FORMATTED - - - - - - - -.. c:function:: write_bool - - .. code:: text - - subroutine write_bool(iunit,value,label) - - File: :file:`output.irp.f` - - Write an logical value in output - - - - - -.. c:function:: write_double - - .. code:: text - - subroutine write_double(iunit,value,label) - - File: :file:`output.irp.f` - - Write a double precision value in output - - - - - -.. c:function:: write_int - - .. code:: text - - subroutine write_int(iunit,value,label) - - File: :file:`output.irp.f` - - Write an integer value in output - - - - - -.. c:function:: write_time - - .. code:: text - - subroutine write_time(iunit) - - File: :file:`output.irp.f` - - Write a time stamp in the output for chronological reconstruction - - diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst deleted file mode 100644 index 09c58e2d..00000000 --- a/docs/source/modules/fci.rst +++ /dev/null @@ -1,921 +0,0 @@ -.. _fci: - -.. program:: fci - -.. default-role:: option - -=== -fci -=== - -Selected Full Configuration Interaction. - -The :command:`FCI` program starts with a single determinant, or with the wave -function in the |EZFIO| database if :option:`determinants read_wf` is |true|. -Then, it will iteratively: - -* Select the most important determinants from the external space and add them to the - internal space -* If :option:`determinants s2_eig` is |true|, add all the necessary - determinants to allow the eigenstates of |H| to be eigenstates of |S^2| -* Diagonalize |H| in the enlarged internal space -* Compute (stochastically) the second-order perturbative contribution to the energy -* Extrapolate the variational energy by fitting - :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` - - -The number of selected determinants at each iteration will be such that the -size of the wave function will double at every iteration. If :option:`determinants -s2_eig` is |true|, then the number of selected determinants will be 1.5x the -current number, and then all the additional determinants will be added. - -By default, the program will stop when more than one million determinants have -been selected, or when the |PT2| energy is below :math:`10^{-4}`. - -The variational and |PT2| energies of the iterations are stored in the -|EZFIO| database, in the :ref:`iterations` module. - - - -Computation of the |PT2| energy -------------------------------- - -At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet -zeroth-order Hamiltonian: - -.. math:: - - E_{\text{PT2}} = \sum_{ \alpha } - \frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2} - {E - \langle \alpha | \hat{H} | \alpha \rangle} - -where the |kalpha| determinants are generated by applying all the single and -double excitation operators to all the determinants of the wave function -:math:`\Psi_G`. - -When the hybrid-deterministic/stochastic algorithm is chosen -(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the -internal space. -When the deterministic algorithm is chosen (:option:`perturbation do_pt2` -is set to |false|), :math:`Psi_G` is a truncation of |Psi| using -:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation -of |Psi| using :option:`determinants threshold_selectors`, and re-weighted -by :math:`1/\langle \Psi_s | \Psi_s \rangle`. - -At every iteration, while computing the |PT2|, the variance of the wave -function is also computed: - -.. math:: - - \sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle - - \langle \Psi | \hat{H} | \Psi \rangle^2 \\ - & = \sum_{i \in \text{FCI}} - \langle \Psi | \hat{H} | i \rangle - \langle i | \hat{H} | \Psi \rangle - - \langle \Psi | \hat{H} | \Psi \rangle^2 \\ - & = \sum_{ \alpha } - \langle |\Psi | \hat{H} | \alpha \rangle|^2. - -The expression of the variance is the same as the expression of the |PT2|, with -a denominator of 1. It measures how far the wave function is from the |FCI| -solution. Note that the absence of denominator in the Heat-Bath selected |CI| -method is selection method by minimization of the variance, whereas |CIPSI| is -a selection method by minimization of the energy. - - -If :option:`perturbation do_pt2` is set to |false|, then the stochastic -|PT2| is not computed, and an approximate value is obtained from the |CIPSI| -selection. The calculation is faster, but the extrapolated |FCI| value is -less accurate. This way of running the code should be used when the only -goal is to generate a wave function, as for using |CIPSI| wave functions as -trial wave functions of |QMC| calculations for example. - - -The :command:`PT2` program reads the wave function of the |EZFIO| database -and computes the energy and the |PT2| contribution. - - -State-averaging ---------------- - -Extrapolated |FCI| energy -------------------------- - -An estimate of the |FCI| energy is computed by extrapolating - -.. math:: - - E=E_\text{FCI} - \alpha\, E_\text{PT2} - -This extrapolation is done for all the requested states, and excitation -energies are printed as energy differences between the extrapolated -energies of the excited states and the extrapolated energy of the ground -state. - -The extrapolations are given considering the 2 last points, the 3 last points, ..., -the 7 last points. The extrapolated value should be chosen such that the extrpolated -value is stable with the number of points. - - - - -EZFIO parameters ----------------- - -.. option:: energy - - Calculated Selected |FCI| energy - - -.. option:: energy_pt2 - - Calculated |FCI| energy + |PT2| - - - -Providers ---------- - - -.. c:var:: initialize_pt2_e0_denominator - - .. code:: text - - logical :: initialize_pt2_e0_denominator - - File: :file:`energy.irp.f` - - If true, initialize pt2_E0_denominator - - - - -.. c:var:: pt2_cw - - .. code:: text - - double precision, allocatable :: pt2_w (N_det_generators) - double precision, allocatable :: pt2_cw (0:N_det_generators) - double precision :: pt2_w_t - double precision :: pt2_u_0 - integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_e0_denominator - - .. code:: text - - double precision, allocatable :: pt2_e0_denominator (N_states) - - File: :file:`energy.irp.f` - - E0 in the denominator of the PT2 - - - - -.. c:var:: pt2_f - - .. code:: text - - integer, allocatable :: pt2_f (N_det_generators) - integer :: pt2_n_tasks_max - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_j - - .. code:: text - - integer, allocatable :: pt2_j (N_det_generators) - integer, allocatable :: pt2_r (N_det_generators) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_mindetinfirstteeth - - .. code:: text - - integer :: pt2_n_teeth - integer :: pt2_mindetinfirstteeth - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_n_0 - - .. code:: text - - double precision, allocatable :: pt2_w (N_det_generators) - double precision, allocatable :: pt2_cw (0:N_det_generators) - double precision :: pt2_w_t - double precision :: pt2_u_0 - integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_n_tasks - - .. code:: text - - integer :: pt2_n_tasks - - File: :file:`pt2_stoch_routines.irp.f` - - Number of parallel tasks for the Monte Carlo - - - - -.. c:var:: pt2_n_tasks_max - - .. code:: text - - integer, allocatable :: pt2_f (N_det_generators) - integer :: pt2_n_tasks_max - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_n_teeth - - .. code:: text - - integer :: pt2_n_teeth - integer :: pt2_mindetinfirstteeth - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_r - - .. code:: text - - integer, allocatable :: pt2_j (N_det_generators) - integer, allocatable :: pt2_r (N_det_generators) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_stoch_istate - - .. code:: text - - integer :: pt2_stoch_istate - - File: :file:`pt2_stoch_routines.irp.f` - - State for stochatsic PT2 - - - - -.. c:var:: pt2_u - - .. code:: text - - double precision, allocatable :: pt2_u (N_det_generators) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_u_0 - - .. code:: text - - double precision, allocatable :: pt2_w (N_det_generators) - double precision, allocatable :: pt2_cw (0:N_det_generators) - double precision :: pt2_w_t - double precision :: pt2_u_0 - integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_w - - .. code:: text - - double precision, allocatable :: pt2_w (N_det_generators) - double precision, allocatable :: pt2_cw (0:N_det_generators) - double precision :: pt2_w_t - double precision :: pt2_u_0 - integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -.. c:var:: pt2_w_t - - .. code:: text - - double precision, allocatable :: pt2_w (N_det_generators) - double precision, allocatable :: pt2_cw (0:N_det_generators) - double precision :: pt2_w_t - double precision :: pt2_u_0 - integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: add_to_selection_buffer - - .. code:: text - - subroutine add_to_selection_buffer(b, det, val) - - File: :file:`selection_buffer.irp.f` - - - - - - - -.. c:function:: bitstring_to_list_in_selection - - .. code:: text - - subroutine bitstring_to_list_in_selection( string, list, n_elements, Nint) - - File: :file:`selection.irp.f` - - Gives the inidices(+1) of the bits set to 1 in the bit string - - - - - -.. c:function:: create_selection_buffer - - .. code:: text - - subroutine create_selection_buffer(N, siz_, res) - - File: :file:`selection_buffer.irp.f` - - - - - - - -.. c:function:: delete_selection_buffer - - .. code:: text - - subroutine delete_selection_buffer(b) - - File: :file:`selection_buffer.irp.f` - - - - - - - -.. c:function:: fci - - .. code:: text - - subroutine fci - - File: :file:`fci.irp.f` - - Selected Full Configuration Interaction. - - - - - -.. c:function:: fill_buffer_double - - .. code:: text - - subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_d0 - - .. code:: text - - subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_d1 - - .. code:: text - - subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_d2 - - .. code:: text - - subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_m0 - - .. code:: text - - subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_m1 - - .. code:: text - - subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_m2 - - .. code:: text - - subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_mask_phase - - .. code:: text - - subroutine get_mask_phase(det1, pm, Nint) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: get_phase_bi - - .. code:: text - - double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2, Nint) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: make_selection_buffer_s2 - - .. code:: text - - subroutine make_selection_buffer_s2(b) - - File: :file:`selection_buffer.irp.f` - - - - - - - -.. c:function:: merge_selection_buffers - - .. code:: text - - subroutine merge_selection_buffers(b1, b2) - - File: :file:`selection_buffer.irp.f` - - Merges the selection buffers b1 and b2 into b2 - - - - - -.. c:function:: past_d1 - - .. code:: text - - subroutine past_d1(bannedOrb, p) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: past_d2 - - .. code:: text - - subroutine past_d2(banned, p, sp) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: pt2 - - .. code:: text - - subroutine pt2 - - File: :file:`pt2.irp.f` - - Second order perturbative correction to the wave function contained in the EZFIO directory. - - - - - -.. c:function:: pt2_collector - - .. code:: text - - subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, variance, norm) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: pt2_find_sample - - .. code:: text - - integer function pt2_find_sample(v, w) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: pt2_find_sample_lr - - .. code:: text - - integer function pt2_find_sample_lr(v, w, l_in, r_in) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: pt2_slave_inproc - - .. code:: text - - subroutine pt2_slave_inproc(i) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: pull_pt2_results - - .. code:: text - - subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks) - - File: :file:`run_pt2_slave.irp.f` - - - - - - - -.. c:function:: pull_selection_results - - .. code:: text - - subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det, N, task_id, ntask) - - File: :file:`run_selection_slave.irp.f` - - - - - - - -.. c:function:: push_pt2_results - - .. code:: text - - subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, task_id, n_tasks) - - File: :file:`run_pt2_slave.irp.f` - - - - - - - -.. c:function:: push_selection_results - - .. code:: text - - subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_id, ntask) - - File: :file:`run_selection_slave.irp.f` - - - - - - - -.. c:function:: run_pt2_slave - - .. code:: text - - subroutine run_pt2_slave(thread,iproc,energy) - - File: :file:`run_pt2_slave.irp.f` - - - - - - - -.. c:function:: run_selection_slave - - .. code:: text - - subroutine run_selection_slave(thread,iproc,energy) - - File: :file:`run_selection_slave.irp.f` - - - - - - - -.. c:function:: select_connected - - .. code:: text - - subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: select_singles_and_doubles - - .. code:: text - - subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,buf,subset,csubset) - - File: :file:`selection.irp.f` - - WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted - - - - - -.. c:function:: selection_collector - - .. code:: text - - subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm) - - File: :file:`zmq_selection.irp.f` - - - - - - - -.. c:function:: selection_slave_inproc - - .. code:: text - - subroutine selection_slave_inproc(i) - - File: :file:`zmq_selection.irp.f` - - - - - - - -.. c:function:: sort_selection_buffer - - .. code:: text - - subroutine sort_selection_buffer(b) - - File: :file:`selection_buffer.irp.f` - - - - - - - -.. c:function:: splash_pq - - .. code:: text - - subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: spot_isinwf - - .. code:: text - - subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) - - File: :file:`selection.irp.f` - - - - - - - -.. c:function:: testteethbuilding - - .. code:: text - - logical function testTeethBuilding(minF, N) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: zmq_pt2 - - .. code:: text - - subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm) - - File: :file:`pt2_stoch_routines.irp.f` - - - - - - - -.. c:function:: zmq_selection - - .. code:: text - - subroutine ZMQ_selection(N_in, pt2, variance, norm) - - File: :file:`zmq_selection.irp.f` - - - - diff --git a/docs/source/modules/generators_cas.rst b/docs/source/modules/generators_cas.rst deleted file mode 100644 index a00b7a01..00000000 --- a/docs/source/modules/generators_cas.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. _generators_cas: - -.. program:: generators_cas - -.. default-role:: option - -============== -generators_cas -============== - -Module defining the generator determinants as those belonging to a |CAS|. -The |MOs| belonging to the |CAS| are those which were set as active with -the :ref:`qp_set_mo_class` command. - -This module is intended to be included in the :file:`NEED` file to define -the generators as the |CAS| determinants, which can be useful to define post-CAS approaches (see cassd module for instance). - - - diff --git a/docs/source/modules/generators_full.rst b/docs/source/modules/generators_full.rst deleted file mode 100644 index 90b32a98..00000000 --- a/docs/source/modules/generators_full.rst +++ /dev/null @@ -1,145 +0,0 @@ -.. _generators_full: - -.. program:: generators_full - -.. default-role:: option - -=============== -generators_full -=============== - -Module defining the generator determinants as all the determinants of the -variational space. - -This module is intended to be included in the :file:`NEED` file to define -a full set of generators. - - - -Providers ---------- - - -.. c:var:: degree_max_generators - - .. code:: text - - integer :: degree_max_generators - - File: :file:`generators.irp.f` - - Max degree of excitation (respect to HF) of the generators - - - - -.. c:var:: n_det_generators - - .. code:: text - - integer :: n_det_generators - - File: :file:`generators.irp.f` - - For Single reference wave functions, the number of generators is 1 : the Hartree-Fock determinant - - - - -.. c:var:: psi_coef_generators - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) - - File: :file:`generators.irp.f` - - For Single reference wave functions, the generator is the Hartree-Fock determinant - - - - -.. c:var:: psi_coef_sorted_gen - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) - integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) - - File: :file:`generators.irp.f` - - For Single reference wave functions, the generator is the Hartree-Fock determinant - - - - -.. c:var:: psi_det_generators - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) - - File: :file:`generators.irp.f` - - For Single reference wave functions, the generator is the Hartree-Fock determinant - - - - -.. c:var:: psi_det_sorted_gen - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) - integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) - - File: :file:`generators.irp.f` - - For Single reference wave functions, the generator is the Hartree-Fock determinant - - - - -.. c:var:: psi_det_sorted_gen_order - - .. code:: text - - integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) - double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) - integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) - - File: :file:`generators.irp.f` - - For Single reference wave functions, the generator is the Hartree-Fock determinant - - - - -.. c:var:: select_max - - .. code:: text - - double precision, allocatable :: select_max (size_select_max) - - File: :file:`generators.irp.f` - - Memo to skip useless selectors - - - - -.. c:var:: size_select_max - - .. code:: text - - integer :: size_select_max - - File: :file:`generators.irp.f` - - Size of the select_max array - - diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst deleted file mode 100644 index 7ca55dfe..00000000 --- a/docs/source/modules/hartree_fock.rst +++ /dev/null @@ -1,233 +0,0 @@ -.. _hartree_fock: - -.. program:: hartree_fock - -.. default-role:: option - -============ -hartree_fock -============ - - -The Hartree-Fock module performs *Restricted* Hartree-Fock calculations (the -spatial part of the |MOs| is common for alpha and beta spinorbitals). - -The Hartree-Fock in an SCF and therefore is based on the ``scf_utils`` structure. -It performs the following actions: - -#. Compute/Read all the one- and two-electron integrals, and store them in memory - -#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it - will read them as initial guess. Otherwise, it will create a guess. -#. Perform the |SCF| iterations - -The definition of the Fock matrix is in :file:`hartree_fock fock_matrix_hf.irp.f` -For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. -The main are: - -# :option:`scf_utils thresh_scf` - -# :option:`scf_utils level_shift` - -At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation -crashes for any unexpected reason, the calculation can be restarted by running again -the |SCF| with the same |EZFIO| database. - -The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. -If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. - -To start a calculation from scratch, the simplest way is to remove the -``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. - - - - -.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS -.. _level-shifting: https://doi.org/10.1002/qua.560070407 - - - - - - -EZFIO parameters ----------------- - -.. option:: energy - - Energy HF - - - -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 - - double precision :: hf_energy - double precision :: hf_two_electron_energy - double precision :: hf_one_electron_energy - - File: :file:`hf_energy.irp.f` - - Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. - - - - -.. c:var:: hf_one_electron_energy - - .. code:: text - - double precision :: hf_energy - double precision :: hf_two_electron_energy - double precision :: hf_one_electron_energy - - File: :file:`hf_energy.irp.f` - - Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. - - - - -.. c:var:: hf_two_electron_energy - - .. code:: text - - double precision :: hf_energy - double precision :: hf_two_electron_energy - double precision :: hf_one_electron_energy - - File: :file:`hf_energy.irp.f` - - Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. - - - - -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 - - subroutine scf - - File: :file:`scf.irp.f` - - Produce `Hartree_Fock` |MOs| - - output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ - - output: hartree_fock.energy - - optional: mo_basis.mo_coef - - diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst deleted file mode 100644 index 0f192da4..00000000 --- a/docs/source/modules/iterations.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. _iterations: - -.. program:: iterations - -.. default-role:: option - -========== -iterations -========== - -Module which saves the computed energies for an extrapolation to -the |FCI| limit. - - - -EZFIO parameters ----------------- - -.. option:: n_iter - - Number of saved iterations - - Default: 1 - -.. option:: n_det_iterations - - Number of determinants at each iteration - - -.. option:: energy_iterations - - The variational energy at each iteration - - -.. option:: pt2_iterations - - The |PT2| correction at each iteration - - - -Providers ---------- - - -.. c:var:: extrapolated_energy - - .. code:: text - - double precision, allocatable :: extrapolated_energy (N_iter,N_states) - - File: :file:`iterations.irp.f` - - Extrapolated energy, using E_var = f(PT2) where PT2=0 - - - - -.. c:var:: n_iter - - .. code:: text - - integer :: n_iter - - File: :file:`io.irp.f` - - number of iterations - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: print_extrapolated_energy - - .. code:: text - - subroutine print_extrapolated_energy(e_,pt2_) - - File: :file:`print_extrapolation.irp.f` - - Print the extrapolated energy in the output - - - - - -.. c:function:: print_summary - - .. code:: text - - subroutine print_summary(e_,pt2_,error_,variance_,norm_) - - File: :file:`print_summary.irp.f` - - Print the extrapolated energy in the output - - - - - -.. c:function:: save_iterations - - .. code:: text - - subroutine save_iterations(e_, pt2_,n_) - - File: :file:`iterations.irp.f` - - Update the energy in the EZFIO file. - - diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst deleted file mode 100644 index 4710a3d8..00000000 --- a/docs/source/modules/kohn_sham.rst +++ /dev/null @@ -1,87 +0,0 @@ -.. _kohn_sham: - -.. program:: kohn_sham - -.. default-role:: option - -========= -kohn_sham -========= - - -The Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the -spatial part of the |MOs| is common for alpha and beta spinorbitals). - -The Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. -It performs the following actions: - -#. Compute/Read all the one- and two-electron integrals, and store them in memory -#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it - will read them as initial guess. Otherwise, it will create a guess. -#. Perform the |SCF| iterations - -The definition of the Fock matrix is in :file:`kohn_sham fock_matrix_ks.irp.f` -For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. -The main are: - -#. :option:`scf_utils thresh_scf` -#. :option:`scf_utils level_shift` - -At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation -crashes for any unexpected reason, the calculation can be restarted by running again -the |SCF| with the same |EZFIO| database. - -The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. -If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. - -To start a calculation from scratch, the simplest way is to remove the -``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. - - - - -.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS -.. _level-shifting: https://doi.org/10.1002/qua.560070407 - - - - - - -Providers ---------- - - -.. 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. - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: srs_ks_cf - - .. code:: text - - subroutine srs_ks_cf - - File: :file:`ks_scf.irp.f` - - Produce `Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef - - diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst deleted file mode 100644 index ca51ab5b..00000000 --- a/docs/source/modules/kohn_sham_rs.rst +++ /dev/null @@ -1,259 +0,0 @@ -.. _kohn_sham_rs: - -.. program:: kohn_sham_rs - -.. default-role:: option - -============ -kohn_sham_rs -============ - - -The Range-separated Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the -spatial part of the |MOs| is common for alpha and beta spinorbitals) where the coulomb interaction is partially treated using exact exchange. -The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_ints mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals. - -The Range-separated Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. -It performs the following actions: - -#. Compute/Read all the one- and two-electron integrals, and store them in memory -#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it - will read them as initial guess. Otherwise, it will create a guess. -#. Perform the |SCF| iterations - -The definition of the Fock matrix is in :file:`kohn_sham_rs fock_matrix_rs_ks.irp.f` -For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. -The main are: -# :option:`scf_utils thresh_scf` -# :option:`scf_utils level_shift` - - -At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation -crashes for any unexpected reason, the calculation can be restarted by running again -the |SCF| with the same |EZFIO| database. - -The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. -If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. - -To start a calculation from scratch, the simplest way is to remove the -``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. - - -.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS -.. _level-shifting: https://doi.org/10.1002/qua.560070407 - - - - - - -EZFIO parameters ----------------- - -.. option:: energy - - Energy range separated hybrid - - - -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 - - 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:: 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 - - subroutine rs_ks_scf - - File: :file:`rs_ks_scf.irp.f` - - Produce `Range_separated_Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef - - diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst deleted file mode 100644 index bf647f5c..00000000 --- a/docs/source/modules/mo_basis.rst +++ /dev/null @@ -1,370 +0,0 @@ -.. _mo_basis: - -.. program:: mo_basis - -.. default-role:: option - -======== -mo_basis -======== - -Molecular orbitals are expressed as - -.. math:: - - \phi_k({\bf r}) = \sum_i C_{ik} \chi_k({\bf r}) - - -where :math:`\chi_k` are *normalized* atomic basis functions. - -The current set of |MOs| has a label `mo_label`. -When the orbitals are modified, the label should also be updated to keep -everything consistent. - -When saving the |MOs|, the :file:`mo_basis` directory of the |EZFIO| database -is copied in the :file:`save` directory, named by the current `mo_label`. All -this is done with the script named :file:`save_current_mos.sh` in the -:file:`$QP_ROOT/scripts` directory. - - - - - - -EZFIO parameters ----------------- - -.. option:: mo_num - - Total number of |MOs| - - -.. option:: mo_coef - - Coefficient of the i-th |AO| on the j-th |MO| - - -.. option:: mo_label - - Label characterizing the MOS (Local, Canonical, Natural, *etc*) - - -.. option:: mo_occ - - |MO| occupation numbers - - -.. option:: mo_class - - [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class` - - -.. option:: ao_md5 - - MD5 checksum characterizing the |AO| basis set. - - - -Providers ---------- - - -.. c:var:: mo_coef - - .. code:: text - - double precision, allocatable :: mo_coef (ao_num,mo_num) - - File: :file:`mos.irp.f` - - Molecular orbital coefficients on |AO| basis set - - mo_coef(i,j) = coefficient of the i-th |AO| on the jth mo - - mo_label : Label characterizing the MOS (local, canonical, natural, etc) - - - - -.. c:var:: mo_coef_begin_iteration - - .. code:: text - - double precision, allocatable :: mo_coef_begin_iteration (ao_num,mo_num) - - File: :file:`track_orb.irp.f` - - Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration - - Usefull to track some orbitals - - - - -.. c:var:: mo_coef_in_ao_ortho_basis - - .. code:: text - - double precision, allocatable :: mo_coef_in_ao_ortho_basis (ao_num,mo_num) - - File: :file:`mos.irp.f` - - |MO| coefficients in orthogonalized |AO| basis - - :math:`C^{-1}.C_{mo}` - - - - -.. c:var:: mo_coef_transp - - .. code:: text - - double precision, allocatable :: mo_coef_transp (mo_num,ao_num) - - File: :file:`mos.irp.f` - - |MO| coefficients on |AO| basis set - - - - -.. c:var:: mo_label - - .. code:: text - - character*(64) :: mo_label - - File: :file:`mos.irp.f` - - |MO| coefficients on |AO| basis set - - mo_coef(i,j) = coefficient of the i-th |AO| on the j-th |MO| - - mo_label : Label characterizing the |MOs| (local, canonical, natural, etc) - - - - -.. c:var:: mo_num - - .. code:: text - - integer :: mo_num - - File: :file:`mos.irp.f` - - Number of MOs - - - - -.. c:var:: mo_occ - - .. code:: text - - double precision, allocatable :: mo_occ (mo_num) - - File: :file:`mos.irp.f` - - |MO| occupation numbers - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: ao_ortho_cano_to_ao - - .. code:: text - - subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA) - - File: :file:`mos.irp.f` - - Transform A from the |AO| basis to the orthogonal |AO| basis - - :math:`C^{-1}.A_{ao}.C^{\dagger-1}` - - - - - -.. c:function:: ao_to_mo - - .. code:: text - - subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) - - File: :file:`mos.irp.f` - - Transform A from the |AO| basis to the |MO| basis - - :math:`C^\dagger.A_{ao}.C` - - - - - -.. c:function:: give_all_mos_and_grad_and_lapl_at_r - - .. code:: text - - subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array) - - File: :file:`mos_in_r.irp.f` - - - - - - - -.. c:function:: give_all_mos_and_grad_at_r - - .. code:: text - - subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array) - - File: :file:`mos_in_r.irp.f` - - - - - - - -.. c:function:: give_all_mos_at_r - - .. code:: text - - subroutine give_all_mos_at_r(r,mos_array) - - File: :file:`mos_in_r.irp.f` - - - - - - - -.. c:function:: initialize_mo_coef_begin_iteration - - .. code:: text - - subroutine initialize_mo_coef_begin_iteration - - File: :file:`track_orb.irp.f` - - - - Initialize :c:data:`mo_coef_begin_iteration` to the current :c:data:`mo_coef` - - - - - -.. c:function:: mix_mo_jk - - .. code:: text - - subroutine mix_mo_jk(j,k) - - File: :file:`mos.irp.f` - - Rotates the j-th |MO| with the k-th |MO| to give two new |MOs| that are - - * :math:`+ = \frac{1}{\sqrt{2}} (|j\rangle + |k\rangle)` - - * :math:`- = \frac{1}{\sqrt{2}} (|j\rangle - |k\rangle)` - - by convention, the '+' |MO| is in the lowest index (min(j,k)) by convention, the '-' |MO| is in the highest index (max(j,k)) - - - - - -.. c:function:: mo_as_eigvectors_of_mo_matrix - - .. code:: text - - subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output) - - File: :file:`utils.irp.f` - - - - - - - -.. c:function:: mo_as_svd_vectors_of_mo_matrix - - .. code:: text - - subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) - - File: :file:`utils.irp.f` - - - - - - - -.. c:function:: mo_as_svd_vectors_of_mo_matrix_eig - - .. code:: text - - subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) - - File: :file:`utils.irp.f` - - - - - - - -.. c:function:: reorder_active_orb - - .. code:: text - - subroutine reorder_active_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` - - - - - -.. c:function:: save_mos - - .. code:: text - - subroutine save_mos - - File: :file:`utils.irp.f` - - - - - - - -.. c:function:: save_mos_truncated - - .. code:: text - - subroutine save_mos_truncated(n) - - File: :file:`utils.irp.f` - - - - diff --git a/docs/source/modules/mo_guess.rst b/docs/source/modules/mo_guess.rst deleted file mode 100644 index 24dc1476..00000000 --- a/docs/source/modules/mo_guess.rst +++ /dev/null @@ -1,87 +0,0 @@ -.. _mo_guess: - -.. program:: mo_guess - -.. default-role:: option - -======== -mo_guess -======== - -Guess for |MOs|. - - - - -Providers ---------- - - -.. c:var:: ao_ortho_canonical_nucl_elec_integrals - - .. code:: text - - double precision, allocatable :: ao_ortho_canonical_nucl_elec_integrals (mo_num,mo_num) - - File: :file:`pot_mo_ortho_canonical_ints.irp.f` - - - - - - -.. c:var:: ao_ortho_lowdin_coef - - .. code:: text - - double precision, allocatable :: ao_ortho_lowdin_coef (ao_num,ao_num) - - File: :file:`mo_ortho_lowdin.irp.f` - - matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_lowdin_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_lowdin orbital - - - - -.. c:var:: ao_ortho_lowdin_nucl_elec_integrals - - .. code:: text - - double precision, allocatable :: ao_ortho_lowdin_nucl_elec_integrals (mo_num,mo_num) - - File: :file:`pot_mo_ortho_lowdin_ints.irp.f` - - - - - - -.. c:var:: ao_ortho_lowdin_overlap - - .. code:: text - - double precision, allocatable :: ao_ortho_lowdin_overlap (ao_num,ao_num) - - File: :file:`mo_ortho_lowdin.irp.f` - - overlap matrix of the ao_ortho_lowdin supposed to be the Identity - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: hcore_guess - - .. code:: text - - subroutine hcore_guess - - File: :file:`h_core_guess_routine.irp.f` - - Produce `H_core` MO orbital - - diff --git a/docs/source/modules/mo_one_e_ints.rst b/docs/source/modules/mo_one_e_ints.rst deleted file mode 100644 index 167b62c8..00000000 --- a/docs/source/modules/mo_one_e_ints.rst +++ /dev/null @@ -1,287 +0,0 @@ -.. _mo_one_e_ints: - -.. program:: mo_one_e_ints - -.. default-role:: option - -================== -mo_one_e_integrals -================== - -All the one-electron integrals in |MO| basis are defined here. - -The most important providers for usual quantum-chemistry calculation are: - -* `mo_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`) -* `mo_integrals_n_e` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`) -* `mo_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`) - -Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`. - - - -EZFIO parameters ----------------- - -.. option:: mo_integrals_e_n - - Nucleus-electron integrals in |MO| basis set - - -.. option:: io_mo_integrals_e_n - - Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: mo_integrals_kinetic - - Kinetic energy integrals in |MO| basis set - - -.. option:: io_mo_integrals_kinetic - - Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: mo_integrals_pseudo - - Pseudopotential integrals in |MO| basis set - - -.. option:: io_mo_integrals_pseudo - - Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: mo_one_e_integrals - - One-electron integrals in |MO| basis set - - -.. option:: io_mo_one_e_integrals - - Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] - - Default: None - - -Providers ---------- - - -.. c:var:: mo_dipole_x - - .. code:: text - - double precision, allocatable :: mo_dipole_x (mo_num,mo_num) - double precision, allocatable :: mo_dipole_y (mo_num,mo_num) - double precision, allocatable :: mo_dipole_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j - - - - -.. c:var:: mo_dipole_y - - .. code:: text - - double precision, allocatable :: mo_dipole_x (mo_num,mo_num) - double precision, allocatable :: mo_dipole_y (mo_num,mo_num) - double precision, allocatable :: mo_dipole_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j - - - - -.. c:var:: mo_dipole_z - - .. code:: text - - double precision, allocatable :: mo_dipole_x (mo_num,mo_num) - double precision, allocatable :: mo_dipole_y (mo_num,mo_num) - double precision, allocatable :: mo_dipole_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j - - - - -.. c:var:: mo_integrals_n_e - - .. code:: text - - double precision, allocatable :: mo_integrals_n_e (mo_num,mo_num) - - File: :file:`pot_mo_ints.irp.f` - - Nucleus-electron interaction on the |MO| basis - - - - -.. c:var:: mo_integrals_n_e_per_atom - - .. code:: text - - double precision, allocatable :: mo_integrals_n_e_per_atom (mo_num,mo_num,nucl_num) - - File: :file:`pot_mo_ints.irp.f` - - mo_integrals_n_e_per_atom(i,j,k) = :math:`\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle` . where R_k is the coordinate of the k-th nucleus. - - - - -.. c:var:: mo_kinetic_integrals - - .. code:: text - - double precision, allocatable :: mo_kinetic_integrals (mo_num,mo_num) - - File: :file:`kin_mo_ints.irp.f` - - Kinetic energy integrals in the MO basis - - - - -.. c:var:: mo_one_e_integrals - - .. code:: text - - double precision, allocatable :: mo_one_e_integrals (mo_num,mo_num) - - File: :file:`mo_one_e_ints.irp.f` - - array of the mono electronic hamiltonian on the MOs basis : sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) - - - - -.. c:var:: mo_overlap - - .. code:: text - - double precision, allocatable :: mo_overlap (mo_num,mo_num) - - File: :file:`mo_overlap.irp.f` - - Provider to check that the MOs are indeed orthonormal. - - - - -.. c:var:: mo_pseudo_integrals - - .. code:: text - - double precision, allocatable :: mo_pseudo_integrals (mo_num,mo_num) - - File: :file:`pot_mo_pseudo_ints.irp.f` - - Pseudopotential integrals in |MO| basis - - - - -.. c:var:: mo_spread_x - - .. code:: text - - double precision, allocatable :: mo_spread_x (mo_num,mo_num) - double precision, allocatable :: mo_spread_y (mo_num,mo_num) - double precision, allocatable :: mo_spread_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j - - - - -.. c:var:: mo_spread_y - - .. code:: text - - double precision, allocatable :: mo_spread_x (mo_num,mo_num) - double precision, allocatable :: mo_spread_y (mo_num,mo_num) - double precision, allocatable :: mo_spread_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j - - - - -.. c:var:: mo_spread_z - - .. code:: text - - double precision, allocatable :: mo_spread_x (mo_num,mo_num) - double precision, allocatable :: mo_spread_y (mo_num,mo_num) - double precision, allocatable :: mo_spread_z (mo_num,mo_num) - - File: :file:`spread_dipole_mo.irp.f` - - array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j - - - - -.. c:var:: s_mo_coef - - .. code:: text - - double precision, allocatable :: s_mo_coef (ao_num,mo_num) - - File: :file:`ao_to_mo.irp.f` - - Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: mo_to_ao - - .. code:: text - - subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) - - File: :file:`ao_to_mo.irp.f` - - Transform A from the MO basis to the AO basis - - (S.C).A_mo.(S.C)t - - - - - -.. c:function:: orthonormalize_mos - - .. code:: text - - subroutine orthonormalize_mos - - File: :file:`orthonormalize.irp.f` - - - - diff --git a/docs/source/modules/mo_two_e_erf_ints.rst b/docs/source/modules/mo_two_e_erf_ints.rst deleted file mode 100644 index 12f7c130..00000000 --- a/docs/source/modules/mo_two_e_erf_ints.rst +++ /dev/null @@ -1,488 +0,0 @@ -.. _mo_two_e_erf_ints: - -.. program:: mo_two_e_erf_ints - -.. default-role:: option - -====================== -mo_two_e_erf_ints -====================== - -Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed. -As they have 4 indices and many are zero, they are stored in a map, as defined -in :file:`Utils/map_module.f90`. - -The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_ints mu_erf`. - -To fetch an |MO| integral, use -`get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_map_erf)` - -The conventions are: - -* For |MO| integrals : = <12|12> - -Be aware that it might not be the same conventions for |MO| and |AO| integrals. - - - - - -EZFIO parameters ----------------- - -.. option:: io_mo_two_e_integrals_erf - - Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ] - - Default: None - - -Providers ---------- - - -.. c:var:: core_energy_erf - - .. code:: text - - double precision :: core_energy_erf - - File: :file:`core_quantities_erf.irp.f` - - energy from the core : contains all core-core contributionswith the erf interaction - - - - -.. c:var:: core_fock_operator_erf - - .. code:: text - - double precision, allocatable :: core_fock_operator_erf (mo_num,mo_num) - - File: :file:`core_quantities_erf.irp.f` - - this is the contribution to the Fock operator from the core electrons with the erf interaction - - - - -.. c:var:: insert_into_mo_integrals_erf_map - - .. code:: text - - subroutine insert_into_mo_integrals_erf_map(n_integrals, & - buffer_i, buffer_values, thr) - - File: :file:`map_integrals_erf.irp.f` - - Create new entry into |MO| map, or accumulate in an existing entry - - - - -.. c:var:: int_erf_3_index - - .. code:: text - - double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) - double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) - - File: :file:`ints_erf_3_index.irp.f` - - int_erf_3_index(i,j) = = (ii|jj) with the erf interaction - - int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction - - - - -.. c:var:: int_erf_3_index_exc - - .. code:: text - - double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) - double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) - - File: :file:`ints_erf_3_index.irp.f` - - int_erf_3_index(i,j) = = (ii|jj) with the erf interaction - - int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction - - - - -.. c:var:: mo_integrals_erf_cache - - .. code:: text - - double precision, allocatable :: mo_integrals_erf_cache (0:64*64*64*64) - - File: :file:`map_integrals_erf.irp.f` - - Cache of |MO| integrals for fast access - - - - -.. c:var:: mo_integrals_erf_cache_max - - .. code:: text - - integer :: mo_integrals_erf_cache_min - integer :: mo_integrals_erf_cache_max - - File: :file:`map_integrals_erf.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_erf_cache_min - - .. code:: text - - integer :: mo_integrals_erf_cache_min - integer :: mo_integrals_erf_cache_max - - File: :file:`map_integrals_erf.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_erf_map - - .. code:: text - - type(map_type) :: mo_integrals_erf_map - - File: :file:`map_integrals_erf.irp.f` - - |MO| integrals - - - - -.. c:var:: mo_two_e_int_erf_jj - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_int_erf_jj_anti - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_int_erf_jj_anti_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_int_erf_jj_exchange - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_int_erf_jj_exchange_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_int_erf_jj_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals_erf.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_erf_in_map - - .. code:: text - - logical :: mo_two_e_integrals_erf_in_map - - File: :file:`mo_bi_integrals_erf.irp.f` - - If True, the map of MO two-electron integrals is provided - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: add_integrals_to_map_erf - - .. code:: text - - subroutine add_integrals_to_map_erf(mask_ijkl) - - File: :file:`mo_bi_integrals_erf.irp.f` - - Adds integrals to tha MO map according to some bitmask - - - - - -.. c:function:: clear_mo_erf_map - - .. code:: text - - subroutine clear_mo_erf_map - - File: :file:`mo_bi_integrals_erf.irp.f` - - Frees the memory of the MO map - - - - - -.. c:function:: get_mo_erf_map_size - - .. code:: text - - integer*8 function get_mo_erf_map_size() - - File: :file:`map_integrals_erf.irp.f` - - Returns the number of elements in the |MO| map - - - - - -.. c:function:: get_mo_two_e_integral_erf - - .. code:: text - - double precision function get_mo_two_e_integral_erf(i,j,k,l,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis - - - - - -.. c:function:: get_mo_two_e_integrals_erf - - .. code:: text - - subroutine get_mo_two_e_integrals_erf(j,k,l,sze,out_val,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all i for j,k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_erf_coulomb_ii - - .. code:: text - - subroutine get_mo_two_e_integrals_erf_coulomb_ii(k,l,sze,out_val,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns multiple integrals :math:`\langle ki|li \rangle` - - k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_erf_exch_ii - - .. code:: text - - subroutine get_mo_two_e_integrals_erf_exch_ii(k,l,sze,out_val,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns multiple integrals :math:`\langle ki|il \rangle` - - :math:`\int k(1)i(2) \frac{1}{r_{12}} i(1)l(2)` :: out_val(i1) for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_erf_i1j1 - - .. code:: text - - subroutine get_mo_two_e_integrals_erf_i1j1(k,l,sze,out_array,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns multiple integrals :math:`\langle ik|jl \rangle` in the |MO| basis, all :math:`\int i(1)j(1) \frac{\erf(\mu * r_{12})}{r_{12}} k(2)l(2)` i, j for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_erf_ij - - .. code:: text - - subroutine get_mo_two_e_integrals_erf_ij(k,l,sze,out_array,map) - - File: :file:`map_integrals_erf.irp.f` - - Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all :math:`\int i(1)j(2) \frac{1}{r_{12}} k(1)l(2)` i, j for k,l fixed. - - - - - -.. c:function:: load_mo_integrals_erf - - .. code:: text - - integer function load_mo_integrals_erf(filename) - - File: :file:`map_integrals_erf.irp.f` - - Read from disk the |MO| erf integrals - - - - - -.. c:function:: mo_two_e_integral_erf - - .. code:: text - - double precision function mo_two_e_integral_erf(i,j,k,l) - - File: :file:`map_integrals_erf.irp.f` - - Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis - - - - - -.. c:function:: mo_two_e_integrals_erf_index - - .. code:: text - - subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1) - - File: :file:`mo_bi_integrals_erf.irp.f` - - Computes an unique index for i,j,k,l integrals - - - - - -.. c:function:: provide_all_mo_integrals_erf - - .. code:: text - - subroutine provide_all_mo_integrals_erf - - File: :file:`mo_bi_integrals_erf.irp.f` - - - - - - - -.. c:function:: save_erf_two_e_integrals_mo - - .. code:: text - - subroutine save_erf_two_e_integrals_mo - - File: :file:`routines_save_integrals_erf.irp.f` - - - - - - - -.. c:function:: save_erf_two_e_ints_mo_into_ints_mo - - .. code:: text - - subroutine save_erf_two_e_ints_mo_into_ints_mo - - File: :file:`routines_save_integrals_erf.irp.f` - - - - diff --git a/docs/source/modules/mo_two_e_ints.rst b/docs/source/modules/mo_two_e_ints.rst deleted file mode 100644 index 2dfdf1b4..00000000 --- a/docs/source/modules/mo_two_e_ints.rst +++ /dev/null @@ -1,590 +0,0 @@ -.. _mo_two_e_ints: - -.. program:: mo_two_e_ints - -.. default-role:: option - -================== -mo_two_e_ints -================== - -Here, all two-electron integrals (:math:`1/r_{12}`) are computed. -As they have 4 indices and many are zero, they are stored in a map, as defined -in :file:`Utils/map_module.f90`. - -To fetch an |AO| integral, use the -`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function, and -to fetch an |MO| integral, use -`get_two_e_integral(i,j,k,l,mo_integrals_map)` or -`mo_two_e_integral(i,j,k,l)`. - -The conventions are: - -* For |AO| integrals : (ik|jl) = (11|22) -* For |MO| integrals : = <12|12> - - - - - - -EZFIO parameters ----------------- - -.. option:: io_mo_two_e_integrals - - Read/Write |MO| integrals from/to disk [ Write | Read | None ] - - Default: None - -.. option:: mo_integrals_threshold - - If | | < `mo_integrals_threshold` then is zero - - Default: 1.e-15 - -.. option:: no_vvvv_integrals - - If `True`, computes all integrals except for the integrals having 4 virtual indices - - Default: False - -.. option:: no_ivvv_integrals - - Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual indices and 1 belonging to the core inactive active orbitals - - Default: False - -.. option:: no_vvv_integrals - - Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual orbitals - - Default: False - - -Providers ---------- - - -.. c:var:: big_array_coulomb_integrals - - .. code:: text - - double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) - double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) - - File: :file:`integrals_3_index.irp.f` - - big_array_coulomb_integrals(i,j) = = (ii|jj) - - big_array_exchange_integrals(i,j) = = (ij|ij) - - - - -.. c:var:: big_array_exchange_integrals - - .. code:: text - - double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) - double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) - - File: :file:`integrals_3_index.irp.f` - - big_array_coulomb_integrals(i,j) = = (ii|jj) - - big_array_exchange_integrals(i,j) = = (ij|ij) - - - - -.. c:var:: core_energy - - .. code:: text - - double precision :: core_energy - - File: :file:`core_quantities.irp.f` - - energy from the core : contains all core-core contributions - - - - -.. c:var:: core_fock_operator - - .. code:: text - - double precision, allocatable :: core_fock_operator (mo_num,mo_num) - - File: :file:`core_quantities.irp.f` - - this is the contribution to the Fock operator from the core electrons - - - - -.. c:var:: insert_into_mo_integrals_map - - .. code:: text - - subroutine insert_into_mo_integrals_map(n_integrals, & - buffer_i, buffer_values, thr) - - File: :file:`map_integrals.irp.f` - - Create new entry into MO map, or accumulate in an existing entry - - - - -.. c:var:: mo_integrals_cache - - .. code:: text - - double precision, allocatable :: mo_integrals_cache (0_8:128_8*128_8*128_8*128_8) - - File: :file:`map_integrals.irp.f` - - Cache of MO integrals for fast access - - - - -.. c:var:: mo_integrals_cache_max - - .. code:: text - - integer*4 :: mo_integrals_cache_min - integer*4 :: mo_integrals_cache_max - integer*8 :: mo_integrals_cache_min_8 - integer*8 :: mo_integrals_cache_max_8 - - File: :file:`map_integrals.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_cache_max_8 - - .. code:: text - - integer*4 :: mo_integrals_cache_min - integer*4 :: mo_integrals_cache_max - integer*8 :: mo_integrals_cache_min_8 - integer*8 :: mo_integrals_cache_max_8 - - File: :file:`map_integrals.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_cache_min - - .. code:: text - - integer*4 :: mo_integrals_cache_min - integer*4 :: mo_integrals_cache_max - integer*8 :: mo_integrals_cache_min_8 - integer*8 :: mo_integrals_cache_max_8 - - File: :file:`map_integrals.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_cache_min_8 - - .. code:: text - - integer*4 :: mo_integrals_cache_min - integer*4 :: mo_integrals_cache_max - integer*8 :: mo_integrals_cache_min_8 - integer*8 :: mo_integrals_cache_max_8 - - File: :file:`map_integrals.irp.f` - - Min and max values of the MOs for which the integrals are in the cache - - - - -.. c:var:: mo_integrals_map - - .. code:: text - - type(map_type) :: mo_integrals_map - - File: :file:`map_integrals.irp.f` - - MO integrals - - - - -.. c:var:: mo_two_e_integral_jj_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_in_map - - .. code:: text - - logical :: mo_two_e_integrals_in_map - - File: :file:`mo_bi_integrals.irp.f` - - If True, the map of MO two-electron integrals is provided - - - - -.. c:var:: mo_two_e_integrals_jj - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_jj_anti - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_jj_anti_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_jj_exchange - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_jj_exchange_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij - - - - -.. c:var:: mo_two_e_integrals_vv_anti_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals - - - - -.. c:var:: mo_two_e_integrals_vv_exchange_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals - - - - -.. c:var:: mo_two_e_integrals_vv_from_ao - - .. code:: text - - double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) - double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) - - File: :file:`mo_bi_integrals.irp.f` - - mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: add_integrals_to_map - - .. code:: text - - subroutine add_integrals_to_map(mask_ijkl) - - File: :file:`mo_bi_integrals.irp.f` - - Adds integrals to tha MO map according to some bitmask - - - - - -.. c:function:: add_integrals_to_map_no_exit_34 - - .. code:: text - - subroutine add_integrals_to_map_no_exit_34(mask_ijkl) - - File: :file:`mo_bi_integrals.irp.f` - - Adds integrals to tha MO map according to some bitmask - - - - - -.. c:function:: add_integrals_to_map_three_indices - - .. code:: text - - subroutine add_integrals_to_map_three_indices(mask_ijk) - - File: :file:`mo_bi_integrals.irp.f` - - Adds integrals to tha MO map according to some bitmask - - - - - -.. c:function:: clear_mo_map - - .. code:: text - - subroutine clear_mo_map - - File: :file:`mo_bi_integrals.irp.f` - - Frees the memory of the MO map - - - - - -.. c:function:: dump_mo_integrals - - .. code:: text - - subroutine dump_mo_integrals(filename) - - File: :file:`map_integrals.irp.f` - - Save to disk the |MO| integrals - - - - - -.. c:function:: get_mo_map_size - - .. code:: text - - integer*8 function get_mo_map_size() - - File: :file:`map_integrals.irp.f` - - Return the number of elements in the MO map - - - - - -.. c:function:: get_mo_two_e_integrals - - .. code:: text - - subroutine get_mo_two_e_integrals(j,k,l,sze,out_val,map) - - File: :file:`map_integrals.irp.f` - - Returns multiple integrals in the MO basis, all i for j,k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_coulomb_ii - - .. code:: text - - subroutine get_mo_two_e_integrals_coulomb_ii(k,l,sze,out_val,map) - - File: :file:`map_integrals.irp.f` - - Returns multiple integrals k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_exch_ii - - .. code:: text - - subroutine get_mo_two_e_integrals_exch_ii(k,l,sze,out_val,map) - - File: :file:`map_integrals.irp.f` - - Returns multiple integrals k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_i1j1 - - .. code:: text - - subroutine get_mo_two_e_integrals_i1j1(k,l,sze,out_array,map) - - File: :file:`map_integrals.irp.f` - - Returns multiple integrals in the MO basis, all i(1)j(1) 1/r12 k(2)l(2) i, j for k,l fixed. - - - - - -.. c:function:: get_mo_two_e_integrals_ij - - .. code:: text - - subroutine get_mo_two_e_integrals_ij(k,l,sze,out_array,map) - - File: :file:`map_integrals.irp.f` - - Returns multiple integrals in the MO basis, all i(1)j(2) 1/r12 k(1)l(2) i, j for k,l fixed. - - - - - -.. c:function:: get_two_e_integral - - .. code:: text - - double precision function get_two_e_integral(i,j,k,l,map) - - File: :file:`map_integrals.irp.f` - - Returns one integral in the MO basis - - - - - -.. c:function:: load_mo_integrals - - .. code:: text - - integer function load_mo_integrals(filename) - - File: :file:`map_integrals.irp.f` - - Read from disk the |MO| integrals - - - - - -.. c:function:: mo_two_e_integral - - .. code:: text - - double precision function mo_two_e_integral(i,j,k,l) - - File: :file:`map_integrals.irp.f` - - Returns one integral in the MO basis - - - - - -.. c:function:: mo_two_e_integrals_index - - .. code:: text - - subroutine mo_two_e_integrals_index(i,j,k,l,i1) - - File: :file:`mo_bi_integrals.irp.f` - - Computes an unique index for i,j,k,l integrals - - diff --git a/docs/source/modules/mpi.rst b/docs/source/modules/mpi.rst deleted file mode 100644 index d8c7290f..00000000 --- a/docs/source/modules/mpi.rst +++ /dev/null @@ -1,130 +0,0 @@ -.. _mpi: - -.. program:: mpi - -.. default-role:: option - -=== -mpi -=== - -Contains all the functions and providers for parallelization with |MPI|. - - - -Providers ---------- - - -.. c:var:: mpi_initialized - - .. code:: text - - logical :: mpi_initialized - - File: :file:`mpi.irp.f` - - Always true. Initialized MPI - - - - -.. c:var:: mpi_master - - .. code:: text - - logical :: mpi_master - - File: :file:`mpi.irp.f` - - If true, rank is zero - - - - -.. c:var:: mpi_rank - - .. code:: text - - integer :: mpi_rank - integer :: mpi_size - - File: :file:`mpi.irp.f` - - Rank of MPI process and number of MPI processes - - - - -.. c:var:: mpi_size - - .. code:: text - - integer :: mpi_rank - integer :: mpi_size - - File: :file:`mpi.irp.f` - - Rank of MPI process and number of MPI processes - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: broadcast_chunks_double - - .. code:: text - - subroutine broadcast_chunks_double(A, LDA) - - File: :file:`mpi.irp.f_template_97` - - Broadcast with chunks of ~2GB - - - - - -.. c:function:: broadcast_chunks_integer - - .. code:: text - - subroutine broadcast_chunks_integer(A, LDA) - - File: :file:`mpi.irp.f_template_97` - - Broadcast with chunks of ~2GB - - - - - -.. c:function:: broadcast_chunks_integer8 - - .. code:: text - - subroutine broadcast_chunks_integer8(A, LDA) - - File: :file:`mpi.irp.f_template_97` - - Broadcast with chunks of ~2GB - - - - - -.. c:function:: mpi_print - - .. code:: text - - subroutine mpi_print(string) - - File: :file:`mpi.irp.f` - - Print string to stdout if the MPI rank is zero. - - diff --git a/docs/source/modules/nuclei.rst b/docs/source/modules/nuclei.rst deleted file mode 100644 index 7f6a89ff..00000000 --- a/docs/source/modules/nuclei.rst +++ /dev/null @@ -1,351 +0,0 @@ -.. _nuclei: - -.. program:: nuclei - -.. default-role:: option - -====== -nuclei -====== - -This module contains data relative to the nuclei (coordinates, charge, -nuclear repulsion energy, etc). -The coordinates are expressed in atomic units. - - - - -EZFIO parameters ----------------- - -.. option:: nucl_num - - Number of nuclei - - -.. option:: nucl_label - - Nuclear labels - - -.. option:: nucl_charge - - Nuclear charges - - -.. option:: nucl_coord - - Nuclear coordinates in the format (:, {x,y,z}) - - -.. option:: disk_access_nuclear_repulsion - - Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] - - Default: None - -.. option:: nuclear_repulsion - - Nuclear repulsion (Computed automaticaly or Read in the |EZFIO|) - - - -Providers ---------- - - -.. c:var:: center_of_mass - - .. code:: text - - double precision, allocatable :: center_of_mass (3) - - File: :file:`nuclei.irp.f` - - Center of mass of the molecule - - - - -.. c:var:: element_mass - - .. code:: text - - character*(4), allocatable :: element_name (0:127) - double precision, allocatable :: element_mass (0:127) - - File: :file:`nuclei.irp.f` - - Array of the name of element, sorted by nuclear charge (integer) - - - - -.. c:var:: element_name - - .. code:: text - - character*(4), allocatable :: element_name (0:127) - double precision, allocatable :: element_mass (0:127) - - File: :file:`nuclei.irp.f` - - Array of the name of element, sorted by nuclear charge (integer) - - - - -.. c:var:: inertia_tensor - - .. code:: text - - double precision, allocatable :: inertia_tensor (3,3) - - File: :file:`inertia.irp.f` - - Inertia tensor - - - - -.. c:var:: inertia_tensor_eigenvalues - - .. code:: text - - double precision, allocatable :: inertia_tensor_eigenvectors (3,3) - double precision, allocatable :: inertia_tensor_eigenvalues (3) - - File: :file:`inertia.irp.f` - - Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. - - - - -.. c:var:: inertia_tensor_eigenvectors - - .. code:: text - - double precision, allocatable :: inertia_tensor_eigenvectors (3,3) - double precision, allocatable :: inertia_tensor_eigenvalues (3) - - File: :file:`inertia.irp.f` - - Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. - - - - -.. c:var:: nucl_coord - - .. code:: text - - double precision, allocatable :: nucl_coord (nucl_num,3) - - File: :file:`nuclei.irp.f` - - Nuclear coordinates in the format (:, {x,y,z}) - - - - -.. c:var:: nucl_coord_transp - - .. code:: text - - double precision, allocatable :: nucl_coord_transp (3,nucl_num) - - File: :file:`nuclei.irp.f` - - Transposed array of nucl_coord - - - - -.. c:var:: nucl_dist - - .. code:: text - - double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors - - - - -.. c:var:: nucl_dist_2 - - .. code:: text - - double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors - - - - -.. c:var:: nucl_dist_inv - - .. code:: text - - double precision, allocatable :: nucl_dist_inv (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - Inverse of the distance between nucleus I and nucleus J - - - - -.. c:var:: nucl_dist_vec_x - - .. code:: text - - double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors - - - - -.. c:var:: nucl_dist_vec_y - - .. code:: text - - double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors - - - - -.. c:var:: nucl_dist_vec_z - - .. code:: text - - double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) - double precision, allocatable :: nucl_dist (nucl_num,nucl_num) - - File: :file:`nuclei.irp.f` - - nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors - - - - -.. c:var:: nuclear_repulsion - - .. code:: text - - double precision :: nuclear_repulsion - - File: :file:`nuclei.irp.f` - - Nuclear repulsion energy - - - - -.. c:var:: slater_bragg_radii - - .. code:: text - - double precision, allocatable :: slater_bragg_radii (100) - - File: :file:`atomic_radii.irp.f` - - atomic radii in Angstrom defined in table I of JCP 41, 3199 (1964) Slater execpt for the Hydrogen atom where we took the value of Becke (1988, JCP) - - - - -.. c:var:: slater_bragg_radii_per_atom - - .. code:: text - - double precision, allocatable :: slater_bragg_radii_per_atom (nucl_num) - - File: :file:`atomic_radii.irp.f` - - - - - - -.. c:var:: slater_bragg_radii_per_atom_ua - - .. code:: text - - double precision, allocatable :: slater_bragg_radii_per_atom_ua (nucl_num) - - File: :file:`atomic_radii.irp.f` - - - - - - -.. c:var:: slater_bragg_radii_ua - - .. code:: text - - double precision, allocatable :: slater_bragg_radii_ua (100) - - File: :file:`atomic_radii.irp.f` - - - - - - -.. c:var:: slater_bragg_type_inter_distance - - .. code:: text - - double precision, allocatable :: slater_bragg_type_inter_distance (nucl_num,nucl_num) - - File: :file:`atomic_radii.irp.f` - - - - - - -.. c:var:: slater_bragg_type_inter_distance_ua - - .. code:: text - - double precision, allocatable :: slater_bragg_type_inter_distance_ua (nucl_num,nucl_num) - - File: :file:`atomic_radii.irp.f` - - - - diff --git a/docs/source/modules/perturbation.rst b/docs/source/modules/perturbation.rst deleted file mode 100644 index 5ea4aecc..00000000 --- a/docs/source/modules/perturbation.rst +++ /dev/null @@ -1,560 +0,0 @@ -.. _perturbation: - -.. program:: perturbation - -.. default-role:: option - -============ -perturbation -============ - - -All subroutines in ``*.irp.f`` starting with `pt2_` in the current directory are -perturbation computed using the routine `i_H_psi`. Other cases are not allowed. -The arguments of the `pt2_` are always: - -.. code-block:: fortran - - subroutine pt2_...( & - psi_ref, & - psi_ref_coefs, & - E_refs, & - det_pert, & - c_pert, & - e_2_pert, & - H_pert_diag, & - Nint, & - Ndet, & - N_st ) - - - integer , intent(in) :: Nint,Ndet,N_st - integer(bit_kind), intent(in) :: psi_ref(Nint,2,Ndet) - double precision , intent(in) :: psi_ref_coefs(Ndet,N_st) - double precision , intent(in) :: E_refs(N_st) - integer(bit_kind), intent(in) :: det_pert(Nint,2) - double precision , intent(out) :: c_pert(N_st),e_2_pert(N_st),H_pert_diag - - -`psi_ref` - bitstring of the determinants present in the various `N_st` states - -`psi_ref_coefs` - coefficients of the determinants on the various `N_st` states - -`E_refs` - Energy of the various `N_st` states - -`det_pert` - Perturber determinant - -`c_pert` - Perturbative coefficients for the various states - -`e_2_pert` - Perturbative energetic contribution for the various states - -`H_pert_diag` - Diagonal |H| matrix element of the perturber - -`Nint` - Should be equal to `N_int` - -`Ndet` - Number of determinants `i` in |Psi| on which we apply - -`N_st` - Number of states - - - - - - -EZFIO parameters ----------------- - -.. option:: do_pt2 - - If `True`, compute the |PT2| contribution - - Default: True - -.. option:: pt2_max - - The selection process stops when the largest |PT2| (for all the state) is lower - - than `pt2_max` in absolute value - - Default: 0.0001 - -.. option:: pt2_relative_error - - Stop stochastic |PT2| when the relative error is smaller than `PT2_relative_error` - - Default: 0.005 - -.. option:: correlation_energy_ratio_max - - The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules). - - Defined as :math:`{E_{CI}-E_{HF}}/{E_{CI}+E_{PT2} - E_{HF}}`. - - Default: 1.00 - -.. option:: h0_type - - Type of zeroth-order Hamiltonian [ EN | Barycentric | Variance | SOP ] - - Default: EN - - -Providers ---------- - - -.. c:var:: fill_h_apply_buffer_selection - - .. code:: text - - subroutine fill_H_apply_buffer_selection(n_selected,det_buffer,e_2_pert_buffer,coef_pert_buffer, & - N_st,Nint,iproc,select_max_out) - - File: :file:`selection.irp.f` - - Fill the H_apply buffer with determiants for the selection - - - - -.. c:var:: max_exc_pert - - .. code:: text - - integer :: max_exc_pert - - File: :file:`exc_max.irp.f` - - - - - - -.. c:var:: selection_criterion - - .. code:: text - - double precision :: selection_criterion - double precision :: selection_criterion_min - double precision :: selection_criterion_factor - - File: :file:`selection.irp.f` - - Threshold to select determinants. Set by selection routines. - - - - -.. c:var:: selection_criterion_factor - - .. code:: text - - double precision :: selection_criterion - double precision :: selection_criterion_min - double precision :: selection_criterion_factor - - File: :file:`selection.irp.f` - - Threshold to select determinants. Set by selection routines. - - - - -.. c:var:: selection_criterion_min - - .. code:: text - - double precision :: selection_criterion - double precision :: selection_criterion_min - double precision :: selection_criterion_factor - - File: :file:`selection.irp.f` - - Threshold to select determinants. Set by selection routines. - - - - -.. c:var:: var_pt2_ratio - - .. code:: text - - double precision :: var_pt2_ratio - - File: :file:`var_pt2_ratio_provider.irp.f` - - The selection process stops when the energy ratio variational/(variational+PT2) is equal to var_pt2_ratio - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: perturb_buffer_by_mono_dummy - - .. code:: text - - subroutine perturb_buffer_by_mono_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_epstein_nesbet - - .. code:: text - - subroutine perturb_buffer_by_mono_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2 - - .. code:: text - - subroutine perturb_buffer_by_mono_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_h_core - - .. code:: text - - subroutine perturb_buffer_by_mono_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_moller_plesset - - .. code:: text - - subroutine perturb_buffer_by_mono_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_moller_plesset_general - - .. code:: text - - subroutine perturb_buffer_by_mono_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_by_mono_qdpt - - .. code:: text - - subroutine perturb_buffer_by_mono_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_dummy - - .. code:: text - - subroutine perturb_buffer_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_epstein_nesbet - - .. code:: text - - subroutine perturb_buffer_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_epstein_nesbet_2x2 - - .. code:: text - - subroutine perturb_buffer_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_h_core - - .. code:: text - - subroutine perturb_buffer_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_moller_plesset - - .. code:: text - - subroutine perturb_buffer_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_moller_plesset_general - - .. code:: text - - subroutine perturb_buffer_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: perturb_buffer_qdpt - - .. code:: text - - subroutine perturb_buffer_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) - - File: :file:`perturbation.irp.f_shell_13` - - Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. - - - - - -.. c:function:: pt2_dummy - - .. code:: text - - subroutine pt2_dummy (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Dummy perturbation to add all connected determinants. - - - - - -.. c:function:: pt2_epstein_nesbet - - .. code:: text - - subroutine pt2_epstein_nesbet (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution for the various N_st states. - - `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{ E_n - \langle \alpha|H|\alpha \rangle }` . - - `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{ E_n - \langle \alpha|H|\alpha \rangle }` . - - - - - - - -.. c:function:: pt2_epstein_nesbet_2x2 - - .. code:: text - - subroutine pt2_epstein_nesbet_2x2 (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Computes the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution for the various N_st states. - - `e_2_pert(i)` = :math:`\frac{1}{2} ( \langle \alpha|H|\alpha \rangle - E_n) - \sqrt{ (\langle \alpha|H|\alpha \rangle - E_n)^2 + 4 \langle i|H|\alpha \rangle^2 }` . - - `c_pert(i)` = `e_2_pert(i)` :math:`\times \frac{1}{ \langle i|H|\alpha \rangle}` . - - - - - - - -.. c:function:: pt2_h_core - - .. code:: text - - subroutine pt2_h_core(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pert_single.irp.f` - - compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution - - for the various N_st states. - - c_pert(i) = /( E(i) - ) - - e_2_pert(i) = ^2/( E(i) - ) - - - - - - - -.. c:function:: pt2_moller_plesset - - .. code:: text - - subroutine pt2_moller_plesset (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. - - `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . - - `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . - - - - - - - -.. c:function:: pt2_moller_plesset_general - - .. code:: text - - subroutine pt2_moller_plesset_general (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. - - `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . - - `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . - - - - - - - -.. c:function:: pt2_qdpt - - .. code:: text - - subroutine pt2_qdpt (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) - - File: :file:`pt2_equations.irp.f_template_309` - - Computes the QDPT first order coefficient and second order energetic contribution for the various N_st states. - - `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\langle i|H|i \rangle - \langle \alpha|H|\alpha \rangle}` . - - - - - - - -.. c:function:: remove_small_contributions - - .. code:: text - - subroutine remove_small_contributions - - File: :file:`selection.irp.f` - - Remove determinants with small contributions. N_states is assumed to be provided. - - - - - -.. c:function:: repeat_all_e_corr - - .. code:: text - - double precision function repeat_all_e_corr(key_in) - - File: :file:`pert_sc2.irp.f` - - - - diff --git a/docs/source/modules/pseudo.rst b/docs/source/modules/pseudo.rst deleted file mode 100644 index b9ab7433..00000000 --- a/docs/source/modules/pseudo.rst +++ /dev/null @@ -1,94 +0,0 @@ -.. _pseudo: - -.. program:: pseudo - -.. default-role:: option - -====== -pseudo -====== - -This module defines the |EZFIO| parameters of the effective core potentials. - - - -EZFIO parameters ----------------- - -.. option:: nucl_charge_remove - - Nuclear charges removed per atom - - -.. option:: pseudo_klocmax - - Maximum value of k for the local component - - -.. option:: pseudo_n_k - - Number of gaussians in the local component - - -.. option:: pseudo_v_k - - Coefficients in the local component - - -.. option:: pseudo_dz_k - - Exponents in the local component - - -.. option:: pseudo_lmax - - Maximum angular momentum - - -.. option:: pseudo_kmax - - Maximum number of functions in the non-local component - - -.. option:: pseudo_n_kl - - Number of functions in the non-local component - - -.. option:: pseudo_v_kl - - Coefficients in the non-local component - - -.. option:: pseudo_dz_kl - - Exponents in the non-local component - - -.. option:: do_pseudo - - If `True`, pseudo-potentials are used. - - Default: False - -.. option:: pseudo_grid_size - - Nb of points of the grid for the QMC interfaces - - Default: 1000 - -.. option:: pseudo_grid_rmax - - R_max of the QMC grid - - Default: 10.0 - -.. option:: ao_pseudo_grid - - Grid for the QMC interface - - -.. option:: mo_pseudo_grid - - Grid for the QMC interface - diff --git a/docs/source/modules/psiref_cas.rst b/docs/source/modules/psiref_cas.rst deleted file mode 100644 index fe4e38ae..00000000 --- a/docs/source/modules/psiref_cas.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _psiref_cas: - -.. program:: psiref_cas - -.. default-role:: option - -========== -psiref_cas -========== - -Reference wave function is defined as a |CAS| wave function. -This module is required for |CAS-SD|, |MRPT| or |MRCC|. - - diff --git a/docs/source/modules/psiref_utils.rst b/docs/source/modules/psiref_utils.rst deleted file mode 100644 index 634ecb61..00000000 --- a/docs/source/modules/psiref_utils.rst +++ /dev/null @@ -1,16 +0,0 @@ -.. _psiref_utils: - -.. program:: psiref_utils - -.. default-role:: option - -============ -psiref_utils -============ - - -Utilities related to the use of a reference wave function. This module -needs to be loaded with any `psi_ref_*` module. - - - diff --git a/docs/source/modules/scf_utils.rst b/docs/source/modules/scf_utils.rst deleted file mode 100644 index d9ec8f4f..00000000 --- a/docs/source/modules/scf_utils.rst +++ /dev/null @@ -1,390 +0,0 @@ -.. _scf_utils: - -.. program:: scf_utils - -.. default-role:: option - -========= -scf_utils -========= - - - -The scf_utils module is an abstract module which contains the basics to perform *Restricted* SCF calculations (the -spatial part of the |MOs| is common for alpha and beta spinorbitals) based on a single-determinant wave function. - -This module does not produce any executable *and must not do*, but instead it contains everything one needs to perform an orbital optimization based on an Fock matrix. -The ``scf_utils`` module is meant to be included in the :file:`NEED` of the various single determinant SCF procedures, such as ``hartree_fock`` or ``kohn_sham``, where a specific definition of the Fock matrix is given (see :file:`hartree_fock fock_matrix_hf.irp.f` for an example). - -All SCF programs perform the following actions: - - -#. Compute/Read all the one- and two-electron integrals, and store them in memory - -#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it - will read them as initial guess. Otherwise, it will create a guess. -#. Perform the |SCF| iterations based on the definition of the Fock matrix - - -The main keywords/options are: - -* :option:`scf_utils thresh_scf` -* :option:`scf_utils level_shift` - -At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation -crashes for any unexpected reason, the calculation can be restarted by running again -the |SCF| with the same |EZFIO| database. - -The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. -If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. - -To start a calculation from scratch, the simplest way is to remove the -``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. - -.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS -.. _level-shifting: https://doi.org/10.1002/qua.560070407 - - - - -EZFIO parameters ----------------- - -.. option:: max_dim_diis - - Maximum size of the DIIS extrapolation procedure - - Default: 15 - -.. option:: threshold_diis - - Threshold on the convergence of the DIIS error vector during a Hartree-Fock calculation. If 0. is chosen, the square root of thresh_scf will be used. - - Default: 0. - -.. option:: thresh_scf - - Threshold on the convergence of the Hartree Fock energy. - - Default: 1.e-10 - -.. option:: n_it_scf_max - - Maximum number of SCF iterations - - Default: 500 - -.. option:: level_shift - - Energy shift on the virtual MOs to improve SCF convergence - - Default: 0. - -.. option:: scf_algorithm - - Type of SCF algorithm used. Possible choices are [ Simple | DIIS] - - Default: DIIS - -.. option:: mo_guess_type - - Initial MO guess. Can be [ Huckel | HCore ] - - Default: Huckel - -.. option:: energy - - Calculated HF energy - - -.. option:: no_oa_or_av_opt - - If true, leave the active orbitals untouched in the SCF procedure - - Default: False - - -Providers ---------- - - -.. c:var:: eigenvalues_fock_matrix_ao - - .. code:: text - - double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) - double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) - - File: :file:`diis.irp.f` - - Eigenvalues and eigenvectors of the Fock matrix over the AO basis - - - - -.. c:var:: eigenvectors_fock_matrix_ao - - .. code:: text - - double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) - double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) - - File: :file:`diis.irp.f` - - Eigenvalues and eigenvectors of the Fock matrix over the AO basis - - - - -.. c:var:: eigenvectors_fock_matrix_mo - - .. code:: text - - double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_num) - - File: :file:`diagonalize_fock.irp.f` - - Eigenvector of the Fock matrix in the MO basis obtained with level shift. - - - - -.. c:var:: extrapolate_fock_matrix - - .. code:: text - - subroutine extrapolate_Fock_matrix( & - error_matrix_DIIS,Fock_matrix_DIIS, & - Fock_matrix_AO_,size_Fock_matrix_AO, & - iteration_SCF,dim_DIIS & - ) - - File: :file:`roothaan_hall_scf.irp.f` - - Compute the extrapolated Fock matrix using the DIIS procedure - - - - -.. c:var:: fock_matrix_ao - - .. code:: text - - double precision, allocatable :: fock_matrix_ao (ao_num,ao_num) - - File: :file:`fock_matrix.irp.f` - - Fock matrix in AO basis set - - - - -.. c:var:: fock_matrix_diag_mo - - .. code:: text - - double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) - double precision, allocatable :: fock_matrix_diag_mo (mo_num) - - File: :file:`fock_matrix.irp.f` - - Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is :: - - | F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K | - - - - F = 1/2 (Fa + Fb) - - K = Fb - Fa - - - - - - -.. c:var:: fock_matrix_mo - - .. code:: text - - double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) - double precision, allocatable :: fock_matrix_diag_mo (mo_num) - - File: :file:`fock_matrix.irp.f` - - Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is :: - - | F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K | - - - - F = 1/2 (Fa + Fb) - - K = Fb - Fa - - - - - - -.. c:var:: fock_matrix_mo_alpha - - .. code:: text - - double precision, allocatable :: fock_matrix_mo_alpha (mo_num,mo_num) - - File: :file:`fock_matrix.irp.f` - - Fock matrix on the MO basis - - - - -.. c:var:: fock_matrix_mo_beta - - .. code:: text - - double precision, allocatable :: fock_matrix_mo_beta (mo_num,mo_num) - - File: :file:`fock_matrix.irp.f` - - Fock matrix on the MO basis - - - - -.. c:var:: fps_spf_matrix_ao - - .. code:: text - - double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num) - - File: :file:`diis.irp.f` - - Commutator FPS - SPF - - - - -.. c:var:: fps_spf_matrix_mo - - .. code:: text - - double precision, allocatable :: fps_spf_matrix_mo (mo_num,mo_num) - - File: :file:`diis.irp.f` - - Commutator FPS - SPF in MO basis - - - - -.. c:var:: scf_density_matrix_ao - - .. code:: text - - double precision, allocatable :: scf_density_matrix_ao (ao_num,ao_num) - - File: :file:`scf_density_matrix_ao.irp.f` - - S^{-1}.P.S^{-1} where P = C.C^t - - - - -.. c:var:: scf_density_matrix_ao_alpha - - .. code:: text - - double precision, allocatable :: scf_density_matrix_ao_alpha (ao_num,ao_num) - - File: :file:`scf_density_matrix_ao.irp.f` - - S^{-1}.P_alpha.S^{-1} - - - - -.. c:var:: scf_density_matrix_ao_beta - - .. code:: text - - double precision, allocatable :: scf_density_matrix_ao_beta (ao_num,ao_num) - - File: :file:`scf_density_matrix_ao.irp.f` - - S^{-1}.P_beta.S^{-1} - - - - -.. c:var:: scf_energy - - .. code:: text - - double precision :: scf_energy - - File: :file:`fock_matrix.irp.f` - - Hartree-Fock energy - - - - -.. c:var:: threshold_diis_nonzero - - .. code:: text - - double precision :: threshold_diis_nonzero - - File: :file:`diis.irp.f` - - If threshold_DIIS is zero, choose sqrt(thresh_scf) - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: damping_scf - - .. code:: text - - subroutine damping_SCF - - File: :file:`damping_scf.irp.f` - - - - - - - -.. c:function:: huckel_guess - - .. code:: text - - subroutine huckel_guess - - File: :file:`huckel.irp.f` - - Build the MOs using the extended Huckel model - - - - - -.. c:function:: roothaan_hall_scf - - .. code:: text - - subroutine Roothaan_Hall_SCF - - File: :file:`roothaan_hall_scf.irp.f` - - Roothaan-Hall algorithm for SCF Hartree-Fock calculation - - diff --git a/docs/source/modules/selectors_cassd.rst b/docs/source/modules/selectors_cassd.rst deleted file mode 100644 index d6c2b8ff..00000000 --- a/docs/source/modules/selectors_cassd.rst +++ /dev/null @@ -1,13 +0,0 @@ -.. _selectors_cassd: - -.. program:: selectors_cassd - -.. default-role:: option - -=============== -selectors_cassd -=============== - -Selectors for |CAS-SD| calculations. The selectors are defined as first the -generators from :ref:`Generators_CAS`, and then the rest of the wave function. - diff --git a/docs/source/modules/selectors_full.rst b/docs/source/modules/selectors_full.rst deleted file mode 100644 index 9edb70b9..00000000 --- a/docs/source/modules/selectors_full.rst +++ /dev/null @@ -1,72 +0,0 @@ -.. _selectors_full: - -.. program:: selectors_full - -.. default-role:: option - -============== -selectors_full -============== - -All the determinants are possible selectors. Only the largest contributions are kept, where -a threshold is applied to the squared norm of the wave function, with the :option:`determinants -threshold_selectors` flag. - - - -Providers ---------- - - -.. c:var:: n_det_selectors - - .. code:: text - - integer :: n_det_selectors - - File: :file:`selectors.irp.f` - - For Single reference wave functions, the number of selectors is 1 : the Hartree-Fock determinant - - - - -.. c:var:: psi_selectors - - .. code:: text - - integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) - double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) - - File: :file:`selectors.irp.f` - - Determinants on which we apply for perturbation. - - - - -.. c:var:: psi_selectors_coef - - .. code:: text - - integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) - double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) - - File: :file:`selectors.irp.f` - - Determinants on which we apply for perturbation. - - - - -.. c:var:: threshold_selectors - - .. code:: text - - double precision :: threshold_selectors - - File: :file:`selectors.irp.f` - - Thresholds on selectors (fraction of the square of the norm) - - diff --git a/docs/source/modules/selectors_utils.rst b/docs/source/modules/selectors_utils.rst deleted file mode 100644 index 959d2930..00000000 --- a/docs/source/modules/selectors_utils.rst +++ /dev/null @@ -1,381 +0,0 @@ -.. _selectors_utils: - -.. program:: selectors_utils - -.. default-role:: option - -=============== -selectors_utils -=============== - -Helper functions for selectors. - - - - -Providers ---------- - - -.. c:var:: coef_hf_selector - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: delta_e_per_selector - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: double_index_selectors - - .. code:: text - - integer, allocatable :: exc_degree_per_selectors (N_det_selectors) - integer, allocatable :: double_index_selectors (N_det_selectors) - integer :: n_double_selectors - - File: :file:`e_corr_selectors.irp.f` - - Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. - - double_index_selectors = list of the index of the double excitations - - n_double_selectors = number of double excitations in the selectors determinants - - - - -.. c:var:: e_corr_double_only - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: e_corr_per_selectors - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: e_corr_second_order - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: exc_degree_per_selectors - - .. code:: text - - integer, allocatable :: exc_degree_per_selectors (N_det_selectors) - integer, allocatable :: double_index_selectors (N_det_selectors) - integer :: n_double_selectors - - File: :file:`e_corr_selectors.irp.f` - - Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. - - double_index_selectors = list of the index of the double excitations - - n_double_selectors = number of double excitations in the selectors determinants - - - - -.. c:var:: i_h_hf_per_selectors - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: inv_selectors_coef_hf - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: inv_selectors_coef_hf_squared - - .. code:: text - - double precision :: coef_hf_selector - double precision :: inv_selectors_coef_hf - double precision :: inv_selectors_coef_hf_squared - double precision, allocatable :: e_corr_per_selectors (N_det_selectors) - double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) - double precision, allocatable :: delta_e_per_selector (N_det_selectors) - double precision :: e_corr_double_only - double precision :: e_corr_second_order - - File: :file:`e_corr_selectors.irp.f` - - Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. - - E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. - - E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation - - coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants - - - - -.. c:var:: n_double_selectors - - .. code:: text - - integer, allocatable :: exc_degree_per_selectors (N_det_selectors) - integer, allocatable :: double_index_selectors (N_det_selectors) - integer :: n_double_selectors - - File: :file:`e_corr_selectors.irp.f` - - Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. - - double_index_selectors = list of the index of the double excitations - - n_double_selectors = number of double excitations in the selectors determinants - - - - -.. c:var:: psi_selectors_coef_transp - - .. code:: text - - double precision, allocatable :: psi_selectors_coef_transp (N_states,psi_selectors_size) - - File: :file:`selectors.irp.f` - - Transposed psi_selectors - - - - -.. c:var:: psi_selectors_diag_h_mat - - .. code:: text - - double precision, allocatable :: psi_selectors_diag_h_mat (psi_selectors_size) - - File: :file:`selectors.irp.f` - - Diagonal elements of the H matrix for each selectors - - - - -.. c:var:: psi_selectors_size - - .. code:: text - - integer :: psi_selectors_size - - File: :file:`selectors.irp.f` - - - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: zmq_get_n_det_generators - - .. code:: text - - integer function zmq_get_N_det_generators(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_102` - - Get N_det_generators from the qp_run scheduler - - - - - -.. c:function:: zmq_get_n_det_selectors - - .. code:: text - - integer function zmq_get_N_det_selectors(zmq_to_qp_run_socket, worker_id) - - File: :file:`zmq.irp.f_template_102` - - Get N_det_selectors from the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_det_generators - - .. code:: text - - integer function zmq_put_N_det_generators(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_102` - - Put N_det_generators on the qp_run scheduler - - - - - -.. c:function:: zmq_put_n_det_selectors - - .. code:: text - - integer function zmq_put_N_det_selectors(zmq_to_qp_run_socket,worker_id) - - File: :file:`zmq.irp.f_template_102` - - Put N_det_selectors on the qp_run scheduler - - diff --git a/docs/source/modules/single_ref_method.rst b/docs/source/modules/single_ref_method.rst deleted file mode 100644 index ae80a401..00000000 --- a/docs/source/modules/single_ref_method.rst +++ /dev/null @@ -1,14 +0,0 @@ -.. _single_ref_method: - -.. program:: single_ref_method - -.. default-role:: option - -================= -single_ref_method -================= - -Include this module for single reference methods. -Using this module, the only generator determinant is the Hartree-Fock determinant. - - diff --git a/docs/source/modules/slave.rst b/docs/source/modules/slave.rst deleted file mode 100644 index 74b75541..00000000 --- a/docs/source/modules/slave.rst +++ /dev/null @@ -1,73 +0,0 @@ -.. _slave: - -.. program:: slave - -.. default-role:: option - -===== -slave -===== - -Slave processes for distributed parallelism. - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: provide_everything - - .. code:: text - - subroutine provide_everything - - File: :file:`slave_cipsi.irp.f` - - - - - - - -.. c:function:: qp_ao_ints - - .. code:: text - - subroutine qp_ao_ints - - File: :file:`slave_eri.irp.f` - - Slave for electron repulsion integrals - - - - - -.. c:function:: run_wf - - .. code:: text - - subroutine run_wf - - File: :file:`slave_cipsi.irp.f` - - - - - - - -.. c:function:: slave - - .. code:: text - - subroutine slave - - File: :file:`slave_cipsi.irp.f` - - Helper program for distributed parallelism - - diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst deleted file mode 100644 index fd37d0c2..00000000 --- a/docs/source/modules/tools.rst +++ /dev/null @@ -1,222 +0,0 @@ -.. _tools: - -.. program:: tools - -.. default-role:: option - -===== -tools -===== - -Useful tools are grouped in this module. - - - -Subroutines / functions ------------------------ - - - -.. c:function:: diagonalize_h - - .. code:: text - - subroutine diagonalize_h - - File: :file:`diagonalize_h.irp.f` - - program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder - - - - - -.. c:function:: fcidump - - .. code:: text - - subroutine fcidump - - File: :file:`fcidump.irp.f` - - Produce a FCIDUMP file - - - - - -.. c:function:: four_idx_transform - - .. code:: text - - subroutine four_idx_transform - - File: :file:`four_idx_transform.irp.f` - - 4-index transformation of two-electron integrals from AO to MO integrals - - - - - -.. c:function:: molden - - .. code:: text - - subroutine molden - - File: :file:`molden.irp.f` - - Produce a Molden file - - - - - -.. c:function:: print_wf - - .. code:: text - - subroutine print_wf - - File: :file:`print_wf.irp.f` - - 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 - - and a first-order perturbative analysis of the wave function. - - If the wave function strongly deviates from the first-order analysis, something funny is going on :) - - - - - -.. c:function:: routine - - .. code:: text - - subroutine routine - - File: :file:`write_integrals_erf.irp.f` - - - - - - - -.. c:function:: save_natorb - - .. code:: text - - subroutine save_natorb - - File: :file:`save_natorb.irp.f` - - Save natural MOs into the EZFIO - - - - - -.. c:function:: save_one_body_dm - - .. code:: text - - subroutine save_one_body_dm - - File: :file:`save_one_body_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_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). - - - - - -.. c:function:: save_ortho_mos - - .. code:: text - - subroutine save_ortho_mos - - File: :file:`save_ortho_mos.irp.f` - - Save orthonormalized MOs in the EZFIO. - - - - - -.. c:function:: write_ao_basis - - .. code:: text - - subroutine write_Ao_basis(i_unit_output) - - File: :file:`molden.irp.f` - - - - - - - -.. c:function:: write_geometry - - .. code:: text - - subroutine write_geometry(i_unit_output) - - File: :file:`molden.irp.f` - - - - - - - -.. c:function:: write_integrals - - .. code:: text - - subroutine write_integrals - - File: :file:`write_integrals_erf.irp.f` - - Saves the two-electron erf integrals into the EZFIO - - - - - -.. c:function:: write_intro_gamess - - .. code:: text - - subroutine write_intro_gamess(i_unit_output) - - File: :file:`molden.irp.f` - - - - - - - -.. c:function:: write_mo_basis - - .. code:: text - - subroutine write_Mo_basis(i_unit_output) - - File: :file:`molden.irp.f` - - - - diff --git a/docs/source/modules/utils.rst b/docs/source/modules/utils.rst deleted file mode 100644 index 6437de1f..00000000 --- a/docs/source/modules/utils.rst +++ /dev/null @@ -1,1960 +0,0 @@ -.. _utils: - -.. program:: utils - -.. default-role:: option - -===== -utils -===== - -Contains general purpose utilities (sorting, maps, etc). - - - - -Providers ---------- - - -.. c:var:: binom - - .. code:: text - - double precision, allocatable :: binom (0:40,0:40) - double precision, allocatable :: binom_transp (0:40,0:40) - - File: :file:`util.irp.f` - - Binomial coefficients - - - - -.. c:var:: binom_int - - .. code:: text - - integer*8, allocatable :: binom_int (0:40,0:40) - integer*8, allocatable :: binom_int_transp (0:40,0:40) - - File: :file:`util.irp.f` - - Binomial coefficients, as integers*8 - - - - -.. c:var:: binom_int_transp - - .. code:: text - - integer*8, allocatable :: binom_int (0:40,0:40) - integer*8, allocatable :: binom_int_transp (0:40,0:40) - - File: :file:`util.irp.f` - - Binomial coefficients, as integers*8 - - - - -.. c:var:: binom_transp - - .. code:: text - - double precision, allocatable :: binom (0:40,0:40) - double precision, allocatable :: binom_transp (0:40,0:40) - - File: :file:`util.irp.f` - - Binomial coefficients - - - - -.. c:var:: degree_max_integration_lebedev - - .. code:: text - - integer :: degree_max_integration_lebedev - - File: :file:`angular_integration.irp.f` - - integrate correctly a polynom of order "degree_max_integration_lebedev" needed for the angular integration according to LEBEDEV formulae - - - - -.. c:var:: dtranspose - - .. code:: text - - recursive subroutine dtranspose(A,LDA,B,LDB,d1,d2) - - File: :file:`transpose.irp.f` - - Transpose input matrix A into output matrix B - - - - -.. c:var:: fact_inv - - .. code:: text - - double precision, allocatable :: fact_inv (128) - - File: :file:`util.irp.f` - - 1/n! - - - - -.. c:var:: i2radix_sort - - .. code:: text - - recursive subroutine i2radix_sort(x,iorder,isize,iradix) - - File: :file:`sort.irp.f_template_644` - - Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. - - - - -.. c:var:: i8radix_sort - - .. code:: text - - recursive subroutine i8radix_sort(x,iorder,isize,iradix) - - File: :file:`sort.irp.f_template_644` - - Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. - - - - -.. c:var:: i8radix_sort_big - - .. code:: text - - recursive subroutine i8radix_sort_big(x,iorder,isize,iradix) - - File: :file:`sort.irp.f_template_644` - - Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. - - - - -.. c:var:: inv_int - - .. code:: text - - double precision, allocatable :: inv_int (128) - - File: :file:`util.irp.f` - - 1/i - - - - -.. c:var:: iradix_sort - - .. code:: text - - recursive subroutine iradix_sort(x,iorder,isize,iradix) - - File: :file:`sort.irp.f_template_644` - - Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. - - - - -.. c:var:: iradix_sort_big - - .. code:: text - - recursive subroutine iradix_sort_big(x,iorder,isize,iradix) - - File: :file:`sort.irp.f_template_644` - - Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. - - - - -.. c:var:: n_points_integration_angular_lebedev - - .. code:: text - - integer :: n_points_integration_angular_lebedev - - File: :file:`angular_integration.irp.f` - - Number of points needed for the angular integral - - - - -.. c:var:: nproc - - .. code:: text - - integer :: nproc - - File: :file:`util.irp.f` - - Number of current OpenMP threads - - - - -.. c:var:: overlap_gaussian_xyz - - .. code:: text - - subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,& - power_B,overlap_x,overlap_y,overlap_z,overlap,dim) - - File: :file:`one_e_integration.irp.f` - - .. math:: - - S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\ S = S_x S_y S_z - - - - - - -.. c:var:: phi_angular_integration_lebedev - - .. code:: text - - double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev) - double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev) - double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev) - - File: :file:`angular_integration.irp.f` - - Theta phi values together with the weights values for the angular integration : integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1 where i is the basis function and psi_j is the j th eigenvector - - - - - - - -.. c:function:: lapack_diagd - - .. code:: text - - subroutine lapack_diagd(eigvalues,eigvectors,H,nmax,n) - - File: :file:`linear_algebra.irp.f` - - Diagonalize matrix H - - H is untouched between input and ouptut - - eigevalues(i) = ith lowest eigenvalue of the H matrix - - eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector - - - - - - - -.. c:function:: logfact - - .. code:: text - - double precision function logfact(n) - - File: :file:`util.irp.f` - - n! - - - - - -.. c:function:: lowercase - - .. code:: text - - subroutine lowercase(txt,n) - - File: :file:`util.irp.f` - - Transform to lower case - - - - - -.. c:function:: map_load_from_disk - - .. code:: text - - subroutine map_load_from_disk(filename,map) - - File: :file:`map_functions.irp.f` - - - - - - - -.. c:function:: map_save_to_disk - - .. code:: text - - subroutine map_save_to_disk(filename,map) - - File: :file:`map_functions.irp.f` - - - - - - - -.. c:function:: memory_of_double - - .. code:: text - - double precision function memory_of_double(n) - - File: :file:`memory.irp.f` - - Computes the memory required for n double precision elements in gigabytes. - - - - - -.. c:function:: memory_of_int - - .. code:: text - - double precision function memory_of_int(n) - - File: :file:`memory.irp.f` - - Computes the memory required for n double precision elements in gigabytes. - - - - - -.. c:function:: multiply_poly - - .. code:: text - - subroutine multiply_poly(b,nb,c,nc,d,nd) - - File: :file:`integration.irp.f` - - Multiply two polynomials D(t) =! D(t) +( B(t)*C(t)) - - - - - -.. c:function:: normalize - - .. code:: text - - subroutine normalize(u,sze) - - File: :file:`util.irp.f` - - Normalizes vector u - - - - - -.. c:function:: ortho_canonical - - .. code:: text - - subroutine ortho_canonical(overlap,LDA,N,C,LDC,m) - - File: :file:`linear_algebra.irp.f` - - Compute C_new=C_old.U.s^-1/2 canonical orthogonalization. - - overlap : overlap matrix - - LDA : leftmost dimension of overlap array - - N : Overlap matrix is NxN (array is (LDA,N) ) - - C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors - - LDC : leftmost dimension of C - - m : Coefficients matrix is MxN, ( array is (LDC,N) ) - - - - - - - -.. c:function:: ortho_lowdin - - .. code:: text - - subroutine ortho_lowdin(overlap,LDA,N,C,LDC,m) - - File: :file:`linear_algebra.irp.f` - - Compute C_new=C_old.S^-1/2 orthogonalization. - - overlap : overlap matrix - - LDA : leftmost dimension of overlap array - - N : Overlap matrix is NxN (array is (LDA,N) ) - - C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors - - LDC : leftmost dimension of C - - M : Coefficients matrix is MxN, ( array is (LDC,N) ) - - - - - - - -.. c:function:: ortho_qr - - .. code:: text - - subroutine ortho_qr(A,LDA,m,n) - - File: :file:`linear_algebra.irp.f` - - Orthogonalization using Q.R factorization - - A : matrix to orthogonalize - - LDA : leftmost dimension of A - - n : Number of rows of A - - m : Number of columns of A - - - - - - - -.. c:function:: ortho_qr_unblocked - - .. code:: text - - subroutine ortho_qr_unblocked(A,LDA,m,n) - - File: :file:`linear_algebra.irp.f` - - Orthogonalization using Q.R factorization - - A : matrix to orthogonalize - - LDA : leftmost dimension of A - - n : Number of rows of A - - m : Number of columns of A - - - - - - - -.. c:function:: overlap_gaussian_x - - .. code:: text - - double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_A,power_B,dim) - - File: :file:`one_e_integration.irp.f` - - .. math:: - - \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx - - - - - - - -.. c:function:: overlap_x_abs - - .. code:: text - - subroutine overlap_x_abs(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) - - File: :file:`one_e_integration.irp.f` - - .. math :: - - \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx - - - - - - - -.. c:function:: print_memory_usage - - .. code:: text - - subroutine print_memory_usage() - - File: :file:`memory.irp.f` - - Prints the memory usage in the output - - - - - -.. c:function:: quick_dsort - - .. code:: text - - subroutine quick_dsort(x, iorder, isize) - - File: :file:`sort.irp.f_template_261` - - Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: quick_i2sort - - .. code:: text - - subroutine quick_i2sort(x, iorder, isize) - - File: :file:`sort.irp.f_template_261` - - Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: quick_i8sort - - .. code:: text - - subroutine quick_i8sort(x, iorder, isize) - - File: :file:`sort.irp.f_template_261` - - Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: quick_isort - - .. code:: text - - subroutine quick_isort(x, iorder, isize) - - File: :file:`sort.irp.f_template_261` - - Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: quick_sort - - .. code:: text - - subroutine quick_sort(x, iorder, isize) - - File: :file:`sort.irp.f_template_261` - - Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: recentered_poly2 - - .. code:: text - - subroutine recentered_poly2(P_new,x_A,x_P,a,P_new2,x_B,x_Q,b) - - File: :file:`integration.irp.f` - - Recenter two polynomials - - - - - -.. c:function:: resident_memory - - .. code:: text - - subroutine resident_memory(value) - - File: :file:`memory.irp.f` - - Returns the current used memory in gigabytes used by the current process. - - - - - -.. c:function:: rint - - .. code:: text - - double precision function rint(n,rho) - - File: :file:`integration.irp.f` - - .. math:: - - \int_0^1 dx \exp(-p x^2) x^n - - - - - - - -.. c:function:: rint1 - - .. code:: text - - double precision function rint1(n,rho) - - File: :file:`integration.irp.f` - - Standard version of rint - - - - - -.. c:function:: rint_large_n - - .. code:: text - - double precision function rint_large_n(n,rho) - - File: :file:`integration.irp.f` - - Version of rint for large values of n - - - - - -.. c:function:: rint_sum - - .. code:: text - - double precision function rint_sum(n_pt_out,rho,d1) - - File: :file:`integration.irp.f` - - Needed for the calculation of two-electron integrals. - - - - - -.. c:function:: rinteg - - .. code:: text - - double precision function rinteg(n,u) - - File: :file:`need.irp.f` - - - - - - - -.. c:function:: rintgauss - - .. code:: text - - double precision function rintgauss(n) - - File: :file:`need.irp.f` - - - - - - - -.. c:function:: sabpartial - - .. code:: text - - double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB,l) - - File: :file:`need.irp.f` - - - - - - - -.. c:function:: set_order - - .. code:: text - - subroutine set_order(x,iorder,isize) - - File: :file:`sort.irp.f_template_347` - - array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. - - - - - -.. c:function:: set_order_big - - .. code:: text - - subroutine set_order_big(x,iorder,isize) - - File: :file:`sort.irp.f_template_412` - - array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format - - - - - -.. c:function:: sort - - .. code:: text - - subroutine sort(x,iorder,isize) - - File: :file:`sort.irp.f_template_293` - - Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. - - - - - -.. c:function:: sorted_dnumber - - .. code:: text - - subroutine sorted_dnumber(x,isize,n) - - File: :file:`sort.irp.f_template_261` - - Returns the number of sorted elements - - - - - -.. c:function:: sorted_i2number - - .. code:: text - - subroutine sorted_i2number(x,isize,n) - - File: :file:`sort.irp.f_template_261` - - Returns the number of sorted elements - - - - - -.. c:function:: sorted_i8number - - .. code:: text - - subroutine sorted_i8number(x,isize,n) - - File: :file:`sort.irp.f_template_261` - - Returns the number of sorted elements - - - - - -.. c:function:: sorted_inumber - - .. code:: text - - subroutine sorted_inumber(x,isize,n) - - File: :file:`sort.irp.f_template_261` - - Returns the number of sorted elements - - - - - -.. c:function:: sorted_number - - .. code:: text - - subroutine sorted_number(x,isize,n) - - File: :file:`sort.irp.f_template_261` - - Returns the number of sorted elements - - - - - -.. c:function:: svd - - .. code:: text - - subroutine svd(A,LDA,U,LDU,D,Vt,LDVt,m,n) - - File: :file:`linear_algebra.irp.f` - - Compute A = U.D.Vt - - LDx : leftmost dimension of x - - Dimsneion of A is m x n - - - - - - - -.. c:function:: total_memory - - .. code:: text - - subroutine total_memory(value) - - File: :file:`memory.irp.f` - - Returns the current used memory in gigabytes used by the current process. - - - - - -.. c:function:: u_dot_u - - .. code:: text - - double precision function u_dot_u(u,sze) - - File: :file:`util.irp.f` - - Compute - - - - - -.. c:function:: u_dot_v - - .. code:: text - - double precision function u_dot_v(u,v,sze) - - File: :file:`util.irp.f` - - Compute - - - - - -.. c:function:: wall_time - - .. code:: text - - subroutine wall_time(t) - - File: :file:`util.irp.f` - - The equivalent of cpu_time, but for the wall time. - - - - - -.. c:function:: write_git_log - - .. code:: text - - subroutine write_git_log(iunit) - - File: :file:`util.irp.f` - - Write the last git commit in file iunit. - - diff --git a/docs/source/modules/zmq.rst b/docs/source/modules/zmq.rst deleted file mode 100644 index e5af0f0c..00000000 --- a/docs/source/modules/zmq.rst +++ /dev/null @@ -1,885 +0,0 @@ -.. _zmq: - -.. program:: zmq - -.. default-role:: option - -=== -zmq -=== - -Definition of |ZeroMQ| sockets and messages. - - - - - -Providers ---------- - - -.. c:var:: qp_run_address - - .. code:: text - - character*(128) :: qp_run_address - integer :: zmq_port_start - - File: :file:`utils.irp.f` - - Address of the qp_run socket Example : tcp://130.120.229.139:12345 - - - - -.. c:var:: zmq_context - - .. code:: text - - integer(ZMQ_PTR) :: zmq_context - integer(omp_lock_kind) :: zmq_lock - - File: :file:`utils.irp.f` - - Context for the ZeroMQ library - - - - -.. c:var:: zmq_lock - - .. code:: text - - integer(ZMQ_PTR) :: zmq_context - integer(omp_lock_kind) :: zmq_lock - - File: :file:`utils.irp.f` - - Context for the ZeroMQ library - - - - -.. c:var:: zmq_port_start - - .. code:: text - - character*(128) :: qp_run_address - integer :: zmq_port_start - - File: :file:`utils.irp.f` - - Address of the qp_run socket Example : tcp://130.120.229.139:12345 - - - - -.. c:var:: zmq_socket_pair_inproc_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_socket_pull_inproc_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_socket_pull_tcp_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_socket_push_inproc_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_socket_push_tcp_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_socket_sub_tcp_address - - .. code:: text - - character*(128) :: zmq_socket_pull_tcp_address - character*(128) :: zmq_socket_pair_inproc_address - character*(128) :: zmq_socket_push_tcp_address - character*(128) :: zmq_socket_pull_inproc_address - character*(128) :: zmq_socket_push_inproc_address - character*(128) :: zmq_socket_sub_tcp_address - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - -.. c:var:: zmq_state - - .. code:: text - - character*(128) :: zmq_state - - File: :file:`utils.irp.f` - - Threads executing work through the ZeroMQ interface - - - - -Subroutines / functions ------------------------ - - - -.. c:function:: add_task_to_taskserver - - .. code:: text - - integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) - - File: :file:`utils.irp.f` - - Get a task from the task server - - - - - -.. c:function:: connect_to_taskserver - - .. code:: text - - integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) - - File: :file:`utils.irp.f` - - Connect to the task server and obtain the worker ID - - - - - -.. c:function:: disconnect_from_taskserver - - .. code:: text - - integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) - - File: :file:`utils.irp.f` - - Disconnect from the task server - - - - - -.. c:function:: disconnect_from_taskserver_state - - .. code:: text - - integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) - - File: :file:`utils.irp.f` - - Disconnect from the task server - - - - - -.. c:function:: end_parallel_job - - .. code:: text - - subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) - - File: :file:`utils.irp.f` - - End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' - - - - - -.. c:function:: end_zmq_pair_socket - - .. code:: text - - subroutine end_zmq_pair_socket(zmq_socket_pair) - - File: :file:`utils.irp.f` - - Terminate socket on which the results are sent. - - - - - -.. c:function:: end_zmq_pull_socket - - .. code:: text - - subroutine end_zmq_pull_socket(zmq_socket_pull) - - File: :file:`utils.irp.f` - - Terminate socket on which the results are sent. - - - - - -.. c:function:: end_zmq_push_socket - - .. code:: text - - subroutine end_zmq_push_socket(zmq_socket_push,thread) - - File: :file:`utils.irp.f` - - Terminate socket on which the results are sent. - - - - - -.. c:function:: end_zmq_sub_socket - - .. code:: text - - subroutine end_zmq_sub_socket(zmq_socket_sub) - - File: :file:`utils.irp.f` - - Terminate socket on which the results are sent. - - - - - -.. c:function:: end_zmq_to_qp_run_socket - - .. code:: text - - subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) - - File: :file:`utils.irp.f` - - Terminate the socket from the application to qp_run - - - - - -.. c:function:: get_task_from_taskserver - - .. code:: text - - integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task) - - File: :file:`utils.irp.f` - - Get a task from the task server - - - - - -.. c:function:: get_tasks_from_taskserver - - .. code:: text - - integer function get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task,n_tasks) - - File: :file:`utils.irp.f` - - Get multiple tasks from the task server - - - - - -.. c:function:: new_parallel_job - - .. code:: text - - subroutine new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) - - File: :file:`utils.irp.f` - - Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' - - - - - -.. c:function:: new_zmq_pair_socket - - .. code:: text - - function new_zmq_pair_socket(bind) - - File: :file:`utils.irp.f` - - Socket on which the collector and the main communicate - - - - - -.. c:function:: new_zmq_pull_socket - - .. code:: text - - function new_zmq_pull_socket() - - File: :file:`utils.irp.f` - - Socket on which the results are sent. If thread is 1, use inproc - - - - - -.. c:function:: new_zmq_push_socket - - .. code:: text - - function new_zmq_push_socket(thread) - - File: :file:`utils.irp.f` - - Socket on which the results are sent. If thread is 1, use inproc - - - - - -.. c:function:: new_zmq_sub_socket - - .. code:: text - - function new_zmq_sub_socket() - - File: :file:`utils.irp.f` - - Socket to read the state published by the Task server - - - - - -.. c:function:: new_zmq_to_qp_run_socket - - .. code:: text - - function new_zmq_to_qp_run_socket() - - File: :file:`utils.irp.f` - - Socket on which the qp_run process replies - - - - - -.. c:function:: reset_zmq_addresses - - .. code:: text - - subroutine reset_zmq_addresses - - File: :file:`utils.irp.f` - - Socket which pulls the results (2) - - - - - -.. c:function:: switch_qp_run_to_master - - .. code:: text - - subroutine switch_qp_run_to_master - - File: :file:`utils.irp.f` - - Address of the master qp_run socket Example : tcp://130.120.229.139:12345 - - - - - -.. c:function:: task_done_to_taskserver - - .. code:: text - - integer function task_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id) - - File: :file:`utils.irp.f` - - Get a task from the task server - - - - - -.. c:function:: tasks_done_to_taskserver - - .. code:: text - - integer function tasks_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id, n_tasks) - - File: :file:`utils.irp.f` - - Get a task from the task server - - - - - -.. c:function:: wait_for_next_state - - .. code:: text - - subroutine wait_for_next_state(state) - - File: :file:`utils.irp.f` - - - - - - - -.. c:function:: wait_for_state - - .. code:: text - - subroutine wait_for_state(state_wait,state) - - File: :file:`utils.irp.f` - - Wait for the ZMQ state to be ready - - - - - -.. c:function:: wait_for_states - - .. code:: text - - subroutine wait_for_states(state_wait,state,n) - - File: :file:`utils.irp.f` - - Wait for the ZMQ state to be ready - - - - - -.. c:function:: zmq_abort - - .. code:: text - - integer function zmq_abort(zmq_to_qp_run_socket) - - File: :file:`utils.irp.f` - - Aborts a running parallel computation - - - - - -.. c:function:: zmq_delete_task - - .. code:: text - - integer function zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more) - - File: :file:`utils.irp.f` - - When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. - - - - - -.. c:function:: zmq_delete_tasks - - .. code:: text - - integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) - - File: :file:`utils.irp.f` - - When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. - - - - - -.. c:function:: zmq_delete_tasks_async_recv - - .. code:: text - - integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) - - File: :file:`utils.irp.f` - - When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. - - - - - -.. c:function:: zmq_delete_tasks_async_send - - .. code:: text - - integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) - - File: :file:`utils.irp.f` - - When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. - - - - - -.. c:function:: zmq_get8_dvector - - .. code:: text - - integer function zmq_get8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Get a float vector from the qp_run scheduler - - - - - -.. c:function:: zmq_get8_ivector - - .. code:: text - - integer function zmq_get8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Get a vector of integers from the qp_run scheduler - - - - - -.. c:function:: zmq_get_dmatrix - - .. code:: text - - integer function zmq_get_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Get a float vector from the qp_run scheduler - - - - - -.. c:function:: zmq_get_dvector - - .. code:: text - - integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Get a float vector from the qp_run scheduler - - - - - -.. c:function:: zmq_get_i8matrix - - .. code:: text - - integer function zmq_get_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Get a float vector from the qp_run scheduler - - - - - -.. c:function:: zmq_get_imatrix - - .. code:: text - - integer function zmq_get_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Get a float vector from the qp_run scheduler - - - - - -.. c:function:: zmq_get_int - - .. code:: text - - integer function zmq_get_int(zmq_to_qp_run_socket, worker_id, name, x) - - File: :file:`put_get.irp.f` - - Get a vector of integers from the qp_run scheduler - - - - - -.. c:function:: zmq_get_int_nompi - - .. code:: text - - integer function zmq_get_int_nompi(zmq_to_qp_run_socket, worker_id, name, x) - - File: :file:`put_get.irp.f` - - Get a vector of integers from the qp_run scheduler - - - - - -.. c:function:: zmq_get_ivector - - .. code:: text - - integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Get a vector of integers from the qp_run scheduler - - - - - -.. c:function:: zmq_port - - .. code:: text - - function zmq_port(ishift) - - File: :file:`utils.irp.f` - - Return the value of the ZMQ port from the corresponding integer - - - - - -.. c:function:: zmq_put8_dvector - - .. code:: text - - integer function zmq_put8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Put a float vector on the qp_run scheduler - - - - - -.. c:function:: zmq_put8_ivector - - .. code:: text - - integer function zmq_put8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Put a vector of integers on the qp_run scheduler - - - - - -.. c:function:: zmq_put_dmatrix - - .. code:: text - - integer function zmq_put_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Put a float vector on the qp_run scheduler - - - - - -.. c:function:: zmq_put_dvector - - .. code:: text - - integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Put a float vector on the qp_run scheduler - - - - - -.. c:function:: zmq_put_i8matrix - - .. code:: text - - integer function zmq_put_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Put a float vector on the qp_run scheduler - - - - - -.. c:function:: zmq_put_imatrix - - .. code:: text - - integer function zmq_put_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) - - File: :file:`put_get.irp.f` - - Put a float vector on the qp_run scheduler - - - - - -.. c:function:: zmq_put_int - - .. code:: text - - integer function zmq_put_int(zmq_to_qp_run_socket, worker_id, name, x) - - File: :file:`put_get.irp.f` - - Put a vector of integers on the qp_run scheduler - - - - - -.. c:function:: zmq_put_ivector - - .. code:: text - - integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) - - File: :file:`put_get.irp.f` - - Put a vector of integers on the qp_run scheduler - - - - - -.. c:function:: zmq_set_running - - .. code:: text - - integer function zmq_set_running(zmq_to_qp_run_socket) - - File: :file:`utils.irp.f` - - Set the job to Running in QP-run - - diff --git a/scripts/qp_mpirun b/scripts/qp_mpirun index 5c23ea8f..ea82c302 100755 --- a/scripts/qp_mpirun +++ b/scripts/qp_mpirun @@ -78,7 +78,7 @@ then sleep 1 done echo "Starting slaves" - mpiexec.hydra -n $((${SLURM_NTASKS}-1)) -hosts "$SLAVE_NODES" qp_run -slave slave_cipsi $INPUT > $INPUT.slaves.out + mpiexec.hydra -n $((${SLURM_NTASKS}-1)) -hosts "$SLAVE_NODES" qp_run -slave $PROG $INPUT > $INPUT.slaves.out fi wait diff --git a/scripts/qp_srun b/scripts/qp_srun index fb598743..d78bc960 100755 --- a/scripts/qp_srun +++ b/scripts/qp_srun @@ -78,7 +78,7 @@ then sleep 1 done echo "Starting slaves" - srun -n $((${SLURM_NTASKS}-1)) qp_run -slave slave_cipsi $INPUT > $INPUT.slaves.out + srun -n $((${SLURM_NTASKS}-1)) qp_run -slave $PROG $INPUT > $INPUT.slaves.out fi wait diff --git a/src/slave/.gitignore b/src/cipsi/.gitignore similarity index 100% rename from src/slave/.gitignore rename to src/cipsi/.gitignore diff --git a/src/cipsi/NEED b/src/cipsi/NEED new file mode 100644 index 00000000..0cab61d0 --- /dev/null +++ b/src/cipsi/NEED @@ -0,0 +1,5 @@ +perturbation +zmq +mpi +davidson_undressed +iterations diff --git a/src/cipsi/README.rst b/src/cipsi/README.rst new file mode 100644 index 00000000..11dcdc3b --- /dev/null +++ b/src/cipsi/README.rst @@ -0,0 +1,128 @@ +===== +cipsi +===== + +|CIPSI| algorithm. + +The :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` subroutines start with a single +determinant, or with the wave function in the |EZFIO| database if +:option:`determinants read_wf` is |true|. + +The :c:func:`run_cipsi` subroutine iteratively: + +* Selects the most important determinants from the external space and adds them to the + internal space +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Diagonalizes |H| in the enlarged internal space +* Computes the |PT2| contribution to the energy stochastically :cite:`Garniron_2017.2` + or deterministically, depending on :option:`perturbation do_pt2` +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` + +The difference between :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` is that +:c:func:`run_stochastic_cipsi` selects the determinants on the fly with the computation +of the stochastic |PT2| :cite:`Garniron_2017.2`. Hence, it is a semi-stochastic selection. It + +* Selects the most important determinants from the external space and adds them to the + internal space, on the fly with the computation of the PT2 with the stochastic algorithm + presented in :cite:`Garniron_2017.2`. +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` +* Diagonalizes |H| in the enlarged internal space + + +The number of selected determinants at each iteration will be such that the +size of the wave function will double at every iteration. If :option:`determinants +s2_eig` is |true|, then the number of selected determinants will be 1.5x the +current number, and then all the additional determinants will be added. + +By default, the program will stop when more than one million determinants have +been selected, or when the |PT2| energy is below :math:`10^{-4}`. + +The variational and |PT2| energies of the iterations are stored in the +|EZFIO| database, in the :ref:`iterations` module. + + + +Computation of the |PT2| energy +------------------------------- + +At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet +zeroth-order Hamiltonian: + +.. math:: + + E_{\text{PT2}} = \sum_{ \alpha } + \frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2} + {E - \langle \alpha | \hat{H} | \alpha \rangle} + +where the |kalpha| determinants are generated by applying all the single and +double excitation operators to all the determinants of the wave function +:math:`\Psi_G`. + +When the hybrid-deterministic/stochastic algorithm is chosen +(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the +internal space. +When the deterministic algorithm is chosen (:option:`perturbation do_pt2` +is set to |false|), :math:`Psi_G` is a truncation of |Psi| using +:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation +of |Psi| using :option:`determinants threshold_selectors`, and re-weighted +by :math:`1/\langle \Psi_s | \Psi_s \rangle`. + +At every iteration, while computing the |PT2|, the variance of the wave +function is also computed: + +.. math:: + + \sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{i \in \text{FCI}} + \langle \Psi | \hat{H} | i \rangle + \langle i | \hat{H} | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{ \alpha } + \langle |\Psi | \hat{H} | \alpha \rangle|^2. + +The expression of the variance is the same as the expression of the |PT2|, with +a denominator of 1. It measures how far the wave function is from the |FCI| +solution. Note that the absence of denominator in the Heat-Bath selected |CI| +method is selection method by minimization of the variance, whereas |CIPSI| is +a selection method by minimization of the energy. + + +If :option:`perturbation do_pt2` is set to |false|, then the stochastic +|PT2| is not computed, and an approximate value is obtained from the |CIPSI| +selection. The calculation is faster, but the extrapolated |FCI| value is +less accurate. This way of running the code should be used when the only +goal is to generate a wave function, as for using |CIPSI| wave functions as +trial wave functions of |QMC| calculations for example. + + +The :command:`PT2` program reads the wave function of the |EZFIO| database +and computes the energy and the |PT2| contribution. + + +State-averaging +--------------- + +Extrapolated |FCI| energy +------------------------- + +An estimate of the |FCI| energy is computed by extrapolating + +.. math:: + + E=E_\text{FCI} - \alpha\, E_\text{PT2} + +This extrapolation is done for all the requested states, and excitation +energies are printed as energy differences between the extrapolated +energies of the excited states and the extrapolated energy of the ground +state. + +The extrapolations are given considering the 2 last points, the 3 last points, ..., +the 7 last points. The extrapolated value should be chosen such that the extrpolated +value is stable with the number of points. + diff --git a/src/cipsi/cipsi.irp.f b/src/cipsi/cipsi.irp.f new file mode 100644 index 00000000..ecbab7c6 --- /dev/null +++ b/src/cipsi/cipsi.irp.f @@ -0,0 +1,147 @@ +subroutine run_cipsi + implicit none + BEGIN_DOC +! Selected Full Configuration Interaction with deterministic selection and +! stochastic PT2. + END_DOC + integer :: i,j,k + double precision, allocatable :: pt2(:), variance(:), norm(:), rpt2(:) + integer :: n_det_before, to_select + + double precision :: rss + double precision, external :: memory_of_double + rss = memory_of_double(N_states)*4.d0 + call check_mem(rss,irp_here) + + allocate (pt2(N_states), rpt2(N_states), norm(N_states), variance(N_states)) + + double precision :: hf_energy_ref + logical :: has + double precision :: relative_error + + PROVIDE H_apply_buffer_allocated + + relative_error=PT2_relative_error + + pt2 = -huge(1.e0) + rpt2 = -huge(1.e0) + norm = 0.d0 + variance = 0.d0 + + if (s2_eig) then + call make_s2_eigenfunction + endif + call diagonalize_CI + call save_wavefunction + + call ezfio_has_hartree_fock_energy(has) + if (has) then + call ezfio_get_hartree_fock_energy(hf_energy_ref) + else + hf_energy_ref = ref_bitmask_energy + endif + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + endif + + n_det_before = 0 + + double precision :: correlation_energy_ratio + double precision :: threshold_generators_save + threshold_generators_save = threshold_generators + double precision :: error(N_states) + + correlation_energy_ratio = 0.d0 + + do while ( & + (N_det < N_det_max) .and. & + (maxval(abs(pt2(1:N_states))) > pt2_max) .and. & + (correlation_energy_ratio <= correlation_energy_ratio_max) & + ) + write(*,'(A)') '--------------------------------------------------------------------------------' + + + if (do_pt2) then + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + threshold_generators = 1.d0 + SOFT_TOUCH threshold_generators + call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & + norm, 0) ! Stochastic PT2 + threshold_generators = threshold_generators_save + SOFT_TOUCH threshold_generators + endif + + + correlation_energy_ratio = (psi_energy_with_nucl_rep(1) - hf_energy_ref) / & + (psi_energy_with_nucl_rep(1) + pt2(1) - hf_energy_ref) + correlation_energy_ratio = min(1.d0,correlation_energy_ratio) + + call save_energy(psi_energy_with_nucl_rep, pt2) + call write_double(6,correlation_energy_ratio, 'Correlation ratio') + call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern) + + do k=1,N_states + rpt2(:) = pt2(:)/(1.d0 + norm(k)) + enddo + + call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) + call print_extrapolated_energy() + N_iter += 1 + + n_det_before = N_det + to_select = N_det + to_select = max(N_states_diag, to_select) +! to_select = min(to_select, N_det_max-n_det_before) + call ZMQ_selection(to_select, pt2, variance, norm) + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + call diagonalize_CI + call save_wavefunction + rpt2(:) = 0.d0 + call save_energy(psi_energy_with_nucl_rep, rpt2) + enddo + + if (N_det < N_det_max) then + call diagonalize_CI + call save_wavefunction + rpt2(:) = 0.d0 + call save_energy(psi_energy_with_nucl_rep, rpt2) + endif + + if (do_pt2) then + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + threshold_generators = 1d0 + SOFT_TOUCH threshold_generators + call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,variance, & + norm,0) ! Stochastic PT2 + SOFT_TOUCH threshold_generators + call save_energy(psi_energy_with_nucl_rep, pt2) + endif + print *, 'N_det = ', N_det + print *, 'N_sop = ', N_occ_pattern + print *, 'N_states = ', N_states + print*, 'correlation_ratio = ', correlation_energy_ratio + + + do k=1,N_states + rpt2(:) = pt2(:)/(1.d0 + norm(k)) + enddo + + call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern) + call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) + call print_extrapolated_energy() + +end diff --git a/src/fci/energy.irp.f b/src/cipsi/energy.irp.f similarity index 100% rename from src/fci/energy.irp.f rename to src/cipsi/energy.irp.f diff --git a/src/fci/pt2_stoch_routines.irp.f b/src/cipsi/pt2_stoch_routines.irp.f similarity index 100% rename from src/fci/pt2_stoch_routines.irp.f rename to src/cipsi/pt2_stoch_routines.irp.f diff --git a/src/fci/run_pt2_slave.irp.f b/src/cipsi/run_pt2_slave.irp.f similarity index 100% rename from src/fci/run_pt2_slave.irp.f rename to src/cipsi/run_pt2_slave.irp.f diff --git a/src/fci/run_selection_slave.irp.f b/src/cipsi/run_selection_slave.irp.f similarity index 100% rename from src/fci/run_selection_slave.irp.f rename to src/cipsi/run_selection_slave.irp.f diff --git a/src/fci/selection.irp.f b/src/cipsi/selection.irp.f similarity index 100% rename from src/fci/selection.irp.f rename to src/cipsi/selection.irp.f diff --git a/src/fci/selection_buffer.irp.f b/src/cipsi/selection_buffer.irp.f similarity index 100% rename from src/fci/selection_buffer.irp.f rename to src/cipsi/selection_buffer.irp.f diff --git a/src/fci/selection_types.f90 b/src/cipsi/selection_types.f90 similarity index 100% rename from src/fci/selection_types.f90 rename to src/cipsi/selection_types.f90 diff --git a/src/slave/slave_cipsi.irp.f b/src/cipsi/slave_cipsi.irp.f similarity index 99% rename from src/slave/slave_cipsi.irp.f rename to src/cipsi/slave_cipsi.irp.f index adc6374a..a9186545 100644 --- a/src/slave/slave_cipsi.irp.f +++ b/src/cipsi/slave_cipsi.irp.f @@ -1,4 +1,4 @@ -program slave +subroutine run_slave_cipsi implicit none BEGIN_DOC ! Helper program for distributed parallelism @@ -10,7 +10,7 @@ program slave SOFT_TOUCH read_wf distributed_davidson call provide_everything call switch_qp_run_to_master - call run_wf + call run_slave_main end subroutine provide_everything @@ -20,7 +20,7 @@ subroutine provide_everything PROVIDE N_det_selectors pt2_stoch_istate N_det end -subroutine run_wf +subroutine run_slave_main use f77_zmq implicit none diff --git a/src/cipsi/stochastic_cipsi.irp.f b/src/cipsi/stochastic_cipsi.irp.f new file mode 100644 index 00000000..7913e7fc --- /dev/null +++ b/src/cipsi/stochastic_cipsi.irp.f @@ -0,0 +1,130 @@ +subroutine run_stochastic_cipsi + implicit none + BEGIN_DOC +! Selected Full Configuration Interaction with Stochastic selection and PT2. + END_DOC + integer :: i,j,k + double precision, allocatable :: pt2(:), variance(:), norm(:), rpt2(:) + integer :: N_det_before, N_occ_pattern_before, to_select + + double precision :: rss + double precision, external :: memory_of_double + threshold_generators = 1.d0 + SOFT_TOUCH threshold_generators + + rss = memory_of_double(N_states)*4.d0 + call check_mem(rss,irp_here) + + allocate (pt2(N_states), rpt2(N_states), norm(N_states), variance(N_states)) + + double precision :: hf_energy_ref + logical :: has + double precision :: relative_error + + PROVIDE H_apply_buffer_allocated + + relative_error=PT2_relative_error + + pt2 = -huge(1.e0) + rpt2 = -huge(1.e0) + norm = 0.d0 + variance = 0.d0 + + if (s2_eig) then + call make_s2_eigenfunction + endif + call diagonalize_CI + call save_wavefunction + + call ezfio_has_hartree_fock_energy(has) + if (has) then + call ezfio_get_hartree_fock_energy(hf_energy_ref) + else + hf_energy_ref = ref_bitmask_energy + endif + + if (N_det > N_det_max) then + psi_det = psi_det_sorted + psi_coef = psi_coef_sorted + N_det = N_det_max + soft_touch N_det psi_det psi_coef + call diagonalize_CI + call save_wavefunction + endif + + N_det_before = 0 + N_occ_pattern_before = 0 + + double precision :: correlation_energy_ratio + double precision :: error(N_states) + + correlation_energy_ratio = 0.d0 + + do while ( & + (N_det < N_det_max) .and. & + (maxval(abs(pt2(1:N_states))) > pt2_max) .and. & + (correlation_energy_ratio <= correlation_energy_ratio_max) & + ) + write(*,'(A)') '--------------------------------------------------------------------------------' + + + N_det_before = N_det + N_occ_pattern_before = N_occ_pattern + to_select = N_det + to_select = max(N_states_diag, to_select) + + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & + norm, to_select) ! Stochastic PT2 + + correlation_energy_ratio = (psi_energy_with_nucl_rep(1) - hf_energy_ref) / & + (psi_energy_with_nucl_rep(1) + pt2(1) - hf_energy_ref) + correlation_energy_ratio = min(1.d0,correlation_energy_ratio) + + call save_energy(psi_energy_with_nucl_rep, pt2) + call write_double(6,correlation_energy_ratio, 'Correlation ratio') + call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det_before,N_occ_pattern_before) + + do k=1,N_states + rpt2(:) = pt2(:)/(1.d0 + norm(k)) + enddo + + call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det_before) + call print_extrapolated_energy() + N_iter += 1 + + PROVIDE psi_coef + PROVIDE psi_det + PROVIDE psi_det_sorted + + call diagonalize_CI + call save_wavefunction + rpt2(:) = 0.d0 + call save_energy(psi_energy_with_nucl_rep, rpt2) + enddo + + if (N_det < N_det_max) then + call diagonalize_CI + call save_wavefunction + rpt2(:) = 0.d0 + call save_energy(psi_energy_with_nucl_rep, rpt2) + endif + + pt2 = 0.d0 + variance = 0.d0 + norm = 0.d0 + call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,variance, & + norm,0) ! Stochastic PT2 + call save_energy(psi_energy_with_nucl_rep, pt2) + + do k=1,N_states + rpt2(:) = pt2(:)/(1.d0 + norm(k)) + enddo + + call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern) + call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) + call print_extrapolated_energy() + +end diff --git a/src/fci/zmq_selection.irp.f b/src/cipsi/zmq_selection.irp.f similarity index 100% rename from src/fci/zmq_selection.irp.f rename to src/cipsi/zmq_selection.irp.f diff --git a/src/cis/20.cis.bats b/src/cis/20.cis.bats index 81d2f88e..4eeb8217 100644 --- a/src/cis/20.cis.bats +++ b/src/cis/20.cis.bats @@ -3,7 +3,7 @@ source $QP_ROOT/tests/bats/common.bats.sh function run() { - thresh=1.e-6 + thresh=1.e-5 test_exe cis || skip qp_edit -c $1 ezfio set_file $1 @@ -20,97 +20,100 @@ function run() { eq $energy3 $4 $thresh } - - -@test "HBO" { - run hbo.ezfio -100.018582259097 -99.7127500068768 -99.6982683641297 -} - -@test "H2O" { - run h2o.ezfio -76.02702187043107 -75.6854407466997 -75.61967556334928 -} - -@test "[Cu(NH3)4]2+" { - run cu_nh3_4_2plus.ezfio -1862.97958709248 -1862.92454796197 -1862.91130872182 -} - -@test "C2H2" { - run c2h2.ezfio -12.1214401949634 -11.8824874421211 -11.8682310791620 -} - -@test "ClO" { - run clo.ezfio -534.263560525680 -534.256601571199 -534.062020844428 -} - -@test "DHNO" { - run dhno.ezfio -130.4472288472718 -130.3571808164850 -130.2196257046987 -} - -@test "H3COH" { - run h3coh.ezfio -114.986503059639 -114.649121836046 -114.578365912794 -} - -@test "HCN" { - run hcn.ezfio -92.8871750003811 -92.6250263755063 -92.6089719143274 -} - -@test "N2" { - run n2.ezfio -108.983489785305 -108.670192549322 -108.649653940027 -} - -@test "SiH2_3B1" { +@test "SiH2_3B1" { # 1.23281s run sih2_3b1.ezfio -289.969297318489 -289.766898643192 -289.737521023380 } -@test "SO" { - run so.ezfio -25.7502263243068 -25.5862810638724 -25.5829361589673 +@test "HBO" { # 1.31404s + run hbo.ezfio -100.018582259097 -99.7127500068768 -99.6982683641297 } -@test "CH4" { - run ch4.ezfio -40.1996180778616 -39.7936150141939 -39.7936150141734 -} - -@test "CO2" { - run co2.ezfio -187.650710886151 -187.300746249524 -187.291641359067 -} - -@test "F2" { - run f2.ezfio -198.764357823385 -198.575548537096 -198.575548537096 -} - -@test "HCO" { +@test "HCO" { # 1.33255s run hco.ezfio -113.0940242141341 -113.0023623703527 -112.8947302999338 } -@test "NH3" { - run nh3.ezfio -56.21783428981829 -55.91997684191139 -55.84753645754046 +@test "H2O" { # 1.39318s + run h2o.ezfio -76.02702187043107 -75.6854407466997 -75.61967556334928 } -@test "SiH3" { - run sih3.ezfio -5.45916474249436 -5.23512810272682 -5.23512806272007 +@test "H3COH" { # 1.40257s + run h3coh.ezfio -114.986503059639 -114.649121836046 -114.578365912794 } -@test "ClF" { - run clf.ezfio -558.844257066356 -558.664418728406 -558.664418728405 -} - -@test "H2O2" { - run h2o2.ezfio -150.780660847001 -150.546208866263 -150.483274551717 -} - -@test "H2S" { +@test "H2S" { # 1.44228s run h2s.ezfio -398.694413042222 -398.447164835271 -398.412784774083 } -@test "N2H4" { - run n2h4.ezfio -111.179991667947 -110.894116344878 -110.855788839735 +@test "ClF" { # 1.63289s + run clf.ezfio -558.844257066356 -558.664418728406 -558.664418728405 } -@test "OH" { +@test "ClO" { # 1.65582s + run clo.ezfio -534.263560525680 -534.256601571199 -534.062020844428 +} + +@test "SO" { # 1.9667s + run so.ezfio -25.7502263243068 -25.5862810638724 -25.5829361589673 +} + +@test "OH" { # 2.201s run oh.ezfio -75.4314648243896 -75.4254639668256 -75.2707675632313 } -@test "SO2" { +@test "H2O2" { # 2.27079s + run h2o2.ezfio -150.780660847001 -150.546208866263 -150.483274551717 +} + +@test "CO2" { # 2.86928s + run co2.ezfio -187.650710886151 -187.300746249524 -187.291641359067 +} + +@test "C2H2" { # 3.00666s + run c2h2.ezfio -12.1214401949634 -11.8824874421211 -11.8682310791620 +} + +@test "HCN" { # 4.21678s + run hcn.ezfio -92.8871750003811 -92.6250263755063 -92.6089719143274 +} + +@test "N2H4" { # 4.81968s + run n2h4.ezfio -111.179991667947 -110.894116344878 -110.855788839735 +} + +@test "SiH3" { # 5.72801s + run sih3.ezfio -5.45916474249436 -5.23512810272682 -5.23512806272007 +} + +@test "N2" { # 6.11313s + run n2.ezfio -108.983489785305 -108.670192549322 -108.649653940027 +} + +@test "DHNO" { # 6.42976s + run dhno.ezfio -130.4472288472718 -130.3571808164850 -130.2196257046987 +} + +@test "CH4" { # 6.4969s + run ch4.ezfio -40.1996180778616 -39.7936150141939 -39.7936150141734 +} + +@test "F2" { # 10.4758s + run f2.ezfio -198.764357823385 -198.575548537096 -198.575548537096 +} + +if [[ -z ${TRAVIS} ]] ; then + +@test "NH3" { # 14.2066s + run nh3.ezfio -56.21783428981829 -55.91997684191139 -55.84753645754046 +} + +@test "[Cu(NH3)4]2+" { # 29.7711s + run cu_nh3_4_2plus.ezfio -1862.97958709248 -1862.92454796197 -1862.91130872182 +} + +@test "SO2" { # 32.092s run so2.ezfio -41.5580019075645 -41.38232986913486 -41.35512503680323 } + +fi + diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats index d3b4ca94..cd434fd5 100644 --- a/src/cisd/30.cisd.bats +++ b/src/cisd/30.cisd.bats @@ -18,108 +18,113 @@ function run() { } - -@test "HBO" { - run hbo.ezfio -100.2019254455993 -99.79484127741013 -} - -@test "H2O" { - run h2o.ezfio -76.22975602077072 -75.80609108747208 -} - -@test "[Cu(NH3)4]2+" { - qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]" - run cu_nh3_4_2plus.ezfio -1862.9868140855440 -1862.9868140855440 -} - -@test "C2H2" { - qp_set_mo_class c2h2.ezfio -act "[1-30]" -del "[31-36]" - run c2h2.ezfio -12.3566731164213 -11.9495394759914 -} - -@test "ClO" { - run clo.ezfio -534.5404021326773 -534.3818725793897 -} - -@test "DHNO" { - qp_set_mo_class dhno.ezfio -core "[1-7]" -act "[8-64]" - run dhno.ezfio -130.458814562403 -130.356308303681 -} - -@test "H3COH" { - run h3coh.ezfio -115.204958752377 -114.755913828245 -} - -@test "HCN" { - qp_set_mo_class hcn.ezfio -core "[1,2]" -act "[3-40]" -del "[41-55]" - run hcn.ezfio -93.0776334511721 -92.6684633795506 -} - -@test "N2" { - qp_set_mo_class n2.ezfio -core "[1,2]" -act "[3-40]" -del "[41-60]" - run n2.ezfio -109.275693633982 -108.757794570948 -} - -@test "SiH2_3B1" { +@test "SiH2_3B1" { # 1.53842s run sih2_3b1.ezfio -290.015949171697 -289.805036176618 } -@test "SO" { - run so.ezfio -26.0131812819785 -25.7053111980226 +@test "HBO" { # 4.42968s + run hbo.ezfio -100.2019254455993 -99.79484127741013 } -@test "CH4" { - qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]" - run ch4.ezfio -40.2403962667047 -39.8433221754964 -} - -@test "CO2" { - qp_set_mo_class co2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-42]" - run co2.ezfio -187.959378390998 -187.432502050556 -} - -@test "F2" { - qp_set_mo_class f2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-62]" - run f2.ezfio -199.056829527539 -198.731828008346 -} - -@test "HCO" { +@test "HCO" { # 6.6077s run hco.ezfio -113.288687359997 -113.122945162967 } -@test "NH3" { - qp_set_mo_class nh3.ezfio -core "[1-4]" -act "[5-72]" - run nh3.ezfio -56.2447484835843 -55.9521689975716 +@test "H2O" { # 7.0651s + run h2o.ezfio -76.22975602077072 -75.80609108747208 } -@test "SiH3" { - run sih3.ezfio -5.57096611856522 -5.30950347928823 -} - -@test "ClF" { - run clf.ezfio -559.162476603880 -558.792395927088 -} - -@test "H2O2" { - qp_set_mo_class h2o2.ezfio -core "[1-2]" -act "[3-24]" -del "[25-38]" - run h2o2.ezfio -151.003775695363 -150.650247854914 -} - -@test "H2S" { +@test "H2S" { # 7.42152s run h2s.ezfio -398.853701416768 -398.519020035337 } -@test "N2H4" { +@test "N2H4" { # 15.8394s qp_set_mo_class n2h4.ezfio -core "[1-2]" -act "[3-24]" -del "[25-48]" run n2h4.ezfio -111.366247464687 -110.990795989548 } -@test "OH" { +@test "H2O2" { # 16.3164s + qp_set_mo_class h2o2.ezfio -core "[1-2]" -act "[3-24]" -del "[25-38]" + run h2o2.ezfio -151.003775695363 -150.650247854914 +} + +@test "OH" { # 18.2159s run oh.ezfio -75.6087472926588 -75.5370393736601 } -@test "SO2" { + + +if [[ -z ${TRAVIS} ]] ; then + + +@test "CH4" { # 19.821s + qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]" + run ch4.ezfio -40.2403962667047 -39.8433221754964 +} + +@test "SiH3" { # 20.2202s + run sih3.ezfio -5.57096611856522 -5.30950347928823 +} + +@test "NH3" { # 20.6771s + qp_set_mo_class nh3.ezfio -core "[1-4]" -act "[5-72]" + run nh3.ezfio -56.2447484835843 -55.9521689975716 +} + +@test "DHNO" { # 24.7077s + qp_set_mo_class dhno.ezfio -core "[1-7]" -act "[8-64]" + run dhno.ezfio -130.458814562403 -130.356308303681 +} + +@test "H3COH" { # 24.7248s + run h3coh.ezfio -115.204958752377 -114.755913828245 +} + +@test "[Cu(NH3)4]2+" { # 29.9956s + qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]" + run cu_nh3_4_2plus.ezfio -1862.98659549315 -1862.68813764356 +} + +@test "ClF" { # 30.3225s + run clf.ezfio -559.162476603880 -558.792395927088 +} + +@test "C2H2" { # 35.3324s + qp_set_mo_class c2h2.ezfio -act "[1-30]" -del "[31-36]" + run c2h2.ezfio -12.3566731164213 -11.9495394759914 +} + +@test "ClO" { # 37.6949s + run clo.ezfio -534.5404021326773 -534.3818725793897 +} + +@test "F2" { # 45.2078s + qp_set_mo_class f2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-62]" + run f2.ezfio -199.056829527539 -198.731828008346 +} + +@test "SO2" { # 47.6922s qp_set_mo_class so2.ezfio -core "[1-8]" -act "[9-87]" run so2.ezfio -41.5746738710350 -41.3800467740750 } +@test "SO" { # 51.2476s + run so.ezfio -26.0131812819785 -25.7053111980226 +} + +@test "CO2" { # 95.3736s + qp_set_mo_class co2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-42]" + run co2.ezfio -187.959378390998 -187.432502050556 +} + +@test "N2" { # 133.1814 + qp_set_mo_class n2.ezfio -core "[1,2]" -act "[3-40]" -del "[41-60]" + run n2.ezfio -109.275693633982 -108.757794570948 +} + +@test "HCN" { # 133.8696s + qp_set_mo_class hcn.ezfio -core "[1,2]" -act "[3-40]" -del "[41-55]" + run hcn.ezfio -93.0776334511721 -92.6684633795506 +} + +fi diff --git a/src/dummy/NEED b/src/dummy/NEED index bcaa86de..58588475 100644 --- a/src/dummy/NEED +++ b/src/dummy/NEED @@ -5,6 +5,7 @@ ao_two_e_ints aux_quantities becke_numerical_grid bitmask +cipsi cis cisd davidson @@ -41,7 +42,6 @@ selectors_cassd selectors_full selectors_utils single_ref_method -slave tools utils zmq diff --git a/src/fci/NEED b/src/fci/NEED index f7a3a46f..f096d7ef 100644 --- a/src/fci/NEED +++ b/src/fci/NEED @@ -1,7 +1,3 @@ -perturbation +cipsi selectors_full generators_full -zmq -mpi -davidson_undressed -iterations diff --git a/src/fci/README.rst b/src/fci/README.rst index 8398c521..52128bb2 100644 --- a/src/fci/README.rst +++ b/src/fci/README.rst @@ -2,111 +2,14 @@ fci === -Selected Full Configuration Interaction. +|CIPSI| algorithm in the full configuration interaction space. -The :command:`FCI` program starts with a single determinant, or with the wave -function in the |EZFIO| database if :option:`determinants read_wf` is |true|. -Then, it will iteratively: +* :command:`fci` performs the |CIPSI| calculation, +* :command:`pt2` computes the |PT2| contribution using the wave function stored in the |EZFIO| + database. -* Select the most important determinants from the external space and add them to the - internal space -* If :option:`determinants s2_eig` is |true|, add all the necessary - determinants to allow the eigenstates of |H| to be eigenstates of |S^2| -* Diagonalize |H| in the enlarged internal space -* Compute (stochastically) the second-order perturbative contribution to the energy -* Extrapolate the variational energy by fitting - :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` +.. seealso:: + + The documentation of the :ref:`cipsi` module. -The number of selected determinants at each iteration will be such that the -size of the wave function will double at every iteration. If :option:`determinants -s2_eig` is |true|, then the number of selected determinants will be 1.5x the -current number, and then all the additional determinants will be added. - -By default, the program will stop when more than one million determinants have -been selected, or when the |PT2| energy is below :math:`10^{-4}`. - -The variational and |PT2| energies of the iterations are stored in the -|EZFIO| database, in the :ref:`iterations` module. - - - -Computation of the |PT2| energy -------------------------------- - -At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet -zeroth-order Hamiltonian: - -.. math:: - - E_{\text{PT2}} = \sum_{ \alpha } - \frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2} - {E - \langle \alpha | \hat{H} | \alpha \rangle} - -where the |kalpha| determinants are generated by applying all the single and -double excitation operators to all the determinants of the wave function -:math:`\Psi_G`. - -When the hybrid-deterministic/stochastic algorithm is chosen -(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the -internal space. -When the deterministic algorithm is chosen (:option:`perturbation do_pt2` -is set to |false|), :math:`Psi_G` is a truncation of |Psi| using -:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation -of |Psi| using :option:`determinants threshold_selectors`, and re-weighted -by :math:`1/\langle \Psi_s | \Psi_s \rangle`. - -At every iteration, while computing the |PT2|, the variance of the wave -function is also computed: - -.. math:: - - \sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle - - \langle \Psi | \hat{H} | \Psi \rangle^2 \\ - & = \sum_{i \in \text{FCI}} - \langle \Psi | \hat{H} | i \rangle - \langle i | \hat{H} | \Psi \rangle - - \langle \Psi | \hat{H} | \Psi \rangle^2 \\ - & = \sum_{ \alpha } - \langle |\Psi | \hat{H} | \alpha \rangle|^2. - -The expression of the variance is the same as the expression of the |PT2|, with -a denominator of 1. It measures how far the wave function is from the |FCI| -solution. Note that the absence of denominator in the Heat-Bath selected |CI| -method is selection method by minimization of the variance, whereas |CIPSI| is -a selection method by minimization of the energy. - - -If :option:`perturbation do_pt2` is set to |false|, then the stochastic -|PT2| is not computed, and an approximate value is obtained from the |CIPSI| -selection. The calculation is faster, but the extrapolated |FCI| value is -less accurate. This way of running the code should be used when the only -goal is to generate a wave function, as for using |CIPSI| wave functions as -trial wave functions of |QMC| calculations for example. - - -The :command:`PT2` program reads the wave function of the |EZFIO| database -and computes the energy and the |PT2| contribution. - - -State-averaging ---------------- - -Extrapolated |FCI| energy -------------------------- - -An estimate of the |FCI| energy is computed by extrapolating - -.. math:: - - E=E_\text{FCI} - \alpha\, E_\text{PT2} - -This extrapolation is done for all the requested states, and excitation -energies are printed as energy differences between the extrapolated -energies of the excited states and the extrapolated energy of the ground -state. - -The extrapolations are given considering the 2 last points, the 3 last points, ..., -the 7 last points. The extrapolated value should be chosen such that the extrpolated -value is stable with the number of points. - diff --git a/src/fci/fci.irp.f b/src/fci/fci.irp.f index 2b53bf8b..f4587c75 100644 --- a/src/fci/fci.irp.f +++ b/src/fci/fci.irp.f @@ -1,137 +1,20 @@ program fci implicit none BEGIN_DOC -! Selected Full Configuration Interaction. +! Selected Full Configuration Interaction with stochastic selection and PT2. END_DOC - integer :: i,j,k - double precision, allocatable :: pt2(:), variance(:), norm(:), rpt2(:) - integer :: n_det_before, to_select - - double precision :: rss - double precision, external :: memory_of_double - rss = memory_of_double(N_states)*4.d0 - call check_mem(rss,irp_here) - allocate (pt2(N_states), rpt2(N_states), norm(N_states), variance(N_states)) + if (.not.is_zmq_slave) then - double precision :: hf_energy_ref - logical :: has - double precision :: relative_error + if (do_pt2) then + call run_stochastic_cipsi + else + call run_cipsi + endif - PROVIDE H_apply_buffer_allocated - - relative_error=PT2_relative_error - - pt2 = -huge(1.e0) - rpt2 = -huge(1.e0) - norm = 0.d0 - variance = 0.d0 - - if (s2_eig) then - call make_s2_eigenfunction - endif - call diagonalize_CI - call save_wavefunction - - call ezfio_has_hartree_fock_energy(has) - if (has) then - call ezfio_get_hartree_fock_energy(hf_energy_ref) else - hf_energy_ref = ref_bitmask_energy + + call run_slave_cipsi + endif - - if (N_det > N_det_max) then - psi_det = psi_det_sorted - psi_coef = psi_coef_sorted - N_det = N_det_max - soft_touch N_det psi_det psi_coef - call diagonalize_CI - call save_wavefunction - endif - - n_det_before = 0 - - double precision :: correlation_energy_ratio - double precision :: threshold_generators_save - threshold_generators_save = threshold_generators - double precision :: error(N_states) - - correlation_energy_ratio = 0.d0 - - do while ( & - (N_det < N_det_max) .and. & - (maxval(abs(pt2(1:N_states))) > pt2_max) .and. & - (correlation_energy_ratio <= correlation_energy_ratio_max) & - ) - write(*,'(A)') '--------------------------------------------------------------------------------' - - - n_det_before = N_det - to_select = N_det - to_select = max(N_states_diag, to_select) - - pt2 = 0.d0 - variance = 0.d0 - norm = 0.d0 - threshold_generators = 1.d0 - SOFT_TOUCH threshold_generators - call ZMQ_pt2(psi_energy_with_nucl_rep,pt2,relative_error,error, variance, & - norm, to_select) ! Stochastic PT2 - threshold_generators = threshold_generators_save - SOFT_TOUCH threshold_generators - - correlation_energy_ratio = (psi_energy_with_nucl_rep(1) - hf_energy_ref) / & - (psi_energy_with_nucl_rep(1) + pt2(1) - hf_energy_ref) - correlation_energy_ratio = min(1.d0,correlation_energy_ratio) - - call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep+pt2) - call write_double(6,correlation_energy_ratio, 'Correlation ratio') - call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm) - - do k=1,N_states - rpt2(:) = pt2(:)/(1.d0 + norm(k)) - enddo - - call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) - call print_extrapolated_energy(psi_energy_with_nucl_rep(1:N_states),rpt2) - N_iter += 1 - -! call ZMQ_selection(to_select, pt2, variance, norm) - - PROVIDE psi_coef - PROVIDE psi_det - PROVIDE psi_det_sorted - - call diagonalize_CI - call save_wavefunction - call ezfio_set_fci_energy(psi_energy_with_nucl_rep(1:N_states)) - enddo - - if (N_det < N_det_max) then - call diagonalize_CI - call save_wavefunction - call ezfio_set_fci_energy(psi_energy_with_nucl_rep(1:N_states)) - call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep(1:N_states)+pt2) - endif - - pt2 = 0.d0 - variance = 0.d0 - norm = 0.d0 - threshold_generators = 1d0 - SOFT_TOUCH threshold_generators - call ZMQ_pt2(psi_energy_with_nucl_rep, pt2,relative_error,error,variance, & - norm,0) ! Stochastic PT2 - threshold_generators = threshold_generators_save - SOFT_TOUCH threshold_generators - call ezfio_set_fci_energy(psi_energy_with_nucl_rep(1:N_states)) - call ezfio_set_fci_energy_pt2(psi_energy_with_nucl_rep(1:N_states)+pt2) - - do k=1,N_states - rpt2(:) = pt2(:)/(1.d0 + norm(k)) - enddo - - call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm) - call save_iterations(psi_energy_with_nucl_rep(1:N_states),rpt2,N_det) - call print_extrapolated_energy(psi_energy_with_nucl_rep(1:N_states),rpt2) - end diff --git a/src/fci/pt2.irp.f b/src/fci/pt2.irp.f index e0d03aca..deb6fdb1 100644 --- a/src/fci/pt2.irp.f +++ b/src/fci/pt2.irp.f @@ -4,12 +4,16 @@ program pt2 ! Second order perturbative correction to the wave function contained in the ! EZFIO directory. END_DOC - read_wf = .True. - threshold_generators = 1.d0 - SOFT_TOUCH read_wf threshold_generators - PROVIDE mo_two_e_integrals_in_map - PROVIDE psi_energy - call run + if (.not. is_zmq_slave) then + read_wf = .True. + threshold_generators = 1.d0 + SOFT_TOUCH read_wf threshold_generators + PROVIDE mo_two_e_integrals_in_map + PROVIDE psi_energy + call run + else + call run_slave_cipsi + endif end subroutine run @@ -35,10 +39,8 @@ subroutine run rpt2(:) = pt2(:)/(1.d0 + norm(k)) enddo - call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm) - - call ezfio_set_fci_energy(E_CI_before) - call ezfio_set_fci_energy_pt2(E_CI_before+pt2) + call print_summary(psi_energy_with_nucl_rep(1:N_states),pt2,error,variance,norm,N_det,N_occ_pattern) + call save_energy(E_CI_before,pt2) end diff --git a/src/fci/save_energy.irp.f b/src/fci/save_energy.irp.f new file mode 100644 index 00000000..5dac8da9 --- /dev/null +++ b/src/fci/save_energy.irp.f @@ -0,0 +1,9 @@ +subroutine save_energy(E,pt2) + implicit none + BEGIN_DOC +! Saves the energy in |EZFIO|. + END_DOC + double precision, intent(in) :: E(N_states), pt2(N_states) + call ezfio_set_fci_energy(E(1:N_states)) + call ezfio_set_fci_energy_pt2(E(1:N_states)+pt2(1:N_states)) +end diff --git a/src/hartree_fock/10.hf.bats b/src/hartree_fock/10.hf.bats index 4f59d354..a64f3570 100644 --- a/src/hartree_fock/10.hf.bats +++ b/src/hartree_fock/10.hf.bats @@ -15,98 +15,100 @@ function run() { } +@test "SiH2_3B1" { # 0.539000 + run sih2_3b1.ezfio -289.9654718650881 +} -@test "HBO" { +@test "SO" { # 0.539000 + run so.ezfio -25.71752633718843 +} + +@test "HCO" { # 0.636700 + run hco.ezfio -113.0862778269114 +} + +@test "HBO" { # 0.805600 run hbo.ezfio -100.018582259096 } -@test "H2O" { +@test "H2S" { # 1.655600 + run h2s.ezfio -398.6944130421982 +} + +@test "H3COH" { # 1.751000 + run h3coh.ezfio -114.9865030596373 +} + +@test "H2O" { # 1.811100 run h2o.ezfio -0.760270218692179E+02 } -@test "[Cu(NH3)4]2+" { +@test "H2O2" { # 2.217000 + run h2o2.ezfio -150.7806608469964 +} + +@test "ClF" { # 2.797000 + run clf.ezfio -558.8442570663570 +} + +@test "CO2" { # 2.811100 + run co2.ezfio -187.6507108861204 +} + +@test "N2H4" { # 4.054600 + run n2h4.ezfio -111.1799916679009 +} + +@test "ClO" { # 4.927400 + run clo.ezfio -534.2496714154559 +} + +@test "F2" { # 5.070800 + run f2.ezfio -198.7643578233773 +} + +@test "CH4" { # 5.994000 + run ch4.ezfio -40.19961807784367 +} + +@test "HCN" { # 7.792500 + run hcn.ezfio -92.88717500035233 +} + +@test "N2" { # 8.648100 + run n2.ezfio -108.9834897852979 +} + +@test "DHNO" { # 12.856700 + run dhno.ezfio -130.4278777822 +} + +@test "NH3" { # 13.632200 + run nh3.ezfio -56.21783428976567 +} + +@test "C2H2" { # 19.599000 + run c2h2.ezfio -12.12144019495306 +} + +@test "SiH3" { # 20.316100 + run sih3.ezfio -5.455398769158780 +} + +@test "OH" { # 32.042200 + run oh.ezfio -75.42025413469165 +} + +if [[ -z $TRAVIS ]] ; then + +@test "[Cu(NH3)4]2+" { # 59.610100 ezfio set_file cu_nh3_4_2plus.ezfio ezfio set scf_utils thresh_scf 1.e-10 run cu_nh3_4_2plus.ezfio -1862.97590388214 } -@test "C2H2" { - run c2h2.ezfio -12.12144019495306 -} - -@test "ClO" { - run clo.ezfio -534.2496714154559 -} - -@test "DHNO" { - run dhno.ezfio -130.4278777822 -} - -@test "H3COH" { - run h3coh.ezfio -114.9865030596373 -} - -@test "HCN" { - run hcn.ezfio -92.88717500035233 -} - -@test "N2" { - run n2.ezfio -108.9834897852979 -} - -@test "SiH2_3B1" { - run sih2_3b1.ezfio -289.9654718650881 -} - -@test "SO" { - run so.ezfio -25.71752633718843 -} - -@test "CH4" { - run ch4.ezfio -40.19961807784367 -} - -@test "CO2" { - run co2.ezfio -187.6507108861204 -} - -@test "F2" { - run f2.ezfio -198.7643578233773 -} - -@test "HCO" { - run hco.ezfio -113.0862778269114 -} - -@test "NH3" { - run nh3.ezfio -56.21783428976567 -} - -@test "SiH3" { - run sih3.ezfio -5.455398769158780 -} - -@test "ClF" { - run clf.ezfio -558.8442570663570 -} - -@test "H2O2" { - run h2o2.ezfio -150.7806608469964 -} - -@test "H2S" { - run h2s.ezfio -398.6944130421982 -} - -@test "N2H4" { - run n2h4.ezfio -111.1799916679009 -} - -@test "OH" { - run oh.ezfio -75.42025413469165 -} - -@test "SO2" { +@test "SO2" { # 71.894900 run so2.ezfio -41.55800190733211 } +fi diff --git a/src/iterations/print_extrapolation.irp.f b/src/iterations/print_extrapolation.irp.f index 2aa30233..55e95529 100644 --- a/src/iterations/print_extrapolation.irp.f +++ b/src/iterations/print_extrapolation.irp.f @@ -1,10 +1,9 @@ -subroutine print_extrapolated_energy(e_,pt2_) +subroutine print_extrapolated_energy implicit none BEGIN_DOC ! Print the extrapolated energy in the output END_DOC - double precision, intent(in) :: e_(N_states), pt2_(N_states) integer :: i,k if (N_iter< 2) then diff --git a/src/iterations/print_summary.irp.f b/src/iterations/print_summary.irp.f index 42a27786..0467b4a3 100644 --- a/src/iterations/print_summary.irp.f +++ b/src/iterations/print_summary.irp.f @@ -1,10 +1,11 @@ -subroutine print_summary(e_,pt2_,error_,variance_,norm_) +subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_) implicit none BEGIN_DOC ! Print the extrapolated energy in the output END_DOC double precision, intent(in) :: e_(N_states), pt2_(N_states), variance_(N_states), norm_(N_states), error_(N_states) + integer, intent(in) :: n_det_, n_occ_pattern_ integer :: i, k integer :: N_states_p character*(9) :: pt2_string @@ -17,14 +18,14 @@ subroutine print_summary(e_,pt2_,error_,variance_,norm_) pt2_string = '(approx)' endif - N_states_p = min(N_det,N_states) + N_states_p = min(N_det_,N_states) do i=1,N_states_p f(i) = 1.d0/(1.d0+norm_(i)) enddo print *, '' - print '(A,I12)', 'Summary at N_det = ', N_det + print '(A,I12)', 'Summary at N_det = ', N_det_ print '(A)', '-----------------------------------' print *, '' @@ -55,10 +56,10 @@ subroutine print_summary(e_,pt2_,error_,variance_,norm_) write(*,fmt) print *, '' - print *, 'N_det = ', N_det + print *, 'N_det = ', N_det_ print *, 'N_states = ', N_states if (s2_eig) then - print *, 'N_sop = ', N_occ_pattern + print *, 'N_sop = ', N_occ_pattern_ endif print *, '' diff --git a/src/slave/NEED b/src/slave/NEED deleted file mode 100644 index e263eb29..00000000 --- a/src/slave/NEED +++ /dev/null @@ -1,2 +0,0 @@ -fci -mpi diff --git a/src/slave/README.rst b/src/slave/README.rst deleted file mode 100644 index 341b3d7d..00000000 --- a/src/slave/README.rst +++ /dev/null @@ -1,6 +0,0 @@ -===== -slave -===== - -Slave processes for distributed parallelism. - diff --git a/src/slave/slave_eri.irp.f b/src/slave/slave_eri.irp.f deleted file mode 100644 index 64056467..00000000 --- a/src/slave/slave_eri.irp.f +++ /dev/null @@ -1,50 +0,0 @@ -program qp_ao_ints - use omp_lib - implicit none - IRP_IF MPI - include 'mpif.h' - IRP_ENDIF - integer :: ierr - - BEGIN_DOC -! Slave for electron repulsion integrals - END_DOC - integer :: i - PROVIDE zmq_context mpi_master zmq_state zmq_context - - call switch_qp_run_to_master - - zmq_context = f77_zmq_ctx_new () - - ! Set the state of the ZMQ - zmq_state = 'ao_integrals' - - ! Provide everything needed - double precision :: integral, ao_two_e_integral - integral = ao_two_e_integral(1,1,1,1) - - do - call wait_for_state('ao_integrals',zmq_state) - if (zmq_state(1:7) == 'Stopped') then - exit - endif - - !$OMP PARALLEL DEFAULT(PRIVATE) PRIVATE(i) - i = omp_get_thread_num() - call ao_two_e_integrals_in_map_slave_tcp(i) - !$OMP END PARALLEL - IRP_IF MPI - call MPI_BARRIER(MPI_COMM_WORLD, ierr) - if (ierr /= MPI_SUCCESS) then - print *, irp_here, 'error in barrier' - endif - IRP_ENDIF - - enddo - IRP_IF MPI - call MPI_finalize(i) - IRP_ENDIF - - print *, 'Done' -end - diff --git a/src/zmq/utils.irp.f b/src/zmq/utils.irp.f index df316b82..4ce3918e 100644 --- a/src/zmq/utils.irp.f +++ b/src/zmq/utils.irp.f @@ -91,8 +91,8 @@ subroutine switch_qp_run_to_master END_DOC character*(128) :: buffer call getenv('QP_RUN_ADDRESS_MASTER',buffer) - if (trim(buffer) == '') then - print *, 'This run should be started with the qp_run command' + if (.not.is_zmq_slave) then + print *, 'This run should be started with "qp_run -slave"' stop -1 endif qp_run_address = adjustl(buffer) @@ -1283,3 +1283,14 @@ subroutine wait_for_states(state_wait,state,n) end +BEGIN_PROVIDER [ logical, is_zmq_slave ] + implicit none + BEGIN_DOC + ! If |true|, the current process is a |ZeroMQ| slave. + END_DOC + character*(128) :: buffer + call getenv('QP_RUN_ADDRESS_MASTER',buffer) + is_zmq_slave = (trim(buffer) /= '') + +END_PROVIDER + From f88bbbf11a4966c2a878d7db2430a889da397901 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Jan 2019 00:39:54 +0100 Subject: [PATCH 3/6] Documentation --- data/module_gitignore | 4 +- docs/source/modules/ao_basis.rst | 657 +++ docs/source/modules/ao_one_e_ints.rst | 1040 +++++ docs/source/modules/ao_two_e_erf_ints.rst | 425 ++ docs/source/modules/ao_two_e_ints.rst | 619 +++ docs/source/modules/aux_quantities.rst | 52 + docs/source/modules/becke_numerical_grid.rst | 454 ++ docs/source/modules/bitmask.rst | 1272 +++++ docs/source/modules/cipsi.rst | 978 ++++ docs/source/modules/cis.rst | 117 + docs/source/modules/cisd.rst | 117 + docs/source/modules/davidson.rst | 720 +++ docs/source/modules/davidson_dressed.rst | 13 + docs/source/modules/davidson_undressed.rst | 45 + docs/source/modules/density_for_dft.rst | 119 + docs/source/modules/determinants.rst | 4072 +++++++++++++++++ docs/source/modules/dft_keywords.rst | 59 + docs/source/modules/dft_utils_in_r.rst | 361 ++ docs/source/modules/dft_utils_one_e.rst | 1951 ++++++++ docs/source/modules/dressing.rst | 36 + docs/source/modules/electrons.rst | 76 + docs/source/modules/ezfio_files.rst | 151 + docs/source/modules/fci.rst | 82 + docs/source/modules/generators_cas.rst | 19 + docs/source/modules/generators_full.rst | 145 + docs/source/modules/hartree_fock.rst | 132 + docs/source/modules/iterations.rst | 114 + docs/source/modules/kohn_sham.rst | 352 ++ docs/source/modules/kohn_sham_rs.rst | 95 + docs/source/modules/mo_basis.rst | 370 ++ docs/source/modules/mo_guess.rst | 87 + docs/source/modules/mo_one_e_ints.rst | 287 ++ docs/source/modules/mo_two_e_erf_ints.rst | 488 ++ docs/source/modules/mo_two_e_ints.rst | 590 +++ docs/source/modules/mpi.rst | 130 + docs/source/modules/nuclei.rst | 351 ++ docs/source/modules/perturbation.rst | 560 +++ docs/source/modules/pseudo.rst | 94 + docs/source/modules/psiref_cas.rst | 14 + docs/source/modules/psiref_utils.rst | 16 + docs/source/modules/scf_utils.rst | 390 ++ docs/source/modules/selectors_cassd.rst | 13 + docs/source/modules/selectors_full.rst | 72 + docs/source/modules/selectors_utils.rst | 381 ++ docs/source/modules/single_ref_method.rst | 14 + docs/source/modules/tools.rst | 222 + docs/source/modules/utils.rst | 1960 ++++++++ docs/source/modules/zmq.rst | 898 ++++ .../programmers_guide/index_providers.rst | 12 +- scripts/module/module_handler.py | 6 +- src/cis/20.cis.bats | 6 +- src/cisd/30.cisd.bats | 17 +- src/hartree_fock/10.hf.bats | 4 +- tests/.gitignore | 1 + 54 files changed, 21247 insertions(+), 13 deletions(-) create mode 100644 docs/source/modules/ao_basis.rst create mode 100644 docs/source/modules/ao_one_e_ints.rst create mode 100644 docs/source/modules/ao_two_e_erf_ints.rst create mode 100644 docs/source/modules/ao_two_e_ints.rst create mode 100644 docs/source/modules/aux_quantities.rst create mode 100644 docs/source/modules/becke_numerical_grid.rst create mode 100644 docs/source/modules/bitmask.rst create mode 100644 docs/source/modules/cipsi.rst create mode 100644 docs/source/modules/cis.rst create mode 100644 docs/source/modules/cisd.rst create mode 100644 docs/source/modules/davidson.rst create mode 100644 docs/source/modules/davidson_dressed.rst create mode 100644 docs/source/modules/davidson_undressed.rst create mode 100644 docs/source/modules/density_for_dft.rst create mode 100644 docs/source/modules/determinants.rst create mode 100644 docs/source/modules/dft_keywords.rst create mode 100644 docs/source/modules/dft_utils_in_r.rst create mode 100644 docs/source/modules/dft_utils_one_e.rst create mode 100644 docs/source/modules/dressing.rst create mode 100644 docs/source/modules/electrons.rst create mode 100644 docs/source/modules/ezfio_files.rst create mode 100644 docs/source/modules/fci.rst create mode 100644 docs/source/modules/generators_cas.rst create mode 100644 docs/source/modules/generators_full.rst create mode 100644 docs/source/modules/hartree_fock.rst create mode 100644 docs/source/modules/iterations.rst create mode 100644 docs/source/modules/kohn_sham.rst create mode 100644 docs/source/modules/kohn_sham_rs.rst create mode 100644 docs/source/modules/mo_basis.rst create mode 100644 docs/source/modules/mo_guess.rst create mode 100644 docs/source/modules/mo_one_e_ints.rst create mode 100644 docs/source/modules/mo_two_e_erf_ints.rst create mode 100644 docs/source/modules/mo_two_e_ints.rst create mode 100644 docs/source/modules/mpi.rst create mode 100644 docs/source/modules/nuclei.rst create mode 100644 docs/source/modules/perturbation.rst create mode 100644 docs/source/modules/pseudo.rst create mode 100644 docs/source/modules/psiref_cas.rst create mode 100644 docs/source/modules/psiref_utils.rst create mode 100644 docs/source/modules/scf_utils.rst create mode 100644 docs/source/modules/selectors_cassd.rst create mode 100644 docs/source/modules/selectors_full.rst create mode 100644 docs/source/modules/selectors_utils.rst create mode 100644 docs/source/modules/single_ref_method.rst create mode 100644 docs/source/modules/tools.rst create mode 100644 docs/source/modules/utils.rst create mode 100644 docs/source/modules/zmq.rst create mode 100644 tests/.gitignore diff --git a/data/module_gitignore b/data/module_gitignore index 6369c858..04989d6e 100644 --- a/data/module_gitignore +++ b/data/module_gitignore @@ -6,7 +6,7 @@ irpf90_entities tags Makefile ao_basis -ao_one_e_integrals +ao_one_e_ints ao_two_e_erf_ints ao_two_e_ints aux_quantities @@ -36,7 +36,7 @@ kohn_sham kohn_sham_rs mo_basis mo_guess -mo_one_e_integrals +mo_one_e_ints mo_two_e_erf_ints mo_two_e_ints mpi diff --git a/docs/source/modules/ao_basis.rst b/docs/source/modules/ao_basis.rst new file mode 100644 index 00000000..863e9eec --- /dev/null +++ b/docs/source/modules/ao_basis.rst @@ -0,0 +1,657 @@ +.. _ao_basis: + +.. program:: ao_basis + +.. default-role:: option + +======== +ao_basis +======== + +This module describes the atomic orbitals basis set. + +An |AO| :math:`\chi` centered on nucleus A is represented as: + +.. math:: + + \chi_i({\bf r}) = (x-X_A)^a (y-Y_A)^b (z-Z_A)^c \sum_k c_{ki} e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} + + +The |AO| coefficients are normalized as: + +.. math:: + + {\tilde c}_{ki} = \frac{c_{ki}}{ \int \left( (x-X_A)^a (y-Y_A)^b (z-Z_A)^c e^{-\gamma_{ki} |{\bf r} - {\bf R}_A|^2} \right)^2 dr} + +Warning: `ao_coef` contains the |AO| coefficients given in input. These do not +include the normalization constant of the |AO|. The `ao_coef_normalized` provider includes +this normalization factor. + +The |AOs| are also sorted by increasing exponent to accelerate the calculation of +the two electron integrals. + + + + + + +EZFIO parameters +---------------- + +.. option:: ao_basis + + Name of the |AO| basis set + + +.. option:: ao_num + + Number of |AOs| + + +.. option:: ao_prim_num + + Number of primitives per |AO| + + +.. option:: ao_prim_num_max + + Maximum number of primitives + + Default: =maxval(ao_basis.ao_prim_num) + +.. option:: ao_nucl + + Index of the nucleus on which the |AO| is centered + + +.. option:: ao_power + + Powers of x, y and z for each |AO| + + +.. option:: ao_coef + + Primitive coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs. + + +.. option:: ao_expo + + Exponents for each primitive of each |AO| + + +.. option:: ao_md5 + + MD5 key, specific of the |AO| basis + + +.. option:: ao_cartesian + + If |true|, use |AOs| in Cartesian coordinates (6d,10f,...) + + Default: false + + +Providers +--------- + + +.. c:var:: ao_coef_normalization_factor + + .. code:: text + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + File: :file:`aos.irp.f` + + Coefficients including the |AO| normalization + + + + +.. c:var:: ao_coef_normalization_libint_factor + + .. code:: text + + double precision, allocatable :: ao_coef_normalization_libint_factor (ao_num) + + File: :file:`aos.irp.f` + + |AO| normalization for interfacing with libint + + + + +.. c:var:: ao_coef_normalized + + .. code:: text + + double precision, allocatable :: ao_coef_normalized (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_coef_normalization_factor (ao_num) + + File: :file:`aos.irp.f` + + Coefficients including the |AO| normalization + + + + +.. c:var:: ao_coef_normalized_ordered + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) + + File: :file:`aos.irp.f` + + Sorted primitives to accelerate 4 index |MO| transformation + + + + +.. c:var:: ao_coef_normalized_ordered_transp + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered_transp (ao_prim_num_max,ao_num) + + File: :file:`aos.irp.f` + + Transposed :c:data:`ao_coef_normalized_ordered` + + + + +.. c:var:: ao_coef_normalized_ordered_transp_per_nucl + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_expo_ordered + + .. code:: text + + double precision, allocatable :: ao_coef_normalized_ordered (ao_num,ao_prim_num_max) + double precision, allocatable :: ao_expo_ordered (ao_num,ao_prim_num_max) + + File: :file:`aos.irp.f` + + Sorted primitives to accelerate 4 index |MO| transformation + + + + +.. c:var:: ao_expo_ordered_transp + + .. code:: text + + double precision, allocatable :: ao_expo_ordered_transp (ao_prim_num_max,ao_num) + + File: :file:`aos.irp.f` + + Transposed :c:data:`ao_expo_ordered` + + + + +.. c:var:: ao_expo_ordered_transp_per_nucl + + .. code:: text + + double precision, allocatable :: ao_expo_ordered_transp_per_nucl (ao_prim_num_max,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_l + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_l_char + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_l_char_space + + .. code:: text + + character*(4), allocatable :: ao_l_char_space (ao_num) + + File: :file:`aos.irp.f` + + Converts an l value to a string + + + + +.. c:var:: ao_l_max + + .. code:: text + + integer, allocatable :: ao_l (ao_num) + integer :: ao_l_max + character*(128), allocatable :: ao_l_char (ao_num) + + File: :file:`aos.irp.f` + + :math:`l` value of the |AO|: :math`a+b+c` in :math:`x^a y^b z^c` + + + + +.. c:var:: ao_power_ordered_transp_per_nucl + + .. code:: text + + integer, allocatable :: ao_power_ordered_transp_per_nucl (3,N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + + + + + +.. c:var:: ao_prim_num_max + + .. code:: text + + integer :: ao_prim_num_max + + File: :file:`aos.irp.f` + + Max number of primitives. + + + + +.. c:var:: cart_to_sphe_0 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_0 (1,1) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=0 + + + + +.. c:var:: cart_to_sphe_1 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_1 (3,3) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=1 + + + + +.. c:var:: cart_to_sphe_2 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_2 (6,5) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=2 + + + + +.. c:var:: cart_to_sphe_3 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_3 (10,7) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=3 + + + + +.. c:var:: cart_to_sphe_4 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_4 (15,9) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=4 + + + + +.. c:var:: cart_to_sphe_5 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_5 (21,11) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=5 + + + + +.. c:var:: cart_to_sphe_6 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_6 (28,13) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=6 + + + + +.. c:var:: cart_to_sphe_7 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_7 (36,15) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=7 + + + + +.. c:var:: cart_to_sphe_8 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_8 (45,17) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=8 + + + + +.. c:var:: cart_to_sphe_9 + + .. code:: text + + double precision, allocatable :: cart_to_sphe_9 (55,19) + + File: :file:`spherical_to_cartesian.irp.f` + + Spherical -> Cartesian Transformation matrix for l=9 + + + + +.. c:var:: l_to_charater + + .. code:: text + + character*(128), allocatable :: l_to_charater (0:7) + + File: :file:`aos.irp.f` + + Character corresponding to the "l" value of an |AO| + + + + +.. c:var:: n_aos_max + + .. code:: text + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + File: :file:`aos.irp.f` + + Number of |AOs| per atom + + + + +.. c:var:: n_pt_max_i_x + + .. code:: text + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + File: :file:`dimensions_integrals.irp.f` + + Number of points used in the numerical integrations. + + + + +.. c:var:: n_pt_max_integrals + + .. code:: text + + integer :: n_pt_max_integrals + integer :: n_pt_max_i_x + + File: :file:`dimensions_integrals.irp.f` + + Number of points used in the numerical integrations. + + + + +.. c:var:: nucl_aos + + .. code:: text + + integer, allocatable :: nucl_aos (nucl_num,N_AOs_max) + + File: :file:`aos.irp.f` + + List of |AOs| centered on each atom + + + + +.. c:var:: nucl_aos_transposed + + .. code:: text + + integer, allocatable :: nucl_aos_transposed (N_AOs_max,nucl_num) + + File: :file:`aos_transp.irp.f` + + List of AOs attached on each atom + + + + +.. c:var:: nucl_list_shell_aos + + .. code:: text + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + File: :file:`aos.irp.f` + + Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis + + + + +.. c:var:: nucl_n_aos + + .. code:: text + + integer, allocatable :: nucl_n_aos (nucl_num) + integer :: n_aos_max + + File: :file:`aos.irp.f` + + Number of |AOs| per atom + + + + +.. c:var:: nucl_num_shell_aos + + .. code:: text + + integer, allocatable :: nucl_list_shell_aos (nucl_num,N_AOs_max) + integer, allocatable :: nucl_num_shell_aos (nucl_num) + + File: :file:`aos.irp.f` + + Index of the shell type |AOs| and of the corresponding |AOs| By convention, for p,d,f and g |AOs|, we take the index of the |AO| with the the corresponding power in the x axis + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_power_index + + .. code:: text + + integer function ao_power_index(nx,ny,nz) + + File: :file:`aos.irp.f` + + Unique index given to a triplet of powers: + + :math:`\frac{1}{2} (l-n_x) (l-n_x+1) + n_z + 1` + + + + + +.. c:function:: ao_value + + .. code:: text + + double precision function ao_value(i,r) + + File: :file:`aos_value.irp.f` + + return the value of the ith ao at point r + + + + + +.. c:function:: give_all_aos_and_grad_and_lapl_at_r + + .. code:: text + + subroutine give_all_aos_and_grad_and_lapl_at_r(r,aos_array,aos_grad_array,aos_lapl_array) + + File: :file:`aos_value.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r + + + + + +.. c:function:: give_all_aos_and_grad_at_r + + .. code:: text + + subroutine give_all_aos_and_grad_at_r(r,aos_array,aos_grad_array) + + File: :file:`aos_value.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : aos_array(i) = ao(i) evaluated at r : aos_grad_array(1,i) = gradient X of the ao(i) evaluated at r + + + + + +.. c:function:: give_all_aos_at_r + + .. code:: text + + subroutine give_all_aos_at_r(r,aos_array) + + File: :file:`aos_value.irp.f` + + input : r == r(1) = x and so on aos_array(i) = aos(i) evaluated in r + + + + + +.. c:function:: give_all_aos_at_r_old + + .. code:: text + + subroutine give_all_aos_at_r_old(r,aos_array) + + File: :file:`aos_value.irp.f` + + gives the values of aos at a given point r + + + + + +.. c:function:: primitive_value + + .. code:: text + + double precision function primitive_value(i,j,r) + + File: :file:`aos_value.irp.f` + + return the value of the jth primitive of ith ao at point r WITHOUT THE COEF + + diff --git a/docs/source/modules/ao_one_e_ints.rst b/docs/source/modules/ao_one_e_ints.rst new file mode 100644 index 00000000..f8691b5e --- /dev/null +++ b/docs/source/modules/ao_one_e_ints.rst @@ -0,0 +1,1040 @@ +.. _ao_one_e_ints: + +.. program:: ao_one_e_ints + +.. default-role:: option + +================== +ao_one_e_integrals +================== + +All the one-electron integrals in the |AO| basis are here. + +The most important providers for usual quantum-chemistry calculation are: + +* `ao_kinetic_integral` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_ao_ints.irp.f`) +* `ao_nucl_elec_integral` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_ao_ints.irp.f`) +* `ao_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`ao_mono_ints.irp.f`) + + +Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_ao.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: ao_integrals_e_n + + Nucleus-electron integrals in |AO| basis set + + +.. option:: io_ao_integrals_e_n + + Read/Write |AO| nucleus-electron attraction integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_kinetic + + Kinetic energy integrals in |AO| basis set + + +.. option:: io_ao_integrals_kinetic + + Read/Write |AO| kinetic integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_pseudo + + Pseudopotential integrals in |AO| basis set + + +.. option:: io_ao_integrals_pseudo + + Read/Write |AO| pseudopotential integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_overlap + + Overlap integrals in |AO| basis set + + +.. option:: io_ao_integrals_overlap + + Read/Write |AO| overlap integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_one_e_integrals + + Combined integrals in |AO| basis set + + +.. option:: io_ao_one_e_integrals + + Read/Write |AO| one-electron integrals from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: ao_cart_to_sphe_coef + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + File: :file:`ao_ortho_canonical.irp.f` + + Coefficients to go from cartesian to spherical coordinates in the current basis set + + + + +.. c:var:: ao_cart_to_sphe_inv + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_inv (ao_cart_to_sphe_num,ao_num) + + File: :file:`ao_ortho_canonical.irp.f` + + Inverse of :c:data:`ao_cart_to_sphe_coef` + + + + +.. c:var:: ao_cart_to_sphe_num + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_coef (ao_num,ao_num) + integer :: ao_cart_to_sphe_num + + File: :file:`ao_ortho_canonical.irp.f` + + Coefficients to go from cartesian to spherical coordinates in the current basis set + + + + +.. c:var:: ao_cart_to_sphe_overlap + + .. code:: text + + double precision, allocatable :: ao_cart_to_sphe_overlap (ao_cart_to_sphe_num,ao_cart_to_sphe_num) + + File: :file:`ao_ortho_canonical.irp.f` + + |AO| overlap matrix in the spherical basis set + + + + +.. c:var:: ao_deriv2_x + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv2_y + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv2_z + + .. code:: text + + double precision, allocatable :: ao_deriv2_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv2_z (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Second derivative matrix elements in the |AO| basis. + + :math:`{\tt ao\_deriv2\_x} = \langle \chi_i(x,y,z) | \frac{\partial^2}{\partial x^2} |\chi_j (x,y,z) \rangle` + + + + + + +.. c:var:: ao_deriv_1_x + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_deriv_1_y + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_deriv_1_z + + .. code:: text + + double precision, allocatable :: ao_deriv_1_x (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_y (ao_num,ao_num) + double precision, allocatable :: ao_deriv_1_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * d/dx AO_j + + * array of the integrals of AO_i * d/dy AO_j + + * array of the integrals of AO_i * d/dz AO_j + + + + +.. c:var:: ao_dipole_x + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_dipole_y + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_dipole_z + + .. code:: text + + double precision, allocatable :: ao_dipole_x (ao_num,ao_num) + double precision, allocatable :: ao_dipole_y (ao_num,ao_num) + double precision, allocatable :: ao_dipole_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x AO_j + + * array of the integrals of AO_i * y AO_j + + * array of the integrals of AO_i * z AO_j + + + + +.. c:var:: ao_integrals_n_e + + .. code:: text + + double precision, allocatable :: ao_integrals_n_e (ao_num,ao_num) + + File: :file:`pot_ao_ints.irp.f` + + Nucleus-electron interaction, in the |AO| basis set. + + :math:`\langle \chi_i | -\sum_A \frac{1}{|r-R_A|} | \chi_j \rangle` + + + + +.. c:var:: ao_integrals_n_e_per_atom + + .. code:: text + + double precision, allocatable :: ao_integrals_n_e_per_atom (ao_num,ao_num,nucl_num) + + File: :file:`pot_ao_ints.irp.f` + + Nucleus-electron interaction in the |AO| basis set, per atom A. + + :math:`\langle \chi_i | -\frac{1}{|r-R_A|} | \chi_j \rangle` + + + + +.. c:var:: ao_kinetic_integrals + + .. code:: text + + double precision, allocatable :: ao_kinetic_integrals (ao_num,ao_num) + + File: :file:`kin_ao_ints.irp.f` + + Kinetic energy integrals in the |AO| basis. + + :math:`\langle \chi_i |\hat{T}| \chi_j \rangle` + + + + +.. c:var:: ao_one_e_integrals + + .. code:: text + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + File: :file:`ao_one_e_ints.irp.f` + + One-electron Hamiltonian in the |AO| basis. + + + + +.. c:var:: ao_one_e_integrals_diag + + .. code:: text + + double precision, allocatable :: ao_one_e_integrals (ao_num,ao_num) + double precision, allocatable :: ao_one_e_integrals_diag (ao_num) + + File: :file:`ao_one_e_ints.irp.f` + + One-electron Hamiltonian in the |AO| basis. + + + + +.. c:var:: ao_ortho_canonical_coef + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + File: :file:`ao_ortho_canonical.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital + + + + +.. c:var:: ao_ortho_canonical_coef_inv + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef_inv (ao_num,ao_num) + + File: :file:`ao_ortho_canonical.irp.f` + + ao_ortho_canonical_coef^(-1) + + + + +.. c:var:: ao_ortho_canonical_num + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_coef (ao_num,ao_num) + integer :: ao_ortho_canonical_num + + File: :file:`ao_ortho_canonical.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_canonical_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_canonical orbital + + + + +.. c:var:: ao_ortho_canonical_overlap + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_overlap (ao_ortho_canonical_num,ao_ortho_canonical_num) + + File: :file:`ao_ortho_canonical.irp.f` + + overlap matrix of the ao_ortho_canonical. Expected to be the Identity + + + + +.. c:var:: ao_overlap + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_abs + + .. code:: text + + double precision, allocatable :: ao_overlap_abs (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between absolute values of atomic basis functions: + + :math:`\int |\chi_i(r)| |\chi_j(r)| dr` + + + + +.. c:var:: ao_overlap_x + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_y + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_overlap_z + + .. code:: text + + double precision, allocatable :: ao_overlap (ao_num,ao_num) + double precision, allocatable :: ao_overlap_x (ao_num,ao_num) + double precision, allocatable :: ao_overlap_y (ao_num,ao_num) + double precision, allocatable :: ao_overlap_z (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Overlap between atomic basis functions: + + :math:`\int \chi_i(r) \chi_j(r) dr` + + + + +.. c:var:: ao_pseudo_integrals + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Pseudo-potential integrals in the |AO| basis set. + + + + +.. c:var:: ao_pseudo_integrals_local + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals_local (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Local pseudo-potential + + + + +.. c:var:: ao_pseudo_integrals_non_local + + .. code:: text + + double precision, allocatable :: ao_pseudo_integrals_non_local (ao_num,ao_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Non-local pseudo-potential + + + + +.. c:var:: ao_spread_x + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: ao_spread_y + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: ao_spread_z + + .. code:: text + + double precision, allocatable :: ao_spread_x (ao_num,ao_num) + double precision, allocatable :: ao_spread_y (ao_num,ao_num) + double precision, allocatable :: ao_spread_z (ao_num,ao_num) + + File: :file:`spread_dipole_ao.irp.f` + + * array of the integrals of AO_i * x^2 AO_j + + * array of the integrals of AO_i * y^2 AO_j + + * array of the integrals of AO_i * z^2 AO_j + + + + +.. c:var:: give_polynomial_mult_center_one_e_erf + + .. code:: text + + subroutine give_polynomial_mult_center_one_e_erf(A_center,B_center,alpha,beta,& + power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in) + + File: :file:`pot_ao_erf_ints.irp.f` + + Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + +.. c:var:: give_polynomial_mult_center_one_e_erf_opt + + .. code:: text + + subroutine give_polynomial_mult_center_one_e_erf_opt(A_center,B_center,alpha,beta,& + power_A,power_B,C_center,n_pt_in,d,n_pt_out,mu_in,p,p_inv,p_inv_2,p_new,P_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Returns the explicit polynomial in terms of the :math:`t` variable of the following polynomial: + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + +.. c:var:: i_x1_pol_mult_one_e + + .. code:: text + + recursive subroutine I_x1_pol_mult_one_e(a,c,R1x,R1xp,R2x,d,nd,n_pt_in) + + File: :file:`pot_ao_ints.irp.f` + + Recursive routine involved in the electron-nucleus potential + + + + +.. c:var:: i_x2_pol_mult_one_e + + .. code:: text + + recursive subroutine I_x2_pol_mult_one_e(c,R1x,R1xp,R2x,d,nd,dim) + + File: :file:`pot_ao_ints.irp.f` + + Recursive routine involved in the electron-nucleus potential + + + + +.. c:var:: pseudo_dz_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_dz_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_n_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_n_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_v_k_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_k_transp (pseudo_klocmax,nucl_num) + integer, allocatable :: pseudo_n_k_transp (pseudo_klocmax,nucl_num) + double precision, allocatable :: pseudo_dz_k_transp (pseudo_klocmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: pseudo_v_kl_transp + + .. code:: text + + double precision, allocatable :: pseudo_v_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + integer, allocatable :: pseudo_n_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + double precision, allocatable :: pseudo_dz_kl_transp (pseudo_kmax,0:pseudo_lmax,nucl_num) + + File: :file:`pot_ao_pseudo_ints.irp.f` + + Transposed arrays for pseudopotentials + + + + +.. c:var:: s_half + + .. code:: text + + double precision, allocatable :: s_half (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + :math:`S^{1/2}` + + + + +.. c:var:: s_half_inv + + .. code:: text + + double precision, allocatable :: s_half_inv (AO_num,AO_num) + + File: :file:`ao_overlap.irp.f` + + :math:`X = S^{-1/2}` obtained by SVD + + + + +.. c:var:: s_inv + + .. code:: text + + double precision, allocatable :: s_inv (ao_num,ao_num) + + File: :file:`ao_overlap.irp.f` + + Inverse of the overlap matrix + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: give_all_erf_kl_ao + + .. code:: text + + subroutine give_all_erf_kl_ao(integrals_ao,mu_in,C_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Subroutine that returns all integrals over :math:`r` of type :math:`\frac{ \erf(\mu * |r-R_C|) }{ |r-R_C| }` + + + + + +.. c:function:: give_polynomial_mult_center_one_e + + .. code:: text + + subroutine give_polynomial_mult_center_one_e(A_center,B_center,alpha,beta,power_A,power_B,C_center,n_pt_in,d,n_pt_out) + + File: :file:`pot_ao_ints.irp.f` + + Returns the explicit polynomial in terms of the "t" variable of the following + + :math:`I_{x1}(a_x, d_x,p,q) \times I_{x1}(a_y, d_y,p,q) \times I_{x1}(a_z, d_z,p,q)` . + + + + + +.. c:function:: int_gaus_pol + + .. code:: text + + double precision function int_gaus_pol(alpha,n) + + File: :file:`pot_ao_ints.irp.f` + + Computes the integral: + + :math:`\int_{-\infty}^{\infty} x^n \exp(-\alpha x^2) dx` . + + + + + +.. c:function:: nai_pol_mult + + .. code:: text + + double precision function NAI_pol_mult(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in) + + File: :file:`pot_ao_ints.irp.f` + + Computes the electron-nucleus attraction with two primitves. + + :math:`\langle g_i | \frac{1}{|r-R_c|} | g_j \rangle` + + + + + +.. c:function:: nai_pol_mult_erf + + .. code:: text + + double precision function NAI_pol_mult_erf(A_center,B_center,power_A,power_B,alpha,beta,C_center,n_pt_in,mu_in) + + File: :file:`pot_ao_erf_ints.irp.f` + + Computes the following integral : :math:`\int dr (x-A_x)^a (x-B_x)^b \exp(-\alpha (x-A_x)^2 - \beta (x-B_x)^2 ) \frac{\erf(\mu |r-R_C|)}{|r-R_c|}` . + + + + + +.. c:function:: nai_pol_mult_erf_ao + + .. code:: text + + double precision function NAI_pol_mult_erf_ao(i_ao,j_ao,mu_in,C_center) + + File: :file:`pot_ao_erf_ints.irp.f` + + Computes the following integral : :math:`\int_{-\infty}^{infty} dr \chi_i(r) \chi_j(r) \frac{\erf(\mu |r-R_C|)}{|r-R_C|}` . + + + + + +.. c:function:: overlap_bourrin_deriv_x + + .. code:: text + + subroutine overlap_bourrin_deriv_x(i_component,A_center,B_center,alpha,beta,power_A,power_B,dx,lower_exp_val,overlap_x,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: overlap_bourrin_dipole + + .. code:: text + + subroutine overlap_bourrin_dipole(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: overlap_bourrin_spread + + .. code:: text + + subroutine overlap_bourrin_spread(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + Computes the following integral : int [-infty ; +infty] of [(x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) * x ] needed for the dipole and those things + + + + + +.. c:function:: overlap_bourrin_x + + .. code:: text + + subroutine overlap_bourrin_x(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`spread_dipole_ao.irp.f` + + + + + + + +.. c:function:: v_e_n + + .. code:: text + + double precision function V_e_n(a_x,a_y,a_z,b_x,b_y,b_z,alpha,beta) + + File: :file:`pot_ao_ints.irp.f` + + Primitve nuclear attraction between the two primitves centered on the same atom. + + :math:`p_1 = x^{a_x} y^{a_y} z^{a_z} \exp(-\alpha r^2)` + + :math:`p_2 = x^{b_x} y^{b_y} z^{b_z} \exp(-\beta r^2)` + + + + + +.. c:function:: v_phi + + .. code:: text + + double precision function V_phi(n,m) + + File: :file:`pot_ao_ints.irp.f` + + Computes the angular :math:`\phi` part of the nuclear attraction integral: + + :math:`\int_{0}^{2 \pi} \cos(\phi)^n \sin(\phi)^m d\phi` . + + + + + +.. c:function:: v_r + + .. code:: text + + double precision function V_r(n,alpha) + + File: :file:`pot_ao_ints.irp.f` + + Computes the radial part of the nuclear attraction integral: + + :math:`\int_{0}^{\infty} r^n \exp(-\alpha r^2) dr` + + + + + + + +.. c:function:: v_theta + + .. code:: text + + double precision function V_theta(n,m) + + File: :file:`pot_ao_ints.irp.f` + + Computes the angular :math:`\theta` part of the nuclear attraction integral: + + :math:`\int_{0}^{\pi} \cos(\theta)^n \sin(\theta)^m d\theta` + + + + + +.. c:function:: wallis + + .. code:: text + + double precision function Wallis(n) + + File: :file:`pot_ao_ints.irp.f` + + Wallis integral: + + :math:`\int_{0}^{\pi} \cos(\theta)^n d\theta` . + + diff --git a/docs/source/modules/ao_two_e_erf_ints.rst b/docs/source/modules/ao_two_e_erf_ints.rst new file mode 100644 index 00000000..0d91b17d --- /dev/null +++ b/docs/source/modules/ao_two_e_erf_ints.rst @@ -0,0 +1,425 @@ +.. _ao_two_e_erf_ints: + +.. program:: ao_two_e_erf_ints + +.. default-role:: option + +====================== +ao_two_e_erf_ints +====================== + +Here, all two-electron integrals (:math:`erf(\mu r_{12})/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`utils/map_module.f90`. + +The main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map)` function. + + +The conventions are: +* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_ao_two_e_integrals_erf + + Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mu_erf + + cutting of the interaction in the range separated model + + Default: 0.5 + + +Providers +--------- + + +.. c:var:: ao_integrals_erf_cache + + .. code:: text + + double precision, allocatable :: ao_integrals_erf_cache (0:64*64*64*64) + + File: :file:`map_integrals_erf.irp.f` + + Cache of |AO| integrals for fast access + + + + +.. c:var:: ao_integrals_erf_cache_max + + .. code:: text + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_erf_cache_min + + .. code:: text + + integer :: ao_integrals_erf_cache_min + integer :: ao_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_erf_map + + .. code:: text + + type(map_type) :: ao_integrals_erf_map + + File: :file:`map_integrals_erf.irp.f` + + |AO| integrals + + + + +.. c:var:: ao_two_e_integral_erf_schwartz + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_erf_schwartz (ao_num,ao_num) + + File: :file:`providers_ao_erf.irp.f` + + Needed to compute Schwartz inequalities + + + + +.. c:var:: ao_two_e_integrals_erf_in_map + + .. code:: text + + logical :: ao_two_e_integrals_erf_in_map + + File: :file:`providers_ao_erf.irp.f` + + Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) + + + + +.. c:var:: general_primitive_integral_erf + + .. code:: text + + double precision function general_primitive_integral_erf(dim, & + P_new,P_center,fact_p,p,p_inv,iorder_p, & + Q_new,Q_center,fact_q,q,q_inv,iorder_q) + + File: :file:`two_e_integrals_erf.irp.f` + + Computes the integral where p,q,r,s are Gaussian primitives + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_two_e_integral_erf + + .. code:: text + + double precision function ao_two_e_integral_erf(i,j,k,l) + + File: :file:`two_e_integrals_erf.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integral_schwartz_accel_erf + + .. code:: text + + double precision function ao_two_e_integral_schwartz_accel_erf(i,j,k,l) + + File: :file:`two_e_integrals_erf.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_collector + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_collector(zmq_socket_pull) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Collects results from the AO integral calculation + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave(thread,iproc) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_inproc + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave_inproc(i) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: ao_two_e_integrals_erf_in_map_slave_tcp + + .. code:: text + + subroutine ao_two_e_integrals_erf_in_map_slave_tcp(i) + + File: :file:`integrals_erf_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: clear_ao_erf_map + + .. code:: text + + subroutine clear_ao_erf_map + + File: :file:`map_integrals_erf.irp.f` + + Frees the memory of the |AO| map + + + + + +.. c:function:: compute_ao_integrals_erf_jl + + .. code:: text + + subroutine compute_ao_integrals_erf_jl(j,l,n_integrals,buffer_i,buffer_value) + + File: :file:`two_e_integrals_erf.irp.f` + + Parallel client for AO integrals + + + + + +.. c:function:: compute_ao_two_e_integrals_erf + + .. code:: text + + subroutine compute_ao_two_e_integrals_erf(j,k,l,sze,buffer_value) + + File: :file:`two_e_integrals_erf.irp.f` + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + + + + +.. c:function:: dump_ao_integrals_erf + + .. code:: text + + subroutine dump_ao_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Save to disk the |AO| erf integrals + + + + + +.. c:function:: eri_erf + + .. code:: text + + double precision function ERI_erf(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals_erf.irp.f` + + ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) + + + + + +.. c:function:: get_ao_erf_map_size + + .. code:: text + + function get_ao_erf_map_size() + + File: :file:`map_integrals_erf.irp.f` + + Returns the number of elements in the |AO| map + + + + + +.. c:function:: get_ao_two_e_integral_erf + + .. code:: text + + double precision function get_ao_two_e_integral_erf(i,j,k,l,map) result(result) + + File: :file:`map_integrals_erf.irp.f` + + Gets one |AO| two-electron integral from the |AO| map + + + + + +.. c:function:: get_ao_two_e_integrals_erf + + .. code:: text + + subroutine get_ao_two_e_integrals_erf(j,k,l,sze,out_val) + + File: :file:`map_integrals_erf.irp.f` + + Gets multiple |AO| two-electron integral from the |AO| map . All i are retrieved for j,k,l fixed. + + + + + +.. c:function:: get_ao_two_e_integrals_erf_non_zero + + .. code:: text + + subroutine get_ao_two_e_integrals_erf_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + File: :file:`map_integrals_erf.irp.f` + + Gets multiple |AO| two-electron integrals from the |AO| map . All non-zero i are retrieved for j,k,l fixed. + + + + + +.. c:function:: insert_into_ao_integrals_erf_map + + .. code:: text + + subroutine insert_into_ao_integrals_erf_map(n_integrals,buffer_i, buffer_values) + + File: :file:`map_integrals_erf.irp.f` + + Create new entry into |AO| map + + + + + +.. c:function:: integrale_new_erf + + .. code:: text + + subroutine integrale_new_erf(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) + + File: :file:`two_e_integrals_erf.irp.f` + + calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) + + + + + +.. c:function:: load_ao_integrals_erf + + .. code:: text + + integer function load_ao_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Read from disk the |AO| erf integrals + + + + + +.. c:function:: save_erf_two_e_integrals_ao + + .. code:: text + + subroutine save_erf_two_e_integrals_ao + + File: :file:`routines_save_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_ints_ao_into_ints_ao + + .. code:: text + + subroutine save_erf_two_e_ints_ao_into_ints_ao + + File: :file:`routines_save_integrals_erf.irp.f` + + + + diff --git a/docs/source/modules/ao_two_e_ints.rst b/docs/source/modules/ao_two_e_ints.rst new file mode 100644 index 00000000..c9b9074a --- /dev/null +++ b/docs/source/modules/ao_two_e_ints.rst @@ -0,0 +1,619 @@ +.. _ao_two_e_ints: + +.. program:: ao_two_e_ints + +.. default-role:: option + +================== +ao_two_e_ints +================== + +Here, all two-electron integrals (:math:`1/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`utils/map_module.f90`. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function. + + +The conventions are: +* For |AO| integrals : (ij|kl) = (11|22) = = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_ao_two_e_integrals + + Read/Write |AO| integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: ao_integrals_threshold + + If | (pq|rs) | < `ao_integrals_threshold` then (pq|rs) is zero + + Default: 1.e-15 + +.. option:: do_direct_integrals + + Compute integrals on the fly (very slow, only for debugging) + + Default: False + + +Providers +--------- + + +.. c:var:: ao_integrals_cache + + .. code:: text + + double precision, allocatable :: ao_integrals_cache (0:64*64*64*64) + + File: :file:`map_integrals.irp.f` + + Cache of AO integrals for fast access + + + + +.. c:var:: ao_integrals_cache_max + + .. code:: text + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + File: :file:`map_integrals.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_cache_min + + .. code:: text + + integer :: ao_integrals_cache_min + integer :: ao_integrals_cache_max + + File: :file:`map_integrals.irp.f` + + Min and max values of the AOs for which the integrals are in the cache + + + + +.. c:var:: ao_integrals_map + + .. code:: text + + type(map_type) :: ao_integrals_map + + File: :file:`map_integrals.irp.f` + + AO integrals + + + + +.. c:var:: ao_two_e_integral_schwartz + + .. code:: text + + double precision, allocatable :: ao_two_e_integral_schwartz (ao_num,ao_num) + + File: :file:`two_e_integrals.irp.f` + + Needed to compute Schwartz inequalities + + + + +.. c:var:: ao_two_e_integrals_in_map + + .. code:: text + + logical :: ao_two_e_integrals_in_map + + File: :file:`two_e_integrals.irp.f` + + Map of Atomic integrals i(r1) j(r2) 1/r12 k(r1) l(r2) + + + + +.. c:var:: gauleg_t2 + + .. code:: text + + double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) + double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) + + File: :file:`gauss_legendre.irp.f` + + t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) + + + + +.. c:var:: gauleg_w + + .. code:: text + + double precision, allocatable :: gauleg_t2 (n_pt_max_integrals,n_pt_max_integrals/2) + double precision, allocatable :: gauleg_w (n_pt_max_integrals,n_pt_max_integrals/2) + + File: :file:`gauss_legendre.irp.f` + + t_w(i,1,k) = w(i) t_w(i,2,k) = t(i) + + + + +.. c:var:: general_primitive_integral + + .. code:: text + + double precision function general_primitive_integral(dim, & + P_new,P_center,fact_p,p,p_inv,iorder_p, & + Q_new,Q_center,fact_q,q,q_inv,iorder_q) + + File: :file:`two_e_integrals.irp.f` + + Computes the integral where p,q,r,s are Gaussian primitives + + + + +.. c:var:: i_x1_new + + .. code:: text + + recursive subroutine I_x1_new(a,c,B_10,B_01,B_00,res,n_pt) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_a1 + + .. code:: text + + recursive subroutine I_x1_pol_mult_a1(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_a2 + + .. code:: text + + recursive subroutine I_x1_pol_mult_a2(c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x1_pol_mult_recurs + + .. code:: text + + recursive subroutine I_x1_pol_mult_recurs(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x2_new + + .. code:: text + + recursive subroutine I_x2_new(c,B_10,B_01,B_00,res,n_pt) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +.. c:var:: i_x2_pol_mult + + .. code:: text + + recursive subroutine I_x2_pol_mult(c,B_10,B_01,B_00,C_00,D_00,d,nd,dim) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_l4 + + .. code:: text + + integer function ao_l4(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + Computes the product of l values of i,j,k,and l + + + + + +.. c:function:: ao_two_e_integral + + .. code:: text + + double precision function ao_two_e_integral(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integral_schwartz_accel + + .. code:: text + + double precision function ao_two_e_integral_schwartz_accel(i,j,k,l) + + File: :file:`two_e_integrals.irp.f` + + integral of the AO basis or (ij|kl) i(r1) j(r1) 1/r12 k(r2) l(r2) + + + + + +.. c:function:: ao_two_e_integrals_in_map_collector + + .. code:: text + + subroutine ao_two_e_integrals_in_map_collector(zmq_socket_pull) + + File: :file:`integrals_in_map_slave.irp.f` + + Collects results from the AO integral calculation + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave(thread,iproc) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave_inproc + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave_inproc(i) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: ao_two_e_integrals_in_map_slave_tcp + + .. code:: text + + subroutine ao_two_e_integrals_in_map_slave_tcp(i) + + File: :file:`integrals_in_map_slave.irp.f` + + Computes a buffer of integrals. i is the ID of the current thread. + + + + + +.. c:function:: clear_ao_map + + .. code:: text + + subroutine clear_ao_map + + File: :file:`map_integrals.irp.f` + + Frees the memory of the AO map + + + + + +.. c:function:: compute_ao_integrals_jl + + .. code:: text + + subroutine compute_ao_integrals_jl(j,l,n_integrals,buffer_i,buffer_value) + + File: :file:`two_e_integrals.irp.f` + + Parallel client for AO integrals + + + + + +.. c:function:: compute_ao_two_e_integrals + + .. code:: text + + subroutine compute_ao_two_e_integrals(j,k,l,sze,buffer_value) + + File: :file:`two_e_integrals.irp.f` + + Compute AO 1/r12 integrals for all i and fixed j,k,l + + + + + +.. c:function:: dump_ao_integrals + + .. code:: text + + subroutine dump_ao_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Save to disk the |AO| integrals + + + + + +.. c:function:: eri + + .. code:: text + + double precision function ERI(alpha,beta,delta,gama,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals.irp.f` + + ATOMIC PRIMTIVE two-electron integral between the 4 primitives :: primitive_1 = x1**(a_x) y1**(a_y) z1**(a_z) exp(-alpha * r1**2) primitive_2 = x1**(b_x) y1**(b_y) z1**(b_z) exp(- beta * r1**2) primitive_3 = x2**(c_x) y2**(c_y) z2**(c_z) exp(-delta * r2**2) primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) + + + + + +.. c:function:: gauleg + + .. code:: text + + subroutine gauleg(x1,x2,x,w,n) + + File: :file:`gauss_legendre.irp.f` + + Gauss-Legendre + + + + + +.. c:function:: get_ao_map_size + + .. code:: text + + function get_ao_map_size() + + File: :file:`map_integrals.irp.f` + + Returns the number of elements in the AO map + + + + + +.. c:function:: get_ao_two_e_integral + + .. code:: text + + double precision function get_ao_two_e_integral(i,j,k,l,map) result(result) + + File: :file:`map_integrals.irp.f` + + Gets one AO bi-electronic integral from the AO map + + + + + +.. c:function:: get_ao_two_e_integrals + + .. code:: text + + subroutine get_ao_two_e_integrals(j,k,l,sze,out_val) + + File: :file:`map_integrals.irp.f` + + Gets multiple AO bi-electronic integral from the AO map . All i are retrieved for j,k,l fixed. + + + + + +.. c:function:: get_ao_two_e_integrals_non_zero + + .. code:: text + + subroutine get_ao_two_e_integrals_non_zero(j,k,l,sze,out_val,out_val_index,non_zero_int) + + File: :file:`map_integrals.irp.f` + + Gets multiple AO bi-electronic integral from the AO map . All non-zero i are retrieved for j,k,l fixed. + + + + + +.. c:function:: give_polynom_mult_center_x + + .. code:: text + + subroutine give_polynom_mult_center_x(P_center,Q_center,a_x,d_x,p,q,n_pt_in,pq_inv,pq_inv_2,p10_1,p01_1,p10_2,p01_2,d,n_pt_out) + + File: :file:`two_e_integrals.irp.f` + + subroutine that returns the explicit polynom in term of the "t" variable of the following polynomw : I_x1(a_x, d_x,p,q) * I_x1(a_y, d_y,p,q) * I_x1(a_z, d_z,p,q) + + + + + +.. c:function:: i_x1_pol_mult + + .. code:: text + + subroutine I_x1_pol_mult(a,c,B_10,B_01,B_00,C_00,D_00,d,nd,n_pt_in) + + File: :file:`two_e_integrals.irp.f` + + recursive function involved in the two-electron integral + + + + + +.. c:function:: insert_into_ao_integrals_map + + .. code:: text + + subroutine insert_into_ao_integrals_map(n_integrals,buffer_i, buffer_values) + + File: :file:`map_integrals.irp.f` + + Create new entry into AO map + + + + + +.. c:function:: integrale_new + + .. code:: text + + subroutine integrale_new(I_f,a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z,p,q,n_pt) + + File: :file:`two_e_integrals.irp.f` + + calculate the integral of the polynom :: I_x1(a_x+b_x, c_x+d_x,p,q) * I_x1(a_y+b_y, c_y+d_y,p,q) * I_x1(a_z+b_z, c_z+d_z,p,q) between ( 0 ; 1) + + + + + +.. c:function:: load_ao_integrals + + .. code:: text + + integer function load_ao_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Read from disk the |AO| integrals + + + + + +.. c:function:: n_pt_sup + + .. code:: text + + integer function n_pt_sup(a_x,b_x,c_x,d_x,a_y,b_y,c_y,d_y,a_z,b_z,c_z,d_z) + + File: :file:`two_e_integrals.irp.f` + + Returns the upper boundary of the degree of the polynomial involved in the bielctronic integral : Ix(a_x,b_x,c_x,d_x) * Iy(a_y,b_y,c_y,d_y) * Iz(a_z,b_z,c_z,d_z) + + + + + +.. c:function:: push_integrals + + .. code:: text + + subroutine push_integrals(zmq_socket_push, n_integrals, buffer_i, buffer_value, task_id) + + File: :file:`integrals_in_map_slave.irp.f` + + Push integrals in the push socket + + + + + +.. c:function:: two_e_integrals_index + + .. code:: text + + subroutine two_e_integrals_index(i,j,k,l,i1) + + File: :file:`map_integrals.irp.f` + + + + + + + +.. c:function:: two_e_integrals_index_reverse + + .. code:: text + + subroutine two_e_integrals_index_reverse(i,j,k,l,i1) + + File: :file:`map_integrals.irp.f` + + + + diff --git a/docs/source/modules/aux_quantities.rst b/docs/source/modules/aux_quantities.rst new file mode 100644 index 00000000..ba56eac3 --- /dev/null +++ b/docs/source/modules/aux_quantities.rst @@ -0,0 +1,52 @@ +.. _aux_quantities: + +.. program:: aux_quantities + +.. default-role:: option + +============== +aux_quantities +============== + + +This module contains some global variables (such as densities and energies) +which are stored in the EZFIO folder in a different place than determinants. +This is used in practice to store density matrices which can be obtained from +any methods, as long as they are stored in the same MO basis which is used for +the calculations. In |RSDFT| calculations, this can be done to perform damping +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 + one-body alpha and beta densities which are necessary read from the EZFIO + folder. + + +Thanks to these providers you can use any density matrix that does not +necessary corresponds to that of the current wave function. + + + +EZFIO parameters +---------------- + +.. option:: data_energy_var + + Variational energy computed with the wave function + + +.. option:: data_energy_proj + + Projected energy computed with the wave function + + +.. option:: data_one_body_alpha_dm_mo + + Alpha one body density matrix on the MO basis computed with the wave function + + +.. option:: data_one_body_beta_dm_mo + + Beta one body density matrix on the MO basis computed with the wave function + diff --git a/docs/source/modules/becke_numerical_grid.rst b/docs/source/modules/becke_numerical_grid.rst new file mode 100644 index 00000000..1c77b50d --- /dev/null +++ b/docs/source/modules/becke_numerical_grid.rst @@ -0,0 +1,454 @@ +.. _becke_numerical_grid: + +.. program:: becke_numerical_grid + +.. default-role:: option + +==================== +becke_numerical_grid +==================== + +This module contains all quantities needed to build the Becke's grid used in general for DFT integration. Note that it can be used for whatever integration in R^3 as long as the functions to be integrated are mostly concentrated near the atomic regions. + +This grid is built as the reunion of a spherical grid around each atom. Each spherical grid contains +a certain number of radial and angular points. No pruning is done on the angular part of the grid. + +The main keyword for that modue is: + +* :option:`becke_numerical_grid grid_type_sgn` which controls the precision of the grid according the standard **SG-n** grids. This keyword controls the two providers `n_points_integration_angular` `n_points_radial_grid`. + +The main providers of that module are: + +* `n_points_integration_angular` which is the number of angular integration points. WARNING: it obeys to specific rules so it cannot be any integer number. Some of the possible values are [ 50 | 74 | 170 | 194 | 266 | 302 | 590 | 1202 | 2030 | 5810 ] for instance. See :file:`angular.f` for more details. +* `n_points_radial_grid` which is the number of radial angular points. This can be any strictly positive integer. Nevertheless, a minimum of 50 is in general necessary. +* `final_grid_points` which are the (x,y,z) coordinates of the grid points. +* `final_weight_at_r_vector` which are the weights at each grid point + + +For a simple example of how to use the grid, see :file:`example.irp.f`. + +The spherical integration uses Lebedev-Laikov grids, which was used from the code distributed through CCL (http://www.ccl.net/). +See next section for explanations and citation policies. + +.. code-block:: text + + This subroutine is part of a set of subroutines that generate + Lebedev grids [1-6] for integration on a sphere. The original + C-code [1] was kindly provided by Dr. Dmitri N. Laikov and + translated into fortran by Dr. Christoph van Wuellen. + This subroutine was translated using a C to fortran77 conversion + tool written by Dr. Christoph van Wuellen. + + Users of this code are asked to include reference [1] in their + publications, and in the user- and programmers-manuals + describing their codes. + + This code was distributed through CCL (http://www.ccl.net/). + + [1] V.I. Lebedev, and D.N. Laikov + "A quadrature formula for the sphere of the 131st + algebraic order of accuracy" + Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481. + + [2] V.I. Lebedev + "A quadrature formula for the sphere of 59th algebraic + order of accuracy" + Russian Acad. Sci. Dokl. Math., Vol. 50, 1995, pp. 283-286. + + [3] V.I. Lebedev, and A.L. Skorokhodov + "Quadrature formulas of orders 41, 47, and 53 for the sphere" + Russian Acad. Sci. Dokl. Math., Vol. 45, 1992, pp. 587-592. + + [4] V.I. Lebedev + "Spherical quadrature formulas exact to orders 25-29" + Siberian Mathematical Journal, Vol. 18, 1977, pp. 99-107. + + [5] V.I. Lebedev + "Quadratures on a sphere" + Computational Mathematics and Mathematical Physics, Vol. 16, + 1976, pp. 10-24. + + [6] V.I. Lebedev + "Values of the nodes and weights of ninth to seventeenth + order Gauss-Markov quadrature formulae invariant under the + octahedron group with inversion" + Computational Mathematics and Mathematical Physics, Vol. 15, + 1975, pp. 44-51. + + + + + +EZFIO parameters +---------------- + +.. option:: grid_type_sgn + + Type of grid used for the Becke's numerical grid. Can be, by increasing accuracy: [ 0 | 1 | 2 | 3 ] + + Default: 2 + + +Providers +--------- + + +.. c:var:: alpha_knowles + + .. code:: text + + double precision, allocatable :: alpha_knowles (100) + + File: :file:`integration_radial.irp.f` + + Recommended values for the alpha parameters according to the paper of Knowles (JCP, 104, 1996) as a function of the nuclear charge + + + + +.. c:var:: angular_quadrature_points + + .. code:: text + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + File: :file:`grid_becke.irp.f` + + weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme + + + + +.. c:var:: dr_radial_integral + + .. code:: text + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + File: :file:`grid_becke.irp.f` + + points in [0,1] to map the radial integral [0,\infty] + + + + +.. c:var:: final_grid_points + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: final_weight_at_r + + .. code:: text + + double precision, allocatable :: final_weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + Total weight on each grid point which takes into account all Lebedev, Voronoi and radial weights. + + + + +.. c:var:: final_weight_at_r_vector + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: grid_points_per_atom + + .. code:: text + + double precision, allocatable :: grid_points_per_atom (3,n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + x,y,z coordinates of grid points used for integration in 3d space + + + + +.. c:var:: grid_points_radial + + .. code:: text + + double precision, allocatable :: grid_points_radial (n_points_radial_grid) + double precision :: dr_radial_integral + + File: :file:`grid_becke.irp.f` + + points in [0,1] to map the radial integral [0,\infty] + + + + +.. c:var:: index_final_points + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: index_final_points_reverse + + .. code:: text + + double precision, allocatable :: final_grid_points (3,n_points_final_grid) + double precision, allocatable :: final_weight_at_r_vector (n_points_final_grid) + integer, allocatable :: index_final_points (3,n_points_final_grid) + integer, allocatable :: index_final_points_reverse (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke_vector.irp.f` + + final_grid_points(1:3,j) = (/ x, y, z /) of the jth grid point + + final_weight_at_r_vector(i) = Total weight function of the ith grid point which contains the Lebedev, Voronoi and radial weights contributions + + index_final_points(1:3,i) = gives the angular, radial and atomic indices associated to the ith grid point + + index_final_points_reverse(i,j,k) = index of the grid point having i as angular, j as radial and l as atomic indices + + + + +.. c:var:: m_knowles + + .. code:: text + + integer :: m_knowles + + File: :file:`grid_becke.irp.f` + + value of the "m" parameter in the equation (7) of the paper of Knowles (JCP, 104, 1996) + + + + +.. c:var:: n_points_final_grid + + .. code:: text + + integer :: n_points_final_grid + + File: :file:`grid_becke_vector.irp.f` + + Number of points which are non zero + + + + +.. c:var:: n_points_grid_per_atom + + .. code:: text + + integer :: n_points_grid_per_atom + + File: :file:`grid_becke.irp.f` + + Number of grid points per atom + + + + +.. c:var:: n_points_integration_angular + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + + n_points_integration_angular = number of angular grid points per atom + + These numbers are automatically set by setting the grid_type_sgn parameter + + + + +.. c:var:: n_points_radial_grid + + .. code:: text + + integer :: n_points_radial_grid + integer :: n_points_integration_angular + + File: :file:`grid_becke.irp.f` + + n_points_radial_grid = number of radial grid points per atom + + n_points_integration_angular = number of angular grid points per atom + + These numbers are automatically set by setting the grid_type_sgn parameter + + + + +.. c:var:: weight_at_r + + .. code:: text + + double precision, allocatable :: weight_at_r (n_points_integration_angular,n_points_radial_grid,nucl_num) + + File: :file:`grid_becke.irp.f` + + Weight function at grid points : w_n(r) according to the equation (22) of Becke original paper (JCP, 88, 1988) + + The "n" discrete variable represents the nucleis which in this array is represented by the last dimension and the points are labelled by the other dimensions. + + + + +.. c:var:: weights_angular_points + + .. code:: text + + double precision, allocatable :: angular_quadrature_points (n_points_integration_angular,3) + double precision, allocatable :: weights_angular_points (n_points_integration_angular) + + File: :file:`grid_becke.irp.f` + + weights and grid points for the integration on the angular variables on the unit sphere centered on (0,0,0) According to the LEBEDEV scheme + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cell_function_becke + + .. code:: text + + double precision function cell_function_becke(r,atom_number) + + File: :file:`step_function_becke.irp.f` + + atom_number :: atom on which the cell function of Becke (1988, JCP,88(4)) r(1:3) :: x,y,z coordinantes of the current point + + + + + +.. c:function:: derivative_knowles_function + + .. code:: text + + double precision function derivative_knowles_function(alpha,m,x) + + File: :file:`integration_radial.irp.f` + + Derivative of the function proposed by Knowles (JCP, 104, 1996) for distributing the radial points + + + + + +.. c:function:: example_becke_numerical_grid + + .. code:: text + + subroutine example_becke_numerical_grid + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in becke_numerical_grid + + + + + +.. c:function:: f_function_becke + + .. code:: text + + double precision function f_function_becke(x) + + File: :file:`step_function_becke.irp.f` + + + + + + + +.. c:function:: knowles_function + + .. code:: text + + double precision function knowles_function(alpha,m,x) + + File: :file:`integration_radial.irp.f` + + Function proposed by Knowles (JCP, 104, 1996) for distributing the radial points : the Log "m" function ( equation (7) in the paper ) + + + + + +.. c:function:: step_function_becke + + .. code:: text + + double precision function step_function_becke(x) + + File: :file:`step_function_becke.irp.f` + + Step function of the Becke paper (1988, JCP,88(4)) + + diff --git a/docs/source/modules/bitmask.rst b/docs/source/modules/bitmask.rst new file mode 100644 index 00000000..9cf72275 --- /dev/null +++ b/docs/source/modules/bitmask.rst @@ -0,0 +1,1272 @@ +.. _bitmask: + +.. program:: bitmask + +.. default-role:: option + +============== +bitmask module +============== + +The central part of this module is the :file:`bitmasks_module.f90` file. It contains +the constants that will be used to define on which kind of integer the bitmasks +will be defined. + +In the program, to represent a determinant as a pair of bitstrings, +the determinant should be defined as + +.. code-block:: fortran + + use bitmasks + integer(bit_kind) :: determinant(N_int,2) + + +:file:`bitmasks_routines.irp.f` contains helper routines to manipulate bitmask, like +transforming a bit string to a list of integers for example. + + +`bit_kind_shift`, `bit_kind_size` and `bit_kind` are supposed to be consistent:: + + 2**bit_kind_shift = bit_kind_size + bit_kind = bit_kind_size / 8 + + +For an example of how to use the bitmaks, see the file :file:`example.irp.f`. + + + +Providers +--------- + + +.. c:var:: cas_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: cas_bitmask (N_int,2,N_cas_bitmask) + + File: :file:`bitmasks.irp.f` + + Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference) + + + + +.. c:var:: closed_shell_ref_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: closed_shell_ref_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: core_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer :: n_core_orb + + File: :file:`bitmasks.irp.f` + + Core + deleted orbitals bitmask + + + + +.. c:var:: core_inact_act_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: core_inact_act_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: core_inact_virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive and virtual bitmasks + + + + +.. c:var:: full_ijkl_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: full_ijkl_bitmask (N_int) + + File: :file:`bitmasks.irp.f` + + Bitmask to include all possible MOs + + + + +.. c:var:: full_ijkl_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: full_ijkl_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: generators_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: generators_bitmask (N_int,2,6,N_generators_bitmask) + + File: :file:`bitmasks.irp.f` + + Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). + + 3rd index is : + + * 1 : hole for single exc + + * 2 : particle for single exc + + * 3 : hole for 1st exc of double + + * 4 : particle for 1st exc of double + + * 5 : hole for 2nd exc of double + + * 6 : particle for 2nd exc of double + + + + + + +.. c:var:: generators_bitmask_restart + + .. code:: text + + integer(bit_kind), allocatable :: generators_bitmask_restart (N_int,2,6,N_generators_bitmask_restart) + + File: :file:`bitmasks.irp.f` + + Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). + + 3rd index is : + + * 1 : hole for single exc + + * 2 : particle for single exc + + * 3 : hole for 1st exc of double + + * 4 : particle for 1st exc of double + + * 5 : hole for 2nd exc of double + + * 6 : particle for 2nd exc of double + + + + + + +.. c:var:: hf_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: hf_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Hartree Fock bit mask + + + + +.. c:var:: i_bitmask_gen + + .. code:: text + + integer :: i_bitmask_gen + + File: :file:`bitmasks.irp.f` + + Current bitmask for the generators + + + + +.. c:var:: inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: inact_virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_virt_bitmask (N_int,2) + integer(bit_kind), allocatable :: core_inact_virt_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive and virtual bitmasks + + + + +.. c:var:: index_holes_bitmask + + .. code:: text + + integer, allocatable :: index_holes_bitmask (3) + + File: :file:`modify_bitmasks.irp.f` + + Index of the holes in the generators_bitmasks + + + + +.. c:var:: index_particl_bitmask + + .. code:: text + + integer, allocatable :: index_particl_bitmask (3) + + File: :file:`modify_bitmasks.irp.f` + + Index of the holes in the generators_bitmasks + + + + +.. c:var:: list_act + + .. code:: text + + integer, allocatable :: list_act (n_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_act(i) = index of the ith active orbital + + list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital + + + + +.. c:var:: list_act_reverse + + .. code:: text + + integer, allocatable :: list_act (n_act_orb) + integer, allocatable :: list_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_act(i) = index of the ith active orbital + + list_act_reverse : reverse list of active orbitals list_act_reverse(i) = 0 ::> not an active list_act_reverse(i) = k ::> IS the kth active orbital + + + + +.. c:var:: list_core + + .. code:: text + + integer, allocatable :: list_core (n_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + List of the core orbitals that are never excited in post CAS method + + + + +.. c:var:: list_core_inact + + .. code:: text + + integer, allocatable :: list_core_inact (n_core_inact_orb) + integer, allocatable :: list_core_inact_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_act + + .. code:: text + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_act_reverse + + .. code:: text + + integer, allocatable :: list_core_inact_act (n_core_inact_act_orb) + integer, allocatable :: list_core_inact_act_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_inact_reverse + + .. code:: text + + integer, allocatable :: list_core_inact (n_core_inact_orb) + integer, allocatable :: list_core_inact_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: list_core_reverse + + .. code:: text + + integer, allocatable :: list_core (n_core_orb) + integer, allocatable :: list_core_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + List of the core orbitals that are never excited in post CAS method + + + + +.. c:var:: list_inact + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_inact_reverse + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_virt + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: list_virt_reverse + + .. code:: text + + integer, allocatable :: list_inact (n_inact_orb) + integer, allocatable :: list_virt (n_virt_orb) + integer, allocatable :: list_inact_reverse (mo_num) + integer, allocatable :: list_virt_reverse (mo_num) + + File: :file:`bitmasks.irp.f` + + list_inact : List of the inactive orbitals which are supposed to be doubly excited in post CAS methods list_virt : List of vritual orbitals which are supposed to be recieve electrons in post CAS methods list_inact_reverse : reverse list of inactive orbitals list_inact_reverse(i) = 0 ::> not an inactive list_inact_reverse(i) = k ::> IS the kth inactive list_virt_reverse : reverse list of virtual orbitals list_virt_reverse(i) = 0 ::> not an virtual list_virt_reverse(i) = k ::> IS the kth virtual + + + + +.. c:var:: mpi_bit_kind + + .. code:: text + + integer :: mpi_bit_kind + + File: :file:`mpi.irp.f` + + MPI bit kind type + + + + +.. c:var:: n_act_orb + + .. code:: text + + integer :: n_act_orb + + File: :file:`bitmasks.irp.f` + + number of active orbitals + + + + +.. c:var:: n_cas_bitmask + + .. code:: text + + integer :: n_cas_bitmask + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for CAS + + + + +.. c:var:: n_core_inact_act_orb + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + File: :file:`bitmasks.irp.f` + + Reunion of the core, inactive and active bitmasks + + + + +.. c:var:: n_core_inact_orb + + .. code:: text + + integer :: n_core_inact_orb + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_core_orb + + .. code:: text + + integer(bit_kind), allocatable :: core_bitmask (N_int,2) + integer :: n_core_orb + + File: :file:`bitmasks.irp.f` + + Core + deleted orbitals bitmask + + + + +.. c:var:: n_core_orb_allocate + + .. code:: text + + integer :: n_core_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_generators_bitmask + + .. code:: text + + integer :: n_generators_bitmask + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for generators + + + + +.. c:var:: n_generators_bitmask_restart + + .. code:: text + + integer :: n_generators_bitmask_restart + + File: :file:`bitmasks.irp.f` + + Number of bitmasks for generators + + + + +.. c:var:: n_inact_orb + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: n_inact_orb_allocate + + .. code:: text + + integer :: n_inact_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: n_int + + .. code:: text + + integer :: n_int + + File: :file:`bitmasks.irp.f` + + Number of 64-bit integers needed to represent determinants as binary strings + + + + +.. c:var:: n_virt_orb + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: n_virt_orb_allocate + + .. code:: text + + integer :: n_virt_orb_allocate + + File: :file:`bitmasks.irp.f` + + + + + + +.. c:var:: ref_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: ref_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask + + + + +.. c:var:: reunion_of_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive, active and virtual bitmasks + + + + +.. c:var:: reunion_of_cas_inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_cas_inact_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the inactive, active and virtual bitmasks + + + + +.. c:var:: reunion_of_core_inact_act_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_act_bitmask (N_int,2) + integer :: n_core_inact_act_orb + + File: :file:`bitmasks.irp.f` + + Reunion of the core, inactive and active bitmasks + + + + +.. c:var:: reunion_of_core_inact_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: reunion_of_core_inact_bitmask (N_int,2) + + File: :file:`bitmasks.irp.f` + + Reunion of the core and inactive and virtual bitmasks + + + + +.. c:var:: unpaired_alpha_electrons + + .. code:: text + + integer(bit_kind), allocatable :: unpaired_alpha_electrons (N_int) + + File: :file:`bitmasks.irp.f` + + Bitmask reprenting the unpaired alpha electrons in the HF_bitmask + + + + +.. c:var:: virt_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: inact_bitmask (N_int,2) + integer(bit_kind), allocatable :: virt_bitmask (N_int,2) + integer :: n_inact_orb + integer :: n_virt_orb + + File: :file:`bitmasks.irp.f` + + inact_bitmask : Bitmask of the inactive orbitals which are supposed to be doubly excited in post CAS methods n_inact_orb : Number of inactive orbitals virt_bitmask : Bitmaks of vritual orbitals which are supposed to be recieve electrons in post CAS methods n_virt_orb : Number of virtual orbitals + + + + +.. c:var:: virt_bitmask_4 + + .. code:: text + + integer(bit_kind), allocatable :: virt_bitmask_4 (N_int,4) + + File: :file:`bitmasks.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: bitstring_to_hexa + + .. code:: text + + subroutine bitstring_to_hexa( output, string, Nint ) + + File: :file:`bitmasks_routines.irp.f` + + Transform a bit string to a string in hexadecimal format for printing + + + + + +.. c:function:: bitstring_to_list + + .. code:: text + + subroutine bitstring_to_list( string, list, n_elements, Nint) + + File: :file:`bitmasks_routines.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string + + + + + +.. c:function:: bitstring_to_str + + .. code:: text + + subroutine bitstring_to_str( output, string, Nint ) + + File: :file:`bitmasks_routines.irp.f` + + Transform a bit string to a string for printing + + + + + +.. c:function:: broadcast_chunks_bit_kind + + .. code:: text + + subroutine broadcast_chunks_bit_kind(A, LDA) + + File: :file:`mpi.irp.f` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: clear_bit_to_integer + + .. code:: text + + subroutine clear_bit_to_integer(i_physical,key,Nint) + + File: :file:`bitmasks_routines.irp.f` + + set to 0 the bit number i_physical in the bitstring key + + + + + +.. c:function:: debug_det + + .. code:: text + + subroutine debug_det(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. + + + + + +.. c:function:: debug_spindet + + .. code:: text + + subroutine debug_spindet(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant in '+-' notation and hexadecimal representation. + + + + + +.. c:function:: example_bitmask + + .. code:: text + + subroutine example_bitmask + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in bitmask + + + + + +.. c:function:: initialize_bitmask_to_restart_ones + + .. code:: text + + subroutine initialize_bitmask_to_restart_ones + + File: :file:`modify_bitmasks.irp.f` + + Initialization of the generators_bitmask to the restart bitmask + + + + + +.. c:function:: is_a_1h + + .. code:: text + + logical function is_a_1h(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1h1p + + .. code:: text + + logical function is_a_1h1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1h2p + + .. code:: text + + logical function is_a_1h2p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_1p + + .. code:: text + + logical function is_a_1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2h + + .. code:: text + + logical function is_a_2h(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2h1p + + .. code:: text + + logical function is_a_2h1p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_2p + + .. code:: text + + logical function is_a_2p(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_a_two_holes_two_particles + + .. code:: text + + logical function is_a_two_holes_two_particles(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + logical function that returns True if the determinant 'key_in' belongs to the 2h-2p excitation class of the DDCI space this is calculated using the CAS_bitmask that defines the active orbital space, the inact_bitmasl that defines the inactive oribital space and the virt_bitmask that defines the virtual orbital space + + + + + +.. c:function:: is_i_in_virtual + + .. code:: text + + logical function is_i_in_virtual(i) + + File: :file:`bitmask_cas_routines.irp.f` + + + + + + + +.. c:function:: is_the_hole_in_det + + .. code:: text + + logical function is_the_hole_in_det(key_in,ispin,i_hole) + + File: :file:`find_hole.irp.f` + + + + + + + +.. c:function:: is_the_particl_in_det + + .. code:: text + + logical function is_the_particl_in_det(key_in,ispin,i_particl) + + File: :file:`find_hole.irp.f` + + + + + + + +.. c:function:: list_to_bitstring + + .. code:: text + + subroutine list_to_bitstring( string, list, n_elements, Nint) + + File: :file:`bitmasks_routines.irp.f` + + Returns the physical string "string(N_int,2)" from the array of occupations "list(N_int*bit_kind_size,2) + + + + + +.. c:function:: modify_bitmasks_for_hole + + .. code:: text + + subroutine modify_bitmasks_for_hole(i_hole) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons occupying i_hole + + + + + +.. c:function:: modify_bitmasks_for_hole_in_out + + .. code:: text + + subroutine modify_bitmasks_for_hole_in_out(i_hole) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons occupying i_hole + + + + + +.. c:function:: modify_bitmasks_for_particl + + .. code:: text + + subroutine modify_bitmasks_for_particl(i_part) + + File: :file:`modify_bitmasks.irp.f` + + modify the generators_bitmask in order that one can only excite the electrons to the orbital i_part + + + + + +.. c:function:: number_of_holes + + .. code:: text + + integer function number_of_holes(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + Function that returns the number of holes in the inact space + + + + + +.. c:function:: number_of_holes_verbose + + .. code:: text + + integer function number_of_holes_verbose(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of holes in the inact space + + + + + +.. c:function:: number_of_particles + + .. code:: text + + integer function number_of_particles(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of particles in the virtual space + + + + + +.. c:function:: number_of_particles_verbose + + .. code:: text + + integer function number_of_particles_verbose(key_in) + + File: :file:`bitmask_cas_routines.irp.f` + + function that returns the number of particles in the inact space + + + + + +.. c:function:: print_det + + .. code:: text + + subroutine print_det(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant using the '+-' notation + + + + + +.. c:function:: print_generators_bitmasks_holes + + .. code:: text + + subroutine print_generators_bitmasks_holes + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_holes_for_one_generator + + .. code:: text + + subroutine print_generators_bitmasks_holes_for_one_generator(i_gen) + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_particles + + .. code:: text + + subroutine print_generators_bitmasks_particles + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_generators_bitmasks_particles_for_one_generator + + .. code:: text + + subroutine print_generators_bitmasks_particles_for_one_generator(i_gen) + + File: :file:`modify_bitmasks.irp.f` + + + + + + + +.. c:function:: print_spindet + + .. code:: text + + subroutine print_spindet(string,Nint) + + File: :file:`bitmasks_routines.irp.f` + + Subroutine to print the content of a determinant using the '+-' notation + + + + + +.. c:function:: set_bit_to_integer + + .. code:: text + + subroutine set_bit_to_integer(i_physical,key,Nint) + + File: :file:`bitmasks_routines.irp.f` + + set to 1 the bit number i_physical in the bitstring key + + + + + +.. c:function:: set_bitmask_hole_as_input + + .. code:: text + + subroutine set_bitmask_hole_as_input(input_bimask) + + File: :file:`modify_bitmasks.irp.f` + + set the generators_bitmask for the holes as the input_bimask + + + + + +.. c:function:: set_bitmask_particl_as_input + + .. code:: text + + subroutine set_bitmask_particl_as_input(input_bimask) + + File: :file:`modify_bitmasks.irp.f` + + set the generators_bitmask for the particles as the input_bimask + + diff --git a/docs/source/modules/cipsi.rst b/docs/source/modules/cipsi.rst new file mode 100644 index 00000000..935a8933 --- /dev/null +++ b/docs/source/modules/cipsi.rst @@ -0,0 +1,978 @@ +.. _cipsi: + +.. program:: cipsi + +.. default-role:: option + +===== +cipsi +===== + +|CIPSI| algorithm. + +The :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` subroutines start with a single +determinant, or with the wave function in the |EZFIO| database if +:option:`determinants read_wf` is |true|. + +The :c:func:`run_cipsi` subroutine iteratively: + +* Selects the most important determinants from the external space and adds them to the + internal space +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Diagonalizes |H| in the enlarged internal space +* Computes the |PT2| contribution to the energy stochastically :cite:`Garniron_2017.2` + or deterministically, depending on :option:`perturbation do_pt2` +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` + +The difference between :c:func:`run_stochastic_cipsi` and :c:func:`run_cipsi` is that +:c:func:`run_stochastic_cipsi` selects the determinants on the fly with the computation +of the stochastic |PT2| :cite:`Garniron_2017.2`. Hence, it is a semi-stochastic selection. It + +* Selects the most important determinants from the external space and adds them to the + internal space, on the fly with the computation of the PT2 with the stochastic algorithm + presented in :cite:`Garniron_2017.2`. +* If :option:`determinants s2_eig` is |true|, it adds all the necessary + determinants to allow the eigenstates of |H| to be eigenstates of |S^2| +* Extrapolates the variational energy by fitting + :math:`E=E_\text{FCI} - \alpha\, E_\text{PT2}` +* Diagonalizes |H| in the enlarged internal space + + +The number of selected determinants at each iteration will be such that the +size of the wave function will double at every iteration. If :option:`determinants +s2_eig` is |true|, then the number of selected determinants will be 1.5x the +current number, and then all the additional determinants will be added. + +By default, the program will stop when more than one million determinants have +been selected, or when the |PT2| energy is below :math:`10^{-4}`. + +The variational and |PT2| energies of the iterations are stored in the +|EZFIO| database, in the :ref:`iterations` module. + + + +Computation of the |PT2| energy +------------------------------- + +At each iteration, the |PT2| energy is computed considering the Epstein-Nesbet +zeroth-order Hamiltonian: + +.. math:: + + E_{\text{PT2}} = \sum_{ \alpha } + \frac{|\langle \Psi_S | \hat{H} | \alpha \rangle|^2} + {E - \langle \alpha | \hat{H} | \alpha \rangle} + +where the |kalpha| determinants are generated by applying all the single and +double excitation operators to all the determinants of the wave function +:math:`\Psi_G`. + +When the hybrid-deterministic/stochastic algorithm is chosen +(default), :math:`Psi_G = \Psi_S = \Psi`, the full wavefunction expanded in the +internal space. +When the deterministic algorithm is chosen (:option:`perturbation do_pt2` +is set to |false|), :math:`Psi_G` is a truncation of |Psi| using +:option:`determinants threshold_generators`, and :math:`Psi_S` is a truncation +of |Psi| using :option:`determinants threshold_selectors`, and re-weighted +by :math:`1/\langle \Psi_s | \Psi_s \rangle`. + +At every iteration, while computing the |PT2|, the variance of the wave +function is also computed: + +.. math:: + + \sigma^2 & = \langle \Psi | \hat{H}^2 | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{i \in \text{FCI}} + \langle \Psi | \hat{H} | i \rangle + \langle i | \hat{H} | \Psi \rangle - + \langle \Psi | \hat{H} | \Psi \rangle^2 \\ + & = \sum_{ \alpha } + \langle |\Psi | \hat{H} | \alpha \rangle|^2. + +The expression of the variance is the same as the expression of the |PT2|, with +a denominator of 1. It measures how far the wave function is from the |FCI| +solution. Note that the absence of denominator in the Heat-Bath selected |CI| +method is selection method by minimization of the variance, whereas |CIPSI| is +a selection method by minimization of the energy. + + +If :option:`perturbation do_pt2` is set to |false|, then the stochastic +|PT2| is not computed, and an approximate value is obtained from the |CIPSI| +selection. The calculation is faster, but the extrapolated |FCI| value is +less accurate. This way of running the code should be used when the only +goal is to generate a wave function, as for using |CIPSI| wave functions as +trial wave functions of |QMC| calculations for example. + + +The :command:`PT2` program reads the wave function of the |EZFIO| database +and computes the energy and the |PT2| contribution. + + +State-averaging +--------------- + +Extrapolated |FCI| energy +------------------------- + +An estimate of the |FCI| energy is computed by extrapolating + +.. math:: + + E=E_\text{FCI} - \alpha\, E_\text{PT2} + +This extrapolation is done for all the requested states, and excitation +energies are printed as energy differences between the extrapolated +energies of the excited states and the extrapolated energy of the ground +state. + +The extrapolations are given considering the 2 last points, the 3 last points, ..., +the 7 last points. The extrapolated value should be chosen such that the extrpolated +value is stable with the number of points. + + + + +Providers +--------- + + +.. c:var:: initialize_pt2_e0_denominator + + .. code:: text + + logical :: initialize_pt2_e0_denominator + + File: :file:`energy.irp.f` + + If true, initialize pt2_E0_denominator + + + + +.. c:var:: pt2_collector + + .. code:: text + + subroutine pt2_collector(zmq_socket_pull, E, relative_error, pt2, error, & + variance, norm, b, N_) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_cw + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_e0_denominator + + .. code:: text + + double precision, allocatable :: pt2_e0_denominator (N_states) + + File: :file:`energy.irp.f` + + E0 in the denominator of the PT2 + + + + +.. c:var:: pt2_f + + .. code:: text + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_j + + .. code:: text + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_mindetinfirstteeth + + .. code:: text + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_0 + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_tasks + + .. code:: text + + integer :: pt2_n_tasks + + File: :file:`pt2_stoch_routines.irp.f` + + Number of parallel tasks for the Monte Carlo + + + + +.. c:var:: pt2_n_tasks_max + + .. code:: text + + integer, allocatable :: pt2_f (N_det_generators) + integer :: pt2_n_tasks_max + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_n_teeth + + .. code:: text + + integer :: pt2_n_teeth + integer :: pt2_mindetinfirstteeth + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_r + + .. code:: text + + integer, allocatable :: pt2_j (N_det_generators) + integer, allocatable :: pt2_r (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_stoch_istate + + .. code:: text + + integer :: pt2_stoch_istate + + File: :file:`pt2_stoch_routines.irp.f` + + State for stochatsic PT2 + + + + +.. c:var:: pt2_u + + .. code:: text + + double precision, allocatable :: pt2_u (N_det_generators) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_u_0 + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_w + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: pt2_w_t + + .. code:: text + + double precision, allocatable :: pt2_w (N_det_generators) + double precision, allocatable :: pt2_cw (0:N_det_generators) + double precision :: pt2_w_t + double precision :: pt2_u_0 + integer, allocatable :: pt2_n_0 (pt2_N_teeth+1) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + +.. c:var:: selection_weight + + .. code:: text + + double precision, allocatable :: selection_weight (N_states) + + File: :file:`selection.irp.f` + + Weights in the state-average calculation of the density matrix + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_to_selection_buffer + + .. code:: text + + subroutine add_to_selection_buffer(b, det, val) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: bitstring_to_list_in_selection + + .. code:: text + + subroutine bitstring_to_list_in_selection( string, list, n_elements, Nint) + + File: :file:`selection.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string + + + + + +.. c:function:: create_selection_buffer + + .. code:: text + + subroutine create_selection_buffer(N, siz_, res) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: delete_selection_buffer + + .. code:: text + + subroutine delete_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: fill_buffer_double + + .. code:: text + + subroutine fill_buffer_double(i_generator, sp, h1, h2, bannedOrb, banned, fock_diag_tmp, E0, pt2, variance, norm, mat, buf) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d0 + + .. code:: text + + subroutine get_d0(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d1 + + .. code:: text + + subroutine get_d1(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_d2 + + .. code:: text + + subroutine get_d2(gen, phasemask, bannedOrb, banned, mat, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m0 + + .. code:: text + + subroutine get_m0(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m1 + + .. code:: text + + subroutine get_m1(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_m2 + + .. code:: text + + subroutine get_m2(gen, phasemask, bannedOrb, vect, mask, h, p, sp, coefs) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_mask_phase + + .. code:: text + + subroutine get_mask_phase(det1, pm, Nint) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: get_phase_bi + + .. code:: text + + double precision function get_phase_bi(phasemask, s1, s2, h1, p1, h2, p2, Nint) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: make_selection_buffer_s2 + + .. code:: text + + subroutine make_selection_buffer_s2(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: merge_selection_buffers + + .. code:: text + + subroutine merge_selection_buffers(b1, b2) + + File: :file:`selection_buffer.irp.f` + + Merges the selection buffers b1 and b2 into b2 + + + + + +.. c:function:: past_d1 + + .. code:: text + + subroutine past_d1(bannedOrb, p) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: past_d2 + + .. code:: text + + subroutine past_d2(banned, p, sp) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: provide_everything + + .. code:: text + + subroutine provide_everything + + File: :file:`slave_cipsi.irp.f` + + + + + + + +.. c:function:: pt2_find_sample + + .. code:: text + + integer function pt2_find_sample(v, w) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pt2_find_sample_lr + + .. code:: text + + integer function pt2_find_sample_lr(v, w, l_in, r_in) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pt2_slave_inproc + + .. code:: text + + subroutine pt2_slave_inproc(i) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: pull_pt2_results + + .. code:: text + + subroutine pull_pt2_results(zmq_socket_pull, index, pt2, variance, norm, task_id, n_tasks, b) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: pull_selection_results + + .. code:: text + + subroutine pull_selection_results(zmq_socket_pull, pt2, variance, norm, val, det, N, task_id, ntask) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: push_pt2_results + + .. code:: text + + subroutine push_pt2_results(zmq_socket_push, index, pt2, variance, norm, b, task_id, n_tasks) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: push_selection_results + + .. code:: text + + subroutine push_selection_results(zmq_socket_push, pt2, variance, norm, b, task_id, ntask) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: run_cipsi + + .. code:: text + + subroutine run_cipsi + + File: :file:`cipsi.irp.f` + + Selected Full Configuration Interaction with deterministic selection and stochastic PT2. + + + + + +.. c:function:: run_pt2_slave + + .. code:: text + + subroutine run_pt2_slave(thread,iproc,energy) + + File: :file:`run_pt2_slave.irp.f` + + + + + + + +.. c:function:: run_selection_slave + + .. code:: text + + subroutine run_selection_slave(thread,iproc,energy) + + File: :file:`run_selection_slave.irp.f` + + + + + + + +.. c:function:: run_slave_cipsi + + .. code:: text + + subroutine run_slave_cipsi + + File: :file:`slave_cipsi.irp.f` + + Helper program for distributed parallelism + + + + + +.. c:function:: run_slave_main + + .. code:: text + + subroutine run_slave_main + + File: :file:`slave_cipsi.irp.f` + + + + + + + +.. c:function:: run_stochastic_cipsi + + .. code:: text + + subroutine run_stochastic_cipsi + + File: :file:`stochastic_cipsi.irp.f` + + Selected Full Configuration Interaction with Stochastic selection and PT2. + + + + + +.. c:function:: select_connected + + .. code:: text + + subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: select_singles_and_doubles + + .. code:: text + + subroutine select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,buf,subset,csubset) + + File: :file:`selection.irp.f` + + WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted + + + + + +.. c:function:: selection_collector + + .. code:: text + + subroutine selection_collector(zmq_socket_pull, b, N, pt2, variance, norm) + + File: :file:`zmq_selection.irp.f` + + + + + + + +.. c:function:: selection_slave_inproc + + .. code:: text + + subroutine selection_slave_inproc(i) + + File: :file:`zmq_selection.irp.f` + + + + + + + +.. c:function:: sort_selection_buffer + + .. code:: text + + subroutine sort_selection_buffer(b) + + File: :file:`selection_buffer.irp.f` + + + + + + + +.. c:function:: splash_pq + + .. code:: text + + subroutine splash_pq(mask, sp, det, i_gen, N_sel, bannedOrb, banned, mat, interesting) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: spot_isinwf + + .. code:: text + + subroutine spot_isinwf(mask, det, i_gen, N, banned, fullMatch, interesting) + + File: :file:`selection.irp.f` + + + + + + + +.. c:function:: testteethbuilding + + .. code:: text + + logical function testTeethBuilding(minF, N) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: zmq_pt2 + + .. code:: text + + subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in) + + File: :file:`pt2_stoch_routines.irp.f` + + + + + + + +.. c:function:: zmq_selection + + .. code:: text + + subroutine ZMQ_selection(N_in, pt2, variance, norm) + + File: :file:`zmq_selection.irp.f` + + + + diff --git a/docs/source/modules/cis.rst b/docs/source/modules/cis.rst new file mode 100644 index 00000000..9ba5c4c7 --- /dev/null +++ b/docs/source/modules/cis.rst @@ -0,0 +1,117 @@ +.. _cis: + +.. program:: cis + +.. default-role:: option + +=== +cis +=== + +This module contains a CIS program, built by setting the following rules: + +* The only generator determinant is the Hartree-Fock (single-reference method) +* All generated singly excited determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Variational |CIS| energy + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cis + + .. code:: text + + subroutine cis + + File: :file:`cis.irp.f` + + Configuration Interaction with Single excitations. + + + + + +.. c:function:: h_apply_cis + + .. code:: text + + subroutine H_apply_cis() + + File: :file:`h_apply.irp.f_shell_8` + + Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + + + + +.. c:function:: h_apply_cis_diexc + + .. code:: text + + subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cis_diexcorg + + .. code:: text + + subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + + + + +.. c:function:: h_apply_cis_diexcp + + .. code:: text + + subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cis_monoexc + + .. code:: text + + subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + diff --git a/docs/source/modules/cisd.rst b/docs/source/modules/cisd.rst new file mode 100644 index 00000000..d1cc56d7 --- /dev/null +++ b/docs/source/modules/cisd.rst @@ -0,0 +1,117 @@ +.. _cisd: + +.. program:: cisd + +.. default-role:: option + +==== +cisd +==== + +This module contains a CISD program, built by setting the following rules: + +* The only generator determinant is the Hartree-Fock (single-reference method) +* All generated determinants are included in the wave function (no perturbative + selection) + +These rules are set in the ``H_apply.irp.f`` file. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Variational |CISD| energy + + + +Subroutines / functions +----------------------- + + + +.. c:function:: cisd + + .. code:: text + + subroutine cisd + + File: :file:`cisd.irp.f` + + Configuration Interaction with Single and Double excitations. + + + + + +.. c:function:: h_apply_cisd + + .. code:: text + + subroutine H_apply_cisd() + + File: :file:`h_apply.irp.f_shell_8` + + Calls H_apply on the |HF| determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. + + + + + +.. c:function:: h_apply_cisd_diexc + + .. code:: text + + subroutine H_apply_cisd_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cisd_diexcorg + + .. code:: text + + subroutine H_apply_cisd_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + + + + +.. c:function:: h_apply_cisd_diexcp + + .. code:: text + + subroutine H_apply_cisd_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + + + + + + +.. c:function:: h_apply_cisd_monoexc + + .. code:: text + + subroutine H_apply_cisd_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in ) + + File: :file:`h_apply.irp.f_shell_8` + + Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided. + + diff --git a/docs/source/modules/davidson.rst b/docs/source/modules/davidson.rst new file mode 100644 index 00000000..dbc7f628 --- /dev/null +++ b/docs/source/modules/davidson.rst @@ -0,0 +1,720 @@ +.. _davidson: + +.. program:: davidson + +.. default-role:: option + +======== +davidson +======== + +Abstract module for Davidson's diagonalization. +It contains everything required for the Davidson algorithm, dressed or not. If +a dressing is used, the dressing column should be defined and the +:ref:`davidson_dressed` module should be used. If no dressing is required, +the :ref:`davidson` module should be used, and it has a default zero dressing vector. + +The important providers for that module are: + +# `psi_energy` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the Hamiltonian, dressed or not. It uses the general subroutine `u_0_H_u_0`. +# `psi_energy_two_e` which is the expectation value over the wave function (`psi_det`, `psi_coef`) of the standard two-electrons coulomb operator. It uses the general routine `u_0_H_u_0_two_e`. + + + +EZFIO parameters +---------------- + +.. option:: threshold_davidson + + Thresholds of Davidson's algorithm + + Default: 1.e-10 + +.. option:: n_states_diag + + Number of states to consider during the Davdison diagonalization + + Default: 4 + +.. option:: davidson_sze_max + + Number of micro-iterations before re-contracting + + Default: 8 + +.. option:: state_following + + If |true|, the states are re-ordered to match the input states + + Default: False + +.. option:: disk_based_davidson + + If |true|, disk space is used to store the vectors + + Default: False + +.. option:: distributed_davidson + + If |true|, use the distributed algorithm + + Default: True + +.. option:: only_expected_s2 + + If |true|, use filter out all vectors with bad |S^2| values + + Default: True + + +Providers +--------- + + +.. c:var:: ci_eigenvectors + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_eigenvectors_s2 + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_electronic_energy + + .. code:: text + + double precision, allocatable :: ci_electronic_energy (N_states_diag) + double precision, allocatable :: ci_eigenvectors (N_det,N_states_diag) + double precision, allocatable :: ci_eigenvectors_s2 (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + Eigenvectors/values of the |CI| matrix + + + + +.. c:var:: ci_energy + + .. code:: text + + double precision, allocatable :: ci_energy (N_states_diag) + + File: :file:`diagonalize_ci.irp.f` + + :c:data:`n_states` lowest eigenvalues of the |CI| matrix + + + + +.. c:var:: davidson_criterion + + .. code:: text + + character(64) :: davidson_criterion + + File: :file:`parameters.irp.f` + + Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] + + + + +.. c:var:: dressed_column_idx + + .. code:: text + + integer, allocatable :: dressed_column_idx (N_states) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Index of the dressed columns + + + + +.. c:var:: n_states_diag + + .. code:: text + + integer :: n_states_diag + + File: :file:`input.irp.f` + + Number of states to consider during the Davdison diagonalization + + + + +.. c:var:: nthreads_davidson + + .. code:: text + + integer :: nthreads_davidson + + File: :file:`davidson_parallel.irp.f` + + Number of threads for Davidson + + + + +.. c:var:: psi_energy + + .. code:: text + + double precision, allocatable :: psi_energy (N_states) + + File: :file:`u0_h_u0.irp.f` + + Electronic energy of the current wave function + + + + +.. c:var:: psi_energy_two_e + + .. code:: text + + double precision, allocatable :: psi_energy_two_e (N_states) + + File: :file:`u0_wee_u0.irp.f` + + Energy of the current wave function + + + + +.. c:var:: psi_energy_with_nucl_rep + + .. code:: text + + double precision, allocatable :: psi_energy_with_nucl_rep (N_states) + + File: :file:`u0_h_u0.irp.f` + + Energy of the wave function with the nuclear repulsion energy. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: davidson_collector + + .. code:: text + + subroutine davidson_collector(zmq_to_qp_run_socket, zmq_socket_pull, v0, s0, sze, N_st) + + File: :file:`davidson_parallel.irp.f` + + Routine collecting the results of the workers in Davidson's algorithm. + + + + + +.. c:function:: davidson_converged + + .. code:: text + + subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged) + + File: :file:`parameters.irp.f` + + True if the Davidson algorithm is converged + + + + + +.. c:function:: davidson_diag_hjj_sjj + + .. code:: text + + subroutine davidson_diag_hjj_sjj(dets_in,u_in,H_jj,s2_out,energies,dim_in,sze,N_st,N_st_diag,Nint,dressing_state,converged) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Davidson diagonalization with specific diagonal elements of the H matrix + + H_jj : specific diagonal H matrix elements to diagonalize de Davidson + + S2_out : Output : s^2 + + dets_in : bitmasks corresponding to determinants + + u_in : guess coefficients on the various states. Overwritten on exit + + dim_in : leftmost dimension of u_in + + sze : Number of determinants + + N_st : Number of eigenstates + + N_st_diag : Number of states in which H is diagonalized. Assumed > sze + + Initial guess vectors are not necessarily orthonormal + + + + + +.. c:function:: davidson_diag_hs2 + + .. code:: text + + subroutine davidson_diag_hs2(dets_in,u_in,s2_out,dim_in,energies,sze,N_st,N_st_diag,Nint,dressing_state,converged) + + File: :file:`diagonalization_hs2_dressed.irp.f` + + Davidson diagonalization. + + dets_in : bitmasks corresponding to determinants + + u_in : guess coefficients on the various states. Overwritten on exit + + dim_in : leftmost dimension of u_in + + sze : Number of determinants + + N_st : Number of eigenstates + + Initial guess vectors are not necessarily orthonormal + + + + + +.. c:function:: davidson_pull_results + + .. code:: text + + subroutine davidson_pull_results(zmq_socket_pull, v_t, s_t, imin, imax, task_id) + + File: :file:`davidson_parallel.irp.f` + + Pull the results of :math:`H|U \rangle` on the master. + + + + + +.. c:function:: davidson_push_results + + .. code:: text + + subroutine davidson_push_results(zmq_socket_push, v_t, s_t, imin, imax, task_id) + + File: :file:`davidson_parallel.irp.f` + + Push the results of :math:`H|U \rangle` from a worker to the master. + + + + + +.. c:function:: davidson_run_slave + + .. code:: text + + subroutine davidson_run_slave(thread,iproc) + + File: :file:`davidson_parallel.irp.f` + + Slave routine for Davidson's diagonalization. + + + + + +.. c:function:: davidson_slave_inproc + + .. code:: text + + subroutine davidson_slave_inproc(i) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: davidson_slave_tcp + + .. code:: text + + subroutine davidson_slave_tcp(i) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: davidson_slave_work + + .. code:: text + + subroutine davidson_slave_work(zmq_to_qp_run_socket, zmq_socket_push, N_st, sze, worker_id) + + File: :file:`davidson_parallel.irp.f` + + + + + + + +.. c:function:: diagonalize_ci + + .. code:: text + + subroutine diagonalize_CI + + File: :file:`diagonalize_ci.irp.f` + + Replace the coefficients of the |CI| states by the coefficients of the eigenstates of the |CI| matrix. + + + + + +.. c:function:: h_s2_u_0_nstates_openmp + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` . + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work + + .. code:: text + + subroutine H_S2_u_0_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_1 + + .. code:: text + + 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` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_2 + + .. code:: text + + 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` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_3 + + .. code:: text + + 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` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_4 + + .. code:: text + + 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` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_openmp_work_n_int + + .. code:: text + + 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` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_nstates_zmq + + .. code:: text + + subroutine H_S2_u_0_nstates_zmq(v_0,s_0,u_0,N_st,sze) + + File: :file:`davidson_parallel.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` + + n : number of determinants + + H_jj : array of :math:`\langle j|H|j \rangle` + + S2_jj : array of :math:`\langle j|S^2|j \rangle` + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp(v_0,s_0,u_0,N_st,sze) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`v_0 = H|u_0\rangle` and :math:`s_0 = S^2 |u_0\rangle` + + Assumes that the determinants are in psi_det + + istart, iend, ishift, istep are used in ZMQ parallelization. + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`v_t = H|u_t\rangle` and :math:`s_t = S^2 |u_t\rangle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_1 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_1(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_2 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_2(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_3 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_3(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_4 + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_4(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: h_s2_u_0_two_e_nstates_openmp_work_n_int + + .. code:: text + + subroutine H_S2_u_0_two_e_nstates_openmp_work_N_int(v_t,s_t,u_t,N_st,sze,istart,iend,ishift,istep) + + File: :file:`u0_wee_u0.irp.f_template_457` + + Computes :math:`v_t = H|u_t angle` and :math:`s_t = S^2 |u_t angle` + + Default should be 1,N_det,0,1 + + + + + +.. c:function:: u_0_h_u_0 + + .. code:: text + + subroutine u_0_H_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + + File: :file:`u0_h_u0.irp.f` + + Computes :math:`E_0 = \frac{\langle u_0|H|u_0 \rangle}{\langle u_0|u_0 \rangle}` + + n : number of determinants + + + + + + + +.. c:function:: u_0_h_u_0_two_e + + .. code:: text + + subroutine u_0_H_u_0_two_e(e_0,u_0,n,keys_tmp,Nint,N_st,sze) + + File: :file:`u0_wee_u0.irp.f` + + Computes :math:`E_0 = \frac{ \langle u_0|H|u_0\rangle}{\langle u_0|u_0 \rangle}` . + + n : number of determinants + + + + + + + +.. c:function:: zmq_get_n_states_diag + + .. code:: text + + integer function zmq_get_N_states_diag(zmq_to_qp_run_socket, worker_id) + + File: :file:`davidson_parallel.irp.f` + + Get N_states_diag from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_states_diag + + .. code:: text + + integer function zmq_put_N_states_diag(zmq_to_qp_run_socket,worker_id) + + File: :file:`davidson_parallel.irp.f` + + Put N_states_diag on the qp_run scheduler + + diff --git a/docs/source/modules/davidson_dressed.rst b/docs/source/modules/davidson_dressed.rst new file mode 100644 index 00000000..4697104f --- /dev/null +++ b/docs/source/modules/davidson_dressed.rst @@ -0,0 +1,13 @@ +.. _davidson_dressed: + +.. program:: davidson_dressed + +.. default-role:: option + +================ +davidson_dressed +================ + +Davidson with single-column dressing. + + diff --git a/docs/source/modules/davidson_undressed.rst b/docs/source/modules/davidson_undressed.rst new file mode 100644 index 00000000..e785b4ca --- /dev/null +++ b/docs/source/modules/davidson_undressed.rst @@ -0,0 +1,45 @@ +.. _davidson_undressed: + +.. program:: davidson_undressed + +.. default-role:: option + +================== +davidson_undressed +================== + +Module for main files Davidson's algorithm with no dressing. + + + + +Providers +--------- + + +.. c:var:: dressing_column_h + + .. code:: text + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + File: :file:`null_dressing_vector.irp.f` + + Null dressing vectors + + + + +.. c:var:: dressing_column_s + + .. code:: text + + double precision, allocatable :: dressing_column_h (N_det,N_states) + double precision, allocatable :: dressing_column_s (N_det,N_states) + + File: :file:`null_dressing_vector.irp.f` + + Null dressing vectors + + diff --git a/docs/source/modules/density_for_dft.rst b/docs/source/modules/density_for_dft.rst new file mode 100644 index 00000000..2c5db607 --- /dev/null +++ b/docs/source/modules/density_for_dft.rst @@ -0,0 +1,119 @@ +.. _density_for_dft: + +.. program:: density_for_dft + +.. default-role:: option + +=============== +density_for_dft +=============== + + +This module defines the *provider* of the density used for the DFT related calculations. +This definition is done through the keyword :option:`density_for_dft density_for_dft`. +The density can be: + +* WFT : the density is computed with a potentially multi determinant wave function (see variables `psi_det` and `psi_det`)# input_density : the density is set to a density previously stored in the |EZFIO| folder (see ``aux_quantities``) +* damping_rs_dft : the density is damped between the input_density and the WFT density, with a damping factor of :option:`density_for_dft damping_for_rs_dft` + + + + +EZFIO parameters +---------------- + +.. option:: density_for_dft + + Type of density used for DFT calculation. If set to WFT , it uses the density of the wave function stored in (psi_det,psi_coef). If set to input_density it uses the one-body dm stored in aux_quantities/ . If set to damping_rs_dft it uses the damped density between WFT and input_density. In the ks_scf and rs_ks_scf programs, it is set to WFT. + + Default: WFT + +.. option:: damping_for_rs_dft + + damping factor for the density used in RSFT. + + Default: 0.5 + + +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_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_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` + + + + diff --git a/docs/source/modules/determinants.rst b/docs/source/modules/determinants.rst new file mode 100644 index 00000000..c2d56042 --- /dev/null +++ b/docs/source/modules/determinants.rst @@ -0,0 +1,4072 @@ +.. _determinants: + +.. program:: determinants + +.. default-role:: option + +============ +determinants +============ + +Contains everything for the computation of the Hamiltonian matrix elements in the basis of orthogonal Slater determinants built on a restricted spin-orbitals basis. + +The main providers for this module are: + +* :option:`determinants n_states`: number of states to be computed +* `psi_det`: list of determinants in the wave function used in many routines/providers of the |QP|. +* `psi_coef`: list of coefficients, for all :option:`determinants n_states` states, and all determinants. + +The main routines for this module are: + +* `i_H_j`: computes the Hamiltonian matrix element between two arbitrary Slater determinants. +* `i_H_j_s2`: computes the Hamiltonian and (:math:`S^2`) matrix element between two arbitrary Slater determinants. +* `i_H_j_verbose`: returns the decomposition in terms of one- and two-body components of the Hamiltonian matrix elements between two arbitrary Slater determinants. Also return the fermionic phase factor. +* `i_H_psi`: computes the Hamiltonian matrix element between an arbitrary Slater determinant and a wave function composed of a sum of arbitrary Slater determinants. + + +For an example of how to use these routines and providers, take a look at :file:`example.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: n_det_max + + Maximum number of determinants in the wave function + + Default: 1000000 + +.. option:: n_det_print_wf + + Maximum number of determinants to be printed with the program print_wf + + Default: 10000 + +.. option:: n_det_max_full + + Maximum number of determinants where |H| is fully diagonalized + + Default: 1000 + +.. option:: n_states + + Number of states to consider + + Default: 1 + +.. option:: read_wf + + If |true|, read the wave function from the |EZFIO| file + + Default: False + +.. option:: s2_eig + + Force the wave function to be an eigenfunction of |S^2| + + Default: True + +.. option:: used_weight + + 0: 1./(c_0^2), 1: 1/N_states, 2: input state-average weight, 3: 1/(Norm_L3(Psi)) + + Default: 0 + +.. option:: threshold_generators + + Thresholds on generators (fraction of the square of the norm) + + Default: 0.99 + +.. option:: n_int + + Number of integers required to represent bitstrings (set in module :ref:`bitmask`) + + +.. option:: bit_kind + + (set in module :ref:`bitmask`) + + +.. option:: mo_label + + Label of the |MOs| on which the determinants are expressed + + +.. option:: n_det + + Number of determinants in the current wave function + + +.. option:: psi_coef + + Coefficients of the wave function + + +.. option:: psi_det + + Determinants of the variational space + + +.. option:: expected_s2 + + Expected value of |S^2| + + +.. option:: target_energy + + Energy that should be obtained when truncating the wave function (optional) + + Default: 0. + +.. option:: state_average_weight + + Weight of the states in state-average calculations. + + + +Providers +--------- + + +.. c:var:: abs_psi_coef_max + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: abs_psi_coef_min + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: barycentric_electronic_energy + + .. code:: text + + double precision, allocatable :: barycentric_electronic_energy (N_states) + + File: :file:`energy.irp.f` + + :math:`E_n = \sum_i {c_i^{(n)}}^2 H_{ii}` + + + + +.. c:var:: c0_weight + + .. code:: text + + double precision, allocatable :: c0_weight (N_states) + + File: :file:`density_matrix.irp.f` + + Weight of the states in the selection : :math:`\frac{1}{c_0^2}` . + + + + +.. c:var:: det_alpha_norm + + .. code:: text + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + File: :file:`spindeterminants.irp.f` + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + ||Da||_i \sum_j C_{ij}**2 + + + + +.. c:var:: det_beta_norm + + .. code:: text + + double precision, allocatable :: det_alpha_norm (N_det_alpha_unique) + double precision, allocatable :: det_beta_norm (N_det_beta_unique) + + File: :file:`spindeterminants.irp.f` + + Norm of the :math:`\alpha` and :math:`\beta` spin determinants in the wave function: + + ||Da||_i \sum_j C_{ij}**2 + + + + +.. c:var:: det_to_occ_pattern + + .. code:: text + + integer, allocatable :: det_to_occ_pattern (N_det) + + File: :file:`occ_pattern.irp.f` + + Returns the index of the occupation pattern for each determinant + + + + +.. c:var:: diag_algorithm + + .. code:: text + + character*(64) :: diag_algorithm + + File: :file:`determinants.irp.f` + + Diagonalization algorithm (Davidson or Lapack) + + + + +.. c:var:: diagonal_h_matrix_on_psi_det + + .. code:: text + + double precision, allocatable :: diagonal_h_matrix_on_psi_det (N_det) + + File: :file:`energy.irp.f` + + Diagonal of the Hamiltonian ordered as psi_det + + + + +.. c:var:: double_exc_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: double_exc_bitmask (N_int,4,N_double_exc_bitmasks) + + File: :file:`determinants_bitmasks.irp.f` + + double_exc_bitmask(:,1,i) is the bitmask for holes of excitation 1 + + double_exc_bitmask(:,2,i) is the bitmask for particles of excitation 1 + + double_exc_bitmask(:,3,i) is the bitmask for holes of excitation 2 + + double_exc_bitmask(:,4,i) is the bitmask for particles of excitation 2 + + for a given couple of hole/particle excitations i. + + + + +.. c:var:: expected_s2 + + .. code:: text + + double precision :: expected_s2 + + File: :file:`s2.irp.f` + + Expected value of |S^2| : S*(S+1) + + + + +.. c:var:: fock_operator_closed_shell_ref_bitmask + + .. code:: text + + double precision, allocatable :: fock_operator_closed_shell_ref_bitmask (mo_num,mo_num) + + File: :file:`single_excitations.irp.f` + + + + + + +.. c:var:: fock_wee_closed_shell + + .. code:: text + + double precision, allocatable :: fock_wee_closed_shell (mo_num,mo_num) + + File: :file:`mono_excitations_bielec.irp.f` + + + + + + +.. c:var:: h_apply_buffer_allocated + + .. code:: text + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + File: :file:`h_apply.irp.f` + + Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. + + + + +.. c:var:: h_apply_buffer_lock + + .. code:: text + + logical :: h_apply_buffer_allocated + integer(omp_lock_kind), allocatable :: h_apply_buffer_lock (64,0:nproc-1) + + File: :file:`h_apply.irp.f` + + Buffer of determinants/coefficients/perturbative energy for H_apply. Uninitialized. Filled by H_apply subroutines. + + + + +.. c:var:: h_matrix_all_dets + + .. code:: text + + double precision, allocatable :: h_matrix_all_dets (N_det,N_det) + + File: :file:`utils.irp.f` + + |H| matrix on the basis of the Slater determinants defined by psi_det + + + + +.. c:var:: h_matrix_cas + + .. code:: text + + double precision, allocatable :: h_matrix_cas (N_det_cas,N_det_cas) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: idx_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: idx_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: max_degree_exc + + .. code:: text + + integer :: max_degree_exc + + File: :file:`determinants.irp.f` + + Maximum degree of excitation in the wave function with respect to the Hartree-Fock determinant. + + + + +.. c:var:: mo_energy_expval + + .. code:: text + + double precision, allocatable :: mo_energy_expval (N_states,mo_num,2,2) + + File: :file:`mo_energy_expval.irp.f` + + Third index is spin. Fourth index is 1:creation, 2:annihilation + + + + +.. c:var:: n_det + + .. code:: text + + integer :: n_det + + File: :file:`determinants.irp.f` + + Number of determinants in the wave function + + + + +.. c:var:: n_det_alpha_unique + + .. code:: text + + 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` + + Unique :math:`\alpha` determinants + + + + +.. c:var:: n_det_beta_unique + + .. code:: text + + 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` + + Unique :math:`\beta` determinants + + + + +.. c:var:: n_det_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: n_det_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: n_double_exc_bitmasks + + .. code:: text + + integer :: n_double_exc_bitmasks + + File: :file:`determinants_bitmasks.irp.f` + + Number of double excitation bitmasks + + + + +.. c:var:: n_occ_pattern + + .. code:: text + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + File: :file:`occ_pattern.irp.f` + + Array of the occ_patterns present in the wave function. + + psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations + + psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations + + The occ patterns are sorted by :c:func:`occ_pattern_search_key` + + + + +.. c:var:: n_single_exc_bitmasks + + .. code:: text + + integer :: n_single_exc_bitmasks + + File: :file:`determinants_bitmasks.irp.f` + + Number of single excitation bitmasks + + + + +.. 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:: psi_average_norm_contrib + + .. code:: text + + double precision, allocatable :: psi_average_norm_contrib (psi_det_size) + + File: :file:`determinants.irp.f` + + Contribution of determinants to the state-averaged density. + + + + +.. c:var:: psi_average_norm_contrib_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_bilinear_matrix + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix (N_det_alpha_unique,N_det_beta_unique,N_states) + + File: :file:`spindeterminants.irp.f` + + Coefficient matrix if the wave function is expressed in a bilinear form : + + :math:`D_\alpha^\dagger.C.D_\beta` + + + + +.. c:var:: psi_bilinear_matrix_columns + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_columns_loc + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_columns_loc (N_det_beta_unique+1) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : + + :math:`D_\alpha^\dagger.C.D_\beta` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order_reverse + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_order_reverse (N_det) + + File: :file:`spindeterminants.irp.f` + + Order which allows to go from psi_bilinear_matrix to psi_det + + + + +.. c:var:: psi_bilinear_matrix_order_transp_reverse + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_order_transp_reverse (N_det) + + File: :file:`spindeterminants.irp.f` + + Order which allows to go from psi_bilinear_matrix_order_transp to psi_bilinear_matrix + + + + +.. c:var:: psi_bilinear_matrix_rows + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_bilinear_matrix_transp_columns + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_order + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_rows + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_transp_rows_loc + + .. code:: text + + integer, allocatable :: psi_bilinear_matrix_transp_rows_loc (N_det_alpha_unique+1) + + File: :file:`spindeterminants.irp.f` + + Location of the columns in the psi_bilinear_matrix + + + + +.. c:var:: psi_bilinear_matrix_transp_values + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_transp_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_transp_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_transp_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Transpose of psi_bilinear_matrix + + :math:`D_\beta^\dagger.C^\dagger.D_\alpha` + + Rows are :math:`\alpha` determinants and columns are :math:`\beta` , but the matrix is stored in row major format + + + + +.. c:var:: psi_bilinear_matrix_values + + .. code:: text + + double precision, allocatable :: psi_bilinear_matrix_values (N_det,N_states) + integer, allocatable :: psi_bilinear_matrix_rows (N_det) + integer, allocatable :: psi_bilinear_matrix_columns (N_det) + integer, allocatable :: psi_bilinear_matrix_order (N_det) + + File: :file:`spindeterminants.irp.f` + + Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + + Rows are :math:`\alpha` determinants and columns are :math:`\beta.` + + Order refers to psi_det + + + + +.. c:var:: psi_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: psi_cas_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_cas (psi_det_size) + integer :: n_det_cas + + File: :file:`psi_cas.irp.f` + + |CAS| wave function, defined from the application of the |CAS| bitmask on the determinants. idx_cas gives the indice of the |CAS| determinant in psi_det. + + + + +.. c:var:: psi_cas_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_cas_energy + + .. code:: text + + double precision, allocatable :: psi_cas_energy (N_states) + + File: :file:`psi_cas.irp.f` + + Variational energy of :math:`\Psi_{CAS}` , where :math:`\Psi_{CAS} = \sum_{I \in CAS} \I \rangle \langle I | \Psi \rangle` . + + + + +.. c:var:: psi_cas_energy_diagonalized + + .. code:: text + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: psi_cas_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_coef + + .. code:: text + + double precision, allocatable :: psi_coef (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + The wave function coefficients. Initialized with Hartree-Fock if the |EZFIO| file is empty. + + + + +.. c:var:: psi_coef_cas_diagonalized + + .. code:: text + + double precision, allocatable :: psi_coef_cas_diagonalized (N_det_cas,N_states) + double precision, allocatable :: psi_cas_energy_diagonalized (N_states) + + File: :file:`psi_cas.irp.f` + + + + + + +.. c:var:: psi_coef_max + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: psi_coef_min + + .. code:: text + + double precision, allocatable :: psi_coef_max (N_states) + double precision, allocatable :: psi_coef_min (N_states) + double precision, allocatable :: abs_psi_coef_max (N_states) + double precision, allocatable :: abs_psi_coef_min (N_states) + + File: :file:`determinants.irp.f` + + Max and min values of the coefficients + + + + +.. c:var:: psi_coef_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_det + + .. code:: text + + integer(bit_kind), allocatable :: psi_det (N_int,2,psi_det_size) + + File: :file:`determinants.irp.f` + + The determinants of the wave function. Initialized with Hartree-Fock if the |EZFIO| file is empty. + + + + +.. c:var:: psi_det_alpha + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_alpha (N_int,psi_det_size) + + File: :file:`spindeterminants.irp.f` + + List of :math:`\alpha` determinants of psi_det + + + + +.. c:var:: psi_det_alpha_unique + + .. code:: text + + 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` + + Unique :math:`\alpha` determinants + + + + +.. c:var:: psi_det_beta + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_beta (N_int,psi_det_size) + + File: :file:`spindeterminants.irp.f` + + List of :math:`\beta` determinants of psi_det + + + + +.. c:var:: psi_det_beta_unique + + .. code:: text + + 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` + + Unique :math:`\beta` determinants + + + + +.. c:var:: psi_det_hii + + .. code:: text + + double precision, allocatable :: psi_det_hii (N_det) + + File: :file:`determinants.irp.f` + + :math:`\langle i|h|i \rangle` for all determinants. + + + + +.. c:var:: psi_det_size + + .. code:: text + + integer :: psi_det_size + + File: :file:`determinants.irp.f` + + Size of the psi_det and psi_coef arrays + + + + +.. c:var:: psi_det_sorted + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_det_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`determinants.irp.f` + + Determinants on which we apply :math:`\langle i|H|psi \rangle` for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_det_sorted_order + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted (psi_det_size,N_states) + double precision, allocatable :: psi_average_norm_contrib_sorted (psi_det_size) + integer, allocatable :: psi_det_sorted_order (psi_det_size) + + File: :file:`determinants.irp.f` + + Wave function sorted by determinants contribution to the norm (state-averaged) + + psi_det_sorted_order(i) -> k : index in psi_det + + + + +.. c:var:: psi_energy_h_core + + .. code:: text + + double precision, allocatable :: psi_energy_h_core (N_states) + + File: :file:`psi_energy_mono_elec.irp.f` + + 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` + + + + +.. c:var:: psi_non_cas + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: psi_non_cas_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef (psi_det_size,n_states) + integer, allocatable :: idx_non_cas (psi_det_size) + integer :: n_det_non_cas + + File: :file:`psi_cas.irp.f` + + Set of determinants which are not part of the |CAS|, defined from the application of the |CAS| bitmask on the determinants. idx_non_cas gives the indice of the determinant in psi_det. + + + + +.. c:var:: psi_non_cas_coef_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_non_cas_sorted_bit + + .. code:: text + + integer(bit_kind), allocatable :: psi_non_cas_sorted_bit (N_int,2,psi_det_size) + double precision, allocatable :: psi_non_cas_coef_sorted_bit (psi_det_size,N_states) + + File: :file:`psi_cas.irp.f` + + |CAS| determinants sorted to accelerate the search of a random determinant in the wave function. + + + + +.. c:var:: psi_occ_pattern + + .. code:: text + + integer(bit_kind), allocatable :: psi_occ_pattern (N_int,2,psi_det_size) + integer :: n_occ_pattern + + File: :file:`occ_pattern.irp.f` + + Array of the occ_patterns present in the wave function. + + psi_occ_pattern(:,1,j) = j-th occ_pattern of the wave function : represents all the single occupations + + psi_occ_pattern(:,2,j) = j-th occ_pattern of the wave function : represents all the double occupations + + The occ patterns are sorted by :c:func:`occ_pattern_search_key` + + + + +.. c:var:: psi_occ_pattern_hii + + .. code:: text + + double precision, allocatable :: psi_occ_pattern_hii (N_occ_pattern) + + File: :file:`occ_pattern.irp.f` + + :math:`\langle I|H|I \rangle` where :math:`|I\rangle` is an occupation pattern. This is the minimum :math:`H_{ii}` , where the :math:`|i\rangle` are the determinants of :math:`|I\rangle` . + + + + +.. c:var:: ref_bitmask_e_n_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_kinetic_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_one_e_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_bitmask_two_e_energy + + .. code:: text + + double precision :: ref_bitmask_energy + double precision :: ref_bitmask_one_e_energy + double precision :: ref_bitmask_kinetic_energy + double precision :: ref_bitmask_e_n_energy + double precision :: ref_bitmask_two_e_energy + + File: :file:`ref_bitmask.irp.f` + + Energy of the reference bitmask used in Slater rules + + + + +.. c:var:: ref_closed_shell_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: ref_closed_shell_bitmask (N_int,2) + + File: :file:`single_excitations.irp.f` + + + + + + +.. c:var:: s2_matrix_all_dets + + .. code:: text + + double precision, allocatable :: s2_matrix_all_dets (N_det,N_det) + + File: :file:`utils.irp.f` + + |S^2| matrix on the basis of the Slater determinants defined by psi_det + + + + +.. c:var:: s2_values + + .. code:: text + + double precision, allocatable :: s2_values (N_states) + + File: :file:`s2.irp.f` + + array of the averaged values of the S^2 operator on the various states + + + + +.. c:var:: s_z + + .. code:: text + + double precision :: s_z + double precision :: s_z2_sz + + File: :file:`s2.irp.f` + + z component of the Spin + + + + +.. c:var:: s_z2_sz + + .. code:: text + + double precision :: s_z + double precision :: s_z2_sz + + File: :file:`s2.irp.f` + + z component of the Spin + + + + +.. c:var:: single_exc_bitmask + + .. code:: text + + integer(bit_kind), allocatable :: single_exc_bitmask (N_int,2,N_single_exc_bitmasks) + + File: :file:`determinants_bitmasks.irp.f` + + single_exc_bitmask(:,1,i) is the bitmask for holes + + single_exc_bitmask(:,2,i) is the bitmask for particles + + for a given couple of hole/particle excitations i. + + + + +.. c:var:: singles_alpha_csc + + .. code:: text + + integer, allocatable :: singles_alpha_csc (singles_alpha_csc_size) + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_csc_idx + + .. code:: text + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_csc_size + + .. code:: text + + integer*8, allocatable :: singles_alpha_csc_idx (N_det_alpha_unique+1) + integer*8 :: singles_alpha_csc_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: singles_alpha_size + + .. code:: text + + integer :: singles_alpha_size + + File: :file:`spindeterminants.irp.f` + + Dimension of the singles_alpha array + + + + +.. c:var:: state_average_weight + + .. code:: text + + double precision, allocatable :: state_average_weight (N_states) + + File: :file:`density_matrix.irp.f` + + Weights in the state-average calculation of the density matrix + + + + +.. c:var:: weight_occ_pattern + + .. code:: text + + double precision, allocatable :: weight_occ_pattern (N_occ_pattern,N_states) + + File: :file:`occ_pattern.irp.f` + + Weight of the occupation patterns in the wave function + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: a_operator + + .. code:: text + + subroutine a_operator(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules.irp.f` + + Needed for :c:func:`diag_H_mat_elem`. + + + + + +.. c:function:: a_operator_two_e + + .. code:: text + + subroutine a_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules_wee_mono.irp.f` + + Needed for :c:func:`diag_Wee_mat_elem`. + + + + + +.. c:function:: ac_operator + + .. code:: text + + subroutine ac_operator(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules.irp.f` + + Needed for :c:func:`diag_H_mat_elem`. + + + + + +.. c:function:: ac_operator_two_e + + .. code:: text + + subroutine ac_operator_two_e(iorb,ispin,key,hjj,Nint,na,nb) + + File: :file:`slater_rules_wee_mono.irp.f` + + Needed for :c:func:`diag_Wee_mat_elem`. + + + + + +.. c:function:: apply_excitation + + .. code:: text + + subroutine apply_excitation(det, exc, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_hole + + .. code:: text + + subroutine apply_hole(det, s1, h1, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_holes + + .. code:: text + + subroutine apply_holes(det, s1, h1, s2, h2, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_particle + + .. code:: text + + subroutine apply_particle(det, s1, p1, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: apply_particles + + .. code:: text + + subroutine apply_particles(det, s1, p1, s2, p2, res, ok, Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: au0_h_au0 + + .. code:: text + + subroutine au0_h_au0(energies,psi_in,psi_in_coef,ndet,dim_psi_coef) + + File: :file:`mo_energy_expval.irp.f` + + + + + + + +.. c:function:: bitstring_to_list_ab + + .. code:: text + + subroutine bitstring_to_list_ab( string, list, n_elements, Nint) + + File: :file:`slater_rules.irp.f` + + Gives the inidices(+1) of the bits set to 1 in the bit string For alpha/beta determinants. + + + + + +.. c:function:: build_fock_tmp + + .. code:: text + + subroutine build_fock_tmp(fock_diag_tmp,det_ref,Nint) + + File: :file:`fock_diag.irp.f` + + Build the diagonal of the Fock matrix corresponding to a generator determinant. :math:`F_{00}` is :math:`\langle i|H|i \rangle = E_0` . + + + + + +.. c:function:: connected_to_ref + + .. code:: text + + integer function connected_to_ref(key,keys,Nint,N_past_in,Ndet) + + File: :file:`connected_to_ref.irp.f` + + input : key : a given Slater determinant + + : keys: a list of Slater determinants + + : Ndet: the number of Slater determinants in keys + + : N_past_in the number of Slater determinants for the connectivity research + + output : 0 : key not connected to the N_past_in first Slater determinants in keys + + i : key is connected to determinant i of keys + + -i : key is the ith determinant of the reference wf keys + + + + + +.. c:function:: connected_to_ref_by_mono + + .. code:: text + + integer function connected_to_ref_by_mono(key,keys,Nint,N_past_in,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| is ``key`` is connected to the reference by a single excitation. input : key : a given Slater determinant + + : keys: a list of Slater determinants + + : Ndet: the number of Slater determinants in keys + + : N_past_in the number of Slater determinants for the connectivity research + + output : 0 : key not connected by a MONO EXCITATION to the N_past_in first Slater determinants in keys + + i : key is connected by a MONO EXCITATION to determinant i of keys + + -i : key is the ith determinant of the reference wf keys + + + + + +.. c:function:: copy_h_apply_buffer_to_wf + + .. code:: text + + subroutine copy_H_apply_buffer_to_wf + + File: :file:`h_apply.irp.f` + + Copies the H_apply buffer to psi_coef. After calling this subroutine, N_det, psi_det and psi_coef need to be touched + + + + + +.. c:function:: copy_psi_bilinear_to_psi + + .. code:: text + + subroutine copy_psi_bilinear_to_psi(psi, isize) + + File: :file:`spindeterminants.irp.f` + + Overwrites psi_det and psi_coef with the wf in bilinear order + + + + + +.. c:function:: create_microlist + + .. code:: text + + subroutine create_microlist(minilist, N_minilist, key_mask, microlist, idx_microlist, N_microlist, ptr_microlist, Nint) + + File: :file:`filter_connected.irp.f` + + + + + + + +.. c:function:: create_minilist + + .. code:: text + + subroutine create_minilist(key_mask, fullList, miniList, idx_miniList, N_fullList, N_miniList, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: create_minilist_find_previous + + .. code:: text + + subroutine create_minilist_find_previous(key_mask, fullList, miniList, N_fullList, N_miniList, fullMatch, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: create_wf_of_psi_bilinear_matrix + + .. code:: text + + subroutine create_wf_of_psi_bilinear_matrix(truncate) + + File: :file:`spindeterminants.irp.f` + + Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants + + + + + +.. c:function:: decode_exc + + .. code:: text + + subroutine decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + + File: :file:`slater_rules.irp.f` + + Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles s1,s2 : Spins (1:alpha, 2:beta) degree : Degree of excitation + + + + + +.. c:function:: decode_exc_spin + + .. code:: text + + subroutine decode_exc_spin(exc,h1,p1,h2,p2) + + File: :file:`slater_rules.irp.f` + + Decodes the exc arrays returned by get_excitation. + + h1,h2 : Holes + + p1,p2 : Particles + + + + + +.. c:function:: det_inf + + .. code:: text + + logical function det_inf(key1, key2, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Ordering function for determinants. + + + + + +.. c:function:: det_search_key + + .. code:: text + + integer*8 function det_search_key(det,Nint) + + File: :file:`connected_to_ref.irp.f` + + Return an integer*8 corresponding to a determinant index for searching + + + + + +.. c:function:: detcmp + + .. code:: text + + integer function detCmp(a,b,Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: deteq + + .. code:: text + + logical function detEq(a,b,Nint) + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: diag_h_mat_elem + + .. code:: text + + double precision function diag_H_mat_elem(det_in,Nint) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: diag_h_mat_elem_au0_h_au0 + + .. code:: text + + subroutine diag_H_mat_elem_au0_h_au0(det_in,Nint,hii) + + File: :file:`mo_energy_expval.irp.f` + + Computes :math:`\langle i|H|i \rangle` for any determinant :math:`|i\rangle` . Used for wave functions with an additional electron. + + + + + +.. c:function:: diag_h_mat_elem_fock + + .. code:: text + + double precision function diag_H_mat_elem_fock(det_ref,det_pert,fock_diag_tmp,Nint) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|i \rangle` when :math:`i` is at most a double excitation from a reference. + + + + + +.. c:function:: diag_h_mat_elem_one_e + + .. code:: text + + double precision function diag_H_mat_elem_one_e(det_in,Nint) + + File: :file:`slater_rules_wee_mono.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: diag_s_mat_elem + + .. code:: text + + double precision function diag_S_mat_elem(key_i,Nint) + + File: :file:`s2.irp.f` + + Returns + + + + + +.. c:function:: diag_wee_mat_elem + + .. code:: text + + double precision function diag_wee_mat_elem(det_in,Nint) + + File: :file:`slater_rules_wee_mono.irp.f` + + Computes :math:`\langle i|H|i \rangle` . + + + + + +.. c:function:: do_mono_excitation + + .. code:: text + + subroutine do_mono_excitation(key_in,i_hole,i_particle,ispin,i_ok) + + File: :file:`create_excitations.irp.f` + + Apply the single excitation operator : a^{dager}_(i_particle) a_(i_hole) of spin = ispin on key_in ispin = 1 == alpha ispin = 2 == beta i_ok = 1 == the excitation is possible i_ok = -1 == the excitation is not possible + + + + + +.. c:function:: example_determinants + + .. code:: text + + subroutine example_determinants + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants + + + + + +.. c:function:: example_determinants_psi_det + + .. code:: text + + subroutine example_determinants_psi_det + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants using the psi_det/psi_coef + + + + + +.. c:function:: fill_h_apply_buffer_no_selection + + .. code:: text + + subroutine fill_H_apply_buffer_no_selection(n_selected,det_buffer,Nint,iproc) + + File: :file:`h_apply.irp.f` + + Fill the H_apply buffer with determiants for |CISD| + + + + + +.. c:function:: filter_connected + + .. code:: text + + subroutine filter_connected(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Filters out the determinants that are not connected by H + + returns the array idx which contains the index of the + + determinants in the array key1 that interact + + via the H operator with key2. + + idx(0) is the number of determinants that interact with key1 + + + + + +.. c:function:: filter_connected_i_h_psi0 + + .. code:: text + + subroutine filter_connected_i_H_psi0(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Returns the array idx which contains the index of the + + determinants in the array key1 that interact + + via the H operator with key2. + + idx(0) is the number of determinants that interact with key1 + + + + + +.. c:function:: filter_not_connected + + .. code:: text + + subroutine filter_not_connected(key1,key2,Nint,sze,idx) + + File: :file:`filter_connected.irp.f` + + Returns the array idx which contains the index of the + + determinants in the array key1 that DO NOT interact + + via the H operator with key2. + + idx(0) is the number of determinants that DO NOT interact with key1 + + + + + +.. c:function:: generate_all_alpha_beta_det_products + + .. code:: text + + subroutine generate_all_alpha_beta_det_products + + File: :file:`spindeterminants.irp.f` + + Create a wave function from all possible :math:`\alpha \times \beta` determinants + + + + + +.. c:function:: get_all_spin_doubles + + .. code:: text + + subroutine get_all_spin_doubles(buffer, idx, spindet, Nint, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_1 + + .. code:: text + + subroutine get_all_spin_doubles_1(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the double excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_2 + + .. code:: text + + subroutine get_all_spin_doubles_2(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_3 + + .. code:: text + + subroutine get_all_spin_doubles_3(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_4 + + .. code:: text + + subroutine get_all_spin_doubles_4(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_doubles_n_int + + .. code:: text + + subroutine get_all_spin_doubles_N_int(buffer, idx, spindet, size_buffer, doubles, n_doubles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the double excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles + + .. code:: text + + subroutine get_all_spin_singles(buffer, idx, spindet, Nint, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_1 + + .. code:: text + + subroutine get_all_spin_singles_1(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single excitations in the list of unique :math:`\alpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_2 + + .. code:: text + + subroutine get_all_spin_singles_2(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_3 + + .. code:: text + + subroutine get_all_spin_singles_3(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_4 + + .. code:: text + + subroutine get_all_spin_singles_4(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles + + .. code:: text + + subroutine get_all_spin_singles_and_doubles(buffer, idx, spindet, Nint, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_1 + + .. code:: text + + subroutine get_all_spin_singles_and_doubles_1(buffer, idx, spindet, size_buffer, singles, doubles, n_singles, n_doubles) + + File: :file:`spindeterminants.irp.f` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`\alpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_2 + + .. code:: text + + 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` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_3 + + .. code:: text + + 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` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_4 + + .. code:: text + + 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` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_and_doubles_n_int + + .. code:: text + + 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` + + + + Returns the indices of all the single and double excitations in the list of unique :math:`lpha` determinants. + + /!\ : The buffer is transposed ! + + + + + + + +.. c:function:: get_all_spin_singles_n_int + + .. code:: text + + subroutine get_all_spin_singles_N_int(buffer, idx, spindet, size_buffer, singles, n_singles) + + File: :file:`spindeterminants.irp.f_template_1218` + + + + Returns the indices of all the single excitations in the list of unique :math:`lpha` determinants. + + + + + + + +.. c:function:: get_double_excitation + + .. code:: text + + subroutine get_double_excitation(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the two excitation operators between two doubly excited determinants and the phase. + + + + + +.. c:function:: get_double_excitation_spin + + .. code:: text + + subroutine get_double_excitation_spin(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the two excitation operators between two doubly excited spin-determinants and the phase. + + + + + +.. c:function:: get_excitation + + .. code:: text + + subroutine get_excitation(det1,det2,exc,degree,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operators between two determinants and the phase. + + + + + +.. c:function:: get_excitation_degree + + .. code:: text + + subroutine get_excitation_degree(key1,key2,degree,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation degree between two determinants. + + + + + +.. c:function:: get_excitation_degree_spin + + .. code:: text + + subroutine get_excitation_degree_spin(key1,key2,degree,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation degree between two determinants. + + + + + +.. c:function:: get_excitation_degree_vector + + .. code:: text + + subroutine get_excitation_degree_vector(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants. + + + + + +.. c:function:: get_excitation_degree_vector_double_alpha_beta + + .. code:: text + + subroutine get_excitation_degree_vector_double_alpha_beta(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_degree_vector_mono + + .. code:: text + + subroutine get_excitation_degree_vector_mono(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and returns only the single excitations. + + + + + +.. c:function:: get_excitation_degree_vector_mono_or_exchange + + .. code:: text + + subroutine get_excitation_degree_vector_mono_or_exchange(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_degree_vector_mono_or_exchange_verbose + + .. code:: text + + subroutine get_excitation_degree_vector_mono_or_exchange_verbose(key1,key2,degree,Nint,sze,idx) + + File: :file:`slater_rules.irp.f` + + Applies get_excitation_degree to an array of determinants and return only the single excitations and the connections through exchange integrals. + + + + + +.. c:function:: get_excitation_spin + + .. code:: text + + subroutine get_excitation_spin(det1,det2,exc,degree,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operators between two determinants and the phase. + + + + + +.. c:function:: get_index_in_psi_det_alpha_unique + + .. code:: text + + integer function get_index_in_psi_det_alpha_unique(key,Nint) + + File: :file:`spindeterminants.irp.f` + + Returns the index of the determinant in the ``psi_det_alpha_unique`` array + + + + + +.. c:function:: get_index_in_psi_det_beta_unique + + .. code:: text + + integer function get_index_in_psi_det_beta_unique(key,Nint) + + File: :file:`spindeterminants.irp.f` + + Returns the index of the determinant in the ``psi_det_beta_unique`` array + + + + + +.. c:function:: get_index_in_psi_det_sorted_bit + + .. code:: text + + integer function get_index_in_psi_det_sorted_bit(key,Nint) + + File: :file:`connected_to_ref.irp.f` + + Returns the index of the determinant in the ``psi_det_sorted_bit`` array + + + + + +.. c:function:: get_mono_excitation + + .. code:: text + + subroutine get_mono_excitation(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operator between two singly excited determinants and the phase. + + + + + +.. c:function:: get_mono_excitation_from_fock + + .. code:: text + + subroutine get_mono_excitation_from_fock(det_1,det_2,h,p,spin,phase,hij) + + File: :file:`single_excitations.irp.f` + + + + + + + +.. c:function:: get_mono_excitation_spin + + .. code:: text + + subroutine get_mono_excitation_spin(det1,det2,exc,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the excitation operator between two singly excited determinants and the phase. + + + + + +.. c:function:: get_phase + + .. code:: text + + subroutine get_phase(key1,key2,phase,Nint) + + File: :file:`slater_rules.irp.f` + + Returns the phase between key1 and key2. + + + + + +.. c:function:: get_phasemask_bit + + .. code:: text + + subroutine get_phasemask_bit(det1, pm, Nint) + + File: :file:`slater_rules.irp.f` + + + + + + + +.. c:function:: get_s2 + + .. code:: text + + subroutine get_s2(key_i,key_j,Nint,s2) + + File: :file:`s2.irp.f` + + Returns + + + + + +.. c:function:: get_uj_s2_ui + + .. code:: text + + subroutine get_uJ_s2_uI(psi_keys_tmp,psi_coefs_tmp,n,nmax_coefs,nmax_keys,s2,nstates) + + File: :file:`s2.irp.f` + + returns the matrix elements of S^2 "s2(i,j)" between the "nstates" states psi_coefs_tmp(:,i) and psi_coefs_tmp(:,j) + + + + + +.. c:function:: getmobiles + + .. code:: text + + subroutine getMobiles(key,key_mask, mobiles,Nint) + + File: :file:`filter_connected.irp.f` + + + + + + + +.. c:function:: i_h_j + + .. code:: text + + subroutine i_H_j(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_double_alpha_beta + + .. code:: text + + subroutine i_H_j_double_alpha_beta(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by an opposite-spin double excitation. + + + + + +.. c:function:: i_h_j_double_spin + + .. code:: text + + subroutine i_H_j_double_spin(key_i,key_j,Nint,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a same-spin double excitation. + + + + + +.. c:function:: i_h_j_mono_spin + + .. code:: text + + subroutine i_H_j_mono_spin(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: i_h_j_mono_spin_one_e + + .. code:: text + + subroutine i_H_j_mono_spin_one_e(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: i_h_j_one_e + + .. code:: text + + subroutine i_H_j_one_e(key_i,key_j,Nint,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_s2 + + .. code:: text + + subroutine i_H_j_s2(key_i,key_j,Nint,hij,s2) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` and :math:`\langle i|S^2|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_two_e + + .. code:: text + + subroutine i_H_j_two_e(key_i,key_j,Nint,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_j_verbose + + .. code:: text + + subroutine i_H_j_verbose(key_i,key_j,Nint,hij,hmono,hdouble,phase) + + File: :file:`slater_rules.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants. + + + + + +.. c:function:: i_h_psi + + .. code:: text + + subroutine i_H_psi(key,keys,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|Psi \rangle = \sum_J c_J \langle i | H | J \rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The i_H_psi_minilist is much faster but requires to build the minilists. + + + + + +.. c:function:: i_h_psi_minilist + + .. code:: text + + subroutine i_H_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_H_psi_array) + + File: :file:`slater_rules.irp.f` + + Computes :math:`\langle i|H|\Psi \rangle = \sum_J c_J \langle i|H|J\rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J \rangle` to which :math:`|i \rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. + + + + + +.. c:function:: i_s2_psi_minilist + + .. code:: text + + subroutine i_S2_psi_minilist(key,keys,idx_key,N_minilist,coef,Nint,Ndet,Ndet_max,Nstate,i_S2_psi_array) + + File: :file:`s2.irp.f` + + Computes :math:`\langle i|S^2|\Psi \rangle = \sum_J c_J \langle i|S^2|J \rangle` . + + Uses filter_connected_i_H_psi0 to get all the :math:`|J\rangle` to which :math:`|i\rangle` is connected. The :math:`|J\rangle` are searched in short pre-computed lists. + + + + + +.. c:function:: i_wee_j_mono + + .. code:: text + + subroutine i_Wee_j_mono(key_i,key_j,Nint,spin,hij) + + File: :file:`slater_rules_wee_mono.irp.f` + + Returns :math:`\langle i|H|j \rangle` where :math:`i` and :math:`j` are determinants differing by a single excitation. + + + + + +.. c:function:: is_connected_to + + .. code:: text + + logical function is_connected_to(key,keys,Nint,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| if determinant ``key`` is connected to ``keys`` + + + + + +.. c:function:: is_connected_to_by_mono + + .. code:: text + + logical function is_connected_to_by_mono(key,keys,Nint,Ndet) + + File: :file:`connected_to_ref.irp.f` + + Returns |true| is ``key`` is connected to ``keys`` by a single excitation. + + + + + +.. c:function:: is_in_wavefunction + + .. code:: text + + logical function is_in_wavefunction(key,Nint) + + File: :file:`connected_to_ref.irp.f` + + |true| if the determinant ``det`` is in the wave function + + + + + +.. c:function:: is_spin_flip_possible + + .. code:: text + + logical function is_spin_flip_possible(key_in,i_flip,ispin) + + File: :file:`create_excitations.irp.f` + + returns |true| if the spin-flip of spin ispin in the orbital i_flip is possible on key_in + + + + + +.. c:function:: make_s2_eigenfunction + + .. code:: text + + subroutine make_s2_eigenfunction + + File: :file:`occ_pattern.irp.f` + + + + + + + +.. c:function:: mono_excitation_wee + + .. code:: text + + subroutine mono_excitation_wee(det_1,det_2,h,p,spin,phase,hij) + + File: :file:`mono_excitations_bielec.irp.f` + + + + + + + +.. c:function:: occ_pattern_of_det + + .. code:: text + + subroutine occ_pattern_of_det(d,o,Nint) + + File: :file:`occ_pattern.irp.f` + + Transforms a determinant to an occupation pattern + + occ(:,1) : Single occupations + + occ(:,2) : Double occupations + + + + + + + +.. c:function:: occ_pattern_search_key + + .. code:: text + + integer*8 function occ_pattern_search_key(det,Nint) + + File: :file:`connected_to_ref.irp.f` + + Return an integer*8 corresponding to a determinant index for searching + + + + + +.. c:function:: occ_pattern_to_dets + + .. code:: text + + subroutine occ_pattern_to_dets(o,d,sze,n_alpha,Nint) + + File: :file:`occ_pattern.irp.f` + + Generate all possible determinants for a give occ_pattern + + + + + +.. c:function:: occ_pattern_to_dets_size + + .. code:: text + + subroutine occ_pattern_to_dets_size(o,sze,n_alpha,Nint) + + File: :file:`occ_pattern.irp.f` + + Number of possible determinants for a given occ_pattern + + + + + +.. c:function:: pull_pt2 + + .. code:: text + + subroutine pull_pt2(zmq_socket_pull,pt2,norm_pert,H_pert_diag,i_generator,N_st,n,task_id) + + File: :file:`h_apply.irp.f` + + Pull |PT2| calculation in the collector + + + + + +.. c:function:: push_pt2 + + .. code:: text + + subroutine push_pt2(zmq_socket_push,pt2,norm_pert,H_pert_diag,i_generator,N_st,task_id) + + File: :file:`h_apply.irp.f` + + Push |PT2| calculation to the collector + + + + + +.. c:function:: read_dets + + .. code:: text + + subroutine read_dets(det,Nint,Ndet) + + File: :file:`determinants.irp.f` + + Reads the determinants from the |EZFIO| file + + + + + +.. c:function:: remove_duplicates_in_psi_det + + .. code:: text + + subroutine remove_duplicates_in_psi_det(found_duplicates) + + File: :file:`h_apply.irp.f` + + Removes duplicate determinants in the wave function. + + + + + +.. c:function:: resize_h_apply_buffer + + .. code:: text + + subroutine resize_H_apply_buffer(new_size,iproc) + + File: :file:`h_apply.irp.f` + + Resizes the H_apply buffer of proc iproc. The buffer lock should be set before calling this function. + + + + + +.. c:function:: routine_example_psi_det + + .. code:: text + + subroutine routine_example_psi_det + + File: :file:`example.irp.f` + + subroutine that illustrates the main features available in determinants using many determinants + + + + + +.. c:function:: s2_u_0 + + .. code:: text + + subroutine S2_u_0(v_0,u_0,n,keys_tmp,Nint) + + File: :file:`s2.irp.f` + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + + + + + +.. c:function:: s2_u_0_nstates + + .. code:: text + + subroutine S2_u_0_nstates(v_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + File: :file:`s2.irp.f` + + Computes v_0 = S^2|u_0> + + n : number of determinants + + + + + + + +.. c:function:: save_natural_mos + + .. code:: text + + subroutine save_natural_mos + + File: :file:`density_matrix.irp.f` + + Save natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis + + + + + +.. c:function:: save_ref_determinant + + .. code:: text + + subroutine save_ref_determinant + + File: :file:`determinants.irp.f` + + + + + + + +.. c:function:: save_wavefunction + + .. code:: text + + subroutine save_wavefunction + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_general + + .. code:: text + + subroutine save_wavefunction_general(ndet,nstates,psidet,dim_psicoef,psicoef) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_specified + + .. code:: text + + subroutine save_wavefunction_specified(ndet,nstates,psidet,psicoef,ndetsave,index_det_save) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_truncated + + .. code:: text + + subroutine save_wavefunction_truncated(thr) + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: save_wavefunction_unsorted + + .. code:: text + + subroutine save_wavefunction_unsorted + + File: :file:`determinants.irp.f` + + Save the wave function into the |EZFIO| file + + + + + +.. c:function:: set_natural_mos + + .. code:: text + + subroutine set_natural_mos + + File: :file:`density_matrix.irp.f` + + Set natural orbitals, obtained by diagonalization of the one-body density matrix in the |MO| basis + + + + + +.. c:function:: sort_dets_ab + + .. code:: text + + subroutine sort_dets_ab(key, idx, shortcut, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_ab_v + + .. code:: text + + subroutine sort_dets_ab_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_ba_v + + .. code:: text + + subroutine sort_dets_ba_v(key_in, key_out, idx, shortcut, version, N_key, Nint) + + File: :file:`sort_dets_ab.irp.f` + + Deprecated routine + + + + + +.. c:function:: sort_dets_by_det_search_key + + .. code:: text + + subroutine sort_dets_by_det_search_key(Ndet, det_in, coef_in, sze, det_out, coef_out, N_st) + + File: :file:`determinants.irp.f` + + Determinants are sorted according to their :c:func:`det_search_key`. Useful to accelerate the search of a random determinant in the wave function. + + /!\ The first dimension of coef_out and coef_in need to be psi_det_size + + + + + + + +.. c:function:: spin_det_search_key + + .. code:: text + + integer*8 function spin_det_search_key(det,Nint) + + File: :file:`spindeterminants.irp.f` + + Return an integer(8) corresponding to a determinant index for searching + + + + + +.. c:function:: tamiser + + .. code:: text + + subroutine tamiser(key, idx, no, n, Nint, N_key) + + File: :file:`sort_dets_ab.irp.f` + + + + + + + +.. c:function:: u_0_s2_u_0 + + .. code:: text + + subroutine u_0_S2_u_0(e_0,u_0,n,keys_tmp,Nint,N_st,sze_8) + + File: :file:`s2.irp.f` + + Computes e_0 = / + + n : number of determinants + + + + + + + +.. c:function:: wf_of_psi_bilinear_matrix + + .. code:: text + + subroutine wf_of_psi_bilinear_matrix(truncate) + + File: :file:`spindeterminants.irp.f` + + Generate a wave function containing all possible products of :math:`\alpha` and :math:`\beta` determinants + + + + + +.. c:function:: write_spindeterminants + + .. code:: text + + subroutine write_spindeterminants + + File: :file:`spindeterminants.irp.f` + + + + + + + +.. c:function:: zmq_get_n_det + + .. code:: text + + integer function zmq_get_N_det(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_alpha_unique + + .. code:: text + + integer function zmq_get_N_det_alpha_unique(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det_alpha_unique from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_beta_unique + + .. code:: text + + integer function zmq_get_N_det_beta_unique(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_det_beta_unique from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_states + + .. code:: text + + integer function zmq_get_N_states(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get N_states from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi + + .. code:: text + + integer function zmq_get_psi(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear + + .. code:: text + + integer function zmq_get_psi_bilinear(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_columns + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_columns on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_order + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_order on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_rows + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Get psi_bilinear_matrix_rows on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_bilinear_matrix_values + + .. code:: text + + integer*8 function zmq_get_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + get psi_bilinear_matrix_values on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_coef + + .. code:: text + + integer*8 function zmq_get_psi_coef(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + get psi_coef on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det + + .. code:: text + + integer*8 function zmq_get_psi_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_alpha_unique + + .. code:: text + + integer*8 function zmq_get_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_beta_unique + + .. code:: text + + integer*8 function zmq_get_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Get psi_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_det_size + + .. code:: text + + integer function zmq_get_psi_det_size(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_379` + + Get psi_det_size from the qp_run scheduler + + + + + +.. c:function:: zmq_get_psi_notouch + + .. code:: text + + integer function zmq_get_psi_notouch(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f` + + Get the wave function from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det + + .. code:: text + + integer function zmq_put_N_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_alpha_unique + + .. code:: text + + integer function zmq_put_N_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_beta_unique + + .. code:: text + + integer function zmq_put_N_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_states + + .. code:: text + + integer function zmq_put_N_states(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put N_states on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi + + .. code:: text + + integer function zmq_put_psi(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f` + + Put the wave function on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear + + .. code:: text + + integer function zmq_put_psi_bilinear(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f` + + Put the wave function on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_columns + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_columns(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_columns on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_order + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_order(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_order on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_rows + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_rows(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_500` + + Put psi_bilinear_matrix_rows on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_bilinear_matrix_values + + .. code:: text + + integer*8 function zmq_put_psi_bilinear_matrix_values(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + Put psi_bilinear_matrix_values on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_coef + + .. code:: text + + integer*8 function zmq_put_psi_coef(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_564` + + Put psi_coef on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det + + .. code:: text + + integer*8 function zmq_put_psi_det(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_alpha_unique + + .. code:: text + + integer*8 function zmq_put_psi_det_alpha_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det_alpha_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_beta_unique + + .. code:: text + + integer*8 function zmq_put_psi_det_beta_unique(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_440` + + Put psi_det_beta_unique on the qp_run scheduler + + + + + +.. c:function:: zmq_put_psi_det_size + + .. code:: text + + integer function zmq_put_psi_det_size(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_379` + + Put psi_det_size on the qp_run scheduler + + diff --git a/docs/source/modules/dft_keywords.rst b/docs/source/modules/dft_keywords.rst new file mode 100644 index 00000000..8a5fe1a5 --- /dev/null +++ b/docs/source/modules/dft_keywords.rst @@ -0,0 +1,59 @@ +.. _dft_keywords: + +.. program:: dft_keywords + +.. default-role:: option + +============ +dft_keywords +============ + +This module contains the main keywords related to a DFT calculation or RS-DFT calculation, such as: + +* :option:`dft_keywords exchange_functional` +* :option:`dft_keywords correlation_functional` +* :option:`dft_keywords HF_exchange` : only relevent for the :c:func:`rs_ks_scf` program + +The keyword for the **range separation parameter** :math:`\mu` is the :option:`ao_two_e_erf_ints mu_erf` keyword. + +The keyword for the type of density used in RS-DFT calculation with a multi-configurational wave function is the :option:`density_for_dft density_for_dft` keyword. + + + +EZFIO parameters +---------------- + +.. option:: exchange_functional + + name of the exchange functional + + Default: short_range_LDA + +.. option:: correlation_functional + + name of the correlation functional + + Default: short_range_LDA + +.. option:: HF_exchange + + Percentage of HF exchange in the DFT model + + Default: 0. + + +Providers +--------- + + +.. c:var:: dft_type + + .. code:: text + + character*(32) :: dft_type + + File: :file:`keywords.irp.f` + + defines the type of DFT applied: LDA, GGA etc ... + + diff --git a/docs/source/modules/dft_utils_in_r.rst b/docs/source/modules/dft_utils_in_r.rst new file mode 100644 index 00000000..bf815025 --- /dev/null +++ b/docs/source/modules/dft_utils_in_r.rst @@ -0,0 +1,361 @@ +.. _dft_utils_in_r: + +.. program:: dft_utils_in_r + +.. default-role:: option + +============== +dft_utils_in_r +============== + +This module contains most of the fundamental quantities (AOs, MOs or density derivatives) evaluated in real-space representation that are needed for the various DFT modules. + +As these quantities might be used and re-used, the values at each point of the grid are stored (see ``becke_numerical_grid`` for more information on the grid). + +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. + + + + +Providers +--------- + + +.. c:var:: aos_grad_in_r_array + + .. code:: text + + double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point + + aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_grad_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_grad_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_grad_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith ao on the jth grid point + + aos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_in_r_array + + .. code:: text + + double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) + double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) + + File: :file:`ao_in_r.irp.f` + + aos_in_r_array(i,j) = value of the ith ao on the jth grid point + + aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point + + + + +.. c:var:: aos_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_in_r_array (ao_num,n_points_final_grid) + double precision, allocatable :: aos_in_r_array_transp (n_points_final_grid,ao_num) + + File: :file:`ao_in_r.irp.f` + + aos_in_r_array(i,j) = value of the ith ao on the jth grid point + + aos_in_r_array_transp(i,j) = value of the jth ao on the ith grid point + + + + +.. c:var:: aos_lapl_in_r_array + + .. code:: text + + double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point + + aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: aos_lapl_in_r_array_transp + + .. code:: text + + double precision, allocatable :: aos_lapl_in_r_array (ao_num,n_points_final_grid,3) + double precision, allocatable :: aos_lapl_in_r_array_transp (n_points_final_grid,ao_num,3) + + File: :file:`ao_in_r.irp.f` + + aos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith ao on the jth grid point + + aos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth ao on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: mos_grad_in_r_array + + .. code:: text + + double precision, allocatable :: mos_grad_in_r_array (mo_num,n_points_final_grid,3) + + File: :file:`mo_in_r.irp.f` + + mos_grad_in_r_array(i,j,k) = value of the kth component of the gradient of ith mo on the jth grid point + + mos_grad_in_r_array_transp(i,j,k) = value of the kth component of the gradient of jth mo on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. c:var:: mos_in_r_array + + .. code:: text + + double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) + double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) + + File: :file:`mo_in_r.irp.f` + + mos_in_r_array(i,j) = value of the ith mo on the jth grid point + + mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point + + + + +.. c:var:: mos_in_r_array_transp + + .. code:: text + + double precision, allocatable :: mos_in_r_array (mo_num,n_points_final_grid) + double precision, allocatable :: mos_in_r_array_transp (n_points_final_grid,mo_num) + + File: :file:`mo_in_r.irp.f` + + mos_in_r_array(i,j) = value of the ith mo on the jth grid point + + mos_in_r_array_transp(i,j) = value of the jth mo on the ith grid point + + + + +.. c:var:: mos_lapl_in_r_array + + .. code:: text + + double precision, allocatable :: mos_lapl_in_r_array (mo_num,n_points_final_grid,3) + + File: :file:`mo_in_r.irp.f` + + mos_lapl_in_r_array(i,j,k) = value of the kth component of the laplacian of ith mo on the jth grid point + + mos_lapl_in_r_array_transp(i,j,k) = value of the kth component of the laplacian of jth mo on the ith grid point + + k = 1 : x, k= 2, y, k 3, z + + + + +.. 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` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r + + .. code:: text + + subroutine density_and_grad_alpha_beta_and_all_aos_and_grad_aos_at_r(r,dm_a,dm_b, grad_dm_a, grad_dm_b, aos_array, grad_aos_array) + + File: :file:`dm_in_r.irp.f` + + input : r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r : dm_b = beta density evaluated at r : aos_array(i) = ao(i) evaluated at r : grad_dm_a(1) = X gradient of the alpha density evaluated in r : grad_dm_a(1) = X gradient of the beta density evaluated in r : grad_aos_array(1) = X gradient of the aos(i) evaluated at r + + + + + +.. c:function:: dm_dft_alpha_beta_and_all_aos_at_r + + .. code:: text + + subroutine dm_dft_alpha_beta_and_all_aos_at_r(r,dm_a,dm_b,aos_array) + + File: :file:`dm_in_r.irp.f` + + input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r output : dm_b = beta density evaluated at r output : aos_array(i) = ao(i) evaluated at r + + + + + +.. c:function:: dm_dft_alpha_beta_at_r + + .. code:: text + + subroutine dm_dft_alpha_beta_at_r(r,dm_a,dm_b) + + File: :file:`dm_in_r.irp.f` + + input: r(1) ==> r(1) = x, r(2) = y, r(3) = z output : dm_a = alpha density evaluated at r(3) output : dm_b = beta density evaluated at r(3) + + diff --git a/docs/source/modules/dft_utils_one_e.rst b/docs/source/modules/dft_utils_one_e.rst new file mode 100644 index 00000000..09708468 --- /dev/null +++ b/docs/source/modules/dft_utils_one_e.rst @@ -0,0 +1,1951 @@ +.. _dft_utils_one_e: + +.. program:: dft_utils_one_e + +.. default-role:: option + +=============== +dft_utils_one_e +=============== + +This module contains all the one-body related quantities needed to perform DFT or RS-DFT calculations. +Therefore, it contains most of the properties which depends on the one-body density and density matrix. + +The most important files and variables are: + +* The general *providers* for the x/c energies in :file:`e_xc_general.irp.f` +* The general *providers* for the x/c potentials in :file:`pot_general.irp.f` +* The short-range hartree operator and all related quantities in :file:`sr_coulomb.irp.f` + +These *providers* will be used in many DFT-related programs, such as :file:`ks_scf.irp.f` or :file:`rs_ks_scf.irp.f`. +It is also needed to compute the effective one-body operator needed in multi-determinant RS-DFT (see plugins by eginer). + +Some other interesting quantities: + +* The LDA and PBE *providers* for the x/c energies in :file:`e_xc.irp.f` and :file:`sr_exc.irp.f` +* The LDA and PBE *providers* for the x/c potentials on the AO basis in :file:`pot_ao.irp.f` and :file:`sr_pot_ao.irp.f` +* The :math:`h_{core}` energy computed directly with the one-body density matrix in :file:`one_e_energy_dft.irp.f` +* LDA and PBE short-range functionals *subroutines* in :file:`exc_sr_lda.irp.f` and :file:`exc_sr_pbe.irp.f` + + + + + +Providers +--------- + + +.. c:var:: aos_dsr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dsr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_dvx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_sr_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_sr_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (sr_v^x_alpha(r_j) + sr_v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_sr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_alpha_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_beta_lda_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vc_beta_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_alpha_lda_w (n_points_final_grid,ao_num,N_states) + double precision, allocatable :: aos_vx_beta_lda_w (n_points_final_grid,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_LDA_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: aos_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: effective_one_e_potential + + .. code:: text + + double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) + double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) + + File: :file:`sr_coulomb.irp.f` + + Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` + + Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. + + shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal + + + + +.. c:var:: effective_one_e_potential_without_kin + + .. code:: text + + double precision, allocatable :: effective_one_e_potential (mo_num,mo_num,N_states) + double precision, allocatable :: effective_one_e_potential_without_kin (mo_num,mo_num,N_states) + + File: :file:`sr_coulomb.irp.f` + + Effective_one_e_potential(i,j) = :math:`\rangle i| v_{H}^{sr} |j\rangle + \rangle i| h_{core} |j\rangle + \rangle i|v_{xc} |j\rangle` + + Taking the expectation value does not provide any energy, but effective_one_e_potential(i,j) is the potential coupling DFT and WFT part to be used in any WFT calculation. + + shifted_effective_one_e_potential_without_kin = effective_one_e_potential_without_kin + shifting_constant on the diagonal + + + + +.. c:var:: energy_c + + .. code:: text + + double precision, allocatable :: energy_x (N_states) + double precision, allocatable :: energy_c (N_states) + + File: :file:`e_xc_general.irp.f` + + correlation and exchange energies general providers. + + + + +.. c:var:: energy_c_lda + + .. code:: text + + double precision, allocatable :: energy_x_lda (N_states) + double precision, allocatable :: energy_c_lda (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_c_pbe + + .. code:: text + + double precision, allocatable :: energy_x_pbe (N_states) + double precision, allocatable :: energy_c_pbe (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_sr_c_lda + + .. code:: text + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_sr_c_pbe + + .. code:: text + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_sr_x_lda + + .. code:: text + + double precision, allocatable :: energy_sr_x_lda (N_states) + double precision, allocatable :: energy_sr_c_lda (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_sr_x_pbe + + .. code:: text + + double precision, allocatable :: energy_sr_x_pbe (N_states) + double precision, allocatable :: energy_sr_c_pbe (N_states) + + File: :file:`sr_exc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: energy_x + + .. code:: text + + double precision, allocatable :: energy_x (N_states) + double precision, allocatable :: energy_c (N_states) + + File: :file:`e_xc_general.irp.f` + + correlation and exchange energies general providers. + + + + +.. c:var:: energy_x_lda + + .. code:: text + + double precision, allocatable :: energy_x_lda (N_states) + double precision, allocatable :: energy_c_lda (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range LDA functional + + + + +.. c:var:: energy_x_pbe + + .. code:: text + + double precision, allocatable :: energy_x_pbe (N_states) + double precision, allocatable :: energy_c_pbe (N_states) + + File: :file:`e_xc.irp.f` + + exchange/correlation energy with the short range PBE functional + + + + +.. c:var:: gga_sr_type_functionals + + .. code:: text + + subroutine GGA_sr_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + + File: :file:`utils.irp.f` + + routine that helps in building the x/c potentials on the AO basis for a GGA functional with a short-range interaction + + + + +.. c:var:: gga_type_functionals + + .. code:: text + + subroutine GGA_type_functionals(r,rho_a,rho_b,grad_rho_a_2,grad_rho_b_2,grad_rho_a_b, & + ex,vx_rho_a,vx_rho_b,vx_grad_rho_a_2,vx_grad_rho_b_2,vx_grad_rho_a_b, & + ec,vc_rho_a,vc_rho_b,vc_grad_rho_a_2,vc_grad_rho_b_2,vc_grad_rho_a_b ) + + File: :file:`utils.irp.f` + + routine that helps in building the x/c potentials on the AO basis for a GGA functional + + + + +.. c:var:: grad_aos_dsr_vc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dsr_vx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_sr_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_sr_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dsr_vx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`sr_pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvc_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvc_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvx_alpha_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: grad_aos_dvx_beta_pbe_w + + .. code:: text + + double precision, allocatable :: aos_vc_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vc_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_alpha_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_vx_beta_pbe_w (ao_num,n_points_final_grid,N_states) + double precision, allocatable :: aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvc_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_alpha_pbe_w (ao_num,n_points_final_grid,3,N_states) + double precision, allocatable :: grad_aos_dvx_beta_pbe_w (ao_num,n_points_final_grid,3,N_states) + + File: :file:`pot_ao.irp.f` + + aos_vxc_alpha_PBE_w(j,i) = ao_i(r_j) * (v^x_alpha(r_j) + v^c_alpha(r_j)) * W(r_j) + + + + +.. c:var:: mu_erf_dft + + .. code:: text + + double precision :: mu_erf_dft + + File: :file:`mu_erf_dft.irp.f` + + range separation parameter used in RS-DFT. It is set to mu_erf in order to be consistent with the two electrons integrals erf + + + + +.. c:var:: potential_c_alpha_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_c_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_c_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_c_alpha_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_c_beta_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_c_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_c_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_c_beta_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_sr_c_alpha_ao_lda + + .. 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 + + + + +.. c:var:: potential_sr_c_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_c_beta_ao_lda + + .. 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 + + + + +.. c:var:: potential_sr_c_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_x_alpha_ao_lda + + .. 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 + + + + +.. c:var:: potential_sr_x_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_sr_x_beta_ao_lda + + .. 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 + + + + +.. c:var:: potential_sr_x_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_sr_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_sr_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`sr_pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_alpha_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_x_alpha_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_x_alpha_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_alpha_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: potential_x_beta_ao + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao (ao_num,ao_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the AO basis + + + + +.. c:var:: potential_x_beta_ao_lda + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_lda (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_lda (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + short range exchange/correlation alpha/beta potentials with LDA functional on the AO basis + + + + +.. c:var:: potential_x_beta_ao_pbe + + .. code:: text + + double precision, allocatable :: potential_x_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_x_beta_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_alpha_ao_pbe (ao_num,ao_num,N_states) + double precision, allocatable :: potential_c_beta_ao_pbe (ao_num,ao_num,N_states) + + File: :file:`pot_ao.irp.f` + + exchange/correlation alpha/beta potentials with the short range PBE functional on the AO basis + + + + +.. c:var:: potential_x_beta_mo + + .. code:: text + + double precision, allocatable :: potential_x_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_x_beta_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_alpha_mo (mo_num,mo_num,N_states) + double precision, allocatable :: potential_c_beta_mo (mo_num,mo_num,N_states) + + File: :file:`pot_general.irp.f` + + general providers for the alpha/beta exchange/correlation potentials on the MO basis + + + + +.. c:var:: psi_dft_energy_h_core + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + 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 + + + + +.. c:var:: psi_dft_energy_kinetic + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + 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 + + + + +.. c:var:: psi_dft_energy_nuclear_elec + + .. code:: text + + double precision, allocatable :: psi_dft_energy_kinetic (N_states) + double precision, allocatable :: psi_dft_energy_nuclear_elec (N_states) + double precision, allocatable :: psi_dft_energy_h_core (N_states) + + 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 + + + + +.. c:var:: shifting_constant + + .. code:: text + + double precision, allocatable :: shifting_constant (N_states) + + File: :file:`shifted_potential.irp.f` + + shifting_constant = (E_{Hxc} - <\Psi | V_{Hxc} | \Psi>) / N_elec constant to add to the potential in order to obtain the variational energy as the eigenvalue of the effective long-range Hamiltonian (see original paper of Levy PRL 113, 113002 (2014), equation (17) ) + + + + +.. c:var:: short_range_hartree + + .. code:: text + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + File: :file:`sr_coulomb.irp.f` + + short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` + + short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` + + = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` + + + + +.. c:var:: short_range_hartree_operator + + .. code:: text + + double precision, allocatable :: short_range_hartree_operator (mo_num,mo_num,N_states) + double precision, allocatable :: short_range_hartree (N_states) + + File: :file:`sr_coulomb.irp.f` + + short_range_Hartree_operator(i,j) = :math:`\int dr i(r)j(r) \int r' \rho(r') W_{ee}^{sr}` + + short_range_Hartree = :math:`1/2 \sum_{i,j} \rho_{ij} \mathtt{short_range_Hartree_operator}(i,j)` + + = :math:`1/2 \int dr \int r' \rho(r) \rho(r') W_{ee}^{sr}` + + + + +.. c:var:: trace_v_h + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +.. c:var:: trace_v_hxc + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +.. c:var:: trace_v_xc + + .. code:: text + + double precision, allocatable :: trace_v_xc (N_states) + double precision, allocatable :: trace_v_h (N_states) + double precision, allocatable :: trace_v_hxc (N_states) + + File: :file:`pot_general.irp.f` + + Trace_v_xc = \sum_{i,j} (rho_{ij}_\alpha v^{xc}_{ij}^\alpha + rho_{ij}_\beta v^{xc}_{ij}^\beta) Trace_v_Hxc = \sum_{i,j} v^{H}_{ij} (rho_{ij}_\alpha + rho_{ij}_\beta) Trace_v_Hxc = \sum_{i,j} rho_{ij} v^{Hxc}_{ij} + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: berf + + .. code:: text + + function berf(a) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dberfda + + .. code:: text + + function dberfda(a) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpol + + .. code:: text + + double precision function dpol(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpold + + .. code:: text + + double precision function dpold(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: dpoldd + + .. code:: text + + double precision function dpoldd(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_lda + + .. code:: text + + subroutine ec_lda(rho_a,rho_b,ec,vc_a,vc_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_lda_sr + + .. code:: text + + subroutine ec_lda_sr(mu,rho_a,rho_b,ec,vc_a,vc_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_only_lda_sr + + .. code:: text + + subroutine ec_only_lda_sr(mu,rho_a,rho_b,ec) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ec_pbe_only + + .. code:: text + + subroutine ec_pbe_only(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec) + + File: :file:`exc_sr_pbe.irp.f` + + Short-range PBE correlation energy functional for erf interaction + + input : ========== + + mu = range separated parameter + + rhoc, rhoo = total density and spin density + + sigmacc = square of the gradient of the total density + + sigmaco = square of the gradient of the spin density + + sigmaoo = scalar product between the gradient of the total density and the one of the spin density + + output: ========== + + ec = correlation energy + + + + + + + +.. c:function:: ec_pbe_sr + + .. code:: text + + subroutine ec_pbe_sr(mu,rhoc,rhoo,sigmacc,sigmaco,sigmaoo,ec,vrhoc,vrhoo,vsigmacc,vsigmaco,vsigmaoo) + + File: :file:`exc_sr_pbe.irp.f` + + Short-range PBE correlation energy functional for erf interaction + + input : ========== + + mu = range separated parameter + + rhoc, rhoo = total density and spin density + + sigmacc = square of the gradient of the total density + + sigmaco = square of the gradient of the spin density + + sigmaoo = scalar product between the gradient of the total density and the one of the spin density + + output: ========== + + ec = correlation energy + + all variables v** are energy derivatives with respect to components of the density + + vrhoc = derivative with respect to the total density + + vrhoo = derivative with respect to spin density + + vsigmacc = derivative with respect to the square of the gradient of the total density + + vsigmaco = derivative with respect to scalar product between the gradients of total and spin densities + + vsigmaoo = derivative with respect to the square of the gradient of the psin density + + + + + +.. c:function:: ecorrlr + + .. code:: text + + subroutine ecorrlr(rs,z,mu,eclr) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ecpw + + .. code:: text + + subroutine ecPW(x,y,ec,ecd,ecz,ecdd,eczd) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_lda + + .. code:: text + + subroutine ex_lda(rho_a,rho_b,ex,vx_a,vx_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_lda_sr + + .. code:: text + + subroutine ex_lda_sr(mu,rho_a,rho_b,ex,vx_a,vx_b) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: ex_pbe_sr + + .. code:: text + + subroutine ex_pbe_sr(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex,vx_rho_a,vx_rho_b,vx_grd_rho_a_2,vx_grd_rho_b_2,vx_grd_rho_a_b) + + File: :file:`exc_sr_pbe.irp.f` + + mu = range separation parameter rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at the density and corresponding gradients of the density vx_rho_a = d ex / d rho_a vx_rho_b = d ex / d rho_b vx_grd_rho_a_2 = d ex / d grd_rho_a_2 vx_grd_rho_b_2 = d ex / d grd_rho_b_2 vx_grd_rho_a_b = d ex / d grd_rho_a_b + + + + + +.. c:function:: ex_pbe_sr_only + + .. code:: text + + subroutine ex_pbe_sr_only(mu,rho_a,rho_b,grd_rho_a_2,grd_rho_b_2,grd_rho_a_b,ex) + + File: :file:`exc_sr_pbe.irp.f` + + rho_a = density alpha rho_b = density beta grd_rho_a_2 = (gradient rho_a)^2 grd_rho_b_2 = (gradient rho_b)^2 grd_rho_a_b = (gradient rho_a).(gradient rho_b) ex = exchange energy density at point r + + + + + +.. c:function:: g0d + + .. code:: text + + double precision function g0d(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: g0dd + + .. code:: text + + double precision function g0dd(rs) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: g0f + + .. code:: text + + double precision function g0f(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: gpw + + .. code:: text + + subroutine GPW(x,Ac,alfa1,beta1,beta2,beta3,beta4,G,Gd,Gdd) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: grad_rho_ab_to_grad_rho_oc + + .. code:: text + + subroutine grad_rho_ab_to_grad_rho_oc(grad_rho_a_2,grad_rho_b_2,grad_rho_a_b,grad_rho_o_2,grad_rho_c_2,grad_rho_o_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: qrpa + + .. code:: text + + double precision function Qrpa(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: qrpad + + .. code:: text + + double precision function Qrpad(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: qrpadd + + .. code:: text + + double precision function Qrpadd(x) + + File: :file:`exc_sr_lda.irp.f` + + + + + + + +.. c:function:: rho_ab_to_rho_oc + + .. code:: text + + subroutine rho_ab_to_rho_oc(rho_a,rho_b,rho_o,rho_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: rho_oc_to_rho_ab + + .. code:: text + + subroutine rho_oc_to_rho_ab(rho_o,rho_c,rho_a,rho_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_grad_rho_oc_to_v_grad_rho_ab + + .. code:: text + + subroutine v_grad_rho_oc_to_v_grad_rho_ab(v_grad_rho_o_2,v_grad_rho_c_2,v_grad_rho_o_c,v_grad_rho_a_2,v_grad_rho_b_2,v_grad_rho_a_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_rho_ab_to_v_rho_oc + + .. code:: text + + subroutine v_rho_ab_to_v_rho_oc(v_rho_a,v_rho_b,v_rho_o,v_rho_c) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: v_rho_oc_to_v_rho_ab + + .. code:: text + + subroutine v_rho_oc_to_v_rho_ab(v_rho_o,v_rho_c,v_rho_a,v_rho_b) + + File: :file:`rho_ab_to_rho_tot.irp.f` + + + + + + + +.. c:function:: vcorrlr + + .. code:: text + + subroutine vcorrlr(rs,z,mu,vclrup,vclrdown,vclrupd,vclrdownd) + + File: :file:`exc_sr_lda.irp.f` + + + + diff --git a/docs/source/modules/dressing.rst b/docs/source/modules/dressing.rst new file mode 100644 index 00000000..a4b3285d --- /dev/null +++ b/docs/source/modules/dressing.rst @@ -0,0 +1,36 @@ +.. _dressing: + +.. program:: dressing + +.. default-role:: option + +========= +dress_zmq +========= + +Module to facilitate the construction of modules using dressed +Hamiltonians, parallelized with |ZeroMQ|. + + + + +EZFIO parameters +---------------- + +.. option:: thresh_dressed_ci + + Threshold on the convergence of the dressed |CI| energy + + Default: 1.e-5 + +.. option:: n_it_max_dressed_ci + + Maximum number of dressed |CI| iterations + + Default: 10 + +.. option:: dress_relative_error + + Stop stochastic dressing when the relative error is smaller than :option:`perturbation PT2_relative_error` + + Default: 0.001 diff --git a/docs/source/modules/electrons.rst b/docs/source/modules/electrons.rst new file mode 100644 index 00000000..97fee97c --- /dev/null +++ b/docs/source/modules/electrons.rst @@ -0,0 +1,76 @@ +.. _electrons: + +.. program:: electrons + +.. default-role:: option + +========= +electrons +========= + +Describes the electrons. For the moment, only the number of alpha +and beta electrons are provided by this module. + + +Assumptions +=========== + +* `elec_num` >= 0 +* `elec_alpha_num` >= 0 +* `elec_beta_num` >= 0 +* `elec_alpha_num` >= `elec_beta_num` + + + + + +EZFIO parameters +---------------- + +.. option:: elec_alpha_num + + Numbers of electrons alpha ("up") + + +.. option:: elec_beta_num + + Numbers of electrons beta ("down") + + +.. option:: elec_num + + Numbers total of electrons (alpha + beta) + + Default: = electrons.elec_alpha_num + electrons.elec_beta_num + + +Providers +--------- + + +.. c:var:: elec_num + + .. code:: text + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + File: :file:`electrons.irp.f` + + Numbers of alpha ("up") , beta ("down") and total electrons + + + + +.. c:var:: elec_num_tab + + .. code:: text + + integer :: elec_num + integer, allocatable :: elec_num_tab (2) + + File: :file:`electrons.irp.f` + + Numbers of alpha ("up") , beta ("down") and total electrons + + diff --git a/docs/source/modules/ezfio_files.rst b/docs/source/modules/ezfio_files.rst new file mode 100644 index 00000000..7bfdc840 --- /dev/null +++ b/docs/source/modules/ezfio_files.rst @@ -0,0 +1,151 @@ +.. _ezfio_files: + +.. program:: ezfio_files + +.. default-role:: option + +=========== +ezfio_files +=========== + +This modules essentially contains the name of the |EZFIO| directory in the +:c:data:`ezfio_filename` variable. This is read as the first argument of the +command-line, or as the :envvar:`QP_INPUT` environment variable. + + + + +Providers +--------- + + +.. c:var:: ezfio_filename + + .. code:: text + + character*(128) :: ezfio_filename + + File: :file:`ezfio.irp.f` + + Name of EZFIO file. It is obtained from the QPACKAGE_INPUT environment variable if it is set, or as the 1st argument of the command line. + + + + +.. c:var:: ezfio_work_dir + + .. code:: text + + character*(128) :: ezfio_work_dir + + File: :file:`ezfio.irp.f` + + EZFIO/work/ + + + + +.. c:var:: output_cpu_time_0 + + .. code:: text + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + File: :file:`output.irp.f` + + Initial CPU and wall times when printing in the output files + + + + +.. c:var:: output_wall_time_0 + + .. code:: text + + double precision :: output_wall_time_0 + double precision :: output_cpu_time_0 + + File: :file:`output.irp.f` + + Initial CPU and wall times when printing in the output files + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: getunitandopen + + .. code:: text + + integer function getUnitAndOpen(f,mode) + + File: :file:`get_unit_and_open.irp.f` + + :f: file name + + :mode: 'R' : READ, UNFORMATTED 'W' : WRITE, UNFORMATTED 'r' : READ, FORMATTED 'w' : WRITE, FORMATTED 'a' : APPEND, FORMATTED 'x' : READ/WRITE, FORMATTED + + + + + + + +.. c:function:: write_bool + + .. code:: text + + subroutine write_bool(iunit,value,label) + + File: :file:`output.irp.f` + + Write an logical value in output + + + + + +.. c:function:: write_double + + .. code:: text + + subroutine write_double(iunit,value,label) + + File: :file:`output.irp.f` + + Write a double precision value in output + + + + + +.. c:function:: write_int + + .. code:: text + + subroutine write_int(iunit,value,label) + + File: :file:`output.irp.f` + + Write an integer value in output + + + + + +.. c:function:: write_time + + .. code:: text + + subroutine write_time(iunit) + + File: :file:`output.irp.f` + + Write a time stamp in the output for chronological reconstruction + + diff --git a/docs/source/modules/fci.rst b/docs/source/modules/fci.rst new file mode 100644 index 00000000..35f79f49 --- /dev/null +++ b/docs/source/modules/fci.rst @@ -0,0 +1,82 @@ +.. _fci: + +.. program:: fci + +.. default-role:: option + +=== +fci +=== + +|CIPSI| algorithm in the full configuration interaction space. + +* :command:`fci` performs the |CIPSI| calculation, +* :command:`pt2` computes the |PT2| contribution using the wave function stored in the |EZFIO| + database. + +.. seealso:: + + The documentation of the :ref:`cipsi` module. + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Calculated Selected |FCI| energy + + +.. option:: energy_pt2 + + Calculated |FCI| energy + |PT2| + + + +Subroutines / functions +----------------------- + + + +.. c:function:: fci + + .. code:: text + + subroutine fci + + File: :file:`fci.irp.f` + + Selected Full Configuration Interaction with stochastic selection and PT2. + + + + + +.. c:function:: pt2 + + .. code:: text + + subroutine pt2 + + File: :file:`pt2.irp.f` + + Second order perturbative correction to the wave function contained in the EZFIO directory. + + + + + +.. c:function:: save_energy + + .. code:: text + + subroutine save_energy(E,pt2) + + File: :file:`save_energy.irp.f` + + Saves the energy in |EZFIO|. + + diff --git a/docs/source/modules/generators_cas.rst b/docs/source/modules/generators_cas.rst new file mode 100644 index 00000000..a00b7a01 --- /dev/null +++ b/docs/source/modules/generators_cas.rst @@ -0,0 +1,19 @@ +.. _generators_cas: + +.. program:: generators_cas + +.. default-role:: option + +============== +generators_cas +============== + +Module defining the generator determinants as those belonging to a |CAS|. +The |MOs| belonging to the |CAS| are those which were set as active with +the :ref:`qp_set_mo_class` command. + +This module is intended to be included in the :file:`NEED` file to define +the generators as the |CAS| determinants, which can be useful to define post-CAS approaches (see cassd module for instance). + + + diff --git a/docs/source/modules/generators_full.rst b/docs/source/modules/generators_full.rst new file mode 100644 index 00000000..90b32a98 --- /dev/null +++ b/docs/source/modules/generators_full.rst @@ -0,0 +1,145 @@ +.. _generators_full: + +.. program:: generators_full + +.. default-role:: option + +=============== +generators_full +=============== + +Module defining the generator determinants as all the determinants of the +variational space. + +This module is intended to be included in the :file:`NEED` file to define +a full set of generators. + + + +Providers +--------- + + +.. c:var:: degree_max_generators + + .. code:: text + + integer :: degree_max_generators + + File: :file:`generators.irp.f` + + Max degree of excitation (respect to HF) of the generators + + + + +.. c:var:: n_det_generators + + .. code:: text + + integer :: n_det_generators + + File: :file:`generators.irp.f` + + For Single reference wave functions, the number of generators is 1 : the Hartree-Fock determinant + + + + +.. c:var:: psi_coef_generators + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_coef_sorted_gen + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_generators + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_generators (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_generators (psi_det_size,N_states) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_sorted_gen + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: psi_det_sorted_gen_order + + .. code:: text + + integer(bit_kind), allocatable :: psi_det_sorted_gen (N_int,2,psi_det_size) + double precision, allocatable :: psi_coef_sorted_gen (psi_det_size,N_states) + integer, allocatable :: psi_det_sorted_gen_order (psi_det_size) + + File: :file:`generators.irp.f` + + For Single reference wave functions, the generator is the Hartree-Fock determinant + + + + +.. c:var:: select_max + + .. code:: text + + double precision, allocatable :: select_max (size_select_max) + + File: :file:`generators.irp.f` + + Memo to skip useless selectors + + + + +.. c:var:: size_select_max + + .. code:: text + + integer :: size_select_max + + File: :file:`generators.irp.f` + + Size of the select_max array + + diff --git a/docs/source/modules/hartree_fock.rst b/docs/source/modules/hartree_fock.rst new file mode 100644 index 00000000..2005e9af --- /dev/null +++ b/docs/source/modules/hartree_fock.rst @@ -0,0 +1,132 @@ +.. _hartree_fock: + +.. program:: hartree_fock + +.. default-role:: option + +============ +hartree_fock +============ + + +The Hartree-Fock module performs *Restricted* Hartree-Fock calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals). + +The Hartree-Fock in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory + +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`hartree_fock fock_matrix_hf.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: + +# :option:`scf_utils thresh_scf` + +# :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy HF + + + +Providers +--------- + + +.. c:var:: hf_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +.. c:var:: hf_one_electron_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +.. c:var:: hf_two_electron_energy + + .. code:: text + + double precision :: hf_energy + double precision :: hf_two_electron_energy + double precision :: hf_one_electron_energy + + File: :file:`hf_energy.irp.f` + + Hartree-Fock energy containing the nuclear repulsion, and its one- and two-body components. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: scf + + .. code:: text + + subroutine scf + + File: :file:`scf.irp.f` + + Produce `Hartree_Fock` |MOs| + + output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ + + output: hartree_fock.energy + + optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/iterations.rst b/docs/source/modules/iterations.rst new file mode 100644 index 00000000..81b89008 --- /dev/null +++ b/docs/source/modules/iterations.rst @@ -0,0 +1,114 @@ +.. _iterations: + +.. program:: iterations + +.. default-role:: option + +========== +iterations +========== + +Module which saves the computed energies for an extrapolation to +the |FCI| limit. + + + +EZFIO parameters +---------------- + +.. option:: n_iter + + Number of saved iterations + + Default: 1 + +.. option:: n_det_iterations + + Number of determinants at each iteration + + +.. option:: energy_iterations + + The variational energy at each iteration + + +.. option:: pt2_iterations + + The |PT2| correction at each iteration + + + +Providers +--------- + + +.. c:var:: extrapolated_energy + + .. code:: text + + double precision, allocatable :: extrapolated_energy (N_iter,N_states) + + File: :file:`iterations.irp.f` + + Extrapolated energy, using E_var = f(PT2) where PT2=0 + + + + +.. c:var:: n_iter + + .. code:: text + + integer :: n_iter + + File: :file:`io.irp.f` + + number of iterations + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: print_extrapolated_energy + + .. code:: text + + subroutine print_extrapolated_energy + + File: :file:`print_extrapolation.irp.f` + + Print the extrapolated energy in the output + + + + + +.. c:function:: print_summary + + .. code:: text + + subroutine print_summary(e_,pt2_,error_,variance_,norm_,n_det_,n_occ_pattern_) + + File: :file:`print_summary.irp.f` + + Print the extrapolated energy in the output + + + + + +.. c:function:: save_iterations + + .. code:: text + + subroutine save_iterations(e_, pt2_,n_) + + File: :file:`iterations.irp.f` + + Update the energy in the EZFIO file. + + diff --git a/docs/source/modules/kohn_sham.rst b/docs/source/modules/kohn_sham.rst new file mode 100644 index 00000000..1dac5f0f --- /dev/null +++ b/docs/source/modules/kohn_sham.rst @@ -0,0 +1,352 @@ +.. _kohn_sham: + +.. program:: kohn_sham + +.. default-role:: option + +========= +kohn_sham +========= + + +The Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals). + +The Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`kohn_sham fock_matrix_ks.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: + +#. :option:`scf_utils thresh_scf` +#. :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +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 :: 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 + + subroutine srs_ks_cf + + File: :file:`ks_scf.irp.f` + + Produce `Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/kohn_sham_rs.rst b/docs/source/modules/kohn_sham_rs.rst new file mode 100644 index 00000000..9ab0aa5e --- /dev/null +++ b/docs/source/modules/kohn_sham_rs.rst @@ -0,0 +1,95 @@ +.. _kohn_sham_rs: + +.. program:: kohn_sham_rs + +.. default-role:: option + +============ +kohn_sham_rs +============ + + +The Range-separated Kohn-Sham module performs *Restricted* Kohn-Sham calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals) where the coulomb interaction is partially treated using exact exchange. +The splitting of the interaction between long- and short-range is determined by the range-separation parameter :option:`ao_two_e_erf_ints mu_erf`. The long-range part of the interaction is explicitly treated with exact exchange, and the short-range part of the interaction is treated with appropriate DFT functionals. + +The Range-separated Kohn-Sham in an SCF and therefore is based on the ``scf_utils`` structure. +It performs the following actions: + +#. Compute/Read all the one- and two-electron integrals, and store them in memory +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations + +The definition of the Fock matrix is in :file:`kohn_sham_rs fock_matrix_rs_ks.irp.f` +For the keywords related to the |SCF| procedure, see the ``scf_utils`` directory where you will find all options. +The main are: +# :option:`scf_utils thresh_scf` +# :option:`scf_utils level_shift` + + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + + + +EZFIO parameters +---------------- + +.. option:: energy + + Energy range separated hybrid + + + +Providers +--------- + + +.. c:var:: rs_ks_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:: rs_ks_scf + + .. code:: text + + subroutine rs_ks_scf + + File: :file:`rs_ks_scf.irp.f` + + Produce `Range_separated_Kohn_Sham` MO orbital output: mo_basis.mo_num mo_basis.mo_label mo_basis.ao_md5 mo_basis.mo_coef mo_basis.mo_occ output: kohn_sham.energy optional: mo_basis.mo_coef + + diff --git a/docs/source/modules/mo_basis.rst b/docs/source/modules/mo_basis.rst new file mode 100644 index 00000000..bf647f5c --- /dev/null +++ b/docs/source/modules/mo_basis.rst @@ -0,0 +1,370 @@ +.. _mo_basis: + +.. program:: mo_basis + +.. default-role:: option + +======== +mo_basis +======== + +Molecular orbitals are expressed as + +.. math:: + + \phi_k({\bf r}) = \sum_i C_{ik} \chi_k({\bf r}) + + +where :math:`\chi_k` are *normalized* atomic basis functions. + +The current set of |MOs| has a label `mo_label`. +When the orbitals are modified, the label should also be updated to keep +everything consistent. + +When saving the |MOs|, the :file:`mo_basis` directory of the |EZFIO| database +is copied in the :file:`save` directory, named by the current `mo_label`. All +this is done with the script named :file:`save_current_mos.sh` in the +:file:`$QP_ROOT/scripts` directory. + + + + + + +EZFIO parameters +---------------- + +.. option:: mo_num + + Total number of |MOs| + + +.. option:: mo_coef + + Coefficient of the i-th |AO| on the j-th |MO| + + +.. option:: mo_label + + Label characterizing the MOS (Local, Canonical, Natural, *etc*) + + +.. option:: mo_occ + + |MO| occupation numbers + + +.. option:: mo_class + + [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class` + + +.. option:: ao_md5 + + MD5 checksum characterizing the |AO| basis set. + + + +Providers +--------- + + +.. c:var:: mo_coef + + .. code:: text + + double precision, allocatable :: mo_coef (ao_num,mo_num) + + File: :file:`mos.irp.f` + + Molecular orbital coefficients on |AO| basis set + + mo_coef(i,j) = coefficient of the i-th |AO| on the jth mo + + mo_label : Label characterizing the MOS (local, canonical, natural, etc) + + + + +.. c:var:: mo_coef_begin_iteration + + .. code:: text + + double precision, allocatable :: mo_coef_begin_iteration (ao_num,mo_num) + + File: :file:`track_orb.irp.f` + + Void provider to store the coefficients of the |MO| basis at the beginning of the SCF iteration + + Usefull to track some orbitals + + + + +.. c:var:: mo_coef_in_ao_ortho_basis + + .. code:: text + + double precision, allocatable :: mo_coef_in_ao_ortho_basis (ao_num,mo_num) + + File: :file:`mos.irp.f` + + |MO| coefficients in orthogonalized |AO| basis + + :math:`C^{-1}.C_{mo}` + + + + +.. c:var:: mo_coef_transp + + .. code:: text + + double precision, allocatable :: mo_coef_transp (mo_num,ao_num) + + File: :file:`mos.irp.f` + + |MO| coefficients on |AO| basis set + + + + +.. c:var:: mo_label + + .. code:: text + + character*(64) :: mo_label + + File: :file:`mos.irp.f` + + |MO| coefficients on |AO| basis set + + mo_coef(i,j) = coefficient of the i-th |AO| on the j-th |MO| + + mo_label : Label characterizing the |MOs| (local, canonical, natural, etc) + + + + +.. c:var:: mo_num + + .. code:: text + + integer :: mo_num + + File: :file:`mos.irp.f` + + Number of MOs + + + + +.. c:var:: mo_occ + + .. code:: text + + double precision, allocatable :: mo_occ (mo_num) + + File: :file:`mos.irp.f` + + |MO| occupation numbers + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: ao_ortho_cano_to_ao + + .. code:: text + + subroutine ao_ortho_cano_to_ao(A_ao,LDA_ao,A,LDA) + + File: :file:`mos.irp.f` + + Transform A from the |AO| basis to the orthogonal |AO| basis + + :math:`C^{-1}.A_{ao}.C^{\dagger-1}` + + + + + +.. c:function:: ao_to_mo + + .. code:: text + + subroutine ao_to_mo(A_ao,LDA_ao,A_mo,LDA_mo) + + File: :file:`mos.irp.f` + + Transform A from the |AO| basis to the |MO| basis + + :math:`C^\dagger.A_{ao}.C` + + + + + +.. c:function:: give_all_mos_and_grad_and_lapl_at_r + + .. code:: text + + subroutine give_all_mos_and_grad_and_lapl_at_r(r,mos_array,mos_grad_array,mos_lapl_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: give_all_mos_and_grad_at_r + + .. code:: text + + subroutine give_all_mos_and_grad_at_r(r,mos_array,mos_grad_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: give_all_mos_at_r + + .. code:: text + + subroutine give_all_mos_at_r(r,mos_array) + + File: :file:`mos_in_r.irp.f` + + + + + + + +.. c:function:: initialize_mo_coef_begin_iteration + + .. code:: text + + subroutine initialize_mo_coef_begin_iteration + + File: :file:`track_orb.irp.f` + + + + Initialize :c:data:`mo_coef_begin_iteration` to the current :c:data:`mo_coef` + + + + + +.. c:function:: mix_mo_jk + + .. code:: text + + subroutine mix_mo_jk(j,k) + + File: :file:`mos.irp.f` + + Rotates the j-th |MO| with the k-th |MO| to give two new |MOs| that are + + * :math:`+ = \frac{1}{\sqrt{2}} (|j\rangle + |k\rangle)` + + * :math:`- = \frac{1}{\sqrt{2}} (|j\rangle - |k\rangle)` + + by convention, the '+' |MO| is in the lowest index (min(j,k)) by convention, the '-' |MO| is in the highest index (max(j,k)) + + + + + +.. c:function:: mo_as_eigvectors_of_mo_matrix + + .. code:: text + + subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label,sign,output) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix + + .. code:: text + + subroutine mo_as_svd_vectors_of_mo_matrix(matrix,lda,m,n,label) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: mo_as_svd_vectors_of_mo_matrix_eig + + .. code:: text + + subroutine mo_as_svd_vectors_of_mo_matrix_eig(matrix,lda,m,n,eig,label) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: reorder_active_orb + + .. code:: text + + subroutine reorder_active_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` + + + + + +.. c:function:: save_mos + + .. code:: text + + subroutine save_mos + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: save_mos_truncated + + .. code:: text + + subroutine save_mos_truncated(n) + + File: :file:`utils.irp.f` + + + + diff --git a/docs/source/modules/mo_guess.rst b/docs/source/modules/mo_guess.rst new file mode 100644 index 00000000..24dc1476 --- /dev/null +++ b/docs/source/modules/mo_guess.rst @@ -0,0 +1,87 @@ +.. _mo_guess: + +.. program:: mo_guess + +.. default-role:: option + +======== +mo_guess +======== + +Guess for |MOs|. + + + + +Providers +--------- + + +.. c:var:: ao_ortho_canonical_nucl_elec_integrals + + .. code:: text + + double precision, allocatable :: ao_ortho_canonical_nucl_elec_integrals (mo_num,mo_num) + + File: :file:`pot_mo_ortho_canonical_ints.irp.f` + + + + + + +.. c:var:: ao_ortho_lowdin_coef + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_coef (ao_num,ao_num) + + File: :file:`mo_ortho_lowdin.irp.f` + + matrix of the coefficients of the mos generated by the orthonormalization by the S^{-1/2} canonical transformation of the aos ao_ortho_lowdin_coef(i,j) = coefficient of the ith ao on the jth ao_ortho_lowdin orbital + + + + +.. c:var:: ao_ortho_lowdin_nucl_elec_integrals + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_nucl_elec_integrals (mo_num,mo_num) + + File: :file:`pot_mo_ortho_lowdin_ints.irp.f` + + + + + + +.. c:var:: ao_ortho_lowdin_overlap + + .. code:: text + + double precision, allocatable :: ao_ortho_lowdin_overlap (ao_num,ao_num) + + File: :file:`mo_ortho_lowdin.irp.f` + + overlap matrix of the ao_ortho_lowdin supposed to be the Identity + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: hcore_guess + + .. code:: text + + subroutine hcore_guess + + File: :file:`h_core_guess_routine.irp.f` + + Produce `H_core` MO orbital + + diff --git a/docs/source/modules/mo_one_e_ints.rst b/docs/source/modules/mo_one_e_ints.rst new file mode 100644 index 00000000..167b62c8 --- /dev/null +++ b/docs/source/modules/mo_one_e_ints.rst @@ -0,0 +1,287 @@ +.. _mo_one_e_ints: + +.. program:: mo_one_e_ints + +.. default-role:: option + +================== +mo_one_e_integrals +================== + +All the one-electron integrals in |MO| basis are defined here. + +The most important providers for usual quantum-chemistry calculation are: + +* `mo_kinetic_integrals` which are the kinetic operator integrals on the |AO| basis (see :file:`kin_mo_ints.irp.f`) +* `mo_integrals_n_e` which are the nuclear-elctron operator integrals on the |AO| basis (see :file:`pot_mo_ints.irp.f`) +* `mo_one_e_integrals` which are the the h_core operator integrals on the |AO| basis (see :file:`mo_mono_ints.irp.f`) + +Note that you can find other interesting integrals related to the position operator in :file:`spread_dipole_mo.irp.f`. + + + +EZFIO parameters +---------------- + +.. option:: mo_integrals_e_n + + Nucleus-electron integrals in |MO| basis set + + +.. option:: io_mo_integrals_e_n + + Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_kinetic + + Kinetic energy integrals in |MO| basis set + + +.. option:: io_mo_integrals_kinetic + + Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_pseudo + + Pseudopotential integrals in |MO| basis set + + +.. option:: io_mo_integrals_pseudo + + Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_one_e_integrals + + One-electron integrals in |MO| basis set + + +.. option:: io_mo_one_e_integrals + + Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: mo_dipole_x + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_dipole_y + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_dipole_z + + .. code:: text + + double precision, allocatable :: mo_dipole_x (mo_num,mo_num) + double precision, allocatable :: mo_dipole_y (mo_num,mo_num) + double precision, allocatable :: mo_dipole_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x MO_j array of the integrals of MO_i * y MO_j array of the integrals of MO_i * z MO_j + + + + +.. c:var:: mo_integrals_n_e + + .. code:: text + + double precision, allocatable :: mo_integrals_n_e (mo_num,mo_num) + + File: :file:`pot_mo_ints.irp.f` + + Nucleus-electron interaction on the |MO| basis + + + + +.. c:var:: mo_integrals_n_e_per_atom + + .. code:: text + + double precision, allocatable :: mo_integrals_n_e_per_atom (mo_num,mo_num,nucl_num) + + File: :file:`pot_mo_ints.irp.f` + + mo_integrals_n_e_per_atom(i,j,k) = :math:`\langle \phi_i| -\frac{1}{|r-R_k|} | \phi_j \rangle` . where R_k is the coordinate of the k-th nucleus. + + + + +.. c:var:: mo_kinetic_integrals + + .. code:: text + + double precision, allocatable :: mo_kinetic_integrals (mo_num,mo_num) + + File: :file:`kin_mo_ints.irp.f` + + Kinetic energy integrals in the MO basis + + + + +.. c:var:: mo_one_e_integrals + + .. code:: text + + double precision, allocatable :: mo_one_e_integrals (mo_num,mo_num) + + File: :file:`mo_one_e_ints.irp.f` + + array of the mono electronic hamiltonian on the MOs basis : sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) + + + + +.. c:var:: mo_overlap + + .. code:: text + + double precision, allocatable :: mo_overlap (mo_num,mo_num) + + File: :file:`mo_overlap.irp.f` + + Provider to check that the MOs are indeed orthonormal. + + + + +.. c:var:: mo_pseudo_integrals + + .. code:: text + + double precision, allocatable :: mo_pseudo_integrals (mo_num,mo_num) + + File: :file:`pot_mo_pseudo_ints.irp.f` + + Pseudopotential integrals in |MO| basis + + + + +.. c:var:: mo_spread_x + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: mo_spread_y + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: mo_spread_z + + .. code:: text + + double precision, allocatable :: mo_spread_x (mo_num,mo_num) + double precision, allocatable :: mo_spread_y (mo_num,mo_num) + double precision, allocatable :: mo_spread_z (mo_num,mo_num) + + File: :file:`spread_dipole_mo.irp.f` + + array of the integrals of MO_i * x^2 MO_j array of the integrals of MO_i * y^2 MO_j array of the integrals of MO_i * z^2 MO_j + + + + +.. c:var:: s_mo_coef + + .. code:: text + + double precision, allocatable :: s_mo_coef (ao_num,mo_num) + + File: :file:`ao_to_mo.irp.f` + + Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: mo_to_ao + + .. code:: text + + subroutine mo_to_ao(A_mo,LDA_mo,A_ao,LDA_ao) + + File: :file:`ao_to_mo.irp.f` + + Transform A from the MO basis to the AO basis + + (S.C).A_mo.(S.C)t + + + + + +.. c:function:: orthonormalize_mos + + .. code:: text + + subroutine orthonormalize_mos + + File: :file:`orthonormalize.irp.f` + + + + diff --git a/docs/source/modules/mo_two_e_erf_ints.rst b/docs/source/modules/mo_two_e_erf_ints.rst new file mode 100644 index 00000000..12f7c130 --- /dev/null +++ b/docs/source/modules/mo_two_e_erf_ints.rst @@ -0,0 +1,488 @@ +.. _mo_two_e_erf_ints: + +.. program:: mo_two_e_erf_ints + +.. default-role:: option + +====================== +mo_two_e_erf_ints +====================== + +Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`Utils/map_module.f90`. + +The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_ints mu_erf`. + +To fetch an |MO| integral, use +`get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_map_erf)` + +The conventions are: + +* For |MO| integrals : = <12|12> + +Be aware that it might not be the same conventions for |MO| and |AO| integrals. + + + + + +EZFIO parameters +---------------- + +.. option:: io_mo_two_e_integrals_erf + + Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ] + + Default: None + + +Providers +--------- + + +.. c:var:: core_energy_erf + + .. code:: text + + double precision :: core_energy_erf + + File: :file:`core_quantities_erf.irp.f` + + energy from the core : contains all core-core contributionswith the erf interaction + + + + +.. c:var:: core_fock_operator_erf + + .. code:: text + + double precision, allocatable :: core_fock_operator_erf (mo_num,mo_num) + + File: :file:`core_quantities_erf.irp.f` + + this is the contribution to the Fock operator from the core electrons with the erf interaction + + + + +.. c:var:: insert_into_mo_integrals_erf_map + + .. code:: text + + subroutine insert_into_mo_integrals_erf_map(n_integrals, & + buffer_i, buffer_values, thr) + + File: :file:`map_integrals_erf.irp.f` + + Create new entry into |MO| map, or accumulate in an existing entry + + + + +.. c:var:: int_erf_3_index + + .. code:: text + + double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) + double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) + + File: :file:`ints_erf_3_index.irp.f` + + int_erf_3_index(i,j) = = (ii|jj) with the erf interaction + + int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction + + + + +.. c:var:: int_erf_3_index_exc + + .. code:: text + + double precision, allocatable :: int_erf_3_index (mo_num,mo_num,mo_num) + double precision, allocatable :: int_erf_3_index_exc (mo_num,mo_num,mo_num) + + File: :file:`ints_erf_3_index.irp.f` + + int_erf_3_index(i,j) = = (ii|jj) with the erf interaction + + int_erf_3_index_exc(i,j) = = (ij|ij) with the erf interaction + + + + +.. c:var:: mo_integrals_erf_cache + + .. code:: text + + double precision, allocatable :: mo_integrals_erf_cache (0:64*64*64*64) + + File: :file:`map_integrals_erf.irp.f` + + Cache of |MO| integrals for fast access + + + + +.. c:var:: mo_integrals_erf_cache_max + + .. code:: text + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_erf_cache_min + + .. code:: text + + integer :: mo_integrals_erf_cache_min + integer :: mo_integrals_erf_cache_max + + File: :file:`map_integrals_erf.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_erf_map + + .. code:: text + + type(map_type) :: mo_integrals_erf_map + + File: :file:`map_integrals_erf.irp.f` + + |MO| integrals + + + + +.. c:var:: mo_two_e_int_erf_jj + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_anti + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_exchange + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_int_erf_jj_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_int_erf_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_int_erf_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals_erf.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_erf_in_map + + .. code:: text + + logical :: mo_two_e_integrals_erf_in_map + + File: :file:`mo_bi_integrals_erf.irp.f` + + If True, the map of MO two-electron integrals is provided + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_integrals_to_map_erf + + .. code:: text + + subroutine add_integrals_to_map_erf(mask_ijkl) + + File: :file:`mo_bi_integrals_erf.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: clear_mo_erf_map + + .. code:: text + + subroutine clear_mo_erf_map + + File: :file:`mo_bi_integrals_erf.irp.f` + + Frees the memory of the MO map + + + + + +.. c:function:: get_mo_erf_map_size + + .. code:: text + + integer*8 function get_mo_erf_map_size() + + File: :file:`map_integrals_erf.irp.f` + + Returns the number of elements in the |MO| map + + + + + +.. c:function:: get_mo_two_e_integral_erf + + .. code:: text + + double precision function get_mo_two_e_integral_erf(i,j,k,l,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis + + + + + +.. c:function:: get_mo_two_e_integrals_erf + + .. code:: text + + subroutine get_mo_two_e_integrals_erf(j,k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all i for j,k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_coulomb_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_coulomb_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ki|li \rangle` + + k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_exch_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_exch_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ki|il \rangle` + + :math:`\int k(1)i(2) \frac{1}{r_{12}} i(1)l(2)` :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_i1j1 + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_i1j1(k,l,sze,out_array,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ik|jl \rangle` in the |MO| basis, all :math:`\int i(1)j(1) \frac{\erf(\mu * r_{12})}{r_{12}} k(2)l(2)` i, j for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_erf_ij + + .. code:: text + + subroutine get_mo_two_e_integrals_erf_ij(k,l,sze,out_array,map) + + File: :file:`map_integrals_erf.irp.f` + + Returns multiple integrals :math:`\langle ij|kl \rangle` in the |MO| basis, all :math:`\int i(1)j(2) \frac{1}{r_{12}} k(1)l(2)` i, j for k,l fixed. + + + + + +.. c:function:: load_mo_integrals_erf + + .. code:: text + + integer function load_mo_integrals_erf(filename) + + File: :file:`map_integrals_erf.irp.f` + + Read from disk the |MO| erf integrals + + + + + +.. c:function:: mo_two_e_integral_erf + + .. code:: text + + double precision function mo_two_e_integral_erf(i,j,k,l) + + File: :file:`map_integrals_erf.irp.f` + + Returns one integral :math:`\langle ij|kl \rangle` in the |MO| basis + + + + + +.. c:function:: mo_two_e_integrals_erf_index + + .. code:: text + + subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1) + + File: :file:`mo_bi_integrals_erf.irp.f` + + Computes an unique index for i,j,k,l integrals + + + + + +.. c:function:: provide_all_mo_integrals_erf + + .. code:: text + + subroutine provide_all_mo_integrals_erf + + File: :file:`mo_bi_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_integrals_mo + + .. code:: text + + subroutine save_erf_two_e_integrals_mo + + File: :file:`routines_save_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_erf_two_e_ints_mo_into_ints_mo + + .. code:: text + + subroutine save_erf_two_e_ints_mo_into_ints_mo + + File: :file:`routines_save_integrals_erf.irp.f` + + + + diff --git a/docs/source/modules/mo_two_e_ints.rst b/docs/source/modules/mo_two_e_ints.rst new file mode 100644 index 00000000..2dfdf1b4 --- /dev/null +++ b/docs/source/modules/mo_two_e_ints.rst @@ -0,0 +1,590 @@ +.. _mo_two_e_ints: + +.. program:: mo_two_e_ints + +.. default-role:: option + +================== +mo_two_e_ints +================== + +Here, all two-electron integrals (:math:`1/r_{12}`) are computed. +As they have 4 indices and many are zero, they are stored in a map, as defined +in :file:`Utils/map_module.f90`. + +To fetch an |AO| integral, use the +`get_ao_two_e_integral(i,j,k,l,ao_integrals_map)` function, and +to fetch an |MO| integral, use +`get_two_e_integral(i,j,k,l,mo_integrals_map)` or +`mo_two_e_integral(i,j,k,l)`. + +The conventions are: + +* For |AO| integrals : (ik|jl) = (11|22) +* For |MO| integrals : = <12|12> + + + + + + +EZFIO parameters +---------------- + +.. option:: io_mo_two_e_integrals + + Read/Write |MO| integrals from/to disk [ Write | Read | None ] + + Default: None + +.. option:: mo_integrals_threshold + + If | | < `mo_integrals_threshold` then is zero + + Default: 1.e-15 + +.. option:: no_vvvv_integrals + + If `True`, computes all integrals except for the integrals having 4 virtual indices + + Default: False + +.. option:: no_ivvv_integrals + + Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual indices and 1 belonging to the core inactive active orbitals + + Default: False + +.. option:: no_vvv_integrals + + Can be switched on only if `no_vvvv_integrals` is `True`, then does not compute the integrals with 3 virtual orbitals + + Default: False + + +Providers +--------- + + +.. c:var:: big_array_coulomb_integrals + + .. code:: text + + double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) + double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) + + File: :file:`integrals_3_index.irp.f` + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + + + +.. c:var:: big_array_exchange_integrals + + .. code:: text + + double precision, allocatable :: big_array_coulomb_integrals (mo_num,mo_num,mo_num) + double precision, allocatable :: big_array_exchange_integrals (mo_num,mo_num,mo_num) + + File: :file:`integrals_3_index.irp.f` + + big_array_coulomb_integrals(i,j) = = (ii|jj) + + big_array_exchange_integrals(i,j) = = (ij|ij) + + + + +.. c:var:: core_energy + + .. code:: text + + double precision :: core_energy + + File: :file:`core_quantities.irp.f` + + energy from the core : contains all core-core contributions + + + + +.. c:var:: core_fock_operator + + .. code:: text + + double precision, allocatable :: core_fock_operator (mo_num,mo_num) + + File: :file:`core_quantities.irp.f` + + this is the contribution to the Fock operator from the core electrons + + + + +.. c:var:: insert_into_mo_integrals_map + + .. code:: text + + subroutine insert_into_mo_integrals_map(n_integrals, & + buffer_i, buffer_values, thr) + + File: :file:`map_integrals.irp.f` + + Create new entry into MO map, or accumulate in an existing entry + + + + +.. c:var:: mo_integrals_cache + + .. code:: text + + double precision, allocatable :: mo_integrals_cache (0_8:128_8*128_8*128_8*128_8) + + File: :file:`map_integrals.irp.f` + + Cache of MO integrals for fast access + + + + +.. c:var:: mo_integrals_cache_max + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_max_8 + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_min + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_cache_min_8 + + .. code:: text + + integer*4 :: mo_integrals_cache_min + integer*4 :: mo_integrals_cache_max + integer*8 :: mo_integrals_cache_min_8 + integer*8 :: mo_integrals_cache_max_8 + + File: :file:`map_integrals.irp.f` + + Min and max values of the MOs for which the integrals are in the cache + + + + +.. c:var:: mo_integrals_map + + .. code:: text + + type(map_type) :: mo_integrals_map + + File: :file:`map_integrals.irp.f` + + MO integrals + + + + +.. c:var:: mo_two_e_integral_jj_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_in_map + + .. code:: text + + logical :: mo_two_e_integrals_in_map + + File: :file:`mo_bi_integrals.irp.f` + + If True, the map of MO two-electron integrals is provided + + + + +.. c:var:: mo_two_e_integrals_jj + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_anti + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_exchange + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_jj (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_jj(i,j) = J_ij mo_two_e_integrals_jj_exchange(i,j) = K_ij mo_two_e_integrals_jj_anti(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_jj_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integral_jj_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_jj_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integral_jj_from_ao(i,j) = J_ij mo_two_e_integrals_jj_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_jj_anti_from_ao(i,j) = J_ij - K_ij + + + + +.. c:var:: mo_two_e_integrals_vv_anti_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +.. c:var:: mo_two_e_integrals_vv_exchange_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +.. c:var:: mo_two_e_integrals_vv_from_ao + + .. code:: text + + double precision, allocatable :: mo_two_e_integrals_vv_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_exchange_from_ao (mo_num,mo_num) + double precision, allocatable :: mo_two_e_integrals_vv_anti_from_ao (mo_num,mo_num) + + File: :file:`mo_bi_integrals.irp.f` + + mo_two_e_integrals_vv_from_ao(i,j) = J_ij mo_two_e_integrals_vv_exchange_from_ao(i,j) = J_ij mo_two_e_integrals_vv_anti_from_ao(i,j) = J_ij - K_ij but only for the virtual orbitals + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_integrals_to_map + + .. code:: text + + subroutine add_integrals_to_map(mask_ijkl) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: add_integrals_to_map_no_exit_34 + + .. code:: text + + subroutine add_integrals_to_map_no_exit_34(mask_ijkl) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: add_integrals_to_map_three_indices + + .. code:: text + + subroutine add_integrals_to_map_three_indices(mask_ijk) + + File: :file:`mo_bi_integrals.irp.f` + + Adds integrals to tha MO map according to some bitmask + + + + + +.. c:function:: clear_mo_map + + .. code:: text + + subroutine clear_mo_map + + File: :file:`mo_bi_integrals.irp.f` + + Frees the memory of the MO map + + + + + +.. c:function:: dump_mo_integrals + + .. code:: text + + subroutine dump_mo_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Save to disk the |MO| integrals + + + + + +.. c:function:: get_mo_map_size + + .. code:: text + + integer*8 function get_mo_map_size() + + File: :file:`map_integrals.irp.f` + + Return the number of elements in the MO map + + + + + +.. c:function:: get_mo_two_e_integrals + + .. code:: text + + subroutine get_mo_two_e_integrals(j,k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i for j,k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_coulomb_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_coulomb_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_exch_ii + + .. code:: text + + subroutine get_mo_two_e_integrals_exch_ii(k,l,sze,out_val,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_i1j1 + + .. code:: text + + subroutine get_mo_two_e_integrals_i1j1(k,l,sze,out_array,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i(1)j(1) 1/r12 k(2)l(2) i, j for k,l fixed. + + + + + +.. c:function:: get_mo_two_e_integrals_ij + + .. code:: text + + subroutine get_mo_two_e_integrals_ij(k,l,sze,out_array,map) + + File: :file:`map_integrals.irp.f` + + Returns multiple integrals in the MO basis, all i(1)j(2) 1/r12 k(1)l(2) i, j for k,l fixed. + + + + + +.. c:function:: get_two_e_integral + + .. code:: text + + double precision function get_two_e_integral(i,j,k,l,map) + + File: :file:`map_integrals.irp.f` + + Returns one integral in the MO basis + + + + + +.. c:function:: load_mo_integrals + + .. code:: text + + integer function load_mo_integrals(filename) + + File: :file:`map_integrals.irp.f` + + Read from disk the |MO| integrals + + + + + +.. c:function:: mo_two_e_integral + + .. code:: text + + double precision function mo_two_e_integral(i,j,k,l) + + File: :file:`map_integrals.irp.f` + + Returns one integral in the MO basis + + + + + +.. c:function:: mo_two_e_integrals_index + + .. code:: text + + subroutine mo_two_e_integrals_index(i,j,k,l,i1) + + File: :file:`mo_bi_integrals.irp.f` + + Computes an unique index for i,j,k,l integrals + + diff --git a/docs/source/modules/mpi.rst b/docs/source/modules/mpi.rst new file mode 100644 index 00000000..d8c7290f --- /dev/null +++ b/docs/source/modules/mpi.rst @@ -0,0 +1,130 @@ +.. _mpi: + +.. program:: mpi + +.. default-role:: option + +=== +mpi +=== + +Contains all the functions and providers for parallelization with |MPI|. + + + +Providers +--------- + + +.. c:var:: mpi_initialized + + .. code:: text + + logical :: mpi_initialized + + File: :file:`mpi.irp.f` + + Always true. Initialized MPI + + + + +.. c:var:: mpi_master + + .. code:: text + + logical :: mpi_master + + File: :file:`mpi.irp.f` + + If true, rank is zero + + + + +.. c:var:: mpi_rank + + .. code:: text + + integer :: mpi_rank + integer :: mpi_size + + File: :file:`mpi.irp.f` + + Rank of MPI process and number of MPI processes + + + + +.. c:var:: mpi_size + + .. code:: text + + integer :: mpi_rank + integer :: mpi_size + + File: :file:`mpi.irp.f` + + Rank of MPI process and number of MPI processes + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: broadcast_chunks_double + + .. code:: text + + subroutine broadcast_chunks_double(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: broadcast_chunks_integer + + .. code:: text + + subroutine broadcast_chunks_integer(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: broadcast_chunks_integer8 + + .. code:: text + + subroutine broadcast_chunks_integer8(A, LDA) + + File: :file:`mpi.irp.f_template_97` + + Broadcast with chunks of ~2GB + + + + + +.. c:function:: mpi_print + + .. code:: text + + subroutine mpi_print(string) + + File: :file:`mpi.irp.f` + + Print string to stdout if the MPI rank is zero. + + diff --git a/docs/source/modules/nuclei.rst b/docs/source/modules/nuclei.rst new file mode 100644 index 00000000..7f6a89ff --- /dev/null +++ b/docs/source/modules/nuclei.rst @@ -0,0 +1,351 @@ +.. _nuclei: + +.. program:: nuclei + +.. default-role:: option + +====== +nuclei +====== + +This module contains data relative to the nuclei (coordinates, charge, +nuclear repulsion energy, etc). +The coordinates are expressed in atomic units. + + + + +EZFIO parameters +---------------- + +.. option:: nucl_num + + Number of nuclei + + +.. option:: nucl_label + + Nuclear labels + + +.. option:: nucl_charge + + Nuclear charges + + +.. option:: nucl_coord + + Nuclear coordinates in the format (:, {x,y,z}) + + +.. option:: disk_access_nuclear_repulsion + + Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] + + Default: None + +.. option:: nuclear_repulsion + + Nuclear repulsion (Computed automaticaly or Read in the |EZFIO|) + + + +Providers +--------- + + +.. c:var:: center_of_mass + + .. code:: text + + double precision, allocatable :: center_of_mass (3) + + File: :file:`nuclei.irp.f` + + Center of mass of the molecule + + + + +.. c:var:: element_mass + + .. code:: text + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + File: :file:`nuclei.irp.f` + + Array of the name of element, sorted by nuclear charge (integer) + + + + +.. c:var:: element_name + + .. code:: text + + character*(4), allocatable :: element_name (0:127) + double precision, allocatable :: element_mass (0:127) + + File: :file:`nuclei.irp.f` + + Array of the name of element, sorted by nuclear charge (integer) + + + + +.. c:var:: inertia_tensor + + .. code:: text + + double precision, allocatable :: inertia_tensor (3,3) + + File: :file:`inertia.irp.f` + + Inertia tensor + + + + +.. c:var:: inertia_tensor_eigenvalues + + .. code:: text + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + File: :file:`inertia.irp.f` + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + + + +.. c:var:: inertia_tensor_eigenvectors + + .. code:: text + + double precision, allocatable :: inertia_tensor_eigenvectors (3,3) + double precision, allocatable :: inertia_tensor_eigenvalues (3) + + File: :file:`inertia.irp.f` + + Eigenvectors/eigenvalues of the inertia_tensor. Used to find normal orientation. + + + + +.. c:var:: nucl_coord + + .. code:: text + + double precision, allocatable :: nucl_coord (nucl_num,3) + + File: :file:`nuclei.irp.f` + + Nuclear coordinates in the format (:, {x,y,z}) + + + + +.. c:var:: nucl_coord_transp + + .. code:: text + + double precision, allocatable :: nucl_coord_transp (3,nucl_num) + + File: :file:`nuclei.irp.f` + + Transposed array of nucl_coord + + + + +.. c:var:: nucl_dist + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_2 + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_inv + + .. code:: text + + double precision, allocatable :: nucl_dist_inv (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + Inverse of the distance between nucleus I and nucleus J + + + + +.. c:var:: nucl_dist_vec_x + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_vec_y + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nucl_dist_vec_z + + .. code:: text + + double precision, allocatable :: nucl_dist_2 (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_x (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_y (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist_vec_z (nucl_num,nucl_num) + double precision, allocatable :: nucl_dist (nucl_num,nucl_num) + + File: :file:`nuclei.irp.f` + + nucl_dist : Nucleus-nucleus distances nucl_dist_2 : Nucleus-nucleus distances squared nucl_dist_vec : Nucleus-nucleus distances vectors + + + + +.. c:var:: nuclear_repulsion + + .. code:: text + + double precision :: nuclear_repulsion + + File: :file:`nuclei.irp.f` + + Nuclear repulsion energy + + + + +.. c:var:: slater_bragg_radii + + .. code:: text + + double precision, allocatable :: slater_bragg_radii (100) + + File: :file:`atomic_radii.irp.f` + + atomic radii in Angstrom defined in table I of JCP 41, 3199 (1964) Slater execpt for the Hydrogen atom where we took the value of Becke (1988, JCP) + + + + +.. c:var:: slater_bragg_radii_per_atom + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_per_atom (nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_radii_per_atom_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_per_atom_ua (nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_radii_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_radii_ua (100) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_type_inter_distance + + .. code:: text + + double precision, allocatable :: slater_bragg_type_inter_distance (nucl_num,nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + + + +.. c:var:: slater_bragg_type_inter_distance_ua + + .. code:: text + + double precision, allocatable :: slater_bragg_type_inter_distance_ua (nucl_num,nucl_num) + + File: :file:`atomic_radii.irp.f` + + + + diff --git a/docs/source/modules/perturbation.rst b/docs/source/modules/perturbation.rst new file mode 100644 index 00000000..5ea4aecc --- /dev/null +++ b/docs/source/modules/perturbation.rst @@ -0,0 +1,560 @@ +.. _perturbation: + +.. program:: perturbation + +.. default-role:: option + +============ +perturbation +============ + + +All subroutines in ``*.irp.f`` starting with `pt2_` in the current directory are +perturbation computed using the routine `i_H_psi`. Other cases are not allowed. +The arguments of the `pt2_` are always: + +.. code-block:: fortran + + subroutine pt2_...( & + psi_ref, & + psi_ref_coefs, & + E_refs, & + det_pert, & + c_pert, & + e_2_pert, & + H_pert_diag, & + Nint, & + Ndet, & + N_st ) + + + integer , intent(in) :: Nint,Ndet,N_st + integer(bit_kind), intent(in) :: psi_ref(Nint,2,Ndet) + double precision , intent(in) :: psi_ref_coefs(Ndet,N_st) + double precision , intent(in) :: E_refs(N_st) + integer(bit_kind), intent(in) :: det_pert(Nint,2) + double precision , intent(out) :: c_pert(N_st),e_2_pert(N_st),H_pert_diag + + +`psi_ref` + bitstring of the determinants present in the various `N_st` states + +`psi_ref_coefs` + coefficients of the determinants on the various `N_st` states + +`E_refs` + Energy of the various `N_st` states + +`det_pert` + Perturber determinant + +`c_pert` + Perturbative coefficients for the various states + +`e_2_pert` + Perturbative energetic contribution for the various states + +`H_pert_diag` + Diagonal |H| matrix element of the perturber + +`Nint` + Should be equal to `N_int` + +`Ndet` + Number of determinants `i` in |Psi| on which we apply + +`N_st` + Number of states + + + + + + +EZFIO parameters +---------------- + +.. option:: do_pt2 + + If `True`, compute the |PT2| contribution + + Default: True + +.. option:: pt2_max + + The selection process stops when the largest |PT2| (for all the state) is lower + + than `pt2_max` in absolute value + + Default: 0.0001 + +.. option:: pt2_relative_error + + Stop stochastic |PT2| when the relative error is smaller than `PT2_relative_error` + + Default: 0.005 + +.. option:: correlation_energy_ratio_max + + The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules). + + Defined as :math:`{E_{CI}-E_{HF}}/{E_{CI}+E_{PT2} - E_{HF}}`. + + Default: 1.00 + +.. option:: h0_type + + Type of zeroth-order Hamiltonian [ EN | Barycentric | Variance | SOP ] + + Default: EN + + +Providers +--------- + + +.. c:var:: fill_h_apply_buffer_selection + + .. code:: text + + subroutine fill_H_apply_buffer_selection(n_selected,det_buffer,e_2_pert_buffer,coef_pert_buffer, & + N_st,Nint,iproc,select_max_out) + + File: :file:`selection.irp.f` + + Fill the H_apply buffer with determiants for the selection + + + + +.. c:var:: max_exc_pert + + .. code:: text + + integer :: max_exc_pert + + File: :file:`exc_max.irp.f` + + + + + + +.. c:var:: selection_criterion + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: selection_criterion_factor + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: selection_criterion_min + + .. code:: text + + double precision :: selection_criterion + double precision :: selection_criterion_min + double precision :: selection_criterion_factor + + File: :file:`selection.irp.f` + + Threshold to select determinants. Set by selection routines. + + + + +.. c:var:: var_pt2_ratio + + .. code:: text + + double precision :: var_pt2_ratio + + File: :file:`var_pt2_ratio_provider.irp.f` + + The selection process stops when the energy ratio variational/(variational+PT2) is equal to var_pt2_ratio + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: perturb_buffer_by_mono_dummy + + .. code:: text + + subroutine perturb_buffer_by_mono_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet + + .. code:: text + + subroutine perturb_buffer_by_mono_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_epstein_nesbet_2x2 + + .. code:: text + + subroutine perturb_buffer_by_mono_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_h_core + + .. code:: text + + subroutine perturb_buffer_by_mono_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_moller_plesset + + .. code:: text + + subroutine perturb_buffer_by_mono_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_moller_plesset_general + + .. code:: text + + subroutine perturb_buffer_by_mono_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_by_mono_qdpt + + .. code:: text + + subroutine perturb_buffer_by_mono_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_dummy + + .. code:: text + + subroutine perturb_buffer_dummy(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``dummy`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_epstein_nesbet + + .. code:: text + + subroutine perturb_buffer_epstein_nesbet(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_epstein_nesbet_2x2 + + .. code:: text + + subroutine perturb_buffer_epstein_nesbet_2x2(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_h_core + + .. code:: text + + subroutine perturb_buffer_h_core(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_moller_plesset + + .. code:: text + + subroutine perturb_buffer_moller_plesset(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_moller_plesset_general + + .. code:: text + + subroutine perturb_buffer_moller_plesset_general(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``moller_plesset_general`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: perturb_buffer_qdpt + + .. code:: text + + subroutine perturb_buffer_qdpt(i_generator,buffer,buffer_size,e_2_pert_buffer,coef_pert_buffer,sum_e_2_pert,sum_norm_pert,sum_H_pert_diag,N_st,Nint,key_mask,fock_diag_tmp,electronic_energy) + + File: :file:`perturbation.irp.f_shell_13` + + Applly pertubration ``qdpt`` to the buffer of determinants generated in the H_apply routine. + + + + + +.. c:function:: pt2_dummy + + .. code:: text + + subroutine pt2_dummy (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Dummy perturbation to add all connected determinants. + + + + + +.. c:function:: pt2_epstein_nesbet + + .. code:: text + + subroutine pt2_epstein_nesbet (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{ E_n - \langle \alpha|H|\alpha \rangle }` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{ E_n - \langle \alpha|H|\alpha \rangle }` . + + + + + + + +.. c:function:: pt2_epstein_nesbet_2x2 + + .. code:: text + + subroutine pt2_epstein_nesbet_2x2 (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the Epstein-Nesbet 2x2 diagonalization coefficient and energetic contribution for the various N_st states. + + `e_2_pert(i)` = :math:`\frac{1}{2} ( \langle \alpha|H|\alpha \rangle - E_n) - \sqrt{ (\langle \alpha|H|\alpha \rangle - E_n)^2 + 4 \langle i|H|\alpha \rangle^2 }` . + + `c_pert(i)` = `e_2_pert(i)` :math:`\times \frac{1}{ \langle i|H|\alpha \rangle}` . + + + + + + + +.. c:function:: pt2_h_core + + .. code:: text + + subroutine pt2_h_core(det_pert,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pert_single.irp.f` + + compute the standard Epstein-Nesbet perturbative first order coefficient and second order energetic contribution + + for the various N_st states. + + c_pert(i) = /( E(i) - ) + + e_2_pert(i) = ^2/( E(i) - ) + + + + + + + +.. c:function:: pt2_moller_plesset + + .. code:: text + + subroutine pt2_moller_plesset (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . + + + + + + + +.. c:function:: pt2_moller_plesset_general + + .. code:: text + + subroutine pt2_moller_plesset_general (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the standard Moller-Plesset perturbative first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\text{difference of orbital energies}}` . + + `e_2_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle^2}{\text{difference of orbital energies}}` . + + + + + + + +.. c:function:: pt2_qdpt + + .. code:: text + + subroutine pt2_qdpt (electronic_energy,det_ref,det_pert,fock_diag_tmp,c_pert,e_2_pert,H_pert_diag,Nint,ndet,N_st,minilist,idx_minilist,N_minilist) + + File: :file:`pt2_equations.irp.f_template_309` + + Computes the QDPT first order coefficient and second order energetic contribution for the various N_st states. + + `c_pert(i)` = :math:`\frac{\langle i|H|\alpha \rangle}{\langle i|H|i \rangle - \langle \alpha|H|\alpha \rangle}` . + + + + + + + +.. c:function:: remove_small_contributions + + .. code:: text + + subroutine remove_small_contributions + + File: :file:`selection.irp.f` + + Remove determinants with small contributions. N_states is assumed to be provided. + + + + + +.. c:function:: repeat_all_e_corr + + .. code:: text + + double precision function repeat_all_e_corr(key_in) + + File: :file:`pert_sc2.irp.f` + + + + diff --git a/docs/source/modules/pseudo.rst b/docs/source/modules/pseudo.rst new file mode 100644 index 00000000..b9ab7433 --- /dev/null +++ b/docs/source/modules/pseudo.rst @@ -0,0 +1,94 @@ +.. _pseudo: + +.. program:: pseudo + +.. default-role:: option + +====== +pseudo +====== + +This module defines the |EZFIO| parameters of the effective core potentials. + + + +EZFIO parameters +---------------- + +.. option:: nucl_charge_remove + + Nuclear charges removed per atom + + +.. option:: pseudo_klocmax + + Maximum value of k for the local component + + +.. option:: pseudo_n_k + + Number of gaussians in the local component + + +.. option:: pseudo_v_k + + Coefficients in the local component + + +.. option:: pseudo_dz_k + + Exponents in the local component + + +.. option:: pseudo_lmax + + Maximum angular momentum + + +.. option:: pseudo_kmax + + Maximum number of functions in the non-local component + + +.. option:: pseudo_n_kl + + Number of functions in the non-local component + + +.. option:: pseudo_v_kl + + Coefficients in the non-local component + + +.. option:: pseudo_dz_kl + + Exponents in the non-local component + + +.. option:: do_pseudo + + If `True`, pseudo-potentials are used. + + Default: False + +.. option:: pseudo_grid_size + + Nb of points of the grid for the QMC interfaces + + Default: 1000 + +.. option:: pseudo_grid_rmax + + R_max of the QMC grid + + Default: 10.0 + +.. option:: ao_pseudo_grid + + Grid for the QMC interface + + +.. option:: mo_pseudo_grid + + Grid for the QMC interface + diff --git a/docs/source/modules/psiref_cas.rst b/docs/source/modules/psiref_cas.rst new file mode 100644 index 00000000..fe4e38ae --- /dev/null +++ b/docs/source/modules/psiref_cas.rst @@ -0,0 +1,14 @@ +.. _psiref_cas: + +.. program:: psiref_cas + +.. default-role:: option + +========== +psiref_cas +========== + +Reference wave function is defined as a |CAS| wave function. +This module is required for |CAS-SD|, |MRPT| or |MRCC|. + + diff --git a/docs/source/modules/psiref_utils.rst b/docs/source/modules/psiref_utils.rst new file mode 100644 index 00000000..634ecb61 --- /dev/null +++ b/docs/source/modules/psiref_utils.rst @@ -0,0 +1,16 @@ +.. _psiref_utils: + +.. program:: psiref_utils + +.. default-role:: option + +============ +psiref_utils +============ + + +Utilities related to the use of a reference wave function. This module +needs to be loaded with any `psi_ref_*` module. + + + diff --git a/docs/source/modules/scf_utils.rst b/docs/source/modules/scf_utils.rst new file mode 100644 index 00000000..d9ec8f4f --- /dev/null +++ b/docs/source/modules/scf_utils.rst @@ -0,0 +1,390 @@ +.. _scf_utils: + +.. program:: scf_utils + +.. default-role:: option + +========= +scf_utils +========= + + + +The scf_utils module is an abstract module which contains the basics to perform *Restricted* SCF calculations (the +spatial part of the |MOs| is common for alpha and beta spinorbitals) based on a single-determinant wave function. + +This module does not produce any executable *and must not do*, but instead it contains everything one needs to perform an orbital optimization based on an Fock matrix. +The ``scf_utils`` module is meant to be included in the :file:`NEED` of the various single determinant SCF procedures, such as ``hartree_fock`` or ``kohn_sham``, where a specific definition of the Fock matrix is given (see :file:`hartree_fock fock_matrix_hf.irp.f` for an example). + +All SCF programs perform the following actions: + + +#. Compute/Read all the one- and two-electron integrals, and store them in memory + +#. Check in the |EZFIO| database if there is a set of |MOs|. If there is, it + will read them as initial guess. Otherwise, it will create a guess. +#. Perform the |SCF| iterations based on the definition of the Fock matrix + + +The main keywords/options are: + +* :option:`scf_utils thresh_scf` +* :option:`scf_utils level_shift` + +At each iteration, the |MOs| are saved in the |EZFIO| database. Hence, if the calculation +crashes for any unexpected reason, the calculation can be restarted by running again +the |SCF| with the same |EZFIO| database. + +The `DIIS`_ algorithm is implemented, as well as the `level-shifting`_ method. +If the |SCF| does not converge, try again with a higher value of :option:`level_shift`. + +To start a calculation from scratch, the simplest way is to remove the +``mo_basis`` directory from the |EZFIO| database, and run the |SCF| again. + +.. _DIIS: https://en.wikipedia.org/w/index.php?title=DIIS +.. _level-shifting: https://doi.org/10.1002/qua.560070407 + + + + +EZFIO parameters +---------------- + +.. option:: max_dim_diis + + Maximum size of the DIIS extrapolation procedure + + Default: 15 + +.. option:: threshold_diis + + Threshold on the convergence of the DIIS error vector during a Hartree-Fock calculation. If 0. is chosen, the square root of thresh_scf will be used. + + Default: 0. + +.. option:: thresh_scf + + Threshold on the convergence of the Hartree Fock energy. + + Default: 1.e-10 + +.. option:: n_it_scf_max + + Maximum number of SCF iterations + + Default: 500 + +.. option:: level_shift + + Energy shift on the virtual MOs to improve SCF convergence + + Default: 0. + +.. option:: scf_algorithm + + Type of SCF algorithm used. Possible choices are [ Simple | DIIS] + + Default: DIIS + +.. option:: mo_guess_type + + Initial MO guess. Can be [ Huckel | HCore ] + + Default: Huckel + +.. option:: energy + + Calculated HF energy + + +.. option:: no_oa_or_av_opt + + If true, leave the active orbitals untouched in the SCF procedure + + Default: False + + +Providers +--------- + + +.. c:var:: eigenvalues_fock_matrix_ao + + .. code:: text + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + + + +.. c:var:: eigenvectors_fock_matrix_ao + + .. code:: text + + double precision, allocatable :: eigenvalues_fock_matrix_ao (AO_num) + double precision, allocatable :: eigenvectors_fock_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + + + +.. c:var:: eigenvectors_fock_matrix_mo + + .. code:: text + + double precision, allocatable :: eigenvectors_fock_matrix_mo (ao_num,mo_num) + + File: :file:`diagonalize_fock.irp.f` + + Eigenvector of the Fock matrix in the MO basis obtained with level shift. + + + + +.. c:var:: extrapolate_fock_matrix + + .. code:: text + + subroutine extrapolate_Fock_matrix( & + error_matrix_DIIS,Fock_matrix_DIIS, & + Fock_matrix_AO_,size_Fock_matrix_AO, & + iteration_SCF,dim_DIIS & + ) + + File: :file:`roothaan_hall_scf.irp.f` + + Compute the extrapolated Fock matrix using the DIIS procedure + + + + +.. c:var:: fock_matrix_ao + + .. code:: text + + double precision, allocatable :: fock_matrix_ao (ao_num,ao_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix in AO basis set + + + + +.. c:var:: fock_matrix_diag_mo + + .. code:: text + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is :: + + | F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K | + + + + F = 1/2 (Fa + Fb) + + K = Fb - Fa + + + + + + +.. c:var:: fock_matrix_mo + + .. code:: text + + double precision, allocatable :: fock_matrix_mo (mo_num,mo_num) + double precision, allocatable :: fock_matrix_diag_mo (mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis. For open shells, the ROHF Fock Matrix is :: + + | F-K | F + K/2 | F | |---------------------------------| | F + K/2 | F | F - K/2 | |---------------------------------| | F | F - K/2 | F + K | + + + + F = 1/2 (Fa + Fb) + + K = Fb - Fa + + + + + + +.. c:var:: fock_matrix_mo_alpha + + .. code:: text + + double precision, allocatable :: fock_matrix_mo_alpha (mo_num,mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis + + + + +.. c:var:: fock_matrix_mo_beta + + .. code:: text + + double precision, allocatable :: fock_matrix_mo_beta (mo_num,mo_num) + + File: :file:`fock_matrix.irp.f` + + Fock matrix on the MO basis + + + + +.. c:var:: fps_spf_matrix_ao + + .. code:: text + + double precision, allocatable :: fps_spf_matrix_ao (AO_num,AO_num) + + File: :file:`diis.irp.f` + + Commutator FPS - SPF + + + + +.. c:var:: fps_spf_matrix_mo + + .. code:: text + + double precision, allocatable :: fps_spf_matrix_mo (mo_num,mo_num) + + File: :file:`diis.irp.f` + + Commutator FPS - SPF in MO basis + + + + +.. c:var:: scf_density_matrix_ao + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P.S^{-1} where P = C.C^t + + + + +.. c:var:: scf_density_matrix_ao_alpha + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao_alpha (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P_alpha.S^{-1} + + + + +.. c:var:: scf_density_matrix_ao_beta + + .. code:: text + + double precision, allocatable :: scf_density_matrix_ao_beta (ao_num,ao_num) + + File: :file:`scf_density_matrix_ao.irp.f` + + S^{-1}.P_beta.S^{-1} + + + + +.. c:var:: scf_energy + + .. code:: text + + double precision :: scf_energy + + File: :file:`fock_matrix.irp.f` + + Hartree-Fock energy + + + + +.. c:var:: threshold_diis_nonzero + + .. code:: text + + double precision :: threshold_diis_nonzero + + File: :file:`diis.irp.f` + + If threshold_DIIS is zero, choose sqrt(thresh_scf) + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: damping_scf + + .. code:: text + + subroutine damping_SCF + + File: :file:`damping_scf.irp.f` + + + + + + + +.. c:function:: huckel_guess + + .. code:: text + + subroutine huckel_guess + + File: :file:`huckel.irp.f` + + Build the MOs using the extended Huckel model + + + + + +.. c:function:: roothaan_hall_scf + + .. code:: text + + subroutine Roothaan_Hall_SCF + + File: :file:`roothaan_hall_scf.irp.f` + + Roothaan-Hall algorithm for SCF Hartree-Fock calculation + + diff --git a/docs/source/modules/selectors_cassd.rst b/docs/source/modules/selectors_cassd.rst new file mode 100644 index 00000000..d6c2b8ff --- /dev/null +++ b/docs/source/modules/selectors_cassd.rst @@ -0,0 +1,13 @@ +.. _selectors_cassd: + +.. program:: selectors_cassd + +.. default-role:: option + +=============== +selectors_cassd +=============== + +Selectors for |CAS-SD| calculations. The selectors are defined as first the +generators from :ref:`Generators_CAS`, and then the rest of the wave function. + diff --git a/docs/source/modules/selectors_full.rst b/docs/source/modules/selectors_full.rst new file mode 100644 index 00000000..9edb70b9 --- /dev/null +++ b/docs/source/modules/selectors_full.rst @@ -0,0 +1,72 @@ +.. _selectors_full: + +.. program:: selectors_full + +.. default-role:: option + +============== +selectors_full +============== + +All the determinants are possible selectors. Only the largest contributions are kept, where +a threshold is applied to the squared norm of the wave function, with the :option:`determinants +threshold_selectors` flag. + + + +Providers +--------- + + +.. c:var:: n_det_selectors + + .. code:: text + + integer :: n_det_selectors + + File: :file:`selectors.irp.f` + + For Single reference wave functions, the number of selectors is 1 : the Hartree-Fock determinant + + + + +.. c:var:: psi_selectors + + .. code:: text + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + File: :file:`selectors.irp.f` + + Determinants on which we apply for perturbation. + + + + +.. c:var:: psi_selectors_coef + + .. code:: text + + integer(bit_kind), allocatable :: psi_selectors (N_int,2,psi_selectors_size) + double precision, allocatable :: psi_selectors_coef (psi_selectors_size,N_states) + + File: :file:`selectors.irp.f` + + Determinants on which we apply for perturbation. + + + + +.. c:var:: threshold_selectors + + .. code:: text + + double precision :: threshold_selectors + + File: :file:`selectors.irp.f` + + Thresholds on selectors (fraction of the square of the norm) + + diff --git a/docs/source/modules/selectors_utils.rst b/docs/source/modules/selectors_utils.rst new file mode 100644 index 00000000..959d2930 --- /dev/null +++ b/docs/source/modules/selectors_utils.rst @@ -0,0 +1,381 @@ +.. _selectors_utils: + +.. program:: selectors_utils + +.. default-role:: option + +=============== +selectors_utils +=============== + +Helper functions for selectors. + + + + +Providers +--------- + + +.. c:var:: coef_hf_selector + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: delta_e_per_selector + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: double_index_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: e_corr_double_only + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: e_corr_per_selectors + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: e_corr_second_order + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: exc_degree_per_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: i_h_hf_per_selectors + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: inv_selectors_coef_hf + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: inv_selectors_coef_hf_squared + + .. code:: text + + double precision :: coef_hf_selector + double precision :: inv_selectors_coef_hf + double precision :: inv_selectors_coef_hf_squared + double precision, allocatable :: e_corr_per_selectors (N_det_selectors) + double precision, allocatable :: i_h_hf_per_selectors (N_det_selectors) + double precision, allocatable :: delta_e_per_selector (N_det_selectors) + double precision :: e_corr_double_only + double precision :: e_corr_second_order + + File: :file:`e_corr_selectors.irp.f` + + Correlation energy per determinant with respect to the Hartree-Fock determinant for the all the double excitations in the selectors determinants. + + E_corr_per_selectors(i) = :math:`\langle D_i | H | \text{HF}\rangle c(D_i)/c(HF)` if :math:`| D_i \rangle` is a double excitation. + + E_corr_per_selectors(i) = -1000.d0 if it is not a double excitation + + coef_hf_selector = coefficient of the Hartree Fock determinant in the selectors determinants + + + + +.. c:var:: n_double_selectors + + .. code:: text + + integer, allocatable :: exc_degree_per_selectors (N_det_selectors) + integer, allocatable :: double_index_selectors (N_det_selectors) + integer :: n_double_selectors + + File: :file:`e_corr_selectors.irp.f` + + Degree of excitation respect to Hartree Fock for the wave function for the all the selectors determinants. + + double_index_selectors = list of the index of the double excitations + + n_double_selectors = number of double excitations in the selectors determinants + + + + +.. c:var:: psi_selectors_coef_transp + + .. code:: text + + double precision, allocatable :: psi_selectors_coef_transp (N_states,psi_selectors_size) + + File: :file:`selectors.irp.f` + + Transposed psi_selectors + + + + +.. c:var:: psi_selectors_diag_h_mat + + .. code:: text + + double precision, allocatable :: psi_selectors_diag_h_mat (psi_selectors_size) + + File: :file:`selectors.irp.f` + + Diagonal elements of the H matrix for each selectors + + + + +.. c:var:: psi_selectors_size + + .. code:: text + + integer :: psi_selectors_size + + File: :file:`selectors.irp.f` + + + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: zmq_get_n_det_generators + + .. code:: text + + integer function zmq_get_N_det_generators(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_102` + + Get N_det_generators from the qp_run scheduler + + + + + +.. c:function:: zmq_get_n_det_selectors + + .. code:: text + + integer function zmq_get_N_det_selectors(zmq_to_qp_run_socket, worker_id) + + File: :file:`zmq.irp.f_template_102` + + Get N_det_selectors from the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_generators + + .. code:: text + + integer function zmq_put_N_det_generators(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_102` + + Put N_det_generators on the qp_run scheduler + + + + + +.. c:function:: zmq_put_n_det_selectors + + .. code:: text + + integer function zmq_put_N_det_selectors(zmq_to_qp_run_socket,worker_id) + + File: :file:`zmq.irp.f_template_102` + + Put N_det_selectors on the qp_run scheduler + + diff --git a/docs/source/modules/single_ref_method.rst b/docs/source/modules/single_ref_method.rst new file mode 100644 index 00000000..ae80a401 --- /dev/null +++ b/docs/source/modules/single_ref_method.rst @@ -0,0 +1,14 @@ +.. _single_ref_method: + +.. program:: single_ref_method + +.. default-role:: option + +================= +single_ref_method +================= + +Include this module for single reference methods. +Using this module, the only generator determinant is the Hartree-Fock determinant. + + diff --git a/docs/source/modules/tools.rst b/docs/source/modules/tools.rst new file mode 100644 index 00000000..fd37d0c2 --- /dev/null +++ b/docs/source/modules/tools.rst @@ -0,0 +1,222 @@ +.. _tools: + +.. program:: tools + +.. default-role:: option + +===== +tools +===== + +Useful tools are grouped in this module. + + + +Subroutines / functions +----------------------- + + + +.. c:function:: diagonalize_h + + .. code:: text + + subroutine diagonalize_h + + File: :file:`diagonalize_h.irp.f` + + program that extracts the N_states lowest states of the Hamiltonian within the set of Slater determinants stored in the EZFIO folder + + + + + +.. c:function:: fcidump + + .. code:: text + + subroutine fcidump + + File: :file:`fcidump.irp.f` + + Produce a FCIDUMP file + + + + + +.. c:function:: four_idx_transform + + .. code:: text + + subroutine four_idx_transform + + File: :file:`four_idx_transform.irp.f` + + 4-index transformation of two-electron integrals from AO to MO integrals + + + + + +.. c:function:: molden + + .. code:: text + + subroutine molden + + File: :file:`molden.irp.f` + + Produce a Molden file + + + + + +.. c:function:: print_wf + + .. code:: text + + subroutine print_wf + + File: :file:`print_wf.irp.f` + + 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 + + and a first-order perturbative analysis of the wave function. + + If the wave function strongly deviates from the first-order analysis, something funny is going on :) + + + + + +.. c:function:: routine + + .. code:: text + + subroutine routine + + File: :file:`write_integrals_erf.irp.f` + + + + + + + +.. c:function:: save_natorb + + .. code:: text + + subroutine save_natorb + + File: :file:`save_natorb.irp.f` + + Save natural MOs into the EZFIO + + + + + +.. c:function:: save_one_body_dm + + .. code:: text + + subroutine save_one_body_dm + + File: :file:`save_one_body_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_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). + + + + + +.. c:function:: save_ortho_mos + + .. code:: text + + subroutine save_ortho_mos + + File: :file:`save_ortho_mos.irp.f` + + Save orthonormalized MOs in the EZFIO. + + + + + +.. c:function:: write_ao_basis + + .. code:: text + + subroutine write_Ao_basis(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_geometry + + .. code:: text + + subroutine write_geometry(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_integrals + + .. code:: text + + subroutine write_integrals + + File: :file:`write_integrals_erf.irp.f` + + Saves the two-electron erf integrals into the EZFIO + + + + + +.. c:function:: write_intro_gamess + + .. code:: text + + subroutine write_intro_gamess(i_unit_output) + + File: :file:`molden.irp.f` + + + + + + + +.. c:function:: write_mo_basis + + .. code:: text + + subroutine write_Mo_basis(i_unit_output) + + File: :file:`molden.irp.f` + + + + diff --git a/docs/source/modules/utils.rst b/docs/source/modules/utils.rst new file mode 100644 index 00000000..6437de1f --- /dev/null +++ b/docs/source/modules/utils.rst @@ -0,0 +1,1960 @@ +.. _utils: + +.. program:: utils + +.. default-role:: option + +===== +utils +===== + +Contains general purpose utilities (sorting, maps, etc). + + + + +Providers +--------- + + +.. c:var:: binom + + .. code:: text + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients + + + + +.. c:var:: binom_int + + .. code:: text + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients, as integers*8 + + + + +.. c:var:: binom_int_transp + + .. code:: text + + integer*8, allocatable :: binom_int (0:40,0:40) + integer*8, allocatable :: binom_int_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients, as integers*8 + + + + +.. c:var:: binom_transp + + .. code:: text + + double precision, allocatable :: binom (0:40,0:40) + double precision, allocatable :: binom_transp (0:40,0:40) + + File: :file:`util.irp.f` + + Binomial coefficients + + + + +.. c:var:: degree_max_integration_lebedev + + .. code:: text + + integer :: degree_max_integration_lebedev + + File: :file:`angular_integration.irp.f` + + integrate correctly a polynom of order "degree_max_integration_lebedev" needed for the angular integration according to LEBEDEV formulae + + + + +.. c:var:: dtranspose + + .. code:: text + + recursive subroutine dtranspose(A,LDA,B,LDB,d1,d2) + + File: :file:`transpose.irp.f` + + Transpose input matrix A into output matrix B + + + + +.. c:var:: fact_inv + + .. code:: text + + double precision, allocatable :: fact_inv (128) + + File: :file:`util.irp.f` + + 1/n! + + + + +.. c:var:: i2radix_sort + + .. code:: text + + recursive subroutine i2radix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: i8radix_sort + + .. code:: text + + recursive subroutine i8radix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: i8radix_sort_big + + .. code:: text + + recursive subroutine i8radix_sort_big(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: inv_int + + .. code:: text + + double precision, allocatable :: inv_int (128) + + File: :file:`util.irp.f` + + 1/i + + + + +.. c:var:: iradix_sort + + .. code:: text + + recursive subroutine iradix_sort(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: iradix_sort_big + + .. code:: text + + recursive subroutine iradix_sort_big(x,iorder,isize,iradix) + + File: :file:`sort.irp.f_template_644` + + Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. + + + + +.. c:var:: n_points_integration_angular_lebedev + + .. code:: text + + integer :: n_points_integration_angular_lebedev + + File: :file:`angular_integration.irp.f` + + Number of points needed for the angular integral + + + + +.. c:var:: nproc + + .. code:: text + + integer :: nproc + + File: :file:`util.irp.f` + + Number of current OpenMP threads + + + + +.. c:var:: overlap_gaussian_xyz + + .. code:: text + + subroutine overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,& + power_B,overlap_x,overlap_y,overlap_z,overlap,dim) + + File: :file:`one_e_integration.irp.f` + + .. math:: + + S_x = \int (x-A_x)^{a_x} exp(-\alpha(x-A_x)^2) (x-B_x)^{b_x} exp(-beta(x-B_x)^2) dx \\ S = S_x S_y S_z + + + + + + +.. c:var:: phi_angular_integration_lebedev + + .. code:: text + + double precision, allocatable :: theta_angular_integration_lebedev (n_points_integration_angular_lebedev) + double precision, allocatable :: phi_angular_integration_lebedev (n_points_integration_angular_lebedev) + double precision, allocatable :: weights_angular_integration_lebedev (n_points_integration_angular_lebedev) + + File: :file:`angular_integration.irp.f` + + Theta phi values together with the weights values for the angular integration : integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1 where i is the basis function and psi_j is the j th eigenvector + + + + + + + +.. c:function:: lapack_diagd + + .. code:: text + + subroutine lapack_diagd(eigvalues,eigvectors,H,nmax,n) + + File: :file:`linear_algebra.irp.f` + + Diagonalize matrix H + + H is untouched between input and ouptut + + eigevalues(i) = ith lowest eigenvalue of the H matrix + + eigvectors(i,j) = where i is the basis function and psi_j is the j th eigenvector + + + + + + + +.. c:function:: logfact + + .. code:: text + + double precision function logfact(n) + + File: :file:`util.irp.f` + + n! + + + + + +.. c:function:: lowercase + + .. code:: text + + subroutine lowercase(txt,n) + + File: :file:`util.irp.f` + + Transform to lower case + + + + + +.. c:function:: map_load_from_disk + + .. code:: text + + subroutine map_load_from_disk(filename,map) + + File: :file:`map_functions.irp.f` + + + + + + + +.. c:function:: map_save_to_disk + + .. code:: text + + subroutine map_save_to_disk(filename,map) + + File: :file:`map_functions.irp.f` + + + + + + + +.. c:function:: memory_of_double + + .. code:: text + + double precision function memory_of_double(n) + + File: :file:`memory.irp.f` + + Computes the memory required for n double precision elements in gigabytes. + + + + + +.. c:function:: memory_of_int + + .. code:: text + + double precision function memory_of_int(n) + + File: :file:`memory.irp.f` + + Computes the memory required for n double precision elements in gigabytes. + + + + + +.. c:function:: multiply_poly + + .. code:: text + + subroutine multiply_poly(b,nb,c,nc,d,nd) + + File: :file:`integration.irp.f` + + Multiply two polynomials D(t) =! D(t) +( B(t)*C(t)) + + + + + +.. c:function:: normalize + + .. code:: text + + subroutine normalize(u,sze) + + File: :file:`util.irp.f` + + Normalizes vector u + + + + + +.. c:function:: ortho_canonical + + .. code:: text + + subroutine ortho_canonical(overlap,LDA,N,C,LDC,m) + + File: :file:`linear_algebra.irp.f` + + Compute C_new=C_old.U.s^-1/2 canonical orthogonalization. + + overlap : overlap matrix + + LDA : leftmost dimension of overlap array + + N : Overlap matrix is NxN (array is (LDA,N) ) + + C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors + + LDC : leftmost dimension of C + + m : Coefficients matrix is MxN, ( array is (LDC,N) ) + + + + + + + +.. c:function:: ortho_lowdin + + .. code:: text + + subroutine ortho_lowdin(overlap,LDA,N,C,LDC,m) + + File: :file:`linear_algebra.irp.f` + + Compute C_new=C_old.S^-1/2 orthogonalization. + + overlap : overlap matrix + + LDA : leftmost dimension of overlap array + + N : Overlap matrix is NxN (array is (LDA,N) ) + + C : Coefficients of the vectors to orthogonalize. On exit, orthogonal vectors + + LDC : leftmost dimension of C + + M : Coefficients matrix is MxN, ( array is (LDC,N) ) + + + + + + + +.. c:function:: ortho_qr + + .. code:: text + + subroutine ortho_qr(A,LDA,m,n) + + File: :file:`linear_algebra.irp.f` + + Orthogonalization using Q.R factorization + + A : matrix to orthogonalize + + LDA : leftmost dimension of A + + n : Number of rows of A + + m : Number of columns of A + + + + + + + +.. c:function:: ortho_qr_unblocked + + .. code:: text + + subroutine ortho_qr_unblocked(A,LDA,m,n) + + File: :file:`linear_algebra.irp.f` + + Orthogonalization using Q.R factorization + + A : matrix to orthogonalize + + LDA : leftmost dimension of A + + n : Number of rows of A + + m : Number of columns of A + + + + + + + +.. c:function:: overlap_gaussian_x + + .. code:: text + + double precision function overlap_gaussian_x(A_center,B_center,alpha,beta,power_A,power_B,dim) + + File: :file:`one_e_integration.irp.f` + + .. math:: + + \sum_{-infty}^{+infty} (x-A_x)^ax (x-B_x)^bx exp(-alpha(x-A_x)^2) exp(-beta(x-B_X)^2) dx + + + + + + + +.. c:function:: overlap_x_abs + + .. code:: text + + subroutine overlap_x_abs(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,lower_exp_val,dx,nx) + + File: :file:`one_e_integration.irp.f` + + .. math :: + + \int_{-infty}^{+infty} (x-A_center)^(power_A) * (x-B_center)^power_B * exp(-alpha(x-A_center)^2) * exp(-beta(x-B_center)^2) dx + + + + + + + +.. c:function:: print_memory_usage + + .. code:: text + + subroutine print_memory_usage() + + File: :file:`memory.irp.f` + + Prints the memory usage in the output + + + + + +.. c:function:: quick_dsort + + .. code:: text + + subroutine quick_dsort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_i2sort + + .. code:: text + + subroutine quick_i2sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_i8sort + + .. code:: text + + subroutine quick_i8sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_isort + + .. code:: text + + subroutine quick_isort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: quick_sort + + .. code:: text + + subroutine quick_sort(x, iorder, isize) + + File: :file:`sort.irp.f_template_261` + + Sort array x(isize) using the quicksort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: recentered_poly2 + + .. code:: text + + subroutine recentered_poly2(P_new,x_A,x_P,a,P_new2,x_B,x_Q,b) + + File: :file:`integration.irp.f` + + Recenter two polynomials + + + + + +.. c:function:: resident_memory + + .. code:: text + + subroutine resident_memory(value) + + File: :file:`memory.irp.f` + + Returns the current used memory in gigabytes used by the current process. + + + + + +.. c:function:: rint + + .. code:: text + + double precision function rint(n,rho) + + File: :file:`integration.irp.f` + + .. math:: + + \int_0^1 dx \exp(-p x^2) x^n + + + + + + + +.. c:function:: rint1 + + .. code:: text + + double precision function rint1(n,rho) + + File: :file:`integration.irp.f` + + Standard version of rint + + + + + +.. c:function:: rint_large_n + + .. code:: text + + double precision function rint_large_n(n,rho) + + File: :file:`integration.irp.f` + + Version of rint for large values of n + + + + + +.. c:function:: rint_sum + + .. code:: text + + double precision function rint_sum(n_pt_out,rho,d1) + + File: :file:`integration.irp.f` + + Needed for the calculation of two-electron integrals. + + + + + +.. c:function:: rinteg + + .. code:: text + + double precision function rinteg(n,u) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: rintgauss + + .. code:: text + + double precision function rintgauss(n) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: sabpartial + + .. code:: text + + double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB,l) + + File: :file:`need.irp.f` + + + + + + + +.. c:function:: set_order + + .. code:: text + + subroutine set_order(x,iorder,isize) + + File: :file:`sort.irp.f_template_347` + + array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. + + + + + +.. c:function:: set_order_big + + .. code:: text + + subroutine set_order_big(x,iorder,isize) + + File: :file:`sort.irp.f_template_412` + + array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format + + + + + +.. c:function:: sort + + .. code:: text + + subroutine sort(x,iorder,isize) + + File: :file:`sort.irp.f_template_293` + + Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. + + + + + +.. c:function:: sorted_dnumber + + .. code:: text + + subroutine sorted_dnumber(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_i2number + + .. code:: text + + subroutine sorted_i2number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_i8number + + .. code:: text + + subroutine sorted_i8number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_inumber + + .. code:: text + + subroutine sorted_inumber(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: sorted_number + + .. code:: text + + subroutine sorted_number(x,isize,n) + + File: :file:`sort.irp.f_template_261` + + Returns the number of sorted elements + + + + + +.. c:function:: svd + + .. code:: text + + subroutine svd(A,LDA,U,LDU,D,Vt,LDVt,m,n) + + File: :file:`linear_algebra.irp.f` + + Compute A = U.D.Vt + + LDx : leftmost dimension of x + + Dimsneion of A is m x n + + + + + + + +.. c:function:: total_memory + + .. code:: text + + subroutine total_memory(value) + + File: :file:`memory.irp.f` + + Returns the current used memory in gigabytes used by the current process. + + + + + +.. c:function:: u_dot_u + + .. code:: text + + double precision function u_dot_u(u,sze) + + File: :file:`util.irp.f` + + Compute + + + + + +.. c:function:: u_dot_v + + .. code:: text + + double precision function u_dot_v(u,v,sze) + + File: :file:`util.irp.f` + + Compute + + + + + +.. c:function:: wall_time + + .. code:: text + + subroutine wall_time(t) + + File: :file:`util.irp.f` + + The equivalent of cpu_time, but for the wall time. + + + + + +.. c:function:: write_git_log + + .. code:: text + + subroutine write_git_log(iunit) + + File: :file:`util.irp.f` + + Write the last git commit in file iunit. + + diff --git a/docs/source/modules/zmq.rst b/docs/source/modules/zmq.rst new file mode 100644 index 00000000..c70a4b0f --- /dev/null +++ b/docs/source/modules/zmq.rst @@ -0,0 +1,898 @@ +.. _zmq: + +.. program:: zmq + +.. default-role:: option + +=== +zmq +=== + +Definition of |ZeroMQ| sockets and messages. + + + + + +Providers +--------- + + +.. c:var:: is_zmq_slave + + .. code:: text + + logical :: is_zmq_slave + + File: :file:`utils.irp.f` + + If |true|, the current process is a |ZeroMQ| slave. + + + + +.. c:var:: qp_run_address + + .. code:: text + + character*(128) :: qp_run_address + integer :: zmq_port_start + + File: :file:`utils.irp.f` + + Address of the qp_run socket Example : tcp://130.120.229.139:12345 + + + + +.. c:var:: zmq_context + + .. code:: text + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + File: :file:`utils.irp.f` + + Context for the ZeroMQ library + + + + +.. c:var:: zmq_lock + + .. code:: text + + integer(ZMQ_PTR) :: zmq_context + integer(omp_lock_kind) :: zmq_lock + + File: :file:`utils.irp.f` + + Context for the ZeroMQ library + + + + +.. c:var:: zmq_port_start + + .. code:: text + + character*(128) :: qp_run_address + integer :: zmq_port_start + + File: :file:`utils.irp.f` + + Address of the qp_run socket Example : tcp://130.120.229.139:12345 + + + + +.. c:var:: zmq_socket_pair_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_pull_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_pull_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_push_inproc_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_push_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_socket_sub_tcp_address + + .. code:: text + + character*(128) :: zmq_socket_pull_tcp_address + character*(128) :: zmq_socket_pair_inproc_address + character*(128) :: zmq_socket_push_tcp_address + character*(128) :: zmq_socket_pull_inproc_address + character*(128) :: zmq_socket_push_inproc_address + character*(128) :: zmq_socket_sub_tcp_address + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + +.. c:var:: zmq_state + + .. code:: text + + character*(128) :: zmq_state + + File: :file:`utils.irp.f` + + Threads executing work through the ZeroMQ interface + + + + +Subroutines / functions +----------------------- + + + +.. c:function:: add_task_to_taskserver + + .. code:: text + + integer function add_task_to_taskserver(zmq_to_qp_run_socket,task) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: connect_to_taskserver + + .. code:: text + + integer function connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) + + File: :file:`utils.irp.f` + + Connect to the task server and obtain the worker ID + + + + + +.. c:function:: disconnect_from_taskserver + + .. code:: text + + integer function disconnect_from_taskserver(zmq_to_qp_run_socket, worker_id) + + File: :file:`utils.irp.f` + + Disconnect from the task server + + + + + +.. c:function:: disconnect_from_taskserver_state + + .. code:: text + + integer function disconnect_from_taskserver_state(zmq_to_qp_run_socket, worker_id, state) + + File: :file:`utils.irp.f` + + Disconnect from the task server + + + + + +.. c:function:: end_parallel_job + + .. code:: text + + subroutine end_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + File: :file:`utils.irp.f` + + End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + + + + +.. c:function:: end_zmq_pair_socket + + .. code:: text + + subroutine end_zmq_pair_socket(zmq_socket_pair) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_pull_socket + + .. code:: text + + subroutine end_zmq_pull_socket(zmq_socket_pull) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_push_socket + + .. code:: text + + subroutine end_zmq_push_socket(zmq_socket_push,thread) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_sub_socket + + .. code:: text + + subroutine end_zmq_sub_socket(zmq_socket_sub) + + File: :file:`utils.irp.f` + + Terminate socket on which the results are sent. + + + + + +.. c:function:: end_zmq_to_qp_run_socket + + .. code:: text + + subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Terminate the socket from the application to qp_run + + + + + +.. c:function:: get_task_from_taskserver + + .. code:: text + + integer function get_task_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: get_tasks_from_taskserver + + .. code:: text + + integer function get_tasks_from_taskserver(zmq_to_qp_run_socket,worker_id,task_id,task,n_tasks) + + File: :file:`utils.irp.f` + + Get multiple tasks from the task server + + + + + +.. c:function:: new_parallel_job + + .. code:: text + + subroutine new_parallel_job(zmq_to_qp_run_socket,zmq_socket_pull,name_in) + + File: :file:`utils.irp.f` + + Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' + + + + + +.. c:function:: new_zmq_pair_socket + + .. code:: text + + function new_zmq_pair_socket(bind) + + File: :file:`utils.irp.f` + + Socket on which the collector and the main communicate + + + + + +.. c:function:: new_zmq_pull_socket + + .. code:: text + + function new_zmq_pull_socket() + + File: :file:`utils.irp.f` + + Socket on which the results are sent. If thread is 1, use inproc + + + + + +.. c:function:: new_zmq_push_socket + + .. code:: text + + function new_zmq_push_socket(thread) + + File: :file:`utils.irp.f` + + Socket on which the results are sent. If thread is 1, use inproc + + + + + +.. c:function:: new_zmq_sub_socket + + .. code:: text + + function new_zmq_sub_socket() + + File: :file:`utils.irp.f` + + Socket to read the state published by the Task server + + + + + +.. c:function:: new_zmq_to_qp_run_socket + + .. code:: text + + function new_zmq_to_qp_run_socket() + + File: :file:`utils.irp.f` + + Socket on which the qp_run process replies + + + + + +.. c:function:: reset_zmq_addresses + + .. code:: text + + subroutine reset_zmq_addresses + + File: :file:`utils.irp.f` + + Socket which pulls the results (2) + + + + + +.. c:function:: switch_qp_run_to_master + + .. code:: text + + subroutine switch_qp_run_to_master + + File: :file:`utils.irp.f` + + Address of the master qp_run socket Example : tcp://130.120.229.139:12345 + + + + + +.. c:function:: task_done_to_taskserver + + .. code:: text + + integer function task_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: tasks_done_to_taskserver + + .. code:: text + + integer function tasks_done_to_taskserver(zmq_to_qp_run_socket, worker_id, task_id, n_tasks) + + File: :file:`utils.irp.f` + + Get a task from the task server + + + + + +.. c:function:: wait_for_next_state + + .. code:: text + + subroutine wait_for_next_state(state) + + File: :file:`utils.irp.f` + + + + + + + +.. c:function:: wait_for_state + + .. code:: text + + subroutine wait_for_state(state_wait,state) + + File: :file:`utils.irp.f` + + Wait for the ZMQ state to be ready + + + + + +.. c:function:: wait_for_states + + .. code:: text + + subroutine wait_for_states(state_wait,state,n) + + File: :file:`utils.irp.f` + + Wait for the ZMQ state to be ready + + + + + +.. c:function:: zmq_abort + + .. code:: text + + integer function zmq_abort(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Aborts a running parallel computation + + + + + +.. c:function:: zmq_delete_task + + .. code:: text + + integer function zmq_delete_task(zmq_to_qp_run_socket,zmq_socket_pull,task_id,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks + + .. code:: text + + integer function zmq_delete_tasks(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks_async_recv + + .. code:: text + + integer function zmq_delete_tasks_async_recv(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_delete_tasks_async_send + + .. code:: text + + integer function zmq_delete_tasks_async_send(zmq_to_qp_run_socket,zmq_socket_pull,task_id,n_tasks,more) + + File: :file:`utils.irp.f` + + When a task is done, it has to be removed from the list of tasks on the qp_run queue. This guarantees that the results have been received in the pull. + + + + + +.. c:function:: zmq_get8_dvector + + .. code:: text + + integer function zmq_get8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get8_ivector + + .. code:: text + + integer function zmq_get8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_dmatrix + + .. code:: text + + integer function zmq_get_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_dvector + + .. code:: text + + integer function zmq_get_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_i8matrix + + .. code:: text + + integer function zmq_get_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_imatrix + + .. code:: text + + integer function zmq_get_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Get a float vector from the qp_run scheduler + + + + + +.. c:function:: zmq_get_int + + .. code:: text + + integer function zmq_get_int(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_int_nompi + + .. code:: text + + integer function zmq_get_int_nompi(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_get_ivector + + .. code:: text + + integer function zmq_get_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Get a vector of integers from the qp_run scheduler + + + + + +.. c:function:: zmq_port + + .. code:: text + + function zmq_port(ishift) + + File: :file:`utils.irp.f` + + Return the value of the ZMQ port from the corresponding integer + + + + + +.. c:function:: zmq_put8_dvector + + .. code:: text + + integer function zmq_put8_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put8_ivector + + .. code:: text + + integer function zmq_put8_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_put_dmatrix + + .. code:: text + + integer function zmq_put_dmatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_dvector + + .. code:: text + + integer function zmq_put_dvector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_i8matrix + + .. code:: text + + integer function zmq_put_i8matrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_imatrix + + .. code:: text + + integer function zmq_put_imatrix(zmq_to_qp_run_socket, worker_id, name, x, size_x1, size_x2, sze) + + File: :file:`put_get.irp.f` + + Put a float vector on the qp_run scheduler + + + + + +.. c:function:: zmq_put_int + + .. code:: text + + integer function zmq_put_int(zmq_to_qp_run_socket, worker_id, name, x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_put_ivector + + .. code:: text + + integer function zmq_put_ivector(zmq_to_qp_run_socket, worker_id, name, x, size_x) + + File: :file:`put_get.irp.f` + + Put a vector of integers on the qp_run scheduler + + + + + +.. c:function:: zmq_set_running + + .. code:: text + + integer function zmq_set_running(zmq_to_qp_run_socket) + + File: :file:`utils.irp.f` + + Set the job to Running in QP-run + + diff --git a/docs/source/programmers_guide/index_providers.rst b/docs/source/programmers_guide/index_providers.rst index 0e4f11d3..5ba32dcc 100644 --- a/docs/source/programmers_guide/index_providers.rst +++ b/docs/source/programmers_guide/index_providers.rst @@ -311,6 +311,7 @@ Index of Providers * :c:data:`io_mo_two_e_integrals_erf` * :c:data:`iradix_sort` * :c:data:`iradix_sort_big` +* :c:data:`is_zmq_slave` * :c:data:`ks_energy` * :c:data:`l_to_charater` * :c:data:`level_shift` @@ -590,6 +591,7 @@ Index of Providers * :c:data:`psi_selectors_coef_transp` * :c:data:`psi_selectors_diag_h_mat` * :c:data:`psi_selectors_size` +* :c:data:`pt2_collector` * :c:data:`pt2_cw` * :c:data:`pt2_e0_denominator` * :c:data:`pt2_f` @@ -660,6 +662,7 @@ Index of Providers * :c:data:`selection_criterion` * :c:data:`selection_criterion_factor` * :c:data:`selection_criterion_min` +* :c:data:`selection_weight` * :c:data:`shifting_constant` * :c:data:`short_range_hartree` * :c:data:`short_range_hartree_operator` @@ -1178,7 +1181,6 @@ Index of Subroutines/Functions * :c:func:`provide_all_mo_integrals_erf` * :c:func:`provide_everything` * :c:func:`pt2` -* :c:func:`pt2_collector` * :c:func:`pt2_dummy` * :c:func:`pt2_epstein_nesbet` * :c:func:`pt2_epstein_nesbet_2x2` @@ -1196,7 +1198,6 @@ Index of Subroutines/Functions * :c:func:`push_pt2` * :c:func:`push_pt2_results` * :c:func:`push_selection_results` -* :c:func:`qp_ao_ints` * :c:func:`qrpa` * :c:func:`qrpad` * :c:func:`qrpadd` @@ -1227,12 +1228,16 @@ Index of Subroutines/Functions * :c:func:`routine_example_psi_det` * :c:func:`rs_ks_scf` * :c:func:`run` +* :c:func:`run_cipsi` * :c:func:`run_pt2_slave` * :c:func:`run_selection_slave` -* :c:func:`run_wf` +* :c:func:`run_slave_cipsi` +* :c:func:`run_slave_main` +* :c:func:`run_stochastic_cipsi` * :c:func:`s2_u_0` * :c:func:`s2_u_0_nstates` * :c:func:`sabpartial` +* :c:func:`save_energy` * :c:func:`save_erf_two_e_integrals_ao` * :c:func:`save_erf_two_e_integrals_mo` * :c:func:`save_erf_two_e_ints_ao_into_ints_ao` @@ -1261,7 +1266,6 @@ Index of Subroutines/Functions * :c:func:`set_natural_mos` * :c:func:`set_order` * :c:func:`set_order_big` -* :c:func:`slave` * :c:func:`sort` * :c:func:`sort_dets_ab` * :c:func:`sort_dets_ab_v` diff --git a/scripts/module/module_handler.py b/scripts/module/module_handler.py index ae2d563f..97b1022e 100755 --- a/scripts/module/module_handler.py +++ b/scripts/module/module_handler.py @@ -23,7 +23,7 @@ import shutil try: from docopt import docopt - from qp_path import QP_SRC, QP_ROOT, QP_PLUGINS + from qp_path import QP_SRC, QP_ROOT, QP_PLUGINS, QP_EZFIO except ImportError: print "source .quantum_package.rc" raise @@ -205,6 +205,10 @@ if __name__ == '__main__': if arguments['--all']: l_module = [f for f in os.listdir(QP_SRC) if os.path.isdir(os.path.join(QP_SRC, f))] + # Remove all produced ezfio_config files + for filename in os.listdir( os.path.join(QP_EZFIO, "config") ): + os.remove( os.path.join(QP_EZFIO, "config", filename) ) + elif not arguments['']: dir_ = os.getcwd() diff --git a/src/cis/20.cis.bats b/src/cis/20.cis.bats index 4eeb8217..d25edb53 100644 --- a/src/cis/20.cis.bats +++ b/src/cis/20.cis.bats @@ -100,20 +100,22 @@ function run() { run f2.ezfio -198.764357823385 -198.575548537096 -198.575548537096 } -if [[ -z ${TRAVIS} ]] ; then + @test "NH3" { # 14.2066s + [[ -z ${TRAVIS} ]] && skip run nh3.ezfio -56.21783428981829 -55.91997684191139 -55.84753645754046 } @test "[Cu(NH3)4]2+" { # 29.7711s + [[ -z ${TRAVIS} ]] && skip run cu_nh3_4_2plus.ezfio -1862.97958709248 -1862.92454796197 -1862.91130872182 } @test "SO2" { # 32.092s + [[ -z ${TRAVIS} ]] && skip run so2.ezfio -41.5580019075645 -41.38232986913486 -41.35512503680323 } -fi diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats index cd434fd5..fdc959b2 100644 --- a/src/cisd/30.cisd.bats +++ b/src/cisd/30.cisd.bats @@ -54,77 +54,90 @@ function run() { -if [[ -z ${TRAVIS} ]] ; then @test "CH4" { # 19.821s + [[ -n $TRAVIS ]] && skip qp_set_mo_class ch4.ezfio -core "[1]" -act "[2-30]" -del "[31-59]" run ch4.ezfio -40.2403962667047 -39.8433221754964 } @test "SiH3" { # 20.2202s + [[ -n $TRAVIS ]] && skip run sih3.ezfio -5.57096611856522 -5.30950347928823 } @test "NH3" { # 20.6771s + [[ -n $TRAVIS ]] && skip qp_set_mo_class nh3.ezfio -core "[1-4]" -act "[5-72]" run nh3.ezfio -56.2447484835843 -55.9521689975716 } @test "DHNO" { # 24.7077s + [[ -n $TRAVIS ]] && skip qp_set_mo_class dhno.ezfio -core "[1-7]" -act "[8-64]" run dhno.ezfio -130.458814562403 -130.356308303681 } @test "H3COH" { # 24.7248s + [[ -n $TRAVIS ]] && skip run h3coh.ezfio -115.204958752377 -114.755913828245 } @test "[Cu(NH3)4]2+" { # 29.9956s + [[ -n $TRAVIS ]] && skip qp_set_mo_class cu_nh3_4_2plus.ezfio -core "[1-24]" -act "[25-45]" -del "[46-87]" run cu_nh3_4_2plus.ezfio -1862.98659549315 -1862.68813764356 } @test "ClF" { # 30.3225s + [[ -n $TRAVIS ]] && skip run clf.ezfio -559.162476603880 -558.792395927088 } @test "C2H2" { # 35.3324s + [[ -n $TRAVIS ]] && skip qp_set_mo_class c2h2.ezfio -act "[1-30]" -del "[31-36]" run c2h2.ezfio -12.3566731164213 -11.9495394759914 } @test "ClO" { # 37.6949s + [[ -n $TRAVIS ]] && skip run clo.ezfio -534.5404021326773 -534.3818725793897 } @test "F2" { # 45.2078s + [[ -n $TRAVIS ]] && skip qp_set_mo_class f2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-62]" run f2.ezfio -199.056829527539 -198.731828008346 } @test "SO2" { # 47.6922s + [[ -n $TRAVIS ]] && skip qp_set_mo_class so2.ezfio -core "[1-8]" -act "[9-87]" run so2.ezfio -41.5746738710350 -41.3800467740750 } @test "SO" { # 51.2476s + [[ -n $TRAVIS ]] && skip run so.ezfio -26.0131812819785 -25.7053111980226 } @test "CO2" { # 95.3736s + [[ -n $TRAVIS ]] && skip qp_set_mo_class co2.ezfio -core "[1,2]" -act "[3-30]" -del "[31-42]" run co2.ezfio -187.959378390998 -187.432502050556 } @test "N2" { # 133.1814 + [[ -n $TRAVIS ]] && skip qp_set_mo_class n2.ezfio -core "[1,2]" -act "[3-40]" -del "[41-60]" run n2.ezfio -109.275693633982 -108.757794570948 } @test "HCN" { # 133.8696s + [[ -n $TRAVIS ]] && skip qp_set_mo_class hcn.ezfio -core "[1,2]" -act "[3-40]" -del "[41-55]" run hcn.ezfio -93.0776334511721 -92.6684633795506 } -fi diff --git a/src/hartree_fock/10.hf.bats b/src/hartree_fock/10.hf.bats index a64f3570..4d6983e1 100644 --- a/src/hartree_fock/10.hf.bats +++ b/src/hartree_fock/10.hf.bats @@ -99,16 +99,16 @@ function run() { run oh.ezfio -75.42025413469165 } -if [[ -z $TRAVIS ]] ; then @test "[Cu(NH3)4]2+" { # 59.610100 + [[ -n $TRAVIS ]] && skip ezfio set_file cu_nh3_4_2plus.ezfio ezfio set scf_utils thresh_scf 1.e-10 run cu_nh3_4_2plus.ezfio -1862.97590388214 } @test "SO2" { # 71.894900 + [[ -n $TRAVIS ]] && skip run so2.ezfio -41.55800190733211 } -fi diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 00000000..b8f99f5b --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +work From 3c5951c8e12bbffa5792b2a70011de618b9835bb Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Jan 2019 00:50:25 +0100 Subject: [PATCH 4/6] Error in tests --- src/cis/20.cis.bats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cis/20.cis.bats b/src/cis/20.cis.bats index d25edb53..0a2ce66d 100644 --- a/src/cis/20.cis.bats +++ b/src/cis/20.cis.bats @@ -103,17 +103,17 @@ function run() { @test "NH3" { # 14.2066s - [[ -z ${TRAVIS} ]] && skip + [[ -n ${TRAVIS} ]] && skip run nh3.ezfio -56.21783428981829 -55.91997684191139 -55.84753645754046 } @test "[Cu(NH3)4]2+" { # 29.7711s - [[ -z ${TRAVIS} ]] && skip + [[ -n ${TRAVIS} ]] && skip run cu_nh3_4_2plus.ezfio -1862.97958709248 -1862.92454796197 -1862.91130872182 } @test "SO2" { # 32.092s - [[ -z ${TRAVIS} ]] && skip + [[ -n ${TRAVIS} ]] && skip run so2.ezfio -41.5580019075645 -41.38232986913486 -41.35512503680323 } From 7258f78305dc0dc624c492d2a27c1f8dc1bca04b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Jan 2019 01:19:01 +0100 Subject: [PATCH 5/6] Improved KSRS, but tests fail --- src/hartree_fock/fock_matrix_hf.irp.f | 10 ++-------- src/kohn_sham_rs/61.rsks.bats | 17 +++++++++-------- src/kohn_sham_rs/fock_matrix_rs_ks.irp.f | 18 ++++++------------ src/scf_utils/roothaan_hall_scf.irp.f | 2 +- 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/src/hartree_fock/fock_matrix_hf.irp.f b/src/hartree_fock/fock_matrix_hf.irp.f index ff37c29a..39ee1c41 100644 --- a/src/hartree_fock/fock_matrix_hf.irp.f +++ b/src/hartree_fock/fock_matrix_hf.irp.f @@ -34,7 +34,7 @@ ao_two_e_integral_beta_tmp = 0.d0 q = ao_num*ao_num*ao_num*ao_num - !$OMP DO SCHEDULE(static,1) + !$OMP DO SCHEDULE(static,64) do p=1_8,q call two_e_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & @@ -90,8 +90,6 @@ !$OMP END DO NOWAIT !$OMP CRITICAL ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp - !$OMP END CRITICAL - !$OMP CRITICAL ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) @@ -143,13 +141,9 @@ enddo enddo enddo - !$OMP END DO - !$OMP BARRIER + !$OMP END DO NOWAIT !$OMP CRITICAL ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp - !$OMP END CRITICAL - !$OMP BARRIER - !$OMP CRITICAL ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) diff --git a/src/kohn_sham_rs/61.rsks.bats b/src/kohn_sham_rs/61.rsks.bats index 3f6bd98b..82a12444 100644 --- a/src/kohn_sham_rs/61.rsks.bats +++ b/src/kohn_sham_rs/61.rsks.bats @@ -7,26 +7,27 @@ function run() { thresh=1.e-8 qp_edit -c $1 ezfio set_file $1 + rm -rf $1/mo_basis ezfio set scf_utils thresh_scf 1.e-10 - echo "short_range_PBE" > $1/dft_keywords/exchange_functional - echo "short_range_PBE" > $1/dft_keywords/correlation_functional - echo "0.5" > $1/ao_two_e_erf_ints/mu_erf - echo "1" > $1/becke_numerical_grid/grid_type_sgn + ezfio set dft_keywords exchange_functional "short_range_PBE" + ezfio set dft_keywords correlation_functional "short_range_PBE" + ezfio set ao_two_e_erf_ints mu_erf 0.5 + ezfio set becke_numerical_grid grid_type_sgn 1 qp_run rs_ks_scf $1 energy="$(ezfio get kohn_sham_rs energy)" eq $energy $2 $thresh } +@test "HCN" { + run hcn.ezfio -93.26674673761752 +} + @test "H3COH" { run h3coh.ezfio -115.50238225208 } -@test "HCN" { - run hcn.ezfio -93.26674673761752 -} - @test "N2" { run n2.ezfio -109.404692225719 } diff --git a/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f b/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f index 6d3c8956..4c0ddc56 100644 --- a/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f +++ b/src/kohn_sham_rs/fock_matrix_rs_ks.irp.f @@ -35,7 +35,7 @@ ao_two_e_integral_beta_tmp = 0.d0 q = ao_num*ao_num*ao_num*ao_num - !$OMP DO SCHEDULE(dynamic) + !$OMP DO SCHEDULE(static,64) do p=1_8,q call two_e_integrals_index_reverse(kk,ii,ll,jj,p) if ( (kk(1)>ao_num).or. & @@ -91,8 +91,6 @@ !$OMP END DO NOWAIT !$OMP CRITICAL ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp - !$OMP END CRITICAL - !$OMP CRITICAL ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) @@ -111,7 +109,7 @@ integer(key_kind), allocatable :: keys_erf(:) double precision, allocatable :: values_erf(:) - !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PARALLEL DEFAULT(NONE) if (ao_num > 100) & !$OMP PRIVATE(i,j,l,k1,k,integral,ii,jj,kk,ll,i8,keys,values,n_elements_max, & !$OMP n_elements,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& @@ -124,7 +122,7 @@ ao_two_e_integral_alpha_tmp = 0.d0 ao_two_e_integral_beta_tmp = 0.d0 - !$OMP DO SCHEDULE(dynamic,64) + !$OMP DO SCHEDULE(static,1) !DIR$ NOVECTOR do i8=0_8,ao_integrals_map%map_size n_elements = n_elements_max @@ -147,16 +145,14 @@ enddo enddo !$OMP END DO NOWAIT - !$OMP CRITICAL + !$OMP CRITICAL ao_two_e_integral_alpha += ao_two_e_integral_alpha_tmp - !$OMP END CRITICAL - !$OMP CRITICAL ao_two_e_integral_beta += ao_two_e_integral_beta_tmp !$OMP END CRITICAL deallocate(keys,values,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) !$OMP END PARALLEL - !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PARALLEL DEFAULT(NONE) if (ao_num > 100) & !$OMP PRIVATE(i,j,l,k1,k,integral_erf,ii,jj,kk,ll,i8,keys_erf,values_erf,n_elements_max_erf, & !$OMP n_elements_erf,ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp)& !$OMP SHARED(ao_num,SCF_density_matrix_ao_alpha,SCF_density_matrix_ao_beta,& @@ -170,7 +166,7 @@ ao_two_e_integral_alpha_tmp = 0.d0 ao_two_e_integral_beta_tmp = 0.d0 - !$OMP DO SCHEDULE(dynamic,64) + !$OMP DO SCHEDULE(static,1) !DIR$ NOVECTOR do i8=0_8,ao_integrals_erf_map%map_size n_elements_erf = n_elements_max_erf @@ -197,8 +193,6 @@ !$OMP END DO NOWAIT !$OMP CRITICAL ao_two_e_integral_alpha = ao_two_e_integral_alpha + ao_two_e_integral_alpha_tmp - !$OMP END CRITICAL - !$OMP CRITICAL ao_two_e_integral_beta = ao_two_e_integral_beta + ao_two_e_integral_beta_tmp !$OMP END CRITICAL deallocate(ao_two_e_integral_alpha_tmp,ao_two_e_integral_beta_tmp) diff --git a/src/scf_utils/roothaan_hall_scf.irp.f b/src/scf_utils/roothaan_hall_scf.irp.f index ac7339ca..f7da8603 100644 --- a/src/scf_utils/roothaan_hall_scf.irp.f +++ b/src/scf_utils/roothaan_hall_scf.irp.f @@ -289,7 +289,7 @@ END_DOC ! Compute extrapolated Fock matrix - !$OMP PARALLEL DO PRIVATE(i,j,k) DEFAULT(SHARED) + !$OMP PARALLEL DO PRIVATE(i,j,k) DEFAULT(SHARED) if (ao_num > 200) do j=1,ao_num do i=1,ao_num Fock_matrix_AO_(i,j) = 0.d0 From bab351a241611944c657929ad0f958eb8672e6f9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Mon, 7 Jan 2019 01:31:24 +0100 Subject: [PATCH 6/6] Fixed tests --- src/kohn_sham_rs/61.rsks.bats | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/kohn_sham_rs/61.rsks.bats b/src/kohn_sham_rs/61.rsks.bats index 82a12444..8302c7ac 100644 --- a/src/kohn_sham_rs/61.rsks.bats +++ b/src/kohn_sham_rs/61.rsks.bats @@ -7,7 +7,6 @@ function run() { thresh=1.e-8 qp_edit -c $1 ezfio set_file $1 - rm -rf $1/mo_basis ezfio set scf_utils thresh_scf 1.e-10 ezfio set dft_keywords exchange_functional "short_range_PBE" ezfio set dft_keywords correlation_functional "short_range_PBE" @@ -19,20 +18,21 @@ function run() { } -@test "HCN" { - run hcn.ezfio -93.26674673761752 -} - - -@test "H3COH" { +@test "H3COH" { # 11.4566s run h3coh.ezfio -115.50238225208 } -@test "N2" { +@test "N2" { # 18.2364s run n2.ezfio -109.404692225719 } -@test "SiH2_3B1" { - run sih2_3b1.ezfio -290.371745382958 +@test "HCN" { # 28.801s + run hcn.ezfio -93.26674673761752 } +@test "SiH2_3B1" { # 82.3904s + [[ -n $TRAVIS ]] && skip + run sih2_3b1.ezfio -290.372258160809 +} + +