9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-06-13 08:05:17 +02:00
qp2/src/tools/rotate_mos.irp.f
Emmanuel Giner LCT cc578279e7 added rotate mos
2019-05-09 23:58:36 +02:00

19 lines
486 B
Fortran

program rotate_mos
implicit none
integer :: iorb,jorb
read(5,*)iorb,jorb
double precision, allocatable :: mo_coef_tmp(:,:)
allocate(mo_coef_tmp(ao_num,mo_num))
mo_coef_tmp = mo_coef
integer :: i,j
double precision :: dsqrt2_inv
dsqrt2_inv = 1.d0/dsqrt(2.d0)
do i = 1, ao_num
mo_coef(i,iorb) = dsqrt2_inv * ( mo_coef_tmp(i,iorb) + mo_coef_tmp(i,jorb) )
mo_coef(i,jorb) = dsqrt2_inv * ( mo_coef_tmp(i,iorb) - mo_coef_tmp(i,jorb) )
enddo
touch mo_coef
call save_mos
end