9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-06 21:43:39 +01:00
qp2/src/tools/rotate_mos.irp.f

19 lines
486 B
Fortran
Raw Normal View History

2019-05-09 23:58:36 +02:00
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