diff --git a/config/ifort.cfg b/config/ifort.cfg index 843e887b..4240b063 100644 --- a/config/ifort.cfg +++ b/config/ifort.cfg @@ -7,7 +7,7 @@ # [COMMON] FC : ifort -LAPACK_LIB : -mkl=parallel +LAPACK_LIB : -mkl=sequential IRPF90 : irpf90 IRPF90_FLAGS : --ninja --align=32 diff --git a/plugins/All_singles/H_apply.irp.f b/plugins/All_singles/H_apply.irp.f index cb0976af..b30fb6d5 100644 --- a/plugins/All_singles/H_apply.irp.f +++ b/plugins/All_singles/H_apply.irp.f @@ -8,6 +8,22 @@ s.unset_skip() s.filter_only_1h1p() print s + +s = H_apply("just_2p") +s.set_selection_pt2("epstein_nesbet_2x2") +s.unset_skip() +s.filter_only_2p() +print s + + +s = H_apply("just_1p") +s.set_selection_pt2("epstein_nesbet_2x2") +s.unset_skip() +s.filter_only_1p() +print s + + + s = H_apply("just_1h_1p_singles",do_double_exc=False) s.set_selection_pt2("epstein_nesbet_2x2") s.unset_skip() diff --git a/plugins/All_singles/all_singles.irp.f b/plugins/All_singles/all_singles.irp.f index ad8648c7..3b5c5cce 100644 --- a/plugins/All_singles/all_singles.irp.f +++ b/plugins/All_singles/all_singles.irp.f @@ -15,7 +15,7 @@ subroutine routine integer :: N_st, degree double precision,allocatable :: E_before(:) integer :: n_det_before - N_st = N_states_diag + N_st = N_states allocate (pt2(N_st), norm_pert(N_st),H_pert_diag(N_st),E_before(N_st)) i = 0 print*,'N_det = ',N_det diff --git a/plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f b/plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f index 46ca9662..3d161141 100644 --- a/plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f +++ b/plugins/FOBOCI/foboci_lmct_mlct_threshold_old.irp.f @@ -110,7 +110,7 @@ subroutine FOBOCI_lmct_mlct_old_thr(iter) call update_density_matrix_osoci enddo - if(.True.)then + if(.False.)then print*,'' print*,'DOING THEN THE MLCT !!' print*,'Threshold_mlct = ',threshold_mlct diff --git a/plugins/Full_CI_ZMQ/README.rst b/plugins/Full_CI_ZMQ/README.rst index d1677a7d..f2ee3e80 100644 --- a/plugins/Full_CI_ZMQ/README.rst +++ b/plugins/Full_CI_ZMQ/README.rst @@ -10,7 +10,6 @@ Needed Modules * `Selectors_full `_ * `Generators_full `_ * `ZMQ `_ -* `Full_CI `_ Documentation ============= @@ -18,19 +17,43 @@ Documentation .. by the `update_README.py` script. -`add_task_to_taskserver `_ +`add_comb `_ + Undocumented + + +`add_task_to_taskserver `_ Get a task from the task server -`add_to_selection_buffer `_ +`add_task_to_taskserver_recv `_ + Get a task from the task server + + +`add_task_to_taskserver_send `_ + Get a task from the task server + + +`add_to_selection_buffer `_ Undocumented -`assert `_ +`assert `_ Undocumented -`connect_to_taskserver `_ +`bitstring_to_list_in_selection `_ + Gives the inidices(+1) of the bits set to 1 in the bit string + + +`comb_step `_ + Undocumented + + +`comb_teeth `_ + Undocumented + + +`connect_to_taskserver `_ Connect to the task server and obtain the worker ID @@ -38,241 +61,135 @@ Documentation Undocumented -`disconnect_from_taskserver `_ +`delete_selection_buffer `_ + Undocumented + + +`disconnect_from_taskserver `_ Disconnect from the task server -`end_parallel_job `_ +`do_carlo `_ + Undocumented + + +`end_parallel_job `_ End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' -`end_zmq_pair_socket `_ +`end_zmq_pair_socket `_ Terminate socket on which the results are sent. -`end_zmq_pull_socket `_ +`end_zmq_pull_socket `_ Terminate socket on which the results are sent. -`end_zmq_push_socket `_ +`end_zmq_push_socket `_ Terminate socket on which the results are sent. -`end_zmq_sub_socket `_ +`end_zmq_sub_socket `_ Terminate socket on which the results are sent. -`end_zmq_to_qp_run_socket `_ +`end_zmq_to_qp_run_socket `_ Terminate the socket from the application to qp_run -`fci_zmq `_ +`fci_zmq `_ Undocumented -`fill_buffer_double `_ +`fill_buffer_double `_ Undocumented -`fill_buffer_single `_ +`first_det_of_comb `_ Undocumented -`full_ci `_ +`first_det_of_teeth `_ Undocumented -`get_d0 `_ +`fragment_count `_ + Number of fragments for the deterministic part + + +`fragment_first `_ Undocumented -`get_d1 `_ +`get_carlo_workbatch `_ Undocumented -`get_d2 `_ +`get_comb `_ Undocumented -`get_m0 `_ +`get_d0 `_ Undocumented -`get_m1 `_ +`get_d1 `_ Undocumented -`get_m2 `_ +`get_d2 `_ Undocumented -`get_mask_phase `_ +`get_first_tooth `_ Undocumented -`get_phase_bi `_ +`get_m0 `_ Undocumented -`get_task_from_taskserver `_ +`get_m1 `_ + Undocumented + + +`get_m2 `_ + Undocumented + + +`get_mask_phase `_ + Undocumented + + +`get_phase_bi `_ + Undocumented + + +`get_task_from_taskserver `_ Get a task from the task server -h_apply_fci - 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. +`initialize_pt2_e0_denominator `_ + If true, initialize pt2_E0_denominator -h_apply_fci_diexc +`integral8 `_ Undocumented -h_apply_fci_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. +`merge_selection_buffers `_ + Merges the selection buffers b1 and b2 into b2 -h_apply_fci_diexcp - Undocumented - - -h_apply_fci_mono - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_fci_mono_diexc - Undocumented - - -h_apply_fci_mono_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_mono_diexcp - Undocumented - - -h_apply_fci_mono_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_no_selection - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_fci_no_selection_diexc - Undocumented - - -h_apply_fci_no_selection_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_no_selection_diexcp - Undocumented - - -h_apply_fci_no_selection_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_no_skip - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_fci_no_skip_diexc - Undocumented - - -h_apply_fci_no_skip_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_no_skip_diexcp - Undocumented - - -h_apply_fci_no_skip_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_pt2 - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_fci_pt2_collector - Collects results from the selection in an array of generators - - -h_apply_fci_pt2_diexc - Undocumented - - -h_apply_fci_pt2_diexcorg - Generate all double excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_pt2_diexcp - Undocumented - - -h_apply_fci_pt2_monoexc - Generate all single excitations of key_in using the bit masks of holes and - particles. - Assume N_int is already provided. - - -h_apply_fci_pt2_slave - Calls H_apply on the HF determinant and selects all connected single and double - excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script. - - -h_apply_fci_pt2_slave_inproc - Computes a buffer using threads - - -h_apply_fci_pt2_slave_tcp - Computes a buffer over the network - - -`integral8 `_ - Undocumented - - -`new_parallel_job `_ +`new_parallel_job `_ Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' -`new_zmq_pair_socket `_ +`new_zmq_pair_socket `_ Socket on which the collector and the main communicate -`new_zmq_pull_socket `_ +`new_zmq_pull_socket `_ Socket on which the results are sent. If thread is 1, use inproc @@ -280,68 +197,120 @@ h_apply_fci_pt2_slave_tcp Socket on which the results are sent. If thread is 1, use inproc -`new_zmq_sub_socket `_ +`new_zmq_sub_socket `_ Socket to read the state published by the Task server -`new_zmq_to_qp_run_socket `_ +`new_zmq_to_qp_run_socket `_ Socket on which the qp_run process replies -`past_d1 `_ +`past_d1 `_ Undocumented -`past_d2 `_ +`past_d2 `_ Undocumented -`provide_everything `_ +`provide_everything `_ Undocumented -`psi_phasemask `_ +`pt2_collector `_ Undocumented -`pull_selection_results `_ +`pt2_cweight `_ Undocumented -`push_selection_results `_ +`pt2_cweight_cache `_ Undocumented -`qp_run_address `_ +`pt2_e0_denominator `_ + E0 in the denominator of the PT2 + + +`pt2_find `_ + Undocumented + + +`pt2_slave `_ + Helper program to compute the PT2 in distributed mode. + + +`pt2_slave_inproc `_ + Undocumented + + +`pt2_slave_tcp `_ + Undocumented + + +`pt2_stoch `_ + Undocumented + + +`pt2_weight `_ + Undocumented + + +`pt2_weight_inv `_ + Inverse of pt2_weight array + + +`pt2_workload `_ + Undocumented + + +`pull_pt2_results `_ + Undocumented + + +`pull_selection_results `_ + Undocumented + + +`push_pt2_results `_ + Undocumented + + +`push_selection_results `_ + Undocumented + + +`qp_run_address `_ Address of the qp_run socket Example : tcp://130.120.229.139:12345 -`reset_zmq_addresses `_ +`reset_zmq_addresses `_ Socket which pulls the results (2) +`run_pt2_slave `_ + Undocumented + + `run_selection_slave `_ Undocumented -`run_wf `_ +`run_wf `_ Undocumented -`select_connected `_ +`select_connected `_ Undocumented -`select_doubles `_ - Undocumented +`select_singles_and_doubles `_ + WARNING /!\ : It is assumed that the generators and selectors are psi_det_sorted -`select_singles `_ - Select determinants connected to i_det by H - - -`selection_collector `_ +`selection_collector `_ Undocumented @@ -349,113 +318,109 @@ h_apply_fci_pt2_slave_tcp Helper program to compute the PT2 in distributed mode. -`selection_slave_inproc `_ +`selection_slave_inproc `_ Undocumented -`selection_slave_tcp `_ +`size_tbc `_ + Size of the tbc array + + +`sort_selection_buffer `_ Undocumented -`sort_selection_buffer `_ +`splash_pq `_ Undocumented -`splash_p `_ +`spot_isinwf `_ Undocumented -`splash_pq `_ - Undocumented - - -`spot_hasbeen `_ - Undocumented - - -`spot_isinwf `_ - Undocumented - - -`switch_qp_run_to_master `_ +`switch_qp_run_to_master `_ Address of the master qp_run socket Example : tcp://130.120.229.139:12345 -`task_done_to_taskserver `_ +`task_done_to_taskserver `_ Get a task from the task server -`update_energy `_ - Update energy when it is received from ZMQ - - -`var_pt2_ratio_run `_ +`wait_for_next_state `_ Undocumented -`wait_for_next_state `_ - Undocumented - - -`wait_for_state `_ +`wait_for_state `_ Wait for the ZMQ state to be ready -`wait_for_states `_ +`wait_for_states `_ Wait for the ZMQ state to be ready -`zmq_context `_ +`zmq_abort `_ + Aborts a running parallel computation + + +`zmq_context `_ Context for the ZeroMQ library -`zmq_delete_task `_ +`zmq_delete_task `_ 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. -`zmq_port `_ +`zmq_lock `_ + Context for the ZeroMQ library + + +`zmq_port `_ Return the value of the ZMQ port from the corresponding integer -`zmq_port_start `_ +`zmq_port_start `_ Address of the qp_run socket Example : tcp://130.120.229.139:12345 -`zmq_selection `_ +`zmq_pt2 `_ Undocumented -`zmq_set_running `_ +`zmq_selection `_ + Undocumented + + +`zmq_set_running `_ Set the job to Running in QP-run -`zmq_socket_pair_inproc_address `_ +`zmq_socket_pair_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_pull_inproc_address `_ +`zmq_socket_pull_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_pull_tcp_address `_ +`zmq_socket_pull_tcp_address `_ Socket which pulls the results (2) -`zmq_socket_push_inproc_address `_ +`zmq_socket_push_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_push_tcp_address `_ +`zmq_socket_push_tcp_address `_ Socket which pulls the results (2) -`zmq_socket_sub_tcp_address `_ +`zmq_socket_sub_tcp_address `_ Socket which pulls the results (2) -`zmq_state `_ +`zmq_state `_ Threads executing work through the ZeroMQ interface diff --git a/plugins/Full_CI_ZMQ/energy.irp.f b/plugins/Full_CI_ZMQ/energy.irp.f index 5f9baf46..281f8eea 100644 --- a/plugins/Full_CI_ZMQ/energy.irp.f +++ b/plugins/Full_CI_ZMQ/energy.irp.f @@ -13,6 +13,8 @@ BEGIN_PROVIDER [ double precision, pt2_E0_denominator, (N_states) ] END_DOC if (initialize_pt2_E0_denominator) then pt2_E0_denominator(1:N_states) = psi_energy(1:N_states) +! call ezfio_get_full_ci_zmq_energy(pt2_E0_denominator(1)) +! pt2_E0_denominator(1) -= nuclear_repulsion ! pt2_E0_denominator(1:N_states) = HF_energy - nuclear_repulsion ! pt2_E0_denominator(1:N_states) = barycentric_electronic_energy(1:N_states) call write_double(6,pt2_E0_denominator(1)+nuclear_repulsion, 'PT2 Energy denominator') diff --git a/plugins/Full_CI_ZMQ/fci_zmq.irp.f b/plugins/Full_CI_ZMQ/fci_zmq.irp.f index 80ba5a7b..e4ae825e 100644 --- a/plugins/Full_CI_ZMQ/fci_zmq.irp.f +++ b/plugins/Full_CI_ZMQ/fci_zmq.irp.f @@ -10,8 +10,9 @@ program fci_zmq double precision :: hf_energy_ref logical :: has - double precision :: relative_error - relative_error=1.d-3 + double precision :: relative_error, absolute_error + relative_error=PT2_relative_error + absolute_error=PT2_absolute_error pt2 = -huge(1.d0) threshold_davidson_in = threshold_davidson @@ -56,6 +57,7 @@ program fci_zmq double precision :: threshold_selectors_save, threshold_generators_save threshold_selectors_save = threshold_selectors threshold_generators_save = threshold_generators + double precision :: error correlation_energy_ratio = 0.d0 @@ -74,7 +76,7 @@ program fci_zmq threshold_selectors = 1.d0 threshold_generators = 1d0 SOFT_TOUCH threshold_selectors threshold_generators - call ZMQ_pt2(CI_energy, pt2,relative_error) ! Stochastic PT2 + call ZMQ_pt2(CI_energy, pt2,relative_error,absolute_error,error) ! Stochastic PT2 threshold_selectors = threshold_selectors_save threshold_generators = threshold_generators_save SOFT_TOUCH threshold_selectors threshold_generators @@ -102,7 +104,11 @@ program fci_zmq print*,'State ',k print *, 'PT2 = ', pt2(k) print *, 'E = ', CI_energy(k) - print *, 'E+PT2'//pt2_string//' = ', CI_energy(k)+pt2(k) + if (N_states==1) then + print *, 'E+PT2'//pt2_string//' = ', CI_energy(k)+pt2(k), ' +/- ', error + else + print *, 'E+PT2'//pt2_string//' = ', CI_energy(k)+pt2(k) + endif enddo print *, '-----' @@ -145,6 +151,7 @@ program fci_zmq call diagonalize_CI call save_wavefunction call ezfio_set_full_ci_zmq_energy(CI_energy(1)) + call ezfio_set_full_ci_zmq_energy(CI_energy(1)) call dump_fci_iterations_value(N_det,CI_energy(1),pt2(1)) ! This call automatically appends data endif @@ -154,7 +161,7 @@ program fci_zmq threshold_selectors = 1.d0 threshold_generators = 1d0 SOFT_TOUCH threshold_selectors threshold_generators - call ZMQ_pt2(CI_energy, pt2, relative_error) ! Stochastic PT2 + call ZMQ_pt2(CI_energy, pt2,relative_error,absolute_error,error) ! Stochastic PT2 threshold_selectors = threshold_selectors_save threshold_generators = threshold_generators_save SOFT_TOUCH threshold_selectors threshold_generators @@ -164,9 +171,27 @@ program fci_zmq SOFT_TOUCH threshold_selectors threshold_generators call ZMQ_selection(0, pt2) ! Deterministic PT2 endif + call ezfio_set_full_ci_zmq_energy(CI_energy(1)) call ezfio_set_full_ci_zmq_energy_pt2(CI_energy(1)+pt2(1)) call dump_fci_iterations_value(N_det,CI_energy(1),pt2(1)) ! This call automatically appends data endif + print *, 'N_det = ', N_det + print *, 'N_states = ', N_states + print*, 'correlation_ratio = ', correlation_energy_ratio + + do k=1, N_states + print*,'State ',k + print *, 'PT2 = ', pt2(k) + print *, 'E = ', CI_energy(k) + if (N_states==1) then + print *, 'E+PT2'//pt2_string//' = ', CI_energy(k)+pt2(k), ' +/- ', error + else + print *, 'E+PT2'//pt2_string//' = ', CI_energy(k)+pt2(k) + endif + print *, 'error = ',error + enddo + + print *, '-----' end diff --git a/plugins/Full_CI_ZMQ/pt2_stoch.irp.f b/plugins/Full_CI_ZMQ/pt2_stoch.irp.f index 9cb972e7..cd96a906 100644 --- a/plugins/Full_CI_ZMQ/pt2_stoch.irp.f +++ b/plugins/Full_CI_ZMQ/pt2_stoch.irp.f @@ -16,7 +16,7 @@ subroutine run integer :: n_det_before, to_select double precision :: threshold_davidson_in - double precision :: E_CI_before, relative_error + double precision :: E_CI_before, relative_error, absolute_error, eqt allocate (pt2(N_states)) pt2 = 0.d0 @@ -24,13 +24,14 @@ subroutine run E_CI_before = pt2_E0_denominator(1) + nuclear_repulsion threshold_selectors = 1.d0 threshold_generators = 1d0 - relative_error = -1.d-3 - call ZMQ_pt2(E_CI_before, pt2, relative_error) + relative_error = 1.d-9 + absolute_error = 1.d-9 + call ZMQ_pt2(E_CI_before, pt2, relative_error, absolute_error, eqt) print *, 'Final step' print *, 'N_det = ', N_det print *, 'PT2 = ', pt2 print *, 'E = ', E_CI_before - print *, 'E+PT2 = ', E_CI_before+pt2 + print *, 'E+PT2 = ', E_CI_before+pt2, ' +/- ', eqt print *, '-----' call ezfio_set_full_ci_zmq_energy_pt2(E_CI_before+pt2(1)) end diff --git a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f index afeb08fd..9abb2c1e 100644 --- a/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f +++ b/plugins/Full_CI_ZMQ/pt2_stoch_routines.irp.f @@ -3,7 +3,7 @@ BEGIN_PROVIDER [ integer, fragment_first ] fragment_first = first_det_of_teeth(1) END_PROVIDER -subroutine ZMQ_pt2(E, pt2,relative_error) +subroutine ZMQ_pt2(E, pt2,relative_error, absolute_error, eqt) use f77_zmq use selection_types @@ -13,8 +13,8 @@ subroutine ZMQ_pt2(E, pt2,relative_error) integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_to_qp_run_socket2 type(selection_buffer) :: b integer, external :: omp_get_thread_num - double precision, intent(in) :: relative_error, E - double precision, intent(out) :: pt2(N_states) + double precision, intent(in) :: relative_error, absolute_error, E + double precision, intent(out) :: pt2(N_states),eqt double precision, allocatable :: pt2_detail(:,:), comb(:) @@ -93,7 +93,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error) !$OMP PRIVATE(i) i = omp_get_thread_num() if (i==0) then - call pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, sum2above, Nabove, relative_error, pt2) + call pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, sum2above, Nabove, relative_error, absolute_error, pt2,eqt) else call pt2_slave_inproc(i) endif @@ -144,7 +144,7 @@ subroutine pt2_slave_inproc(i) call run_pt2_slave(1,i,pt2_e0_denominator) end -subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, sum2above, Nabove, relative_error, pt2) +subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, sum2above, Nabove, relative_error, absolute_error, pt2,eqt) use f77_zmq use selection_types use bitmasks @@ -153,11 +153,11 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, integer, intent(in) :: Ncomb double precision, intent(inout) :: pt2_detail(N_states, N_det_generators) - double precision, intent(in) :: comb(Ncomb), relative_error, E + double precision, intent(in) :: comb(Ncomb), relative_error, absolute_error, E logical, intent(inout) :: computed(N_det_generators) integer, intent(in) :: tbc(0:size_tbc) double precision, intent(inout) :: sumabove(comb_teeth), sum2above(comb_teeth), Nabove(comb_teeth) - double precision, intent(out) :: pt2(N_states) + double precision, intent(out) :: pt2(N_states),eqt type(selection_buffer), intent(inout) :: b @@ -249,7 +249,7 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, end if end do - double precision :: E0, avg, eqt, prop + double precision :: E0, avg, prop call do_carlo(tbc, Ncomb+1-firstTBDcomb, comb(firstTBDcomb), pt2_detail, actually_computed, sumabove, sum2above, Nabove) firstTBDcomb = int(Nabove(1)) - orgTBDcomb + 1 if(Nabove(1) < 5d0) cycle @@ -266,10 +266,11 @@ subroutine pt2_collector(E, b, tbc, comb, Ncomb, computed, pt2_detail, sumabove, eqt = 0.d0 endif call wall_time(time) - if (dabs(eqt/avg) < relative_error) then + if ( (dabs(eqt/avg) < relative_error) .or. (dabs(eqt) < absolute_error)) then ! Termination pt2(1) = avg print '(G10.3, 2X, F16.10, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' +! print*, 'Final statistical error = ',eqt call zmq_abort(zmq_to_qp_run_socket) else if (Nabove(tooth) > Nabove_old) then diff --git a/plugins/Hartree_Fock/README.rst b/plugins/Hartree_Fock/README.rst index 2e329163..5cb05735 100644 --- a/plugins/Hartree_Fock/README.rst +++ b/plugins/Hartree_Fock/README.rst @@ -33,16 +33,16 @@ Documentation .. by the `update_README.py` script. -`ao_bi_elec_integral_alpha `_ +`ao_bi_elec_integral_alpha `_ Alpha Fock matrix in AO basis set -`ao_bi_elec_integral_beta `_ +`ao_bi_elec_integral_beta `_ Alpha Fock matrix in AO basis set `create_guess `_ - Create an MO guess if no MOs are present in the EZFIO directory + Create a MO guess if no MOs are present in the EZFIO directory `damping_scf `_ @@ -53,34 +53,38 @@ Documentation Diagonal Fock matrix in the MO basis -`diagonal_fock_matrix_mo_sum `_ +`diagonal_fock_matrix_mo_sum `_ diagonal element of the fock matrix calculated as the sum over all the interactions with all the electrons in the RHF determinant diagonal_Fock_matrix_mo_sum(i) = sum_{j=1, N_elec} 2 J_ij -K_ij +`eigenvalues_fock_matrix_ao `_ + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + +`eigenvectors_fock_matrix_ao `_ + Eigenvalues and eigenvectors of the Fock matrix over the AO basis + + `eigenvectors_fock_matrix_mo `_ Diagonal Fock matrix in the MO basis -`fock_matrix_alpha_ao `_ - Alpha Fock matrix in AO basis set +`extrapolate_fock_matrix `_ + Compute the extrapolated Fock matrix using the DIIS procedure -`fock_matrix_alpha_mo `_ - Fock matrix on the MO basis - - -`fock_matrix_ao `_ +`fock_matrix_ao `_ Fock matrix in AO basis set -`fock_matrix_beta_ao `_ +`fock_matrix_ao_alpha `_ Alpha Fock matrix in AO basis set -`fock_matrix_beta_mo `_ - Fock matrix on the MO basis +`fock_matrix_ao_beta `_ + Alpha Fock matrix in AO basis set `fock_matrix_diag_mo `_ @@ -115,10 +119,26 @@ Documentation .br -`fock_mo_to_ao `_ +`fock_matrix_mo_alpha `_ + Fock matrix on the MO basis + + +`fock_matrix_mo_beta `_ + Fock matrix on the MO basis + + +`fock_mo_to_ao `_ Undocumented +`fps_spf_matrix_ao `_ + Commutator FPS - SPF + + +`fps_spf_matrix_mo `_ + Commutator FPS - SPF in MO basis + + `guess `_ Undocumented @@ -135,7 +155,7 @@ Documentation S^-1 Beta density matrix in the AO basis x S^-1 -`hf_energy `_ +`hf_energy `_ Hartree-Fock energy @@ -143,23 +163,35 @@ Documentation Build the MOs using the extended Huckel model -`level_shift `_ +`level_shift `_ Energy shift on the virtual MOs to improve SCF convergence -`mo_guess_type `_ +`localize_mos `_ + Undocumented + + +`max_dim_diis `_ + Maximum size of the DIIS extrapolation procedure + + +`mo_guess_type `_ Initial MO guess. Can be [ Huckel | HCore ] -`n_it_scf_max `_ +`n_it_scf_max `_ Maximum number of SCF iterations -`no_oa_or_av_opt `_ +`no_oa_or_av_opt `_ If true, skip the (inactive+core) --> (active) and the (active) --> (virtual) orbital rotations within the SCF procedure -`run `_ +`roothaan_hall_scf `_ + Roothaan-Hall algorithm for SCF Hartree-Fock calculation + + +`run `_ Run SCF calculation @@ -170,6 +202,26 @@ Documentation optional: mo_basis.mo_coef -`thresh_scf `_ - Threshold on the convergence of the Hartree Fock energy +`scf_algorithm `_ + Type of SCF algorithm used. Possible choices are [ Simple | DIIS] + + +`thresh_scf `_ + Threshold on the convergence of the Hartree Fock energy. + + +`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. + + +`threshold_diis_nonzero `_ + If threshold_DIIS is zero, choose sqrt(thresh_scf) + + +`threshold_overlap_ao_eigenvalues `_ + Threshold on the magnitude of the smallest eigenvalues of the overlap matrix in the AO basis + + +`x_matrix_ao `_ + Matrix X = S^{-1/2} obtained by SVD diff --git a/plugins/MR_wf_analysis/analyze_one_det_connections.irp.f b/plugins/MR_wf_analysis/analyze_one_det_connections.irp.f new file mode 100644 index 00000000..4f3bd964 --- /dev/null +++ b/plugins/MR_wf_analysis/analyze_one_det_connections.irp.f @@ -0,0 +1,171 @@ +program test_wf + implicit none + read_wf = .True. + touch read_wf + call routine +end + + + +subroutine routine + use bitmasks + implicit none + integer :: iref + print*, 'which reference slater determinant dou you want ?' + read(5,*)iref + integer :: i + double precision :: delta_e,h0i + double precision :: accu_e, hiiref,accu_coef,hij + double precision, allocatable :: contrib(:) + integer, allocatable :: iorder(:) + integer, allocatable :: idx(:) + allocate(idx(0:N_det)) + print*, '***********************' + print*, '***********************' + print*, '***********************' + print*, 'You chose that SD :' + call debug_det(psi_det(1,1,iref),N_int) + call get_excitation_degree(ref_bitmask,psi_det(1,1,iref),degree,N_int) + call i_H_j(ref_bitmask,psi_det(1,1,iref),N_int,h0i) + call i_H_j(psi_ref(1,1,iref),psi_det(1,1,iref),N_int,hii) + call get_excitation(ref_bitmask,psi_det(1,1,iref),exc,degree,phase,N_int) + call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + + print*,'degree =',degree + print*,'phase =',phase + if(degree == 1)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + else if (degree ==2)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + print*,'s2',s2 + print*,'h2,p2 = ',h2,p2 + endif + if(degree.ne.0)then + delta_e = hii - ref_bitmask_energy + if(h0i.ne.0.d0)then + if (delta_e > 0.d0) then + coef_2_2 = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * h0i * h0i ))/ h0i + else + coef_2_2 = 0.5d0 * (delta_e + dsqrt(delta_e * delta_e + 4.d0 * h0i * h0i )) /h0i + endif + endif + endif + print*,'h0i =',h0i + print*,'delta E =',delta_e + print*,'coef 2x2 =',coef_2_2!*psi_coef(1,1) + print*,'amplitude =',psi_coef(iref,1)/psi_coef(1,1) + print*, '***********************' + print*, '***********************' + print*, '***********************' + + call filter_connected_i_H_psi0(psi_det,psi_det(1,1,iref),N_int,N_det,idx) + + + call i_H_j(psi_det(1,1,iref),psi_det(1,1,iref),N_int,hiiref) + print*, 'passed the connection browsing' + allocate(contrib(idx(0)-1),iorder(idx(0)-1)) + + accu_e = 0.d0 + accu_coef = 0.d0 + print*, iref + print*, idx(0) + do i = 1, idx(0) + contrib(i) = 0.d0 + iorder(i) = idx(i) + if(idx(i)==iref)then + cycle + else + call get_excitation_degree(psi_det(1,1,iref),psi_det(1,1,idx(i)),degree,N_int) + if(degree.gt.2)cycle + call i_H_j(psi_det(1,1,iref),psi_det(1,1,idx(i)),N_int,hij) + accu_coef += psi_coef(idx(i),1) * hij / (var_energy_mr(1) - hiiref) + contrib(i) = -dabs(psi_coef(idx(i),1) * hij / (var_energy_mr(1) - hiiref)) + accu_e += psi_coef(idx(i),1) * hij + endif + enddo + print*, 'passed the contributions ' + + integer :: degree + integer :: exc(0:2,2,2) + double precision :: phase + integer :: h1,h2,p1,p2,s1,s2 + accu_e += psi_coef(iref,1) * hiiref + accu_e = accu_e / psi_coef(iref,1) + print*, psi_coef(iref,1),accu_coef + print*, var_energy_mr(1),accu_e + call dsort(contrib,iorder,idx(0)-1) + print*, 'passed sorting the contributions' + accu_coef = 0.d0 + double precision :: accu_second_order,coef_2_2, hii + accu_second_order = 0.d0 + + print*, '' + do i = 1, idx(0) + if (iorder(i)==iref)cycle + call get_excitation_degree(psi_det(1,1,iref),psi_det(1,1,iorder(i)),degree,N_int) + if(degree.gt.2)cycle + print*, '' + print*, '===============================================' + print*, ' i ',i,iorder(i) + call debug_det(psi_det(1,1,iorder(i)),N_int) + call i_H_j(psi_det(1,1,iorder(i)),psi_det(1,1,iorder(i)),N_int,hii) + call i_H_j(psi_det(1,1,iref),psi_det(1,1,iorder(i)),N_int,hij) + call get_excitation(psi_det(1,1,iref),psi_det(1,1,iorder(i)),exc,degree,phase,N_int) + call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + print*,'Info with respect to the chosen ref determinant' + print*,'degree =',degree + if(degree == 1)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + else + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + print*,'s2',s2 + print*,'h2,p2 = ',h2,p2 + endif + print*,'coef =',psi_coef(iorder(i),1) + print*,'phase =',phase + print*,'hij =',hij + print*,'contrib =',psi_coef(iorder(i),1) * hij / (var_energy_mr(1) - hiiref) + print*,'relative contrib =',psi_coef(iorder(i),1) * hij / (var_energy_mr(1) - hiiref)/psi_coef(iref,1) + accu_coef += psi_coef(iorder(i),1) * hij / (var_energy_mr(1) - hiiref) + + print*,'Info with respect to the HF-like determinant ' + call get_excitation_degree(ref_bitmask,psi_det(1,1,iorder(i)),degree,N_int) + call i_H_j(ref_bitmask,psi_det(1,1,iorder(i)),N_int,h0i) + call get_excitation(ref_bitmask,psi_det(1,1,iorder(i)),exc,degree,phase,N_int) + call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + print*,'degree =',degree + if(degree == 1)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + else if (degree ==2)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + print*,'s2',s2 + print*,'h2,p2 = ',h2,p2 + endif + if(degree.ne.0)then + delta_e = hii - ref_bitmask_energy + if(h0i.ne.0.d0)then + if (delta_e > 0.d0) then + coef_2_2 = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * h0i * h0i ))/ h0i + else + coef_2_2 = 0.5d0 * (delta_e + dsqrt(delta_e * delta_e + 4.d0 * h0i * h0i )) /h0i + endif + endif + print*,'h0i =',h0i + print*,'coef 2x2 =',coef_2_2*psi_coef(1,1) + print*,'delta E =',delta_e + print*,'sec order conrib =',coef_2_2 * hij/(var_energy_mr(1) - hiiref) * psi_coef(1,1) + accu_second_order += coef_2_2 * hij/(var_energy_mr(1) - hiiref) * psi_coef(1,1) + endif + enddo + print*, 'Total comparison ....' + print*, psi_coef(iref,1),accu_coef,accu_second_order + + +end + diff --git a/plugins/MR_wf_analysis/analyze_sr_wf.irp.f b/plugins/MR_wf_analysis/analyze_sr_wf.irp.f new file mode 100644 index 00000000..d5a2ef71 --- /dev/null +++ b/plugins/MR_wf_analysis/analyze_sr_wf.irp.f @@ -0,0 +1,126 @@ +program printwf + implicit none + read_wf = .True. + touch read_wf + print*,'ref_bitmask_energy = ',ref_bitmask_energy + call routine + +end + +subroutine routine + implicit none + integer :: i + integer :: degree + double precision :: hij,hii,coef_1,h00 + integer :: exc(0:2,2,2) + double precision :: phase + integer :: h1,p1,h2,p2,s1,s2 + double precision :: get_mo_bielec_integral + double precision :: norm_mono_a,norm_mono_b + double precision :: norm_mono_a_2,norm_mono_b_2 + double precision :: norm_mono_a_pert_2,norm_mono_b_pert_2 + double precision :: norm_mono_a_pert,norm_mono_b_pert + double precision :: delta_e,coef_2_2 + norm_mono_a = 0.d0 + norm_mono_b = 0.d0 + norm_mono_a_2 = 0.d0 + norm_mono_b_2 = 0.d0 + norm_mono_a_pert = 0.d0 + norm_mono_b_pert = 0.d0 + norm_mono_a_pert_2 = 0.d0 + norm_mono_b_pert_2 = 0.d0 + integer :: number_of_holes,nh + integer :: number_of_particles,np + double precision :: accu_e_corr(0:2,0:2) + accu_e_corr = 0.d0 + do i = 1, min(10000,N_det) + print*,'' + print*,'i = ',i + call debug_det(psi_det(1,1,i),N_int) + nh = number_of_holes(psi_det(1,1,i)) + np = number_of_particles(psi_det(1,1,i)) + call get_excitation_degree(psi_det(1,1,i),psi_det(1,1,1),degree,N_int) + print*,'degree = ',degree + if(degree == 0)then + print*,'Reference determinant ' + call i_H_j(psi_det(1,1,i),psi_det(1,1,i),N_int,h00) + else + call i_H_j(psi_det(1,1,i),psi_det(1,1,i),N_int,hii) + call i_H_j(psi_det(1,1,1),psi_det(1,1,i),N_int,hij) + delta_e = hii - h00 + coef_1 = hij/(h00-hii) + if(hij.ne.0.d0)then + if (delta_e > 0.d0) then + coef_2_2 = 0.5d0 * (delta_e - dsqrt(delta_e * delta_e + 4.d0 * hij * hij ))/ hij + else + coef_2_2 = 0.5d0 * (delta_e + dsqrt(delta_e * delta_e + 4.d0 * hij * hij )) /hij + endif + endif + call get_excitation(psi_det(1,1,1),psi_det(1,1,i),exc,degree,phase,N_int) + call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) + print*,'phase = ',phase + if(degree == 1)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + if(s1 == 1)then + norm_mono_a += dabs(psi_coef(i,1)/psi_coef(1,1)) + norm_mono_a_2 += dabs(psi_coef(i,1)/psi_coef(1,1))**2 + norm_mono_a_pert += dabs(coef_1) + norm_mono_a_pert_2 += dabs(coef_1)**2 + else + norm_mono_b += dabs(psi_coef(i,1)/psi_coef(1,1)) + norm_mono_b_2 += dabs(psi_coef(i,1)/psi_coef(1,1))**2 + norm_mono_b_pert += dabs(coef_1) + norm_mono_b_pert_2 += dabs(coef_1)**2 + endif +! print*,'< h | Ka| p > = ',get_mo_bielec_integral(h1,list_act(1),list_act(1),p1,mo_integrals_map) + double precision :: hmono,hdouble + call i_H_j_verbose(psi_det(1,1,1),psi_det(1,1,i),N_int,hij,hmono,hdouble) + print*,'hmono = ',hmono + print*,'hdouble = ',hdouble + print*,'hmono+hdouble = ',hmono+hdouble + print*,'hij = ',hij + else + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + print*,'s2',s2 + print*,'h2,p2 = ',h2,p2 +! print*,'< h | Ka| p > = ',get_mo_bielec_integral(h1,h2,p1,p2,mo_integrals_map) + endif + print*,'nh,np = ',nh,np + + print*,' = ',hij + print*,'Delta E = ',h00-hii + print*,'coef pert (1) = ',coef_1 + print*,'coef 2x2 = ',coef_2_2 + print*,'Delta E_corr = ',psi_coef(i,1)/psi_coef(1,1) * hij + if(nh<3.and.np<3)then + accu_e_corr(nh,np) += psi_coef(i,1)/psi_coef(1,1) * hij + endif + endif + print*,'amplitude = ',psi_coef(i,1)/psi_coef(1,1) + + enddo + + + print*,'' + print*,'' + do nh = 0, 2 + do np = 0,2 + print*, 'e_corr = ',nh,np,accu_e_corr(nh,np) + enddo + enddo + print*,'' + print*,'L1 norm of mono alpha = ',norm_mono_a + print*,'L1 norm of mono beta = ',norm_mono_b + print*, '---' + print*,'L2 norm of mono alpha = ',norm_mono_a_2 + print*,'L2 norm of mono beta = ',norm_mono_b_2 + print*, '-- perturbative mono' + print*,'' + print*,'L1 norm of pert alpha = ',norm_mono_a_pert + print*,'L1 norm of pert beta = ',norm_mono_b_pert + print*,'L2 norm of pert alpha = ',norm_mono_a_pert_2 + print*,'L2 norm of pert beta = ',norm_mono_b_pert_2 + +end diff --git a/plugins/Perturbation/EZFIO.cfg b/plugins/Perturbation/EZFIO.cfg index 43b375cf..7120e4a6 100644 --- a/plugins/Perturbation/EZFIO.cfg +++ b/plugins/Perturbation/EZFIO.cfg @@ -11,6 +11,18 @@ doc: The selection process stops when the largest PT2 (for all the state) is low interface: ezfio,provider,ocaml default: 0.0001 +[PT2_relative_error] +type: Normalized_float +doc: Stop stochastic PT2 when the relative error is smaller than PT2_relative_error +interface: ezfio,provider,ocaml +default: 0.001 + +[PT2_absolute_error] +type: Threshold +doc: Stop stochastic PT2 when the statistical error is smaller than PT2_absolute_error +interface: ezfio,provider,ocaml +default: 0.00001 + [correlation_energy_ratio_max] type: Normalized_float doc: The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules) @@ -30,3 +42,24 @@ doc: Thresholds on selectors (fraction of the norm) for final PT2 calculation interface: ezfio,provider,ocaml default: 1. + +[correlation_energy_ratio_max] +type: Normalized_float +doc: The selection process stops at a fixed correlation ratio (useful for getting same accuracy between molecules) + Defined as (E_CI-E_HF)/ (E_CI+PT2 - E_HF). (E_HF) is not required. +interface: ezfio,provider,ocaml +default: 1.00 + +[threshold_generators_pt2] +type: Threshold +doc: Thresholds on generators (fraction of the norm) for final PT2 calculation +interface: ezfio,provider,ocaml +default: 0.999 + +[threshold_selectors_pt2] +type: Threshold +doc: Thresholds on selectors (fraction of the norm) for final PT2 calculation +interface: ezfio,provider,ocaml +default: 1. + + diff --git a/plugins/Properties/delta_rho.irp.f b/plugins/Properties/delta_rho.irp.f index 8fd08246..11375b87 100644 --- a/plugins/Properties/delta_rho.irp.f +++ b/plugins/Properties/delta_rho.irp.f @@ -1,14 +1,29 @@ - BEGIN_PROVIDER [integer, N_z_pts] + BEGIN_PROVIDER [integer, spin_dens_coord] + implicit none + BEGIN_DOC + coordinate on which you are going to plot the spin density + and integrate over the ohters + spin_dens_coord = 1 === X + spin_dens_coord = 2 === Y + spin_dens_coord = 3 === Z + END_DOC + spin_dens_coord = 3 + END_PROVIDER + + + BEGIN_PROVIDER [double precision, delta_z] &BEGIN_PROVIDER [double precision, z_min] &BEGIN_PROVIDER [double precision, z_max] -&BEGIN_PROVIDER [double precision, delta_z] implicit none z_min = 0.d0 z_max = 10.d0 - delta_z = 0.005d0 + delta_z = 0.05d0 +END_PROVIDER + +BEGIN_PROVIDER [integer, N_z_pts] + implicit none N_z_pts = int( (z_max - z_min)/delta_z ) print*,'N_z_pts = ',N_z_pts - END_PROVIDER @@ -80,7 +95,7 @@ BEGIN_PROVIDER [ double precision, ao_integrated_delta_rho_all_points, (ao_num_a !$OMP PRIVATE(i,j,n,l,A_center,power_A,B_center,power_B,accu_z, & !$OMP overlap_x,overlap_y,overlap_z,overlap,c,alpha,beta) & !$OMP SHARED(ao_num,nucl_coord,ao_nucl,ao_power,ao_prim_num,ao_expo_ordered_transp,ao_coef_normalized_ordered_transp, & - !$OMP ao_integrated_delta_rho_all_points,N_z_pts,dim1,i_z,z,delta_z) + !$OMP ao_integrated_delta_rho_all_points,N_z_pts,dim1,i_z,z,delta_z,spin_dens_coord) do j=1,ao_num A_center(1) = nucl_coord( ao_nucl(j), 1 ) A_center(2) = nucl_coord( ao_nucl(j), 2 ) @@ -104,7 +119,13 @@ BEGIN_PROVIDER [ double precision, ao_integrated_delta_rho_all_points, (ao_num_a call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) - accu_z += c* overlap_x * overlap_y * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta) + if(spin_dens_coord ==1 )then + accu_z += c* overlap_y * overlap_z * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + else if (spin_dens_coord ==2 )then + accu_z += c* overlap_x * overlap_z * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + else if (spin_dens_coord ==3 )then + accu_z += c* overlap_x * overlap_y * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + endif enddo enddo ao_integrated_delta_rho_all_points(i,j,i_z) = accu_z @@ -144,11 +165,12 @@ BEGIN_PROVIDER [ double precision, ao_integrated_delta_rho_one_point, (ao_num_al double precision :: z,SABpartial,accu_z dim1=100 z = z_one_point + provide delta_z !$OMP PARALLEL DO DEFAULT(none) & !$OMP PRIVATE(i,j,n,l,A_center,power_A,B_center,power_B,accu_z, & !$OMP overlap_x,overlap_y,overlap_z,overlap,c,alpha,beta) & !$OMP SHARED(ao_num,nucl_coord,ao_nucl,ao_power,ao_prim_num,ao_expo_ordered_transp,ao_coef_normalized_ordered_transp, & - !$OMP ao_integrated_delta_rho_one_point,dim1,z,delta_z) + !$OMP ao_integrated_delta_rho_one_point,dim1,z,delta_z,spin_dens_coord) do j=1,ao_num A_center(1) = nucl_coord( ao_nucl(j), 1 ) A_center(2) = nucl_coord( ao_nucl(j), 2 ) @@ -172,7 +194,13 @@ BEGIN_PROVIDER [ double precision, ao_integrated_delta_rho_one_point, (ao_num_al call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) - accu_z += c* overlap_x * overlap_y * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta) + if(spin_dens_coord ==1 )then + accu_z += c* overlap_y * overlap_z * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + else if (spin_dens_coord ==2 )then + accu_z += c* overlap_x * overlap_z * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + else if (spin_dens_coord ==3 )then + accu_z += c* overlap_x * overlap_y * SABpartial(z,z+delta_z,A_center,B_center,power_A,power_B,alpha,beta,spin_dens_coord) + endif enddo enddo ao_integrated_delta_rho_one_point(i,j) = accu_z diff --git a/plugins/Properties/print_spin_density.irp.f b/plugins/Properties/print_spin_density.irp.f index b9cbe4e8..a31f625e 100644 --- a/plugins/Properties/print_spin_density.irp.f +++ b/plugins/Properties/print_spin_density.irp.f @@ -14,7 +14,7 @@ subroutine routine double precision, allocatable :: aos_array(:) allocate(aos_array(ao_num)) r = 0.d0 - r(1) = z_min + r(spin_dens_coord) = z_min do i = 1, N_z_pts call give_all_aos_at_r(r,aos_array) accu = 0.d0 @@ -28,8 +28,8 @@ subroutine routine accu_beta += one_body_dm_ao_beta(k,j) * tmp enddo enddo - r(1) += delta_z - write(33,'(100(f16.10,X))')r(1),accu,accu_alpha,accu_beta + r(spin_dens_coord) += delta_z + write(33,'(100(f16.10,X))')r(spin_dens_coord),accu,accu_alpha,accu_beta enddo diff --git a/plugins/loc_cele/loc.f b/plugins/loc_cele/loc.f index edc3aa7a..ed8b9a76 100644 --- a/plugins/loc_cele/loc.f +++ b/plugins/loc_cele/loc.f @@ -18,7 +18,7 @@ C zprt=.true. niter=1000000 - conv=1.d-8 + conv=1.d-10 C niter=1000000 C conv=1.d-6 diff --git a/plugins/loc_cele/loc_cele.irp.f b/plugins/loc_cele/loc_cele.irp.f index e95c4a7e..fa035bd1 100644 --- a/plugins/loc_cele/loc_cele.irp.f +++ b/plugins/loc_cele/loc_cele.irp.f @@ -101,10 +101,12 @@ program loc_rasorb cmoref = 0.d0 irot = 0 - irot(1,1) = 11 - irot(2,1) = 12 - cmoref(15,1,1) = 1.d0 ! - cmoref(14,2,1) = 1.d0 ! + irot(1,1) = 48 + irot(2,1) = 49 + cmoref(21,1,1) = -0.7d0 ! + cmoref(27,1,1) = -0.4d0 ! + cmoref(22,2,1) = 0.7d0 ! + cmoref(28,2,1) = 0.4d0 ! ! ESATRIENE with 3 bonding and anti bonding orbitals ! First bonding orbital for esa @@ -147,22 +149,22 @@ program loc_rasorb ! cmoref(64,6,1) = 1.d0 ! ! cmoref(83,6,1) =-1.d0 ! - ! ESATRIENE with 1 central bonding and anti bonding orbitals - ! AND 4 radical orbitals - ! First radical orbital - cmoref(7,1,1) = 1.d0 ! - ! Second radical orbital - cmoref(26,2,1) = 1.d0 ! - ! First bonding orbital - cmoref(45,3,1) = 1.d0 ! - cmoref(64,3,1) = 1.d0 ! - ! Third radical orbital for esa - cmoref(83,4,1) = 1.d0 ! - ! Fourth radical orbital for esa - cmoref(102,5,1) = 1.d0 ! - ! First anti bonding orbital - cmoref(45,6,1) = 1.d0 ! - cmoref(64,6,1) =-1.d0 ! + !! ESATRIENE with 1 central bonding and anti bonding orbitals + !! AND 4 radical orbitals + !! First radical orbital + !cmoref(7,1,1) = 1.d0 ! + !! Second radical orbital + !cmoref(26,2,1) = 1.d0 ! + !! First bonding orbital + !cmoref(45,3,1) = 1.d0 ! + !cmoref(64,3,1) = 1.d0 ! + !! Third radical orbital for esa + !cmoref(83,4,1) = 1.d0 ! + !! Fourth radical orbital for esa + !cmoref(102,5,1) = 1.d0 ! + !! First anti bonding orbital + !cmoref(45,6,1) = 1.d0 ! + !cmoref(64,6,1) =-1.d0 ! do i = 1, nrot(1) diff --git a/src/AO_Basis/README.rst b/src/AO_Basis/README.rst index d67a3a63..1f3f67b9 100644 --- a/src/AO_Basis/README.rst +++ b/src/AO_Basis/README.rst @@ -96,19 +96,19 @@ Documentation Transposed ao_expo_ordered -`ao_l `_ +`ao_l `_ ao_l = l value of the AO: a+b+c in x^a y^b z^c -`ao_l_char `_ +`ao_l_char `_ ao_l = l value of the AO: a+b+c in x^a y^b z^c -`ao_l_char_space `_ +`ao_l_char_space `_ Undocumented -`ao_l_max `_ +`ao_l_max `_ ao_l = l value of the AO: a+b+c in x^a y^b z^c @@ -157,7 +157,7 @@ Documentation Powers of x, y and z for each AO -`ao_power_index `_ +`ao_power_index `_ Unique index given to a triplet of powers: .br 1/2 (l-n_x)*(l-n_x+1) + n_z + 1 @@ -171,7 +171,7 @@ Documentation Undocumented -`ao_prim_num_max_align `_ +`ao_prim_num_max_align `_ Number of primitives per atomic orbital aligned @@ -223,11 +223,11 @@ Documentation gives the values of aos at a given point r -`l_to_charater `_ +`l_to_charater `_ character corresponding to the "L" value of an AO orbital -`n_aos_max `_ +`n_aos_max `_ Number of AOs per atom @@ -239,21 +239,21 @@ Documentation Undocumented -`nucl_aos `_ +`nucl_aos `_ List of AOs attached on each atom -`nucl_list_shell_aos `_ +`nucl_list_shell_aos `_ Index of the shell type Aos and of the corresponding Aos Per convention, for P,D,F and G AOs, we take the index of the AO with the the corresponding power in the "X" axis -`nucl_n_aos `_ +`nucl_n_aos `_ Number of AOs per atom -`nucl_num_shell_aos `_ +`nucl_num_shell_aos `_ Index of the shell type Aos and of the corresponding Aos Per convention, for P,D,F and G AOs, we take the index of the AO with the the corresponding power in the "X" axis diff --git a/src/Bitmask/README.rst b/src/Bitmask/README.rst index fbf13d22..c8c6863b 100644 --- a/src/Bitmask/README.rst +++ b/src/Bitmask/README.rst @@ -72,16 +72,24 @@ Documentation Transform a bit string to a string for printing -`cas_bitmask `_ +`cas_bitmask `_ Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference) -`closed_shell_ref_bitmask `_ +`closed_shell_ref_bitmask `_ Undocumented -`core_bitmask `_ - Core orbitals bitmask +`core_bitmask `_ + Core + deleted orbitals bitmask + + +`core_inact_act_bitmask_4 `_ + Undocumented + + +`core_inact_virt_bitmask `_ + Reunion of the inactive and virtual bitmasks `debug_det `_ @@ -94,15 +102,15 @@ Documentation hexadecimal representation. -`full_ijkl_bitmask `_ +`full_ijkl_bitmask `_ Bitmask to include all possible MOs -`full_ijkl_bitmask_4 `_ +`full_ijkl_bitmask_4 `_ Undocumented -`generators_bitmask `_ +`generators_bitmask `_ Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). .br @@ -122,7 +130,7 @@ Documentation .br -`generators_bitmask_restart `_ +`generators_bitmask_restart `_ Bitmasks for generator determinants. (N_int, alpha/beta, hole/particle, generator). .br @@ -142,15 +150,15 @@ Documentation .br -`hf_bitmask `_ +`hf_bitmask `_ Hartree Fock bit mask -`i_bitmask_gen `_ +`i_bitmask_gen `_ Current bitmask for the generators -`inact_bitmask `_ +`inact_bitmask `_ 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 @@ -159,7 +167,7 @@ Documentation n_virt_orb : Number of virtual orbitals -`inact_virt_bitmask `_ +`inact_virt_bitmask `_ Reunion of the inactive and virtual bitmasks @@ -175,27 +183,43 @@ Documentation Initialization of the generators_bitmask to the restart bitmask -`is_a_1h `_ +`is_a_1h `_ Undocumented -`is_a_1h1p `_ +`is_a_1h1p `_ Undocumented -`is_a_1h2p `_ +`is_a_1h2p `_ Undocumented -`is_a_1p `_ +`is_a_1p `_ Undocumented -`is_a_2p `_ +`is_a_2h `_ Undocumented -`is_a_two_holes_two_particles `_ +`is_a_2h1p `_ + Undocumented + + +`is_a_2p `_ + Undocumented + + +`is_a_two_holes_two_particles `_ + 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 + + +`is_i_in_virtual `_ Undocumented @@ -207,19 +231,70 @@ Documentation Undocumented -`list_act `_ - list of active orbitals +`list_act `_ + list_act(i) = index of the ith active orbital + .br + 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 -`list_core `_ +`list_act_reverse `_ + list_act(i) = index of the ith active orbital + .br + 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 + + +`list_core `_ List of the core orbitals that are never excited in post CAS method -`list_inact `_ +`list_core_inact `_ + Undocumented + + +`list_core_inact_act `_ + Undocumented + + +`list_core_inact_act_reverse `_ + Undocumented + + +`list_core_inact_reverse `_ + Undocumented + + +`list_core_reverse `_ + List of the core orbitals that are never excited in post CAS method + + +`list_inact `_ 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 + + +`list_inact_reverse `_ + 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 `list_to_bitstring `_ @@ -227,11 +302,30 @@ Documentation occupations "list(N_int*bit_kind_size,2) -`list_virt `_ +`list_virt `_ 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 + + +`list_virt_reverse `_ + 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 `modify_bitmasks_for_hole `_ @@ -249,27 +343,39 @@ Documentation the electrons to the orbital i_part -`n_act_orb `_ +`n_act_orb `_ number of active orbitals -`n_cas_bitmask `_ +`n_cas_bitmask `_ Number of bitmasks for CAS -`n_core_orb `_ - Core orbitals bitmask +`n_core_inact_act_orb `_ + Reunion of the core, inactive and active bitmasks -`n_generators_bitmask `_ +`n_core_inact_orb `_ + Undocumented + + +`n_core_orb `_ + Core + deleted orbitals bitmask + + +`n_core_orb_allocate `_ + Undocumented + + +`n_generators_bitmask `_ Number of bitmasks for generators -`n_generators_bitmask_restart `_ +`n_generators_bitmask_restart `_ Number of bitmasks for generators -`n_inact_orb `_ +`n_inact_orb `_ 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 @@ -278,11 +384,15 @@ Documentation n_virt_orb : Number of virtual orbitals +`n_inact_orb_allocate `_ + Undocumented + + `n_int `_ Number of 64-bit integers needed to represent determinants as binary strings -`n_virt_orb `_ +`n_virt_orb `_ 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 @@ -291,20 +401,24 @@ Documentation n_virt_orb : Number of virtual orbitals -`number_of_holes `_ +`n_virt_orb_allocate `_ Undocumented -`number_of_holes_verbose `_ - Undocumented +`number_of_holes `_ + Function that returns the number of holes in the inact space -`number_of_particles `_ - Undocumented +`number_of_holes_verbose `_ + function that returns the number of holes in the inact space -`number_of_particles_verbose `_ - Undocumented +`number_of_particles `_ + function that returns the number of particles in the virtual space + + +`number_of_particles_verbose `_ + function that returns the number of particles in the inact space `print_det `_ @@ -331,20 +445,24 @@ Documentation Subroutine to print the content of a determinant using the '+-' notation -`ref_bitmask `_ +`ref_bitmask `_ Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask -`reunion_of_bitmask `_ +`reunion_of_bitmask `_ Reunion of the inactive, active and virtual bitmasks -`reunion_of_cas_inact_bitmask `_ +`reunion_of_cas_inact_bitmask `_ Reunion of the inactive, active and virtual bitmasks -`reunion_of_core_inact_bitmask `_ - Reunion of the inactive, active and virtual bitmasks +`reunion_of_core_inact_act_bitmask `_ + Reunion of the core, inactive and active bitmasks + + +`reunion_of_core_inact_bitmask `_ + Reunion of the core and inactive and virtual bitmasks `set_bitmask_hole_as_input `_ @@ -357,11 +475,11 @@ Documentation as the input_bimask -`unpaired_alpha_electrons `_ +`unpaired_alpha_electrons `_ Bitmask reprenting the unpaired alpha electrons in the HF_bitmask -`virt_bitmask `_ +`virt_bitmask `_ 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 @@ -369,3 +487,7 @@ Documentation in post CAS methods n_virt_orb : Number of virtual orbitals + +`virt_bitmask_4 `_ + Undocumented + diff --git a/src/Bitmask/bitmask_cas_routines.irp.f b/src/Bitmask/bitmask_cas_routines.irp.f index 87a02d10..6682700f 100644 --- a/src/Bitmask/bitmask_cas_routines.irp.f +++ b/src/Bitmask/bitmask_cas_routines.irp.f @@ -13,11 +13,22 @@ integer function number_of_holes(key_in) + popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )& + popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) ) else if(N_int == 2)then + integer(bit_kind) :: det_tmp(N_int,2) +! det_tmp(:,:) = 0_bit_kind +! det_tmp(1,1) = iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))))!, reunion_of_core_inact_bitmask(1,1) +! det_tmp(1,2) = reunion_of_core_inact_bitmask(1,1) +!iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))))!, reunion_of_core_inact_bitmask(1,1) +! call debug_det(key_in,N_int) +! call debug_det(inact_bitmask, N_int) +! call debug_det(core_bitmask, N_int) +! call debug_det(det_tmp, N_int) number_of_holes = number_of_holes & + popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )& + popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )& + popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) )& + popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) ) +! print*, number_of_holes +! pause else if(N_int == 3)then number_of_holes = number_of_holes & + popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )& @@ -512,6 +523,7 @@ logical function is_a_1p(key_in) integer(bit_kind), intent(in) :: key_in(N_int,2) integer :: number_of_particles, number_of_holes is_a_1p = .False. + print*,number_of_holes(key_in), number_of_particles(key_in) if(number_of_holes(key_in).eq.0 .and. number_of_particles(key_in).eq.1)then is_a_1p = .True. endif diff --git a/src/Davidson/README.rst b/src/Davidson/README.rst index 15e9b46a..62a7495b 100644 --- a/src/Davidson/README.rst +++ b/src/Davidson/README.rst @@ -18,65 +18,27 @@ Documentation Eigenvectors/values of the CI matrix -`ci_eigenvectors_mono `_ - Eigenvectors/values of the CI matrix - - `ci_eigenvectors_s2 `_ Eigenvectors/values of the CI matrix -`ci_eigenvectors_s2_mono `_ - Eigenvectors/values of the CI matrix - - `ci_electronic_energy `_ Eigenvectors/values of the CI matrix -`ci_electronic_energy_mono `_ - Eigenvectors/values of the CI matrix - - `ci_energy `_ N_states lowest eigenvalues of the CI matrix -`dav_det `_ - Temporary arrays for parallel davidson - .br - Touched in davidson_miniserver_get - - -`dav_size `_ - Size of the arrays for Davidson - .br - Touched in davidson_miniserver_get - - -`dav_ut `_ - Temporary arrays for parallel davidson - .br - Touched in davidson_miniserver_get - - -`davidson_add_task `_ +`davidson_collector `_ Undocumented -`davidson_collect `_ - Undocumented - - -`davidson_collector `_ - Undocumented - - -`davidson_converged `_ +`davidson_converged `_ True if the Davidson algorithm is converged -`davidson_criterion `_ +`davidson_criterion `_ Can be : [ energy | residual | both | wall_time | cpu_time | iterations ] @@ -122,12 +84,12 @@ Documentation Initial guess vectors are not necessarily orthonormal -`davidson_diag_hjj_sjj `_ +`davidson_diag_hjj_sjj `_ Davidson diagonalization with specific diagonal elements of the H matrix .br H_jj : specific diagonal H matrix elements to diagonalize de Davidson .br - S2_jj : specific diagonal S^2 matrix elements + S2_out : Output : s^2 .br dets_in : bitmasks corresponding to determinants .br @@ -166,43 +128,15 @@ Documentation Initial guess vectors are not necessarily orthonormal -`davidson_init `_ +`davidson_pull_results `_ Undocumented -`davidson_iter_max `_ - Max number of Davidson iterations - - -`davidson_miniserver_end `_ +`davidson_push_results `_ Undocumented -`davidson_miniserver_get `_ - Undocumented - - -`davidson_miniserver_run `_ - Undocumented - - -`davidson_process `_ - Undocumented - - -`davidson_pull_results `_ - Undocumented - - -`davidson_push_results `_ - Undocumented - - -`davidson_run `_ - Undocumented - - -`davidson_run_slave `_ +`davidson_run_slave `_ Undocumented @@ -210,41 +144,52 @@ Documentation Undocumented -`davidson_slave_inproc `_ +`davidson_slave_inproc `_ Undocumented -`davidson_slave_tcp `_ +`davidson_slave_tcp `_ Undocumented -`davidson_slave_work `_ +`davidson_slave_work `_ Undocumented -`davidson_sze_max `_ - Max number of Davidson sizes +`davidson_sze_max `_ + Number of micro-iterations before re-contracting `det_inf `_ Ordering function for determinants +`diag_and_save `_ + Undocumented + + `diagonalize_ci `_ Replace the coefficients of the CI states by the coefficients of the eigenstates of the CI matrix -`diagonalize_ci_mono `_ - Replace the coefficients of the CI states by the coefficients of the - eigenstates of the CI matrix +`disk_based_davidson `_ + If true, disk space is used to store the vectors + + +`distributed_davidson `_ + If true, use the distributed algorithm + + +`find_reference `_ + Undocumented `first_guess `_ Select all the determinants with the lowest energy as a starting point. -`h_s2_u_0_nstates `_ +`h_s2_u_0_nstates `_ Computes v_0 = H|u_0> and s_0 = S^2 |u_0> .br n : number of determinants @@ -254,31 +199,94 @@ Documentation S2_jj : array of -`h_u_0_nstates `_ +`h_s2_u_0_nstates_openmp `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + Assumes that the determinants are in psi_det + .br + istart, iend, ishift, istep are used in ZMQ parallelization. + + +`h_s2_u_0_nstates_openmp_work `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_1 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_2 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_3 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_4 `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_openmp_work_n_int `_ + Computes v_t = H|u_t> and s_t = S^2 |u_t> + .br + Default should be 1,N_det,0,1 + + +`h_s2_u_0_nstates_test `_ + Undocumented + + +`h_s2_u_0_nstates_zmq `_ + Computes v_0 = H|u_0> and s_0 = S^2 |u_0> + .br + n : number of determinants + .br + H_jj : array of + .br + S2_jj : array of + + +`h_u_0_nstates `_ Computes v_0 = H|u_0> .br n : number of determinants .br H_jj : array of + .br -`max_blocksize `_ +`n_states_diag `_ + Number of states to consider during the Davdison diagonalization + + +`nthreads_davidson `_ + Number of threads for Davdison + + +`print_h_matrix_restart `_ Undocumented -`n_states_diag `_ - n_states_diag - - -`provide_everything `_ +`provide_everything `_ Undocumented -`psi_energy `_ +`psi_energy `_ Energy of the current wave function -`shortcut_ `_ +`routine `_ Undocumented @@ -294,29 +302,21 @@ Documentation Uncodumented : TODO -`sort_idx_ `_ - Undocumented - - -`sorted_ `_ - Undocumented +`state_following `_ + If true, the states are re-ordered to match the input states `tamiser `_ Uncodumented : TODO -`threshold_davidson `_ +`threshold_davidson `_ Thresholds of Davidson's algorithm -`u_0_h_u_0 `_ +`u_0_h_u_0 `_ Computes e_0 = / .br n : number of determinants .br - -`version_ `_ - Undocumented - diff --git a/src/Determinants/README.rst b/src/Determinants/README.rst index 9ad0f1a3..9fac5112 100644 --- a/src/Determinants/README.rst +++ b/src/Determinants/README.rst @@ -15,31 +15,35 @@ Documentation .. by the `update_README.py` script. -`a_operator `_ +`a_operator `_ Needed for diag_H_mat_elem -`abs_psi_coef_max `_ +`abs_psi_coef_max `_ Max and min values of the coefficients -`abs_psi_coef_min `_ +`abs_psi_coef_min `_ Max and min values of the coefficients -`ac_operator `_ +`ac_operator `_ Needed for diag_H_mat_elem -`apply_excitation `_ +`add_values_to_two_body_dm_map `_ + Adds values to the map of two_body_dm according to some bitmask + + +`apply_excitation `_ Undocumented -`apply_hole `_ +`apply_hole `_ Undocumented -`apply_holes `_ +`apply_holes `_ Undocumented @@ -47,11 +51,15 @@ Documentation Undocumented -`apply_particle `_ +`apply_particle `_ Undocumented -`apply_particles `_ +`apply_particles `_ + Undocumented + + +`au0_h_au0 `_ Undocumented @@ -59,12 +67,12 @@ Documentation Energy of the reference bitmask used in Slater rules -`bitstring_to_list_ab `_ +`bitstring_to_list_ab `_ Gives the inidices(+1) of the bits set to 1 in the bit string For alpha/beta determinants -`bitstring_to_list_ab_old `_ +`bitstring_to_list_ab_old `_ Gives the inidices(+1) of the bits set to 1 in the bit string For alpha/beta determinants @@ -74,10 +82,42 @@ Documentation determinant. F_00 is = E0. -`cisd `_ +`clear_bit_to_integer `_ Undocumented +`compute_diag_two_body_dm_ab `_ + Undocumented + + +`compute_diag_two_body_dm_ab_act `_ + Undocumented + + +`compute_diag_two_body_dm_ab_core `_ + Undocumented + + +`compute_diag_two_body_dm_ab_core_act `_ + Undocumented + + +`compute_extra_diag_two_body_dm_ab `_ + compute the extra diagonal contribution to the alpha/bet two body density at r1, r2 + + +`compute_extra_diag_two_body_dm_ab_act `_ + compute the extra diagonal contribution to the two body density at r1, r2 + involving ONLY THE ACTIVE PART, which means that the four index of the excitations + involved in the two body density matrix are ACTIVE + + +`compute_extra_diag_two_body_dm_ab_core_act `_ + compute the extra diagonal contribution to the two body density at r1, r2 + involving ONLY THE ACTIVE PART, which means that the four index of the excitations + involved in the two body density matrix are ACTIVE + + `connected_to_ref `_ Undocumented @@ -86,29 +126,33 @@ Documentation Undocumented -`copy_h_apply_buffer_to_wf `_ +`copy_h_apply_buffer_to_wf `_ Copies the H_apply buffer to psi_coef. After calling this subroutine, N_det, psi_det and psi_coef need to be touched -`create_microlist `_ +`copy_psi_bilinear_to_psi `_ + Overwrites psi_det and psi_coef with the wf in bilinear order + + +`create_microlist `_ Undocumented -`create_minilist `_ +`create_minilist `_ Undocumented -`create_minilist_find_previous `_ +`create_minilist_find_previous `_ Undocumented -`create_wf_of_psi_bilinear_matrix `_ +`create_wf_of_psi_bilinear_matrix `_ Generate a wave function containing all possible products of alpha and beta determinants -`decode_exc `_ +`decode_exc `_ Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles @@ -116,31 +160,29 @@ Documentation degree : Degree of excitation -`decode_exc_int2 `_ +`decode_exc_spin `_ Decodes the exc arrays returned by get_excitation. h1,h2 : Holes p1,p2 : Particles - s1,s2 : Spins (1:alpha, 2:beta) - degree : Degree of excitation -`det_alpha_norm `_ +`det_alpha_norm `_ Norm of the alpha and beta spin determinants in the wave function: .br ||Da||_i \sum_j C_{ij}**2 -`det_beta_norm `_ +`det_beta_norm `_ Norm of the alpha and beta spin determinants in the wave function: .br ||Da||_i \sum_j C_{ij}**2 -`det_coef `_ +`det_coef `_ det_coef -`det_occ `_ +`det_occ `_ det_occ @@ -152,11 +194,11 @@ Documentation Transform a determinant to an occupation pattern -`detcmp `_ +`detcmp `_ Undocumented -`deteq `_ +`deteq `_ Undocumented @@ -164,16 +206,24 @@ Documentation Diagonalization algorithm (Davidson or Lapack) -`diag_h_mat_elem `_ +`diag_h_mat_elem `_ Computes -`diag_h_mat_elem_fock `_ +`diag_h_mat_elem_au0_h_au0 `_ + Computes for any determinant i. Used for wave functions with an additional electron. + + +`diag_h_mat_elem_fock `_ Computes when i is at most a double excitation from a reference. -`diagonalize_s2_betweenstates `_ +`diag_s_mat_elem `_ + Returns + + +`diagonalize_s2_betweenstates `_ You enter with nstates vectors in u_0 that may be coupled by S^2 The subroutine diagonalize the S^2 operator in the basis of these states. The vectors that you obtain in output are no more coupled by S^2, @@ -193,6 +243,15 @@ Documentation i_ok = -1 == the excitation is not possible +`do_spin_flip `_ + flip the spin ispin in the orbital i_flip + on key_in + ispin = 1 == alpha + ispin = 2 == beta + i_ok = 1 == the flip is possible + i_ok = -1 == the flip is not possible + + `double_exc_bitmask `_ double_exc_bitmask(:,1,i) is the bitmask for holes of excitation 1 double_exc_bitmask(:,2,i) is the bitmask for particles of excitation 1 @@ -201,7 +260,7 @@ Documentation for a given couple of hole/particle excitations i. -`doubly_occ_empty_in_couple `_ +`doubly_occ_empty_in_couple `_ n_couples is the number of couples of orbitals to be checked couples(i,1) = first orbital of the ith couple couples(i,2) = second orbital of the ith couple @@ -211,7 +270,7 @@ Documentation an orbital doubly occupied in the ith couple -`doubly_occ_empty_in_couple_and_no_hund_elsewhere `_ +`doubly_occ_empty_in_couple_and_no_hund_elsewhere `_ n_couples is the number of couples of orbitals to be checked couples(i,1) = first orbital of the ith couple couples(i,2) = second orbital of the ith couple @@ -221,15 +280,15 @@ Documentation an orbital doubly occupied in the ith couple -`expected_s2 `_ +`expected_s2 `_ Expected value of S2 : S*(S+1) -`fill_h_apply_buffer_no_selection `_ +`fill_h_apply_buffer_no_selection `_ Fill the H_apply buffer with determiants for CISD -`filter_connected `_ +`filter_connected `_ Filters out the determinants that are not connected by H .br returns the array idx which contains the index of the @@ -241,7 +300,7 @@ Documentation idx(0) is the number of determinants that interact with key1 -`filter_connected_i_h_psi0 `_ +`filter_connected_i_h_psi0 `_ returns the array idx which contains the index of the .br determinants in the array key1 that interact @@ -251,7 +310,7 @@ Documentation idx(0) is the number of determinants that interact with key1 -`filter_connected_i_h_psi0_sc2 `_ +`filter_connected_i_h_psi0_sc2 `_ standard filter_connected_i_H_psi but returns in addition .br the array of the index of the non connected determinants to key1 @@ -263,23 +322,180 @@ Documentation to repeat the excitations -`flip_generators `_ +`filter_not_connected `_ + Returns the array idx which contains the index of the + .br + determinants in the array key1 that DO NOT interact + .br + via the H operator with key2. + .br + idx(0) is the number of determinants that DO NOT interact with key1 + + +`flip_generators `_ Undocumented -`generate_all_alpha_beta_det_products `_ +`fock_operator_closed_shell_ref_bitmask `_ + Undocumented + + +`generate_all_alpha_beta_det_products `_ Create a wave function from all possible alpha x beta determinants -`get_double_excitation `_ +`get_all_spin_doubles `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_doubles_1 `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_doubles_2 `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_doubles_3 `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_doubles_4 `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_doubles_n_int `_ + .br + Returns the indices of all the double excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles_1 `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles_2 `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles_3 `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles_4 `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_all_spin_singles_and_doubles `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_and_doubles_1 `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_and_doubles_2 `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_and_doubles_3 `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_and_doubles_4 `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_and_doubles_n_int `_ + .br + Returns the indices of all the single and double excitations in the list of + unique alpha determinants. + .br + /!\ : The buffer is transposed ! + .br + + +`get_all_spin_singles_n_int `_ + .br + Returns the indices of all the single excitations in the list of + unique alpha determinants. + .br + + +`get_double_excitation `_ Returns the two excitation operators between two doubly excited determinants and the phase -`get_double_excitation_phase `_ +`get_double_excitation_phase `_ Undocumented -`get_excitation `_ +`get_double_excitation_spin `_ + Returns the two excitation operators between two doubly excited spin-determinants + and the phase + + +`get_excitation `_ Returns the excitation operators between two determinants and the phase @@ -287,15 +503,47 @@ Documentation Returns the excitation degree between two determinants -`get_excitation_degree_vector `_ +`get_excitation_degree_spin `_ + Returns the excitation degree between two determinants + + +`get_excitation_degree_vector `_ Applies get_excitation_degree to an array of determinants +`get_excitation_degree_vector_double_alpha_beta `_ + Applies get_excitation_degree to an array of determinants and return only the mono excitations + and the connections through exchange integrals + + +`get_excitation_degree_vector_mono `_ + Applies get_excitation_degree to an array of determinants and return only the mono excitations + + +`get_excitation_degree_vector_mono_or_exchange `_ + Applies get_excitation_degree to an array of determinants and return only the mono excitations + and the connections through exchange integrals + + +`get_excitation_degree_vector_mono_or_exchange_verbose `_ + Applies get_excitation_degree to an array of determinants and return only the mono excitations + and the connections through exchange integrals + + +`get_excitation_spin `_ + Returns the excitation operators between two determinants and the phase + + +`get_get_two_body_dm_ab_map_elements `_ + Returns multiple elements of the \rho_{ijkl}^{\alpha \beta }, all + i for j,k,l fixed. + + `get_index_in_psi_det_alpha_unique `_ Returns the index of the determinant in the ``psi_det_alpha_unique`` array -`get_index_in_psi_det_beta_unique `_ +`get_index_in_psi_det_beta_unique `_ Returns the index of the determinant in the ``psi_det_beta_unique`` array @@ -303,32 +551,45 @@ Documentation Returns the index of the determinant in the ``psi_det_sorted_bit`` array -`get_mono_excitation `_ +`get_mono_excitation `_ Returns the excitation operator between two singly excited determinants and the phase -`get_occ_from_key `_ +`get_mono_excitation_from_fock `_ + Undocumented + + +`get_mono_excitation_spin `_ + Returns the excitation operator between two singly excited determinants and the phase + + +`get_occ_from_key `_ Returns a list of occupation numbers from a bitstring -`get_phase `_ +`get_phase `_ Returns the phase between key1 and key2 -`get_s2 `_ +`get_s2 `_ Returns -`get_uj_s2_ui `_ +`get_two_body_dm_ab_map_element `_ + Returns one value of the wo body density matrix \rho_{ijkl}^{\alpha \beta} defined as : + \rho_{ijkl}^{\alpha \beta } = <\Psi|a^{\dagger}_{i\alpha} a^{\dagger}_{j\beta} a_{k\beta} a_{l\alpha}|\Psi> + + +`get_uj_s2_ui `_ returns the matrix elements of S^2 "s2(i,j)" between the "nstates" states psi_coefs_tmp(:,i) and psi_coefs_tmp(:,j) -`getmobiles `_ +`getmobiles `_ Undocumented -`give_index_of_doubly_occ_in_active_space `_ +`give_index_of_doubly_occ_in_active_space `_ Undocumented @@ -350,19 +611,39 @@ Documentation Undocumented -`i_h_j `_ +`h_u_0_stored `_ + Computes v_0 = H|u_0> + .br + n : number of determinants + .br + uses the big_matrix_stored array + + +`i_h_j `_ Returns where i and j are determinants -`i_h_j_phase_out `_ +`i_h_j_double_alpha_beta `_ + Returns where i and j are determinants differing by an opposite-spin double excitation + + +`i_h_j_double_spin `_ + Returns where i and j are determinants differing by a same-spin double excitation + + +`i_h_j_mono_spin `_ + Returns where i and j are determinants differing by a single excitation + + +`i_h_j_phase_out `_ Returns where i and j are determinants -`i_h_j_verbose `_ +`i_h_j_verbose `_ Returns where i and j are determinants -`i_h_psi `_ +`i_h_psi `_ Computes = \sum_J c_J . .br Uses filter_connected_i_H_psi0 to get all the |J> to which |i> @@ -371,14 +652,14 @@ Documentation minilists -`i_h_psi_minilist `_ +`i_h_psi_minilist `_ Computes = \sum_J c_J . .br Uses filter_connected_i_H_psi0 to get all the |J> to which |i> is connected. The |J> are searched in short pre-computed lists. -`i_h_psi_sc2 `_ +`i_h_psi_sc2 `_ for the various Nstate .br returns in addition @@ -392,7 +673,7 @@ Documentation to repeat the excitations -`i_h_psi_sc2_verbose `_ +`i_h_psi_sc2_verbose `_ for the various Nstate .br returns in addition @@ -406,11 +687,11 @@ Documentation to repeat the excitations -`i_h_psi_sec_ord `_ +`i_h_psi_sec_ord `_ for the various Nstates -`i_s2_psi_minilist `_ +`i_s2_psi_minilist `_ Computes = \sum_J c_J . .br Uses filter_connected_i_H_psi0 to get all the |J> to which |i> @@ -428,6 +709,14 @@ Documentation idx_non_cas gives the indice of the determinant in psi_det. +`insert_into_two_body_dm_ab_map `_ + Create new entry into two_body_dm_ab_map, or accumulate in an existing entry + + +`insert_into_two_body_dm_big_array `_ + Undocumented + + `is_connected_to `_ Undocumented @@ -444,11 +733,16 @@ Documentation True if the determinant ``det`` is in the wave function +`is_spin_flip_possible `_ + returns .True. if the spin-flip of spin ispin in the orbital i_flip is possible + on key_in + + `kinetic_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`make_s2_eigenfunction `_ +`make_s2_eigenfunction `_ Undocumented @@ -456,15 +750,20 @@ Documentation Maximum degree of excitation in the wf +`mo_energy_expval `_ + Third index is spin. + Fourth index is 1:creation, 2:annihilation + + `mono_elec_ref_bitmask_energy `_ Energy of the reference bitmask used in Slater rules -`n_closed_shell `_ +`n_closed_shell `_ Undocumented -`n_closed_shell_cas `_ +`n_closed_shell_cas `_ Undocumented @@ -485,18 +784,22 @@ Documentation determinants. idx_cas gives the indice of the CAS determinant in psi_det. -`n_det_max `_ +`n_det_max `_ Max number of determinants in the wave function -`n_det_max_jacobi `_ +`n_det_max_jacobi `_ Maximum number of determinants diagonalized by Jacobi -`n_det_max_property `_ +`n_det_max_property `_ Max number of determinants in the wave function when you select for a given property +`n_det_max_stored `_ + Maximum number of determinants for which the full H matrix is stored. Be careful, the memory requested scales as 10*n_det_max_stored**2. For instance, 90000 determinants represent a matrix of size 60 Gb. + + `n_det_non_cas `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. @@ -507,13 +810,13 @@ Documentation Number of double excitation bitmasks -`n_occ_pattern `_ +`n_occ_pattern `_ array of the occ_pattern present in the wf - psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupation - psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation + psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupations + psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupations -`n_open_shell `_ +`n_open_shell `_ Undocumented @@ -521,11 +824,11 @@ Documentation Number of single excitation bitmasks -`n_states `_ +`n_states `_ Number of states to consider -`neutral_no_hund_in_couple `_ +`neutral_no_hund_in_couple `_ n_couples is the number of couples of orbitals to be checked couples(i,1) = first orbital of the ith couple couples(i,2) = second orbital of the ith couple @@ -543,7 +846,7 @@ Documentation Return an integer*8 corresponding to a determinant index for searching -`occ_pattern_to_dets `_ +`occ_pattern_to_dets `_ Generate all possible determinants for a give occ_pattern @@ -551,72 +854,188 @@ Documentation Number of possible determinants for a given occ_pattern -`one_body_dm_ao_alpha `_ +`one_body_dm_ao_alpha `_ one body density matrix on the AO basis : rho_AO(alpha) , rho_AO(beta) -`one_body_dm_ao_beta `_ +`one_body_dm_ao_alpha_no_align `_ one body density matrix on the AO basis : rho_AO(alpha) , rho_AO(beta) -`one_body_dm_mo `_ +`one_body_dm_ao_beta `_ + one body density matrix on the AO basis : rho_AO(alpha) , rho_AO(beta) + + +`one_body_dm_ao_beta_no_align `_ + one body density matrix on the AO basis : rho_AO(alpha) , rho_AO(beta) + + +`one_body_dm_dagger_mo_spin_index `_ + Undocumented + + +`one_body_dm_mo `_ One-body density matrix -`one_body_dm_mo_alpha `_ +`one_body_dm_mo_alpha `_ Alpha and beta one-body density matrix for each state -`one_body_dm_mo_beta `_ +`one_body_dm_mo_alpha_average `_ Alpha and beta one-body density matrix for each state -`one_body_single_double_dm_mo_alpha `_ +`one_body_dm_mo_alpha_old `_ Alpha and beta one-body density matrix for each state -`one_body_single_double_dm_mo_beta `_ +`one_body_dm_mo_beta `_ Alpha and beta one-body density matrix for each state -`one_body_spin_density_ao `_ +`one_body_dm_mo_beta_average `_ + Alpha and beta one-body density matrix for each state + + +`one_body_dm_mo_beta_old `_ + Alpha and beta one-body density matrix for each state + + +`one_body_dm_mo_spin_index `_ + Undocumented + + +`one_body_single_double_dm_mo_alpha `_ + Alpha and beta one-body density matrix for each state + + +`one_body_single_double_dm_mo_beta `_ + Alpha and beta one-body density matrix for each state + + +`one_body_spin_density_ao `_ one body spin density matrix on the AO basis : rho_AO(alpha) - rho_AO(beta) -`one_body_spin_density_mo `_ +`one_body_spin_density_mo `_ rho(alpha) - rho(beta) -`only_single_double_dm `_ +`only_single_double_dm `_ If true, The One body DM is calculated with ignoring the Double<->Doubles extra diag elements +`print_bitmask `_ + Undocumented + + +`printwf `_ + Undocumented + + `psi_average_norm_contrib `_ Contribution of determinants to the state-averaged density `psi_average_norm_contrib_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) + .br + psi_det_sorted_order(i) -> k : index in psi_det -`psi_bilinear_matrix `_ +`psi_bilinear_matrix `_ Coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b -`psi_bilinear_matrix_columns `_ +`psi_bilinear_matrix_columns `_ Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + .br + Rows are alpha determinants and columns are beta. + .br + Order refers to psi_det -`psi_bilinear_matrix_rows `_ +`psi_bilinear_matrix_columns_loc `_ Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + .br + Rows are alpha determinants and columns are beta. + .br + Order refers to psi_det -`psi_bilinear_matrix_values `_ +`psi_bilinear_matrix_order `_ Sparse coefficient matrix if the wave function is expressed in a bilinear form : D_a^t C D_b + .br + Rows are alpha determinants and columns are beta. + .br + Order refers to psi_det + + +`psi_bilinear_matrix_order_reverse `_ + Order which allows to go from psi_bilinear_matrix to psi_det + + +`psi_bilinear_matrix_order_transp_reverse `_ + Order which allows to go from psi_bilinear_matrix_order_transp to psi_bilinear_matrix + + +`psi_bilinear_matrix_rows `_ + Sparse coefficient matrix if the wave function is expressed in a bilinear form : + D_a^t C D_b + .br + Rows are alpha determinants and columns are beta. + .br + Order refers to psi_det + + +`psi_bilinear_matrix_transp_columns `_ + Transpose of psi_bilinear_matrix + D_b^t C^t D_a + .br + Rows are Alpha determinants and columns are beta, but the matrix is stored in row major + format + + +`psi_bilinear_matrix_transp_order `_ + Transpose of psi_bilinear_matrix + D_b^t C^t D_a + .br + Rows are Alpha determinants and columns are beta, but the matrix is stored in row major + format + + +`psi_bilinear_matrix_transp_rows `_ + Transpose of psi_bilinear_matrix + D_b^t C^t D_a + .br + Rows are Alpha determinants and columns are beta, but the matrix is stored in row major + format + + +`psi_bilinear_matrix_transp_rows_loc `_ + Location of the columns in the psi_bilinear_matrix + + +`psi_bilinear_matrix_transp_values `_ + Transpose of psi_bilinear_matrix + D_b^t C^t D_a + .br + Rows are Alpha determinants and columns are beta, but the matrix is stored in row major + format + + +`psi_bilinear_matrix_values `_ + Sparse coefficient matrix if the wave function is expressed in a bilinear form : + D_a^t C D_b + .br + Rows are alpha determinants and columns are beta. + .br + Order refers to psi_det `psi_cas `_ @@ -656,19 +1075,21 @@ Documentation Undocumented -`psi_coef_max `_ +`psi_coef_max `_ Max and min values of the coefficients -`psi_coef_min `_ +`psi_coef_min `_ Max and min values of the coefficients `psi_coef_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) + .br + psi_det_sorted_order(i) -> k : index in psi_det -`psi_coef_sorted_bit `_ +`psi_coef_sorted_bit `_ Determinants on which we apply for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave @@ -702,15 +1123,23 @@ Documentation `psi_det_sorted `_ Wave function sorted by determinants contribution to the norm (state-averaged) + .br + psi_det_sorted_order(i) -> k : index in psi_det -`psi_det_sorted_bit `_ +`psi_det_sorted_bit `_ Determinants on which we apply for perturbation. They are sorted by determinants interpreted as integers. Useful to accelerate the search of a random determinant in the wave function. +`psi_det_sorted_order `_ + Wave function sorted by determinants contribution to the norm (state-averaged) + .br + psi_det_sorted_order(i) -> k : index in psi_det + + `psi_non_cas `_ Set of determinants which are not part of the CAS, defined from the application of the CAS bitmask on the determinants. @@ -733,17 +1162,17 @@ Documentation function. -`psi_occ_pattern `_ +`psi_occ_pattern `_ array of the occ_pattern present in the wf - psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupation - psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation + psi_occ_pattern(:,1,j) = jth occ_pattern of the wave function : represent all the single occupations + psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupations -`pull_pt2 `_ +`pull_pt2 `_ Pull PT2 calculation in the collector -`push_pt2 `_ +`push_pt2 `_ Push PT2 calculation to the collector @@ -751,15 +1180,15 @@ Documentation Undocumented -`read_dets `_ +`read_dets `_ Reads the determinants from the EZFIO file -`read_wf `_ +`read_wf `_ If true, read the wave function from the EZFIO file -`rec_occ_pattern_to_dets `_ +`rec_occ_pattern_to_dets `_ Undocumented @@ -767,7 +1196,11 @@ Documentation Energy of the reference bitmask used in Slater rules -`remove_duplicates_in_psi_det `_ +`ref_closed_shell_bitmask `_ + Undocumented + + +`remove_duplicates_in_psi_det `_ Removes duplicate determinants in the wave function. @@ -776,33 +1209,37 @@ Documentation be set before calling this function. -`s2_eig `_ +`s2_eig `_ Force the wave function to be an eigenfunction of S^2 -`s2_u_0 `_ +`s2_eig_restart `_ + Undocumented + + +`s2_u_0 `_ Computes v_0 = S^2|u_0> .br n : number of determinants .br -`s2_u_0_nstates `_ +`s2_u_0_nstates `_ Computes v_0 = S^2|u_0> .br n : number of determinants .br -`s2_values `_ +`s2_values `_ array of the averaged values of the S^2 operator on the various states -`s_z `_ +`s_z `_ z component of the Spin -`s_z2_sz `_ +`s_z2_sz `_ z component of the Spin @@ -814,35 +1251,39 @@ Documentation Undocumented -`save_natural_mos `_ +`save_natural_mos `_ Save natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis -`save_ref_determinant `_ +`save_only_singles `_ Undocumented -`save_wavefunction `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_general `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_specified `_ - Save the wave function into the EZFIO file - - -`save_wavefunction_unsorted `_ - Save the wave function into the EZFIO file - - -`set_bit_to_integer `_ +`save_ref_determinant `_ Undocumented -`set_natural_mos `_ +`save_wavefunction `_ + Save the wave function into the EZFIO file + + +`save_wavefunction_general `_ + Save the wave function into the EZFIO file + + +`save_wavefunction_specified `_ + Save the wave function into the EZFIO file + + +`save_wavefunction_unsorted `_ + Save the wave function into the EZFIO file + + +`set_bit_to_integer `_ + Undocumented + + +`set_natural_mos `_ Set natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis @@ -852,7 +1293,23 @@ Documentation for a given couple of hole/particle excitations i. -`sort_dets_by_det_search_key `_ +`singles_alpha_csc `_ + Dimension of the singles_alpha array + + +`singles_alpha_csc_idx `_ + Dimension of the singles_alpha array + + +`singles_alpha_csc_size `_ + Dimension of the singles_alpha array + + +`singles_alpha_size `_ + Dimension of the singles_alpha array + + +`sort_dets_by_det_search_key `_ Determinants are sorted are sorted according to their det_search_key. Useful to accelerate the search of a random determinant in the wave function. @@ -862,15 +1319,19 @@ Documentation Return an integer(8) corresponding to a determinant index for searching -`state_average_weight `_ +`state_average_weight `_ Weights in the state-average calculation of the density matrix -`target_energy `_ +`store_full_h_mat `_ + If True, the Davidson diagonalization is performed by storing the full H matrix up to n_det_max_stored. Be careful, it can cost a lot of memory but can also save a lot of CPU time + + +`target_energy `_ Energy that should be obtained when truncating the wave function (optional) -`threshold_generators `_ +`threshold_generators `_ Thresholds on generators (fraction of the norm) @@ -878,13 +1339,200 @@ Documentation Thresholds on selectors (fraction of the norm) -`u_0_s2_u_0 `_ +`two_body_dm_ab_big_array_act `_ + two_body_dm_ab_big_array_act = Purely active part of the two body density matrix + two_body_dm_ab_big_array_act_core takes only into account the single excitation + within the active space that adds terms in the act <-> core two body dm + two_body_dm_ab_big_array_act_core(i,j,k) = < a^\dagger_i n_k a_j > + with i,j in the ACTIVE SPACE + with k in the CORE SPACE + .br + The alpha-beta extra diagonal energy FOR WF DEFINED AS AN APPROXIMATION OF A CAS can be computed thanks to + sum_{h1,p1,h2,p2} two_body_dm_ab_big_array_act(h1,p1,h2,p2) * (h1p1|h2p2) + + sum_{h1,p1,h2,p2} two_body_dm_ab_big_array_core_act(h1,p1,h2,p2) * (h1p1|h2p2) + + +`two_body_dm_ab_big_array_core_act `_ + two_body_dm_ab_big_array_act = Purely active part of the two body density matrix + two_body_dm_ab_big_array_act_core takes only into account the single excitation + within the active space that adds terms in the act <-> core two body dm + two_body_dm_ab_big_array_act_core(i,j,k) = < a^\dagger_i n_k a_j > + with i,j in the ACTIVE SPACE + with k in the CORE SPACE + .br + The alpha-beta extra diagonal energy FOR WF DEFINED AS AN APPROXIMATION OF A CAS can be computed thanks to + sum_{h1,p1,h2,p2} two_body_dm_ab_big_array_act(h1,p1,h2,p2) * (h1p1|h2p2) + + sum_{h1,p1,h2,p2} two_body_dm_ab_big_array_core_act(h1,p1,h2,p2) * (h1p1|h2p2) + + +`two_body_dm_ab_diag_act `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_ab_diag_all `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_ab_diag_core `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_ab_diag_inact `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_ab_map `_ + Map of the two body density matrix elements for the alpha/beta elements + + +`two_body_dm_diag_core_a_act_b `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_diag_core_act `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_diag_core_b_act_a `_ + two_body_dm_ab_diag_all(k,m) = <\Psi | n_(k\alpha) n_(m\beta) | \Psi> + two_body_dm_ab_diag_act(k,m) is restricted to the active orbitals : + orbital k = list_act(k) + two_body_dm_ab_diag_inact(k,m) is restricted to the inactive orbitals : + orbital k = list_inact(k) + two_body_dm_ab_diag_core(k,m) is restricted to the core orbitals : + orbital k = list_core(k) + two_body_dm_ab_diag_core_b_act_a(k,m) represents the core beta <-> active alpha part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_a_act_b(k,m) represents the core alpha <-> active beta part of the two body dm + orbital k = list_core(k) + orbital m = list_act(m) + two_body_dm_ab_diag_core_act(k,m) represents the core<->active part of the diagonal two body dm + when we traced on the spin + orbital k = list_core(k) + orbital m = list_act(m) + + +`two_body_dm_in_map `_ + If True, the map of the two body density matrix alpha/beta is provided + + +`u_0_h_u_0_stored `_ + Computes e_0 = + .br + n : number of determinants + .br + uses the big_matrix_stored array + + +`u_0_s2_u_0 `_ Computes e_0 = / .br n : number of determinants .br -`write_spindeterminants `_ +`wf_of_psi_bilinear_matrix `_ + Generate a wave function containing all possible products + of alpha and beta determinants + + +`write_spindeterminants `_ Undocumented diff --git a/src/Determinants/occ_pattern.irp.f b/src/Determinants/occ_pattern.irp.f index b0f65d15..c5ed0fa9 100644 --- a/src/Determinants/occ_pattern.irp.f +++ b/src/Determinants/occ_pattern.irp.f @@ -244,6 +244,7 @@ end END_PROVIDER subroutine make_s2_eigenfunction + return implicit none integer :: i,j,k integer :: smax, s diff --git a/src/Determinants/print_wf.irp.f b/src/Determinants/print_wf.irp.f index 737e4d3e..ad397a57 100644 --- a/src/Determinants/print_wf.irp.f +++ b/src/Determinants/print_wf.irp.f @@ -11,14 +11,23 @@ subroutine routine implicit none integer :: i integer :: degree - double precision :: hij + double precision :: hij,hii,coef_1,h00 integer :: exc(0:2,2,2) double precision :: phase integer :: h1,p1,h2,p2,s1,s2 double precision :: get_mo_bielec_integral double precision :: norm_mono_a,norm_mono_b + double precision :: norm_mono_a_2,norm_mono_b_2 + double precision :: norm_mono_a_pert_2,norm_mono_b_pert_2 + double precision :: norm_mono_a_pert,norm_mono_b_pert norm_mono_a = 0.d0 norm_mono_b = 0.d0 + norm_mono_a_2 = 0.d0 + norm_mono_b_2 = 0.d0 + norm_mono_a_pert = 0.d0 + norm_mono_b_pert = 0.d0 + norm_mono_a_pert_2 = 0.d0 + norm_mono_b_pert_2 = 0.d0 do i = 1, min(500,N_det) print*,'' print*,'i = ',i @@ -27,37 +36,48 @@ subroutine routine print*,'degree = ',degree if(degree == 0)then print*,'Reference determinant ' + call i_H_j(psi_det(1,1,i),psi_det(1,1,i),N_int,h00) else - call i_H_j(psi_det(1,1,i),psi_det(1,1,i),N_int,hij) + call i_H_j(psi_det(1,1,i),psi_det(1,1,i),N_int,hii) + call i_H_j(psi_det(1,1,1),psi_det(1,1,i),N_int,hij) + coef_1 = hij/(h00-hii) call get_excitation(psi_det(1,1,1),psi_det(1,1,i),exc,degree,phase,N_int) call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2) print*,'phase = ',phase -! if(degree == 1)then -! print*,'s1',s1 -! print*,'h1,p1 = ',h1,p1 -! if(s1 == 1)then -! norm_mono_a += dabs(psi_coef(i,1)/psi_coef(1,1)) -! else -! norm_mono_b += dabs(psi_coef(i,1)/psi_coef(1,1)) -! endif + if(degree == 1)then + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + if(s1 == 1)then + norm_mono_a += dabs(psi_coef(i,1)/psi_coef(1,1)) + norm_mono_a_2 += dabs(psi_coef(i,1)/psi_coef(1,1))**2 + norm_mono_a_pert += dabs(coef_1) + norm_mono_a_pert_2 += dabs(coef_1)**2 + else + norm_mono_b += dabs(psi_coef(i,1)/psi_coef(1,1)) + norm_mono_b_2 += dabs(psi_coef(i,1)/psi_coef(1,1))**2 + norm_mono_b_pert += dabs(coef_1) + norm_mono_b_pert_2 += dabs(coef_1)**2 + endif ! print*,'< h | Ka| p > = ',get_mo_bielec_integral(h1,list_act(1),list_act(1),p1,mo_integrals_map) -! double precision :: hmono,hdouble -! call i_H_j_verbose(psi_det(1,1,1),psi_det(1,1,i),N_int,hij,hmono,hdouble) -! print*,'hmono = ',hmono -! print*,'hdouble = ',hdouble -! print*,'hmono+hdouble = ',hmono+hdouble -! print*,'hij = ',hij -! else -! print*,'s1',s1 -! print*,'h1,p1 = ',h1,p1 -! print*,'s2',s2 -! print*,'h2,p2 = ',h2,p2 + double precision :: hmono,hdouble + call i_H_j_verbose(psi_det(1,1,1),psi_det(1,1,i),N_int,hij,hmono,hdouble) + print*,'hmono = ',hmono + print*,'hdouble = ',hdouble + print*,'hmono+hdouble = ',hmono+hdouble + print*,'hij = ',hij + else + print*,'s1',s1 + print*,'h1,p1 = ',h1,p1 + print*,'s2',s2 + print*,'h2,p2 = ',h2,p2 ! print*,'< h | Ka| p > = ',get_mo_bielec_integral(h1,h2,p1,p2,mo_integrals_map) -! endif + endif print*,' = ',hij + print*,'Delta E = ',h00-hii + print*,'coef pert (1) = ',coef_1 endif - print*,'amplitude = ',psi_coef(i,1)/psi_coef(1,1) + print*,'amplitude = ',psi_coef(i,1)/psi_coef(1,1) enddo @@ -65,7 +85,16 @@ subroutine routine print*,'' print*,'' print*,'' - print*,'mono alpha = ',norm_mono_a - print*,'mono beta = ',norm_mono_b + print*,'L1 norm of mono alpha = ',norm_mono_a + print*,'L1 norm of mono beta = ',norm_mono_b + print*, '---' + print*,'L2 norm of mono alpha = ',norm_mono_a_2 + print*,'L2 norm of mono beta = ',norm_mono_b_2 + print*, '-- perturbative mono' + print*,'' + print*,'L1 norm of pert alpha = ',norm_mono_a_pert + print*,'L1 norm of pert beta = ',norm_mono_b_pert + print*,'L2 norm of pert alpha = ',norm_mono_a_pert_2 + print*,'L2 norm of pert beta = ',norm_mono_b_pert_2 end diff --git a/src/Determinants/truncate_wf.irp.f b/src/Determinants/truncate_wf.irp.f index aba16fa7..320e07c2 100644 --- a/src/Determinants/truncate_wf.irp.f +++ b/src/Determinants/truncate_wf.irp.f @@ -5,7 +5,35 @@ program s2_eig_restart end subroutine routine implicit none - call make_s2_eigenfunction - TOUCH psi_det psi_coef psi_det_sorted psi_coef_sorted psi_average_norm_contrib_sorted N_det - call save_wavefunction + integer :: ndet_max + print*, 'How many determinants would you like ?' + read(5,*)ndet_max + integer(bit_kind), allocatable :: psi_det_tmp(:,:,:) + double precision, allocatable :: psi_coef_tmp(:,:) + allocate(psi_det_tmp(N_int,2,ndet_max),psi_coef_tmp(ndet_max, N_states)) + + integer :: i,j + double precision :: accu(N_states) + accu = 0.d0 + do i = 1, ndet_max + do j = 1, N_int + psi_det_tmp(j,1,i) = psi_det_sorted(j,1,i) + psi_det_tmp(j,2,i) = psi_det_sorted(j,2,i) + enddo + do j = 1, N_states + psi_coef_tmp(i,j) = psi_coef_sorted(i,j) + accu(j) += psi_coef_tmp(i,j) **2 + enddo + enddo + do j = 1, N_states + accu(j) = 1.d0/dsqrt(accu(j)) + enddo + do j = 1, N_states + do i = 1, ndet_max + psi_coef_tmp(i,j) = psi_coef_tmp(i,j) * accu(j) + enddo + enddo + + call save_wavefunction_general(ndet_max,N_states,psi_det_tmp,N_det_max,psi_coef_tmp) + end diff --git a/src/Ezfio_files/README.rst b/src/Ezfio_files/README.rst index ad87e7f5..17f81a55 100644 --- a/src/Ezfio_files/README.rst +++ b/src/Ezfio_files/README.rst @@ -199,10 +199,6 @@ Documentation .br -output_all_singles - Output file for All_singles - - output_ao_basis Output file for AO_Basis @@ -211,10 +207,6 @@ output_bitmask Output file for Bitmask -output_cas_sd - Output file for CAS_SD - - `output_cpu_time_0 `_ Initial CPU and wall times when printing in the output files @@ -235,26 +227,6 @@ output_ezfio_files Output file for Ezfio_files -output_full_ci - Output file for Full_CI - - -output_full_ci_zmq - Output file for Full_CI_ZMQ - - -output_generators_cas - Output file for Generators_CAS - - -output_generators_full - Output file for Generators_full - - -output_generators_restart - Output file for Generators_restart - - output_hartree_fock Output file for Hartree_Fock @@ -275,46 +247,14 @@ output_moguess Output file for MOGuess -output_mrcc_utils - Output file for MRCC_Utils - - -output_mrcepa0 - Output file for mrcepa0 - - output_nuclei Output file for Nuclei -output_perturbation - Output file for Perturbation - - -output_properties - Output file for Properties - - output_pseudo Output file for Pseudo -output_psiref_cas - Output file for Psiref_CAS - - -output_psiref_utils - Output file for Psiref_Utils - - -output_selectors_full - Output file for Selectors_full - - -output_selectors_no_sorted - Output file for Selectors_no_sorted - - output_utils Output file for Utils diff --git a/src/Integrals_Bielec/README.rst b/src/Integrals_Bielec/README.rst index f6644db4..37961fb6 100644 --- a/src/Integrals_Bielec/README.rst +++ b/src/Integrals_Bielec/README.rst @@ -45,7 +45,15 @@ Documentation .. by the `update_README.py` script. -`add_integrals_to_map `_ +`add_integrals_to_map `_ + Adds integrals to tha MO map according to some bitmask + + +`add_integrals_to_map_no_exit_34 `_ + Adds integrals to tha MO map according to some bitmask + + +`add_integrals_to_map_three_indices `_ Adds integrals to tha MO map according to some bitmask @@ -54,7 +62,7 @@ Documentation i(r1) j(r1) 1/r12 k(r2) l(r2) -`ao_bielec_integral_schwartz `_ +`ao_bielec_integral_schwartz `_ Needed to compute Schwartz inequalities @@ -68,11 +76,11 @@ Documentation i(r1) j(r2) 1/r12 k(r1) l(r2) -`ao_bielec_integrals_in_map_collector `_ +`ao_bielec_integrals_in_map_collector `_ Collects results from the AO integral calculation -`ao_bielec_integrals_in_map_slave `_ +`ao_bielec_integrals_in_map_slave `_ Computes a buffer of integrals @@ -100,7 +108,7 @@ Documentation AO integrals -`ao_integrals_threshold `_ +`ao_integrals_threshold `_ If || < ao_integrals_threshold then is zero @@ -120,11 +128,19 @@ Documentation Undocumented -`clear_ao_map `_ +`big_array_coulomb_integrals `_ + Undocumented + + +`big_array_exchange_integrals `_ + Undocumented + + +`clear_ao_map `_ Frees the memory of the AO map -`clear_mo_map `_ +`clear_mo_map `_ Frees the memory of the MO map @@ -132,31 +148,31 @@ Documentation Compute AO 1/r12 integrals for all i and fixed j,k,l -`compute_ao_integrals_jl `_ +`compute_ao_integrals_jl `_ Parallel client for AO integrals -`disk_access_ao_integrals `_ +`disk_access_ao_integrals `_ Read/Write AO integrals from/to disk [ Write | Read | None ] -`disk_access_mo_integrals `_ +`disk_access_mo_integrals `_ Read/Write MO integrals from/to disk [ Write | Read | None ] -`do_direct_integrals `_ +`do_direct_integrals `_ Compute integrals on the fly -`dump_ao_integrals `_ +`dump_ao_integrals `_ Save to disk the $ao integrals -`dump_mo_integrals `_ +`dump_mo_integrals `_ Save to disk the $ao integrals -`eri `_ +`eri `_ ATOMIC PRIMTIVE bielectronic 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) @@ -164,6 +180,10 @@ Documentation primitive_4 = x2**(d_x) y2**(d_y) z2**(d_z) exp(- gama * r2**2) +`four_idx `_ + 4-index transformation from AO to MO integrals + + `gauleg `_ Gauss-Legendre @@ -178,7 +198,7 @@ Documentation t_w(i,2,k) = t(i) -`general_primitive_integral `_ +`general_primitive_integral `_ Computes the integral where p,q,r,s are Gaussian primitives @@ -186,149 +206,166 @@ Documentation Gets one AO bi-electronic integral from the AO map -`get_ao_bielec_integrals `_ +`get_ao_bielec_integrals `_ Gets multiple AO bi-electronic integral from the AO map . All i are retrieved for j,k,l fixed. -`get_ao_bielec_integrals_non_zero `_ +`get_ao_bielec_integrals_non_zero `_ Gets multiple AO bi-electronic integral from the AO map . All non-zero i are retrieved for j,k,l fixed. -`get_ao_map_size `_ +`get_ao_map_size `_ Returns the number of elements in the AO map -`get_mo_bielec_integral `_ +`get_mo_bielec_integral `_ Returns one integral in the MO basis -`get_mo_bielec_integral_schwartz `_ - Returns one integral in the MO basis - - -`get_mo_bielec_integrals `_ +`get_mo_bielec_integrals `_ Returns multiple integrals in the MO basis, all i for j,k,l fixed. -`get_mo_bielec_integrals_ij `_ +`get_mo_bielec_integrals_coulomb_ii `_ + Returns multiple integrals + k(1)i(2) 1/r12 l(1)i(2) :: out_val(i1) + for k,l fixed. + + +`get_mo_bielec_integrals_exch_ii `_ + Returns multiple integrals + k(1)i(2) 1/r12 i(1)l(2) :: out_val(i1) + for k,l fixed. + + +`get_mo_bielec_integrals_ij `_ Returns multiple integrals in the MO basis, all i(1)j(2) 1/r12 k(1)l(2) i, j for k,l fixed. -`get_mo_map_size `_ +`get_mo_map_size `_ Return the number of elements in the MO map -`give_polynom_mult_center_x `_ +`give_polynom_mult_center_x `_ 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) -`i_x1_new `_ +`i_x1_new `_ recursive function involved in the bielectronic integral -`i_x1_pol_mult `_ +`i_x1_pol_mult `_ recursive function involved in the bielectronic integral -`i_x1_pol_mult_a1 `_ +`i_x1_pol_mult_a1 `_ recursive function involved in the bielectronic integral -`i_x1_pol_mult_a2 `_ +`i_x1_pol_mult_a2 `_ recursive function involved in the bielectronic integral -`i_x1_pol_mult_recurs `_ +`i_x1_pol_mult_recurs `_ recursive function involved in the bielectronic integral -`i_x2_new `_ +`i_x2_new `_ recursive function involved in the bielectronic integral -`i_x2_pol_mult `_ +`i_x2_pol_mult `_ recursive function involved in the bielectronic integral -`insert_into_ao_integrals_map `_ +`insert_into_ao_integrals_map `_ Create new entry into AO map -`insert_into_mo_integrals_map `_ +`insert_into_mo_integrals_map `_ Create new entry into MO map, or accumulate in an existing entry -`integrale_new `_ +`integrale_new `_ 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) -`load_ao_integrals `_ +`load_ao_integrals `_ Read from disk the $ao integrals -`load_mo_integrals `_ +`load_mo_integrals `_ Read from disk the $ao integrals -`mo_bielec_integral `_ +`mo_bielec_integral `_ Returns one integral in the MO basis -`mo_bielec_integral_jj `_ +`mo_bielec_integral_jj `_ mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij -`mo_bielec_integral_jj_anti `_ +`mo_bielec_integral_jj_anti `_ mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij -`mo_bielec_integral_jj_anti_from_ao `_ +`mo_bielec_integral_jj_anti_from_ao `_ mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij -`mo_bielec_integral_jj_exchange `_ +`mo_bielec_integral_jj_exchange `_ mo_bielec_integral_jj(i,j) = J_ij mo_bielec_integral_jj_exchange(i,j) = K_ij mo_bielec_integral_jj_anti(i,j) = J_ij - K_ij -`mo_bielec_integral_jj_exchange_from_ao `_ +`mo_bielec_integral_jj_exchange_from_ao `_ mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij -`mo_bielec_integral_jj_from_ao `_ +`mo_bielec_integral_jj_from_ao `_ mo_bielec_integral_jj_from_ao(i,j) = J_ij mo_bielec_integral_jj_exchange_from_ao(i,j) = J_ij mo_bielec_integral_jj_anti_from_ao(i,j) = J_ij - K_ij -`mo_bielec_integral_mipi `_ - and - . Indices are (i,m,p) +`mo_bielec_integral_vv_anti_from_ao `_ + mo_bielec_integral_vv_from_ao(i,j) = J_ij + mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij + mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij + but only for the virtual orbitals -`mo_bielec_integral_mipi_anti `_ - and - . Indices are (i,m,p) +`mo_bielec_integral_vv_exchange_from_ao `_ + mo_bielec_integral_vv_from_ao(i,j) = J_ij + mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij + mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij + but only for the virtual orbitals -`mo_bielec_integral_schwartz `_ - Needed to compute Schwartz inequalities +`mo_bielec_integral_vv_from_ao `_ + mo_bielec_integral_vv_from_ao(i,j) = J_ij + mo_bielec_integral_vv_exchange_from_ao(i,j) = J_ij + mo_bielec_integral_vv_anti_from_ao(i,j) = J_ij - K_ij + but only for the virtual orbitals `mo_bielec_integrals_in_map `_ @@ -339,23 +376,23 @@ Documentation Computes an unique index for i,j,k,l integrals -`mo_integrals_cache `_ +`mo_integrals_cache `_ Cache of MO integrals for fast access -`mo_integrals_cache_max `_ +`mo_integrals_cache_max `_ Min and max values of the MOs for which the integrals are in the cache -`mo_integrals_cache_min `_ +`mo_integrals_cache_min `_ Min and max values of the MOs for which the integrals are in the cache -`mo_integrals_map `_ +`mo_integrals_map `_ MO integrals -`mo_integrals_threshold `_ +`mo_integrals_threshold `_ If || < ao_integrals_threshold then is zero @@ -363,13 +400,25 @@ Documentation Aligned n_pt_max_integrals -`n_pt_sup `_ +`n_pt_sup `_ 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) -`provide_all_mo_integrals `_ +`no_ivvv_integrals `_ + Can be switched on only if no_vvvv_integrals is True, then do not computes the integrals having 3 virtual index and 1 belonging to the core inactive active orbitals + + +`no_vvv_integrals `_ + Can be switched on only if no_vvvv_integrals is True, then do not computes the integrals having 3 virtual orbitals + + +`no_vvvv_integrals `_ + If True, computes all integrals except for the integrals having 4 virtual index + + +`provide_all_mo_integrals `_ Undocumented @@ -389,6 +438,14 @@ Documentation One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals +`set_integrals_exchange_jj_into_map `_ + Undocumented + + +`set_integrals_jj_into_map `_ + Undocumented + + `write_ao_integrals `_ One level of abstraction for disk_access_ao_integrals and disk_access_mo_integrals diff --git a/src/Integrals_Monoelec/README.rst b/src/Integrals_Monoelec/README.rst index 7e926fd5..9a2ef0c5 100644 --- a/src/Integrals_Monoelec/README.rst +++ b/src/Integrals_Monoelec/README.rst @@ -115,7 +115,7 @@ Documentation Local pseudo-potential -`ao_pseudo_integral_non_local `_ +`ao_pseudo_integral_non_local `_ Local pseudo-potential @@ -193,7 +193,7 @@ Documentation `mo_mono_elec_integral `_ array of the mono electronic hamiltonian on the MOs basis : - sum of the kinetic and nuclear electronic potential + sum of the kinetic and nuclear electronic potential (and pseudo potential if needed) `mo_nucl_elec_integral `_ @@ -259,27 +259,27 @@ Documentation Undocumented -`pseudo_dz_k_transp `_ +`pseudo_dz_k_transp `_ Transposed arrays for pseudopotentials -`pseudo_dz_kl_transp `_ +`pseudo_dz_kl_transp `_ Transposed arrays for pseudopotentials -`pseudo_n_k_transp `_ +`pseudo_n_k_transp `_ Transposed arrays for pseudopotentials -`pseudo_n_kl_transp `_ +`pseudo_n_kl_transp `_ Transposed arrays for pseudopotentials -`pseudo_v_k_transp `_ +`pseudo_v_k_transp `_ Transposed arrays for pseudopotentials -`pseudo_v_kl_transp `_ +`pseudo_v_kl_transp `_ Transposed arrays for pseudopotentials diff --git a/src/MOGuess/README.rst b/src/MOGuess/README.rst index 3fca60c0..7f2e8d94 100644 --- a/src/MOGuess/README.rst +++ b/src/MOGuess/README.rst @@ -42,7 +42,7 @@ Documentation Undocumented -`ao_ortho_lowdin_overlap `_ +`ao_ortho_lowdin_overlap `_ overlap matrix of the ao_ortho_lowdin supposed to be the Identity diff --git a/src/MO_Basis/README.rst b/src/MO_Basis/README.rst index aa99670b..5b91499f 100644 --- a/src/MO_Basis/README.rst +++ b/src/MO_Basis/README.rst @@ -78,33 +78,64 @@ Documentation AO overlap matrix in the spherical basis set -`ao_ortho_canonical_coef `_ +`ao_ortho_cano_to_ao `_ + Transform A from the AO basis to the orthogonal AO basis + .br + C^(-1).A_ao.Ct^(-1) + + +`ao_ortho_canonical_coef `_ 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 -`ao_ortho_canonical_num `_ +`ao_ortho_canonical_coef_inv `_ + ao_ortho_canonical_coef^(-1) + + +`ao_ortho_canonical_num `_ 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 -`ao_ortho_canonical_overlap `_ +`ao_ortho_canonical_overlap `_ overlap matrix of the ao_ortho_canonical. Expected to be the Identity -`ao_to_mo `_ +`ao_to_mo `_ Transform A from the AO basis to the MO basis + .br + C.A_ao.Ct `cholesky_mo `_ - Cholesky decomposition of AO Density matrix to - generate MOs + Cholesky decomposition of AO Density matrix + .br + n : Number of AOs + m : Number of MOs + .br + P(LDP,n) : Density matrix in AO basis + .br + C(LDC,m) : MOs + .br + tol_in : tolerance + .br + rank : Nomber of local MOs (output) + .br -`mix_mo_jk `_ +`give_all_mos_at_r `_ + Undocumented + + +`give_specific_mos_at_r `_ + Undocumented + + +`mix_mo_jk `_ subroutine that rotates the jth MO with the kth MO to give two new MO's that are '+' = 1/sqrt(2) (|j> + |k>) @@ -125,31 +156,33 @@ Documentation Undocumented +`mo_class `_ + Core|Inactive|Active|Virtual|Deleted + + `mo_coef `_ Molecular orbital coefficients on AO basis set mo_coef(i,j) = coefficient of the ith ao on the jth mo mo_label : Label characterizing the MOS (local, canonical, natural, etc) -`mo_coef_transp `_ +`mo_coef_in_ao_ortho_basis `_ + MO coefficients in orthogonalized AO basis + .br + C^(-1).C_mo + + +`mo_coef_transp `_ Molecular orbital coefficients on AO basis set -`mo_density_matrix `_ - Density matrix in MO basis - - -`mo_density_matrix_virtual `_ - Density matrix in MO basis (virtual MOs) - - -`mo_label `_ +`mo_label `_ Molecular orbital coefficients on AO basis set mo_coef(i,j) = coefficient of the ith ao on the jth mo mo_label : Label characterizing the MOS (local, canonical, natural, etc) -`mo_occ `_ +`mo_occ `_ MO occupation numbers @@ -161,11 +194,13 @@ Documentation Undocumented -`mo_to_ao `_ +`mo_to_ao `_ Transform A from the MO basis to the AO basis + .br + (S.C).A_mo.(S.C)t -`mo_to_ao_no_overlap `_ +`mo_to_ao_no_overlap `_ Transform A from the MO basis to the S^-1 AO basis @@ -177,7 +212,15 @@ Documentation Aligned variable for dimensioning of arrays -`s_mo_coef `_ +`permut_mos `_ + Undocumented + + +`pouet `_ + Undocumented + + +`s_mo_coef `_ Product S.C where S is the overlap matrix in the AO basis and C the mo_coef matrix. @@ -189,6 +232,22 @@ Documentation Undocumented +`svd_mo `_ + Singular value decomposition of the AO Density matrix + .br + n : Number of AOs + m : Number of MOs + .br + P(LDP,n) : Density matrix in AO basis + .br + C(LDC,m) : MOs + .br + tol_in : tolerance + .br + rank : Nomber of local MOs (output) + .br + + `swap_mos `_ Undocumented diff --git a/src/Nuclei/README.rst b/src/Nuclei/README.rst index 356b8e9e..b75b117d 100644 --- a/src/Nuclei/README.rst +++ b/src/Nuclei/README.rst @@ -34,11 +34,15 @@ Documentation .. by the `update_README.py` script. -`element_name `_ +`disk_access_nuclear_repulsion `_ + Read/Write Nuclear Repulsion from/to disk [ Write | Read | None ] + + +`element_name `_ Array of the name of element, sorted by nuclear charge (integer) -`nucl_charge `_ +`nucl_charge `_ Nuclear charges @@ -80,11 +84,11 @@ Documentation nucl_dist_vec : Nucleus-nucleus distances vectors -`nucl_label `_ +`nucl_label `_ Nuclear labels -`nucl_num `_ +`nucl_num `_ Number of nuclei @@ -99,3 +103,28 @@ Documentation `positive_charge_barycentre `_ Centroid of the positive charges + +`slater_bragg_radii `_ + 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) + + +`slater_bragg_radii_per_atom `_ + Undocumented + + +`slater_bragg_radii_per_atom_ua `_ + Undocumented + + +`slater_bragg_radii_ua `_ + Undocumented + + +`slater_bragg_type_inter_distance `_ + Undocumented + + +`slater_bragg_type_inter_distance_ua `_ + Undocumented + diff --git a/src/Utils/README.rst b/src/Utils/README.rst index 902a5250..ea5f2854 100644 --- a/src/Utils/README.rst +++ b/src/Utils/README.rst @@ -28,11 +28,11 @@ Documentation Compute 1st dimension such that it is aligned for vectorization. -`apply_rotation `_ +`apply_rotation `_ Apply the rotation found by find_rotation -`approx_dble `_ +`approx_dble `_ Undocumented @@ -75,19 +75,24 @@ Documentation Undocumented -`dset_order `_ +`degree_max_integration_lebedev `_ + integrate correctly a polynom of order "degree_max_integration_lebedev" + needed for the angular integration according to LEBEDEV formulae + + +`dset_order `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. -`dset_order_big `_ +`dset_order_big `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format -`dsort `_ +`dsort `_ Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -114,7 +119,7 @@ Documentation 1/n! -`find_rotation `_ +`find_rotation `_ Find A.C = B @@ -140,7 +145,11 @@ Documentation Undocumented -`get_pseudo_inverse `_ +`get_inverse `_ + Returns the inverse of the square matrix A + + +`get_pseudo_inverse `_ Find C = A^-1 @@ -175,13 +184,13 @@ Documentation Undocumented -`heap_dsort `_ +`heap_dsort `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`heap_dsort_big `_ +`heap_dsort_big `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -189,13 +198,13 @@ Documentation to be in integer*8 format -`heap_i2sort `_ +`heap_i2sort `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`heap_i2sort_big `_ +`heap_i2sort_big `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -203,13 +212,13 @@ Documentation to be in integer*8 format -`heap_i8sort `_ +`heap_i8sort `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`heap_i8sort_big `_ +`heap_i8sort_big `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -217,13 +226,13 @@ Documentation to be in integer*8 format -`heap_isort `_ +`heap_isort `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`heap_isort_big `_ +`heap_isort_big `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -231,13 +240,13 @@ Documentation to be in integer*8 format -`heap_sort `_ +`heap_sort `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`heap_sort_big `_ +`heap_sort_big `_ Sort array x(isize) using the heap sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -249,70 +258,70 @@ Documentation Hermite polynomial -`i2radix_sort `_ +`i2radix_sort `_ Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. -`i2set_order `_ +`i2set_order `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. -`i2set_order_big `_ +`i2set_order_big `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format -`i2sort `_ +`i2sort `_ Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`i8radix_sort `_ +`i8radix_sort `_ Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. -`i8radix_sort_big `_ +`i8radix_sort_big `_ Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. -`i8set_order `_ +`i8set_order `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. -`i8set_order_big `_ +`i8set_order_big `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format -`i8sort `_ +`i8sort `_ Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_dsort `_ +`insertion_dsort `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_dsort_big `_ +`insertion_dsort_big `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -320,13 +329,13 @@ Documentation to be in integer*8 format -`insertion_i2sort `_ +`insertion_i2sort `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_i2sort_big `_ +`insertion_i2sort_big `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -334,13 +343,13 @@ Documentation to be in integer*8 format -`insertion_i8sort `_ +`insertion_i8sort `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_i8sort_big `_ +`insertion_i8sort_big `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -348,13 +357,13 @@ Documentation to be in integer*8 format -`insertion_isort `_ +`insertion_isort `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_isort_big `_ +`insertion_isort_big `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -362,13 +371,13 @@ Documentation to be in integer*8 format -`insertion_sort `_ +`insertion_sort `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`insertion_sort_big `_ +`insertion_sort_big `_ Sort array x(isize) using the insertion sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. @@ -376,43 +385,43 @@ Documentation to be in integer*8 format -`inv_int `_ +`inv_int `_ 1/i -`iradix_sort `_ +`iradix_sort `_ Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. -`iradix_sort_big `_ +`iradix_sort_big `_ Sort integer array x(isize) using the radix sort algorithm. iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. iradix should be -1 in input. -`iset_order `_ +`iset_order `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. -`iset_order_big `_ +`iset_order_big `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format -`isort `_ +`isort `_ Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. -`lapack_diag `_ +`lapack_diag `_ Diagonalize matrix H .br H is untouched between input and ouptut @@ -423,7 +432,7 @@ Documentation .br -`lapack_diag_s2 `_ +`lapack_diag_s2 `_ Diagonalize matrix H .br H is untouched between input and ouptut @@ -434,7 +443,7 @@ Documentation .br -`lapack_diagd `_ +`lapack_diagd `_ Diagonalize matrix H .br H is untouched between input and ouptut @@ -445,7 +454,7 @@ Documentation .br -`lapack_partial_diag `_ +`lapack_partial_diag `_ Diagonalize matrix H .br H is untouched between input and ouptut @@ -460,11 +469,11 @@ Documentation n! -`lowercase `_ +`lowercase `_ Transform to lower case -`map_load_from_disk `_ +`map_load_from_disk `_ Undocumented @@ -472,17 +481,25 @@ Documentation Undocumented +`matrix_vector_product `_ + performs u1 =! performs u1 +( u0 * matrix) + + `multiply_poly `_ Multiply two polynomials D(t) =! D(t) +( B(t)*C(t)) -`normalize `_ +`n_points_integration_angular_lebedev `_ + Number of points needed for the angular integral + + +`normalize `_ Normalizes vector u u is expected to be aligned in memory. -`nproc `_ +`nproc `_ Number of current OpenMP threads @@ -504,7 +521,7 @@ Documentation .br -`ortho_lowdin `_ +`ortho_lowdin `_ Compute C_new=C_old.S^-1/2 orthogonalization. .br overlap : overlap matrix @@ -518,7 +535,7 @@ Documentation .br LDC : leftmost dimension of C .br - m : Coefficients matrix is MxN, ( array is (LDC,N) ) + M : Coefficients matrix is MxN, ( array is (LDC,N) ) .br @@ -535,6 +552,19 @@ Documentation .br +`ortho_qr_unblocked `_ + Orthogonalization using Q.R factorization + .br + A : matrix to orthogonalize + .br + LDA : leftmost dimension of A + .br + n : Number of rows of A + .br + m : Number of columns of A + .br + + `overlap_a_b_c `_ Undocumented @@ -561,6 +591,12 @@ Documentation .br +`phi_angular_integration_lebedev `_ + Theta phi values together with the weights values for the angular integration : + integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1`_ Current status for displaying progress bars. Global variable. @@ -581,6 +617,56 @@ Documentation Current status for displaying progress bars. Global variable. +`quick_dsort `_ + 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. + + +`quick_i2sort `_ + 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. + + +`quick_i8sort `_ + 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. + + +`quick_isort `_ + 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. + + +`quick_sort `_ + 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. + + +`rec__quicksort `_ + Undocumented + + +`rec_d_quicksort `_ + Undocumented + + +`rec_i2_quicksort `_ + Undocumented + + +`rec_i8_quicksort `_ + Undocumented + + +`rec_i_quicksort `_ + Undocumented + + `recentered_poly2 `_ Recenter two polynomials @@ -620,28 +706,48 @@ Documentation Undocumented -`set_order `_ +`set_order `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. -`set_order_big `_ +`set_order_big `_ array A has already been sorted, and iorder has contains the new order of elements of A. This subroutine changes the order of x to match the new order of A. This is a version for very large arrays where the indices need to be in integer*8 format -`set_zero_extra_diag `_ +`set_zero_extra_diag `_ Undocumented -`sort `_ +`sort `_ Sort array x(isize). iorder in input should be (1,2,3,...,isize), and in output contains the new order of the elements. +`sorted_dnumber `_ + Returns the number of sorted elements + + +`sorted_i2number `_ + Returns the number of sorted elements + + +`sorted_i8number `_ + Returns the number of sorted elements + + +`sorted_inumber `_ + Returns the number of sorted elements + + +`sorted_number `_ + Returns the number of sorted elements + + `start_progress `_ Starts the progress bar @@ -659,22 +765,34 @@ Documentation .br +`theta_angular_integration_lebedev `_ + Theta phi values together with the weights values for the angular integration : + integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1`_ Transpose input matrix A into output matrix B -`u_dot_u `_ +`u_dot_u `_ Compute -`u_dot_v `_ +`u_dot_v `_ Compute -`wall_time `_ +`wall_time `_ The equivalent of cpu_time, but for the wall time. -`write_git_log `_ +`weights_angular_integration_lebedev `_ + Theta phi values together with the weights values for the angular integration : + integral [dphi,dtheta] f(x,y,z) = 4 * pi * sum (1`_ Write the last git commit in file iunit. diff --git a/src/Utils/need.irp.f b/src/Utils/need.irp.f index 35b61c2e..b8afe6b3 100644 --- a/src/Utils/need.irp.f +++ b/src/Utils/need.irp.f @@ -1,12 +1,11 @@ - double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB) + double precision function SABpartial(zA,zB,A,B,nA,nB,gamA,gamB,l) implicit double precision(a-h,o-z) dimension nA(3),nB(3) dimension A(3),B(3) gamtot=gamA+gamB SABpartial=1.d0 - l=3 u=gamA/gamtot*A(l)+gamB/gamtot*B(l) arg=gamtot*u**2-gamA*A(l)**2-gamB*B(l)**2 alpha=dexp(arg) diff --git a/src/ZMQ/README.rst b/src/ZMQ/README.rst index b73dc42d..860346fb 100644 --- a/src/ZMQ/README.rst +++ b/src/ZMQ/README.rst @@ -21,55 +21,63 @@ Documentation .. by the `update_README.py` script. -`add_task_to_taskserver `_ +`add_task_to_taskserver `_ Get a task from the task server -`connect_to_taskserver `_ +`add_task_to_taskserver_recv `_ + Get a task from the task server + + +`add_task_to_taskserver_send `_ + Get a task from the task server + + +`connect_to_taskserver `_ Connect to the task server and obtain the worker ID -`disconnect_from_taskserver `_ +`disconnect_from_taskserver `_ Disconnect from the task server -`end_parallel_job `_ +`end_parallel_job `_ End a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' -`end_zmq_pair_socket `_ +`end_zmq_pair_socket `_ Terminate socket on which the results are sent. -`end_zmq_pull_socket `_ +`end_zmq_pull_socket `_ Terminate socket on which the results are sent. -`end_zmq_push_socket `_ +`end_zmq_push_socket `_ Terminate socket on which the results are sent. -`end_zmq_sub_socket `_ +`end_zmq_sub_socket `_ Terminate socket on which the results are sent. -`end_zmq_to_qp_run_socket `_ +`end_zmq_to_qp_run_socket `_ Terminate the socket from the application to qp_run -`get_task_from_taskserver `_ +`get_task_from_taskserver `_ Get a task from the task server -`new_parallel_job `_ +`new_parallel_job `_ Start a new parallel job with name 'name'. The slave tasks execute subroutine 'slave' -`new_zmq_pair_socket `_ +`new_zmq_pair_socket `_ Socket on which the collector and the main communicate -`new_zmq_pull_socket `_ +`new_zmq_pull_socket `_ Socket on which the results are sent. If thread is 1, use inproc @@ -77,90 +85,98 @@ Documentation Socket on which the results are sent. If thread is 1, use inproc -`new_zmq_sub_socket `_ +`new_zmq_sub_socket `_ Socket to read the state published by the Task server -`new_zmq_to_qp_run_socket `_ +`new_zmq_to_qp_run_socket `_ Socket on which the qp_run process replies -`qp_run_address `_ +`qp_run_address `_ Address of the qp_run socket Example : tcp://130.120.229.139:12345 -`reset_zmq_addresses `_ +`reset_zmq_addresses `_ Socket which pulls the results (2) -`switch_qp_run_to_master `_ +`switch_qp_run_to_master `_ Address of the master qp_run socket Example : tcp://130.120.229.139:12345 -`task_done_to_taskserver `_ +`task_done_to_taskserver `_ Get a task from the task server -`wait_for_next_state `_ +`wait_for_next_state `_ Undocumented -`wait_for_state `_ +`wait_for_state `_ Wait for the ZMQ state to be ready -`wait_for_states `_ +`wait_for_states `_ Wait for the ZMQ state to be ready -`zmq_context `_ +`zmq_abort `_ + Aborts a running parallel computation + + +`zmq_context `_ Context for the ZeroMQ library -`zmq_delete_task `_ +`zmq_delete_task `_ 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. -`zmq_port `_ +`zmq_lock `_ + Context for the ZeroMQ library + + +`zmq_port `_ Return the value of the ZMQ port from the corresponding integer -`zmq_port_start `_ +`zmq_port_start `_ Address of the qp_run socket Example : tcp://130.120.229.139:12345 -`zmq_set_running `_ +`zmq_set_running `_ Set the job to Running in QP-run -`zmq_socket_pair_inproc_address `_ +`zmq_socket_pair_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_pull_inproc_address `_ +`zmq_socket_pull_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_pull_tcp_address `_ +`zmq_socket_pull_tcp_address `_ Socket which pulls the results (2) -`zmq_socket_push_inproc_address `_ +`zmq_socket_push_inproc_address `_ Socket which pulls the results (2) -`zmq_socket_push_tcp_address `_ +`zmq_socket_push_tcp_address `_ Socket which pulls the results (2) -`zmq_socket_sub_tcp_address `_ +`zmq_socket_sub_tcp_address `_ Socket which pulls the results (2) -`zmq_state `_ +`zmq_state `_ Threads executing work through the ZeroMQ interface