mirror of
https://github.com/QuantumPackage/qp2.git
synced 2025-01-11 13:38:18 +01:00
added kconserv array
This commit is contained in:
parent
9b91e53119
commit
b39a7895f4
@ -37,3 +37,20 @@ type: logical
|
|||||||
doc: If true, the calculation uses periodic boundary conditions
|
doc: If true, the calculation uses periodic boundary conditions
|
||||||
interface: ezfio, provider, ocaml
|
interface: ezfio, provider, ocaml
|
||||||
default: false
|
default: false
|
||||||
|
|
||||||
|
[io_kconserv]
|
||||||
|
doc: Read/Write kconserv array from/to disk [ Write | Read | None ]
|
||||||
|
type: Disk_access
|
||||||
|
interface: ezfio,provider,ocaml
|
||||||
|
default: None
|
||||||
|
|
||||||
|
[kpt_num]
|
||||||
|
doc: Number of k-points
|
||||||
|
type: integer
|
||||||
|
interface: ezfio, provider
|
||||||
|
|
||||||
|
[kconserv]
|
||||||
|
type: integer
|
||||||
|
doc: array containing information about k-point symmetry
|
||||||
|
size: (nuclei.kpt_num,nuclei.kpt_num,nuclei.kpt_num)
|
||||||
|
interface: ezfio
|
||||||
|
26
src/nuclei/kconserv_complex.irp.f
Normal file
26
src/nuclei/kconserv_complex.irp.f
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
BEGIN_PROVIDER [integer, kconserv, (kpt_num,kpt_num,kpt_num)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Information about k-point symmetry
|
||||||
|
!
|
||||||
|
! for k-points I,J,K: kconserv(I,J,K) gives L such that
|
||||||
|
! k_I + k_J = k_K + k_L
|
||||||
|
! two-electron integrals of the form <ij|kx>
|
||||||
|
! (where i,j,k have momentum k_I, k_J, k_K)
|
||||||
|
! will only be nonzero if x has momentum k_L (as described above)
|
||||||
|
!
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,k,l
|
||||||
|
|
||||||
|
if (read_kconserv) then
|
||||||
|
call ezfio_get_nuclei_kconserv(kconserv)
|
||||||
|
print *, 'kconserv read from disk'
|
||||||
|
else
|
||||||
|
print*,'kconserv must be provided'
|
||||||
|
stop -1
|
||||||
|
endif
|
||||||
|
if (write_kconserv) then
|
||||||
|
call ezfio_set_nuclei_kconserv(kconserv)
|
||||||
|
print *, 'kconserv written to disk'
|
||||||
|
endif
|
||||||
|
END_PROVIDER
|
36
src/utils_periodic/import_kconserv.irp.f
Normal file
36
src/utils_periodic/import_kconserv.irp.f
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
program import_kconserv
|
||||||
|
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
call run
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine run
|
||||||
|
use map_module
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! read kconserv in physicists' notation order <ij|kl>
|
||||||
|
! if kconserv(i,j,k)=l, then <ij|kl> is allowed by symmetry
|
||||||
|
! NOTE: pyscf stores this internally in the order of chemists' notation (ik|jl)
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
integer :: iunit
|
||||||
|
integer :: getunitandopen
|
||||||
|
|
||||||
|
integer ::i,j,k,l
|
||||||
|
integer, allocatable :: A(:,:,:)
|
||||||
|
|
||||||
|
allocate(A(kpt_num,kpt_num,kpt_num))
|
||||||
|
|
||||||
|
A = 0
|
||||||
|
iunit = getunitandopen('kconserv','r')
|
||||||
|
do
|
||||||
|
read (iunit,*,end=10) i,j,k,l
|
||||||
|
A(i,j,k) = l
|
||||||
|
enddo
|
||||||
|
10 continue
|
||||||
|
close(iunit)
|
||||||
|
call ezfio_set_nuclei_kconserv(A)
|
||||||
|
call ezfio_set_nuclei_io_kconserv("Read")
|
||||||
|
deallocate(A)
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user