9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 19:43:32 +01:00
This commit is contained in:
Kevin Gasperich 2020-03-18 16:30:27 -05:00
parent 380cbdcbb5
commit a0eb1d34db
9 changed files with 179 additions and 11 deletions

View File

@ -15,6 +15,12 @@ doc: Complex MO coefficient of the i-th |AO| on the j-th |MO|
interface: ezfio interface: ezfio
size: (2,ao_basis.ao_num,mo_basis.mo_num) size: (2,ao_basis.ao_num,mo_basis.mo_num)
[mo_coef_kpts]
type: double precision
doc: Complex MO coefficient of the i-th |AO| on the j-th |MO|
interface: ezfio
size: (2,ao_basis.ao_num_per_kpt,mo_basis.mo_num_per_kpt,nuclei.kpt_num)
[mo_label] [mo_label]
type: character*(64) type: character*(64)
doc: Label characterizing the MOS (Local, Canonical, Natural, *etc*) doc: Label characterizing the MOS (Local, Canonical, Natural, *etc*)
@ -26,6 +32,12 @@ doc: |MO| occupation numbers
interface: ezfio interface: ezfio
size: (mo_basis.mo_num) size: (mo_basis.mo_num)
[mo_occ_kpts]
type: double precision
doc: |MO| occupation numbers
interface: ezfio
size: (mo_basis.mo_num_per_kpt,nuclei.kpt_num)
[mo_class] [mo_class]
type: MO_class type: MO_class
doc: [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class` doc: [ Core | Inactive | Active | Virtual | Deleted ], as defined by :ref:`qp_set_mo_class`

View File

@ -1,8 +1,8 @@
subroutine save_mos subroutine save_mos
implicit none implicit none
double precision, allocatable :: buffer(:,:) double precision, allocatable :: buffer(:,:)
complex*16, allocatable :: buffer_c(:,:) complex*16, allocatable :: buffer_c(:,:),buffer_k(:,:,:)
integer :: i,j integer :: i,j,k
!TODO: change this for periodic? !TODO: change this for periodic?
! save real/imag parts of mo_coef_complex ! save real/imag parts of mo_coef_complex
! otherwise need to make sure mo_coef and mo_coef_imag ! otherwise need to make sure mo_coef and mo_coef_imag
@ -13,14 +13,18 @@ subroutine save_mos
call ezfio_set_mo_basis_ao_md5(ao_md5) call ezfio_set_mo_basis_ao_md5(ao_md5)
if (is_complex) then if (is_complex) then
allocate ( buffer_c(ao_num,mo_num)) allocate ( buffer_c(ao_num,mo_num))
buffer_c = (0.d0,0.d0) allocate ( buffer_k(ao_num_per_kpt,mo_num_per_kpt,kpt_num))
do j = 1, mo_num buffer_k = (0.d0,0.d0)
do i = 1, ao_num do k=1,kpt_num
buffer_c(i,j) = mo_coef_complex(i,j) do j = 1, mo_num_per_kpt
do i = 1, ao_num_per_kpt
buffer_k(i,j,k) = mo_coef_kpts(i,j,k)
enddo
enddo enddo
enddo enddo
call ezfio_set_mo_basis_mo_coef_complex(buffer_c) call ezfio_set_mo_basis_mo_coef_kpts(buffer_k)
deallocate (buffer_c) deallocate (buffer_k)
call ezfio_set_mo_basis_mo_occ_kpts(mo_occ_kpts)
else else
allocate ( buffer(ao_num,mo_num) ) allocate ( buffer(ao_num,mo_num) )
buffer = 0.d0 buffer = 0.d0
@ -31,8 +35,8 @@ subroutine save_mos
enddo enddo
call ezfio_set_mo_basis_mo_coef(buffer) call ezfio_set_mo_basis_mo_coef(buffer)
deallocate (buffer) deallocate (buffer)
call ezfio_set_mo_basis_mo_occ(mo_occ)
endif endif
call ezfio_set_mo_basis_mo_occ(mo_occ)
call ezfio_set_mo_basis_mo_class(mo_class) call ezfio_set_mo_basis_mo_class(mo_class)
end end

View File

@ -10,6 +10,12 @@ doc: Complex nucleus-electron integrals in |MO| basis set
size: (2,mo_basis.mo_num,mo_basis.mo_num) size: (2,mo_basis.mo_num,mo_basis.mo_num)
interface: ezfio interface: ezfio
[mo_integrals_e_n_kpts]
type: double precision
doc: Complex nucleus-electron integrals in |MO| basis set
size: (2,mo_basis.mo_num_per_kpt,mo_basis.mo_num_per_kpt,nuclei.kpt_num)
interface: ezfio
[io_mo_integrals_e_n] [io_mo_integrals_e_n]
type: Disk_access type: Disk_access
doc: Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ] doc: Read/Write |MO| electron-nucleus attraction integrals from/to disk [ Write | Read | None ]
@ -29,6 +35,12 @@ doc: Complex kinetic energy integrals in |MO| basis set
size: (2,mo_basis.mo_num,mo_basis.mo_num) size: (2,mo_basis.mo_num,mo_basis.mo_num)
interface: ezfio interface: ezfio
[mo_integrals_kinetic_kpts]
type: double precision
doc: Complex kinetic energy integrals in |MO| basis set
size: (2,mo_basis.mo_num_per_kpt,mo_basis.mo_num_per_kpt,nuclei.kpt_num)
interface: ezfio
[io_mo_integrals_kinetic] [io_mo_integrals_kinetic]
type: Disk_access type: Disk_access
doc: Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ] doc: Read/Write |MO| one-electron kinetic integrals from/to disk [ Write | Read | None ]
@ -48,6 +60,12 @@ doc: Complex pseudopotential integrals in |MO| basis set
size: (2,mo_basis.mo_num,mo_basis.mo_num) size: (2,mo_basis.mo_num,mo_basis.mo_num)
interface: ezfio interface: ezfio
[mo_integrals_pseudo_kpts]
type: double precision
doc: Complex pseudopotential integrals in |MO| basis set
size: (2,mo_basis.mo_num_per_kpt,mo_basis.mo_num_per_kpt,nuclei.kpt_num)
interface: ezfio
[io_mo_integrals_pseudo] [io_mo_integrals_pseudo]
type: Disk_access type: Disk_access
doc: Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ] doc: Read/Write |MO| pseudopotential integrals from/to disk [ Write | Read | None ]
@ -67,6 +85,12 @@ doc: Complex one-electron integrals in |MO| basis set
size: (2,mo_basis.mo_num,mo_basis.mo_num) size: (2,mo_basis.mo_num,mo_basis.mo_num)
interface: ezfio interface: ezfio
[mo_one_e_integrals_kpts]
type: double precision
doc: Complex one-electron integrals in |MO| basis set
size: (2,mo_basis.mo_num_per_kpt,mo_basis.mo_num_per_kpt,nuclei.kpt_num)
interface: ezfio
[io_mo_one_e_integrals] [io_mo_one_e_integrals]
type: Disk_access type: Disk_access
doc: Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ] doc: Read/Write |MO| one-electron integrals from/to disk [ Write | Read | None ]

View File

@ -25,3 +25,36 @@ BEGIN_PROVIDER [complex*16, mo_kinetic_integrals_complex, (mo_num,mo_num)]
END_PROVIDER END_PROVIDER
!============================================!
! !
! kpts !
! !
!============================================!
BEGIN_PROVIDER [complex*16, mo_kinetic_integrals_kpts, (mo_num_per_kpt,mo_num_per_kpt,kpt_num)]
implicit none
BEGIN_DOC
! Kinetic energy integrals in the MO basis
END_DOC
integer :: i,j
print *, 'Providing MO kinetic integrals'
if (read_mo_integrals_kinetic) then
call ezfio_get_mo_one_e_ints_mo_integrals_kinetic_kpts(mo_kinetic_integrals_kpts)
print *, 'MO kinetic integrals read from disk'
else
print *, 'Providing MO kinetic integrals from AO kinetic integrals'
call ao_to_mo_kpts( &
ao_kinetic_integrals_kpts, &
size(ao_kinetic_integrals_kpts,1), &
mo_kinetic_integrals_kpts, &
size(mo_kinetic_integrals_kpts,1) &
)
endif
if (write_mo_integrals_kinetic) then
call ezfio_set_mo_one_e_ints_mo_integrals_kinetic_kpts(mo_kinetic_integrals_kpts)
print *, 'MO kinetic integrals written to disk'
endif
END_PROVIDER

View File

@ -26,3 +26,36 @@ BEGIN_PROVIDER [ complex*16, mo_one_e_integrals_complex,(mo_num,mo_num)]
END_PROVIDER END_PROVIDER
!============================================!
! !
! kpts !
! !
!============================================!
BEGIN_PROVIDER [ complex*16, mo_one_e_integrals_kpts,(mo_num_per_kpt,mo_num_per_kpt,kpt_num)]
implicit none
integer :: i,j,n,l
BEGIN_DOC
! array of the one-electron Hamiltonian on the |MO| basis :
! sum of the kinetic and nuclear electronic potentials (and pseudo potential if needed)
END_DOC
print*,'Providing the one-electron integrals'
IF (read_mo_one_e_integrals) THEN
call ezfio_get_mo_one_e_ints_mo_one_e_integrals_kpts(mo_one_e_integrals_kpts)
ELSE
mo_one_e_integrals_kpts = mo_integrals_n_e_kpts + mo_kinetic_integrals_kpts
IF (do_pseudo) THEN
mo_one_e_integrals_kpts += mo_pseudo_integrals_kpts
ENDIF
ENDIF
IF (write_mo_one_e_integrals) THEN
call ezfio_set_mo_one_e_ints_mo_one_e_integrals_kpts(mo_one_e_integrals_kpts)
print *, 'MO one-e integrals written to disk'
ENDIF
print*,'Provided the one-electron integrals'
END_PROVIDER

View File

@ -25,4 +25,35 @@ BEGIN_PROVIDER [complex*16, mo_integrals_n_e_complex, (mo_num,mo_num)]
END_PROVIDER END_PROVIDER
!============================================!
! !
! kpts !
! !
!============================================!
BEGIN_PROVIDER [complex*16, mo_integrals_n_e_kpts, (mo_num_per_kpt,mo_num_per_kpt,kpt_num)]
implicit none
BEGIN_DOC
! Kinetic energy integrals in the MO basis
END_DOC
integer :: i,j
print *, 'Providing MO N-e integrals'
if (read_mo_integrals_e_n) then
call ezfio_get_mo_one_e_ints_mo_integrals_e_n_kpts(mo_integrals_n_e_kpts)
print *, 'MO N-e integrals read from disk'
else
print *, 'Providing MO N-e integrals from AO N-e integrals'
call ao_to_mo_kpts( &
ao_integrals_n_e_kpts, &
size(ao_integrals_n_e_kpts,1), &
mo_integrals_n_e_kpts, &
size(mo_integrals_n_e_kpts,1) &
)
endif
if (write_mo_integrals_e_n) then
call ezfio_set_mo_one_e_ints_mo_integrals_e_n_kpts(mo_integrals_n_e_kpts)
print *, 'MO N-e integrals written to disk'
endif
END_PROVIDER

View File

@ -25,4 +25,35 @@ BEGIN_PROVIDER [complex*16, mo_pseudo_integrals_complex, (mo_num,mo_num)]
END_PROVIDER END_PROVIDER
!============================================!
! !
! kpts !
! !
!============================================!
BEGIN_PROVIDER [complex*16, mo_pseudo_integrals_kpts, (mo_num_per_kpt,mo_num_per_kpt,kpt_num)]
implicit none
BEGIN_DOC
! Pseudopotential integrals in |MO| basis
END_DOC
integer :: i,j
if (read_mo_integrals_pseudo) then
call ezfio_get_mo_one_e_ints_mo_integrals_pseudo_kpts(mo_pseudo_integrals_kpts)
print *, 'MO pseudopotential integrals read from disk'
else if (do_pseudo) then
call ao_to_mo_kpts( &
ao_pseudo_integrals_kpts, &
size(ao_pseudo_integrals_kpts,1), &
mo_pseudo_integrals_kpts, &
size(mo_pseudo_integrals_kpts,1) &
)
else
mo_pseudo_integrals_kpts = (0.d0,0.d0)
endif
if (write_mo_integrals_pseudo) then
call ezfio_set_mo_one_e_ints_mo_integrals_pseudo_kpts(mo_pseudo_integrals_kpts)
print *, 'MO pseudopotential integrals written to disk'
endif
END_PROVIDER

View File

@ -543,7 +543,7 @@ END_PROVIDER
ao_two_e_integral_alpha_kpts = (0.d0,0.d0) ao_two_e_integral_alpha_kpts = (0.d0,0.d0)
ao_two_e_integral_beta_kpts = (0.d0,0.d0) ao_two_e_integral_beta_kpts = (0.d0,0.d0)
PROVIDE ao_two_e_integrals_in_map PROVIDE ao_two_e_integrals_in_map scf_density_matrix_ao_alpha_kpts scf_density_matrix_ao_beta_kpts
integer(omp_lock_kind) :: lck(ao_num) integer(omp_lock_kind) :: lck(ao_num)
integer(map_size_kind) :: i8 integer(map_size_kind) :: i8

View File

@ -84,7 +84,7 @@ subroutine huckel_guess_kpts
!TOUCH fock_matrix_ao_alpha_complex fock_matrix_ao_beta_kpts !TOUCH fock_matrix_ao_alpha_complex fock_matrix_ao_beta_kpts
TOUCH fock_matrix_ao_alpha_kpts fock_matrix_ao_beta_kpts TOUCH fock_matrix_ao_alpha_kpts fock_matrix_ao_beta_kpts
mo_coef_kpts = eigenvectors_fock_matrix_mo_kpts mo_coef_kpts = eigenvectors_fock_matrix_mo_kpts
SOFT_TOUCH mo_coef_complex SOFT_TOUCH mo_coef_kpts
call save_mos call save_mos
deallocate(A) deallocate(A)