@details This subroutine transforms Multi-Reference Spin-Flip (MRSF) response vectors from a compressed representation to an expanded form. It handles both singlet (mrst=1) and triplet (mrst=3) cases.
@param[in] infos Information structure containing system parameters @param[in] xv Input compressed MRSF response vector @param[out] xv12 Output expanded MRSF response vector
@date Aug 2024 @author Konstantin Komarov
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(information), | intent(in) | :: | infos | |||
real(kind=dp), | intent(in), | dimension(:) | :: | xv | ||
real(kind=dp), | intent(inout), | dimension(:) | :: | xv12 |
subroutine mrsfxvec(infos,xv,xv12) use precision, only: dp use types, only: information use messages, only: show_message, with_abort implicit none type(information), intent(in) :: infos real(kind=dp), intent(in), dimension(:) :: xv real(kind=dp), intent(inout), dimension(:) :: xv12 integer :: noca, nocb, nbf, mrst integer :: i, ij, ijd, ijg, ijlr1, ijlr2, j, xvec_dim, ok real(kind=dp), parameter :: sqrt2 = 1.0_dp/sqrt(2.0_dp) real(kind=dp), allocatable, dimension(:) :: tmp nbf = infos%basis%nbf noca = infos%mol_prop%nelec_A nocb = infos%mol_prop%nelec_B mrst = infos%tddft%mult ijlr1 = (noca-1-nocb-1)*noca+noca-1 ijg = (noca-1-nocb-1)*noca+noca ijd = (noca -nocb-1)*noca+noca-1 ijlr2 = (noca -nocb-1)*noca+noca xvec_dim = noca*(nbf-nocb) allocate(tmp(xvec_dim), source=0.0_dp, stat=ok) if (ok /= 0) call show_message('Cannot allocate memory', with_abort) if (mrst==1) then do i = 1, noca do j = nocb+1, nbf ij = (j-nocb-1)*noca+i if(ij==ijlr1) then tmp(ij) = xv(ijlr1)*sqrt2 cycle else if(ij==ijlr2) then tmp(ij) = -xv(ijlr1)*sqrt2 cycle end if tmp(ij) = xv(ij) end do end do else if (mrst==3) then do i = 1, noca do j = nocb+1,nbf ij = (j-nocb-1)*noca+i if(ij==ijlr1) then tmp(ij) = xv(ijlr1)*sqrt2 cycle else if(ij==ijg) then tmp(ij) = 0.0_dp cycle else if(ij==ijd) then tmp(ij) = 0.0_dp cycle else if(ij==ijlr2) then tmp(ij) = xv(ijlr1)*sqrt2 cycle end if tmp(ij) = xv(ij) end do end do end if xv12(:) = tmp(:) return end subroutine mrsfxvec