@brief Main subroutine for calculating state overlaps and derivative coupling matrix elements
@param[in,out] infos Information class containing molecule parameters
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(information), | intent(inout), | target | :: | infos |
subroutine get_states_overlap(infos) use precision, only: dp use io_constants, only: iw use oqp_tagarray_driver use types, only: information use strings, only: Cstring, fstring use basis_tools, only: basis_set use atomic_structure_m, only: atomic_structure use messages, only: show_message, with_abort use tdhf_mrsf_lib, only: mrsfxvec use util, only: measure_time implicit none character(len=*), parameter :: subroutine_name = "get_states_overlap" type(information), target, intent(inout) :: infos type(basis_set), pointer :: basis integer :: nstates, mrst, xvec_dim, nbf, ok, j integer :: noca, nocb, ndtlf real(kind=dp), allocatable, target :: bvec(:,:), bvec_old(:,:) ! Tagarray character(len=*), parameter :: tags_general(*) = (/ character(len=80) :: & OQP_td_bvec_mo_old, OQP_td_bvec_mo, OQP_overlap_mo /) character(len=*), parameter :: tags_alloc(*) = (/ character(len=80) :: & OQP_nac /) real(kind=dp), contiguous, pointer :: bvec_mo(:,:), bvec_mo_old(:,:), & nac_out(:,:), overlap_mo(:,:), td_states_phase(:), td_states_overlap(:,:) ! Files open open (unit=IW, file=infos%log_filename, position="append") ! Load basis set basis => infos%basis basis%atoms => infos%atoms nstates = infos%tddft%nstate mrst = infos%tddft%mult nbf = basis%nbf xvec_dim = infos%mol_prop%nelec_a*(nbf-infos%mol_prop%nelec_b) ! ndtlf = 0 less accurate ! ndtlf = 1 : tlf(1) ! ndtlf = 2 : tlf(2) most accurate ndtlf = infos%tddft%tlf ! Allocate data for outputing in python level call infos%dat%remove_records(tags_alloc) call infos%dat%reserve_data(OQP_td_states_phase, ta_type_real64, & nstates, (/ nstates /), comment=OQP_td_states_phase_comment) call infos%dat%reserve_data(OQP_td_states_overlap, ta_type_real64, & nstates*nstates, (/ nstates, nstates /), comment=OQP_td_states_overlap_comment) call infos%dat%reserve_data(OQP_nac, ta_type_real64, & nstates*nstates, (/ nstates, nstates /), comment=OQP_nac_comment) ! Load data from python level call data_has_tags(infos%dat, tags_general, module_name, subroutine_name, with_abort) call tagarray_get_data(infos%dat, OQP_td_bvec_mo, bvec_mo) call tagarray_get_data(infos%dat, OQP_overlap_mo, overlap_mo) call tagarray_get_data(infos%dat, OQP_td_bvec_mo_old, bvec_mo_old) call data_has_tags(infos%dat, tags_alloc, module_name, subroutine_name, with_abort) call tagarray_get_data(infos%dat, OQP_td_states_phase, td_states_phase) call tagarray_get_data(infos%dat, OQP_td_states_overlap, td_states_overlap) call tagarray_get_data(infos%dat, OQP_nac, nac_out) allocate(bvec(xvec_dim,nstates), & bvec_old(xvec_dim,nstates), & source=0.0_dp, stat=ok) if( ok/=0 ) call show_message('Cannot allocate memory',with_abort) noca = infos%mol_prop%nelec_a nocb = infos%mol_prop%nelec_b do j = 1, nstates call mrsfxvec(infos, bvec_mo_old(:,j), bvec_old(:,j)) call mrsfxvec(infos, bvec_mo(:,j), bvec(:,j)) end do call check_states_phase(bvec, bvec_old, td_states_phase) call compute_states_overlap( & infos, overlap_mo, td_states_overlap, bvec, & bvec_old, nbf,noca, nocb, nstates, ndtlf) call get_dcv(nac_out, td_states_overlap, nstates) ! call print_nac(infos, td_states_overlap, nac_out) ! Print timings call measure_time(print_total=1, log_unit=iw) call flush(iw) close(iw) end subroutine get_states_overlap