mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 20:34:58 +01:00
Fixed pseudo-inverse (extrapolations)
This commit is contained in:
parent
419ed79c49
commit
1b9a75f488
@ -21,3 +21,10 @@ type: logical
|
||||
doc: If true and N_states > 1, the oscillator strength will be computed
|
||||
interface: ezfio,provider,ocaml
|
||||
default: false
|
||||
|
||||
[calc_energy_components]
|
||||
type: logical
|
||||
doc: If true, the components of the energy (1e, 2e, kinetic) will be computed
|
||||
interface: ezfio,provider,ocaml
|
||||
default: false
|
||||
|
||||
|
@ -6,6 +6,11 @@ subroutine print_mol_properties()
|
||||
! Run the propertie calculations
|
||||
END_DOC
|
||||
|
||||
! Energy components
|
||||
if (calc_energy_components) then
|
||||
call print_energy_components
|
||||
endif
|
||||
|
||||
! Electric dipole moment
|
||||
if (calc_dipole_moment) then
|
||||
call print_dipole_moment
|
||||
|
@ -1377,31 +1377,29 @@ subroutine get_pseudo_inverse(A, LDA, m, n, C, LDC, cutoff)
|
||||
enddo
|
||||
endif
|
||||
|
||||
print*, ' n_svd = ', n_svd
|
||||
! !$OMP PARALLEL &
|
||||
! !$OMP DEFAULT (NONE) &
|
||||
! !$OMP PRIVATE (i, j) &
|
||||
! !$OMP SHARED (n, n_svd, D, Vt)
|
||||
! !$OMP DO
|
||||
! do j = 1, n
|
||||
! do i = 1, n_svd
|
||||
! Vt(i,j) = D(i) * Vt(i,j)
|
||||
! enddo
|
||||
! enddo
|
||||
! !$OMP END DO
|
||||
! !$OMP END PARALLEL
|
||||
|
||||
!$OMP PARALLEL &
|
||||
!$OMP DEFAULT (NONE) &
|
||||
!$OMP PRIVATE (i, j) &
|
||||
!$OMP SHARED (n, n_svd, D, Vt)
|
||||
!$OMP DO
|
||||
do j = 1, n
|
||||
do i = 1, n_svd
|
||||
Vt(i,j) = D(i) * Vt(i,j)
|
||||
! call dgemm('N', 'N', n, m, n_svd, 1.d0, Vt, size(Vt,1), U, size(U,1), 0.d0, C, size(C,1))
|
||||
|
||||
C = 0.d0
|
||||
do i=1,m
|
||||
do j=1,n
|
||||
do k=1,n_svd
|
||||
C(j,i) = C(j,i) + U(i,k) * D(k) * Vt(k,j)
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
!$OMP END DO
|
||||
!$OMP END PARALLEL
|
||||
|
||||
call dgemm("N", "N", m, n, n_svd, 1.d0, U, m, Vt, n, 0.d0, C, LDC)
|
||||
|
||||
! C = 0.d0
|
||||
! do i=1,m
|
||||
! do j=1,n
|
||||
! do k=1,n
|
||||
! C(j,i) = C(j,i) + U(i,k) * D(k) * Vt(k,j)
|
||||
! enddo
|
||||
! enddo
|
||||
! enddo
|
||||
|
||||
deallocate(U,D,Vt,work,A_tmp)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user