mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 10:05:57 +01:00
Added MOs and bitmasks
This commit is contained in:
parent
d649150543
commit
a89f032e15
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,3 @@
|
|||||||
sci.rc
|
quantum_package.rc
|
||||||
EZFIO
|
EZFIO
|
||||||
irpf90
|
irpf90
|
||||||
|
2
Makefile
2
Makefile
@ -23,5 +23,5 @@ doc:
|
|||||||
$(MAKE) -C doc
|
$(MAKE) -C doc
|
||||||
|
|
||||||
src: irpf90 EZFIO
|
src: irpf90 EZFIO
|
||||||
export SCI_ROOT=$$PWD ; \
|
export QPACKAGE_ROOT=$$PWD ; \
|
||||||
$(MAKE) -C src
|
$(MAKE) -C src
|
||||||
|
@ -32,7 +32,7 @@ fi
|
|||||||
|
|
||||||
for d in $COMMAND_LINE
|
for d in $COMMAND_LINE
|
||||||
do
|
do
|
||||||
if [[ ! -d ${SCI_ROOT}/src/$d ]]
|
if [[ ! -d ${QPACKAGE_ROOT}/src/$d ]]
|
||||||
then
|
then
|
||||||
echo Error: Directory $d does not exist
|
echo Error: Directory $d does not exist
|
||||||
exit 2
|
exit 2
|
||||||
@ -44,7 +44,7 @@ DEPS_LONG=""
|
|||||||
for i in $COMMAND_LINE
|
for i in $COMMAND_LINE
|
||||||
do
|
do
|
||||||
DEPS_LONG+=" $i "
|
DEPS_LONG+=" $i "
|
||||||
DEPS_LONG+=$(grep -e '^INCLUDE_DIRS' ${SCI_ROOT}/src/${i}/Makefile 2>/dev/null | cut -d '=' -f 2)
|
DEPS_LONG+=$(grep -e '^INCLUDE_DIRS' ${QPACKAGE_ROOT}/src/${i}/Makefile 2>/dev/null | cut -d '=' -f 2)
|
||||||
done
|
done
|
||||||
|
|
||||||
DEPS=$(unique_list $DEPS_LONG)
|
DEPS=$(unique_list $DEPS_LONG)
|
||||||
|
@ -11,7 +11,7 @@ DEPS_LONG=""
|
|||||||
for i in $@
|
for i in $@
|
||||||
do
|
do
|
||||||
DEPS_LONG+=" $i "
|
DEPS_LONG+=" $i "
|
||||||
DEPS_LONG+=$(grep 'INCLUDE_DIRS' ${SCI_ROOT}/src/${i}/Makefile 2>/dev/null | cut -d '=' -f 2)
|
DEPS_LONG+=$(grep 'INCLUDE_DIRS' ${QPACKAGE_ROOT}/src/${i}/Makefile 2>/dev/null | cut -d '=' -f 2)
|
||||||
done
|
done
|
||||||
|
|
||||||
DEPS=($(
|
DEPS=($(
|
||||||
@ -34,15 +34,15 @@ SRC=
|
|||||||
OBJ=
|
OBJ=
|
||||||
|
|
||||||
include Makefile.depend
|
include Makefile.depend
|
||||||
include \$(SCI_ROOT)/src/Makefile.config
|
include \$(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
include \$(SCI_ROOT)/src/Makefile.common
|
include \$(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
|
|
||||||
irpf90.make: \$(filter-out IRPF90_temp/%, \$(wildcard */*.irp.f)) \$(wildcard *.irp.f) \$(wildcard *.inc.f) Makefile \$(EZFIO)
|
irpf90.make: \$(filter-out IRPF90_temp/%, \$(wildcard */*.irp.f)) \$(wildcard *.irp.f) \$(wildcard *.inc.f) Makefile \$(EZFIO)
|
||||||
\$(IRPF90)
|
\$(IRPF90)
|
||||||
|
|
||||||
Makefile.depend: Makefile
|
Makefile.depend: Makefile
|
||||||
\$(SCI_ROOT)/scripts/create_Makefile_depend.sh
|
\$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,12 +13,12 @@ DEPS=$(grep "INCLUDE_DIRS" Makefile 2>/dev/null | cut -d '=' -f 2)
|
|||||||
for M in ${DEPS}
|
for M in ${DEPS}
|
||||||
do
|
do
|
||||||
# X is the list of external source files
|
# X is the list of external source files
|
||||||
X=$(grep 'SRC=' ${SCI_ROOT}/src/${M}/Makefile 2>/dev/null |cut -d '=' -f 2)
|
X=$(grep 'SRC=' ${QPACKAGE_ROOT}/src/${M}/Makefile 2>/dev/null |cut -d '=' -f 2)
|
||||||
for f in ${X}
|
for f in ${X}
|
||||||
do
|
do
|
||||||
SRC+=" ${M}/${f}"
|
SRC+=" ${M}/${f}"
|
||||||
done
|
done
|
||||||
X=$(grep 'OBJ=' ${SCI_ROOT}/src/${M}/Makefile 2>/dev/null |cut -d '=' -f 2)
|
X=$(grep 'OBJ=' ${QPACKAGE_ROOT}/src/${M}/Makefile 2>/dev/null |cut -d '=' -f 2)
|
||||||
for f in ${X}
|
for f in ${X}
|
||||||
do
|
do
|
||||||
OBJ+=" IRPF90_temp/${M}/${f/IRPF90_temp//}"
|
OBJ+=" IRPF90_temp/${M}/${f/IRPF90_temp//}"
|
||||||
|
@ -23,6 +23,6 @@ mkdir ${MODULE}
|
|||||||
cd ${MODULE}
|
cd ${MODULE}
|
||||||
|
|
||||||
# Create the Makefile
|
# Create the Makefile
|
||||||
${SCI_ROOT}/create_Makefile.sh
|
${QPACKAGE_ROOT}/create_Makefile.sh
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
SCI_ROOT=${PWD}
|
QPACKAGE_ROOT=${PWD}
|
||||||
|
|
||||||
IRPF90=$(which irpf90)
|
IRPF90=$(which irpf90)
|
||||||
|
|
||||||
if [[ -z ${IRPF90} ]] ;
|
if [[ -z ${IRPF90} ]] ;
|
||||||
then
|
then
|
||||||
make irpf90
|
make irpf90
|
||||||
IRPF90=${SCI_ROOT}/irpf90/bin/irpf90
|
IRPF90=${QPACKAGE_ROOT}/irpf90/bin/irpf90
|
||||||
fi
|
fi
|
||||||
make EZFIO
|
make EZFIO
|
||||||
|
|
||||||
cat << EOF > sci.rc
|
cat << EOF > quantum_package.rc
|
||||||
export IRPF90=${IRPF90}
|
export IRPF90=${IRPF90}
|
||||||
export SCI_ROOT=${SCI_ROOT}
|
export QPACKAGE_ROOT=${QPACKAGE_ROOT}
|
||||||
export PATH+=:${SCI_ROOT}/scripts
|
export PATH+=:${QPACKAGE_ROOT}/scripts
|
||||||
export PATH+=:${SCI_ROOT}/bin
|
export PATH+=:${QPACKAGE_ROOT}/bin
|
||||||
EOF
|
EOF
|
||||||
|
9
src/.gitignore
vendored
Normal file
9
src/.gitignore
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Makefile.config
|
||||||
|
*IRPF90_temp
|
||||||
|
*IRPF90_man
|
||||||
|
*irpf90.make
|
||||||
|
*irpf90_entities
|
||||||
|
*tags
|
||||||
|
*.o
|
||||||
|
*.mod
|
||||||
|
*/Makefile.depend
|
@ -1,9 +1,20 @@
|
|||||||
default: all
|
default: all
|
||||||
INCLUDE_DIRS = Ezfio_files Utils Nuclei
|
|
||||||
|
|
||||||
include ../Makefile.config
|
# Define here all other modules on which the current module depends
|
||||||
include ../Makefile.common
|
INCLUDE_DIRS = Ezfio_files Nuclei Utils
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
|
|
||||||
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
$(IRPF90)
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
||||||
|
20
src/Bitmask/Makefile
Normal file
20
src/Bitmask/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
|
INCLUDE_DIRS = AOs Electrons Ezfio_files MOs Nuclei Utils
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=bitmasks_module.f90
|
||||||
|
OBJ=IRPF90_temp/bitmasks_module.o
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
|
include irpf90.make
|
||||||
|
|
||||||
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
57
src/Bitmask/bitmasks.irp.f
Normal file
57
src/Bitmask/bitmasks.irp.f
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
use bitmasks
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, N_int ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Number of 64-bit integers needed to represent determinants as binary strings
|
||||||
|
END_DOC
|
||||||
|
N_int = (mo_tot_num-1)/bit_kind_size + 1
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), full_ijkl_bitmask, (N_int,4) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Bitmask to include all possible <ij|kl> integrals
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
integer :: i,j,n
|
||||||
|
n = mod(mo_tot_num-1,bit_kind_size)+1
|
||||||
|
full_ijkl_bitmask = 0_bit_kind
|
||||||
|
do j=1,4
|
||||||
|
do i=1,N_int-1
|
||||||
|
full_ijkl_bitmask(i,j) = not(0_bit_kind)
|
||||||
|
enddo
|
||||||
|
do i=1,n
|
||||||
|
full_ijkl_bitmask(N_int,j) = ibset(full_ijkl_bitmask(N_int,j),i-1)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), HF_bitmask, (N_int,2)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Hartree Fock bit mask
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,n
|
||||||
|
integer :: occ(elec_alpha_num)
|
||||||
|
|
||||||
|
HF_bitmask = 0_bit_kind
|
||||||
|
do i=1,elec_alpha_num
|
||||||
|
occ(i) = i
|
||||||
|
enddo
|
||||||
|
call list_to_bitstring( HF_bitmask(1,1), occ, elec_alpha_num, N_int)
|
||||||
|
! elec_alpha_num <= elec_beta_num, so occ is already OK.
|
||||||
|
call list_to_bitstring( HF_bitmask(1,2), occ, elec_beta_num, N_int)
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), ref_bitmask, (N_int,2)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reference bit mask, used in Slater rules, chosen as Hartree-Fock bitmask
|
||||||
|
END_DOC
|
||||||
|
ref_bitmask = HF_bitmask
|
||||||
|
END_PROVIDER
|
||||||
|
|
5
src/Bitmask/bitmasks_module.f90
Normal file
5
src/Bitmask/bitmasks_module.f90
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
module bitmasks
|
||||||
|
integer, parameter :: bit_kind_shift = 6 ! 5: 32 bits, 6: 64 bits
|
||||||
|
integer, parameter :: bit_kind_size = 64
|
||||||
|
integer, parameter :: bit_kind = 64/8
|
||||||
|
end module
|
94
src/Bitmask/bitmasks_routines.irp.f
Normal file
94
src/Bitmask/bitmasks_routines.irp.f
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
subroutine bitstring_to_list( string, list, n_elements, Nint)
|
||||||
|
use bitmasks
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Gives the inidices(+1) of the bits set to 1 in the bit string
|
||||||
|
END_DOC
|
||||||
|
integer, intent(in) :: Nint
|
||||||
|
integer(bit_kind), intent(in) :: string(Nint)
|
||||||
|
integer, intent(out) :: list(Nint*bit_kind_size)
|
||||||
|
integer, intent(out) :: n_elements
|
||||||
|
|
||||||
|
integer :: i, ishift
|
||||||
|
integer(bit_kind) :: l
|
||||||
|
|
||||||
|
n_elements = 0
|
||||||
|
ishift = 2
|
||||||
|
do i=1,Nint
|
||||||
|
l = string(i)
|
||||||
|
do while (l /= 0_bit_kind)
|
||||||
|
n_elements = n_elements+1
|
||||||
|
list(n_elements) = ishift+popcnt(l-1_bit_kind) - popcnt(l)
|
||||||
|
l = iand(l,l-1_bit_kind)
|
||||||
|
enddo
|
||||||
|
ishift = ishift + bit_kind_size
|
||||||
|
enddo
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine list_to_bitstring( string, list, n_elements, Nint)
|
||||||
|
use bitmasks
|
||||||
|
implicit none
|
||||||
|
integer, intent(in) :: Nint
|
||||||
|
integer(bit_kind), intent(out) :: string(Nint)
|
||||||
|
integer, intent(in) :: list(Nint*bit_kind_size)
|
||||||
|
integer, intent(in) :: n_elements
|
||||||
|
|
||||||
|
|
||||||
|
integer :: i, j
|
||||||
|
integer :: ipos, iint
|
||||||
|
BEGIN_DOC
|
||||||
|
! return the physical string "string(N_int,2)" from the array of occupations "list(N_int*bit_kind_size,2)
|
||||||
|
! list
|
||||||
|
! <== ipos ==>
|
||||||
|
! |
|
||||||
|
! v
|
||||||
|
!string :|------------------------|-------------------------|------------------------|
|
||||||
|
! <==== bit_kind_size ====> <==== bit_kind_size ====> <==== bit_kind_size ====>
|
||||||
|
! { iint } { iint } { iint }
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
string = 0_bit_kind
|
||||||
|
|
||||||
|
do i=1,n_elements
|
||||||
|
iint = ishft(list(i)-1,-bit_kind_shift) + 1
|
||||||
|
ipos = list(i)-ishft((iint-1),bit_kind_shift)-1
|
||||||
|
string(iint) = ibset( string(iint), ipos )
|
||||||
|
enddo
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
subroutine write_bitstring( iunit, string, Nint )
|
||||||
|
implicit none
|
||||||
|
use bitmasks
|
||||||
|
integer, intent(in) :: iunit
|
||||||
|
integer, intent(in) :: Nint
|
||||||
|
integer(bit_kind), intent(in) :: string(Nint)
|
||||||
|
|
||||||
|
integer :: i, j, ibuf
|
||||||
|
integer(bit_kind) :: itemp
|
||||||
|
character*(1) :: buffer(Nint*bit_kind_size+2)
|
||||||
|
|
||||||
|
ibuf = 1
|
||||||
|
buffer(ibuf) = '|'
|
||||||
|
ibuf = ibuf+1
|
||||||
|
do i=1,Nint
|
||||||
|
itemp = 1_bit_kind
|
||||||
|
do j=1,bit_kind_size
|
||||||
|
if (iand(itemp,string(i)) == itemp) then
|
||||||
|
buffer(ibuf) = '+'
|
||||||
|
else
|
||||||
|
buffer(ibuf) = '-'
|
||||||
|
endif
|
||||||
|
ibuf = ibuf+1
|
||||||
|
itemp = ishft(itemp,1)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
buffer(ibuf) = '|'
|
||||||
|
write(iunit,'(100A)') buffer(1:ibuf)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
20
src/Electrons/Makefile
Normal file
20
src/Electrons/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
|
INCLUDE_DIRS = Ezfio_files
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
|
include irpf90.make
|
||||||
|
|
||||||
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
@ -1,8 +1,20 @@
|
|||||||
default: all
|
default: all
|
||||||
|
|
||||||
include ../Makefile.config
|
# Define here all other modules on which the current module depends
|
||||||
include ../Makefile.common
|
INCLUDE_DIRS =
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
|
|
||||||
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
$(IRPF90)
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
||||||
|
20
src/MOs/Makefile
Normal file
20
src/MOs/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
|
INCLUDE_DIRS = AOs Ezfio_files Nuclei Utils
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
|
include irpf90.make
|
||||||
|
|
||||||
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
8
src/MOs/mos.ezfio_config
Normal file
8
src/MOs/mos.ezfio_config
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
mo_basis
|
||||||
|
mo_tot_num integer
|
||||||
|
mo_coef double precision (ao_basis_ao_num,mo_basis_mo_tot_num)
|
||||||
|
mo_energy double precision (mo_basis_mo_tot_num)
|
||||||
|
mo_occ double precision (mo_basis_mo_tot_num)
|
||||||
|
mo_symmetry character*(8) (mo_basis_mo_tot_num)
|
||||||
|
mo_label character*(64)
|
||||||
|
|
94
src/MOs/mos.irp.f
Normal file
94
src/MOs/mos.irp.f
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
BEGIN_PROVIDER [ integer, mo_tot_num ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Total number of molecular orbitals and the size of the keys corresponding
|
||||||
|
END_DOC
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
call ezfio_get_mo_basis_mo_tot_num(mo_tot_num)
|
||||||
|
ASSERT (mo_tot_num > 0)
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, mo_tot_num_align ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Aligned variable for dimensioning of arrays
|
||||||
|
END_DOC
|
||||||
|
integer :: align_double
|
||||||
|
mo_tot_num_align = align_double(mo_tot_num)
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ character*(64), mo_label ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Label characterizing the MOS (local, canonical, natural, etc)
|
||||||
|
END_DOC
|
||||||
|
logical :: exists
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
call ezfio_has_mo_basis_mo_label(exists)
|
||||||
|
if (exists) then
|
||||||
|
call ezfio_get_mo_basis_mo_label(mo_label)
|
||||||
|
else
|
||||||
|
mo_label = 'no_label'
|
||||||
|
call ezfio_set_mo_basis_mo_label(mo_label)
|
||||||
|
endif
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, mo_energy, (mo_tot_num) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Fock diagonal elements
|
||||||
|
END_DOC
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
mo_energy = 0.d0
|
||||||
|
call ezfio_get_mo_basis_mo_energy(mo_energy)
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, mo_coef, (ao_num_align,mo_tot_num) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Molecular orbital coefficients on AO basis set
|
||||||
|
! mo_coef(i,j) = coefficient of the ith ao on the jth mo
|
||||||
|
END_DOC
|
||||||
|
integer :: i, j
|
||||||
|
double precision, allocatable :: buffer(:,:)
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: buffer
|
||||||
|
|
||||||
|
PROVIDE ezfio_filename
|
||||||
|
allocate(buffer(ao_num,mo_tot_num))
|
||||||
|
buffer = 0.d0
|
||||||
|
call ezfio_get_mo_basis_mo_coef(buffer)
|
||||||
|
do i=1,mo_tot_num
|
||||||
|
do j=1,ao_num
|
||||||
|
mo_coef(j,i) = buffer(j,i)
|
||||||
|
enddo
|
||||||
|
do j=ao_num+1,ao_num_align
|
||||||
|
mo_coef(j,i) = 0.d0
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
deallocate(buffer)
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, mo_coef_transp, (mo_tot_num_align,ao_num) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Molecular orbital coefficients on AO basis set
|
||||||
|
END_DOC
|
||||||
|
integer :: i, j
|
||||||
|
|
||||||
|
do j=1,ao_num
|
||||||
|
do i=1,mo_tot_num
|
||||||
|
mo_coef_transp(i,j) = mo_coef(j,i)
|
||||||
|
enddo
|
||||||
|
do i=mo_tot_num+1,mo_tot_num_align
|
||||||
|
mo_coef_transp(i,j) = 0.d0
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
48
src/MOs/utils.irp.f
Normal file
48
src/MOs/utils.irp.f
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
subroutine save_mos
|
||||||
|
implicit none
|
||||||
|
double precision, allocatable :: buffer(:,:)
|
||||||
|
integer :: i,j
|
||||||
|
|
||||||
|
call system('save_current_mos.sh '//trim(ezfio_filename))
|
||||||
|
|
||||||
|
call ezfio_set_mo_basis_mo_label(mo_label)
|
||||||
|
allocate ( buffer(ao_num,mo_tot_num) )
|
||||||
|
buffer = 0.d0
|
||||||
|
do j = 1, mo_tot_num
|
||||||
|
do i = 1, ao_num
|
||||||
|
buffer(i,j) = mo_coef(i,j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
call ezfio_set_mo_basis_mo_coef(buffer)
|
||||||
|
deallocate (buffer)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine mo_as_eigvectors_of_mo_matrix(matrix,n,m,label)
|
||||||
|
implicit none
|
||||||
|
integer,intent(in) :: n,m
|
||||||
|
character*(64), intent(in) :: label
|
||||||
|
double precision, intent(in) :: matrix(n,m)
|
||||||
|
|
||||||
|
double precision, allocatable :: mo_coef_new(:,:), R(:,:),eigvalues(:)
|
||||||
|
!DIR$ ATTRIBUTES ALIGN : $IRP_ALIGN :: mo_coef_new, R
|
||||||
|
|
||||||
|
if (m /= mo_tot_num) then
|
||||||
|
print *, irp_here, ': Error : m/= mo_tot_num'
|
||||||
|
endif
|
||||||
|
allocate(R(n,m))
|
||||||
|
allocate(mo_coef_new(ao_num_align,m),eigvalues(m))
|
||||||
|
mo_coef_new = mo_coef
|
||||||
|
|
||||||
|
call jacobi_lapack(eigvalues,R,matrix,size(matrix,1),size(matrix,2))
|
||||||
|
integer :: i
|
||||||
|
do i = 1, m
|
||||||
|
print*,'eigvalues(i) = ',eigvalues(i)
|
||||||
|
enddo
|
||||||
|
|
||||||
|
call dgemm('N','N',ao_num,m,m,1.d0,mo_coef_new,size(mo_coef_new,1),R,size(R,1),0.d0,mo_coef,size(mo_coef,1))
|
||||||
|
deallocate(mo_coef_new,R,eigvalues)
|
||||||
|
|
||||||
|
mo_label = label
|
||||||
|
SOFT_TOUCH mo_coef
|
||||||
|
end
|
10
src/Makefile
10
src/Makefile
@ -1,13 +1,13 @@
|
|||||||
default: all
|
default: all
|
||||||
INCLUDE_DIRS = Ezfio_files Nuclei Utils AOs Electrons # MonoInts BiInts MOs Output Bitmask
|
INCLUDE_DIRS = Ezfio_files Nuclei Utils AOs Electrons MonoInts BiInts MOs Output Bitmask
|
||||||
|
|
||||||
include Makefile.common
|
include Makefile.common
|
||||||
include Makefile.config
|
include Makefile.config
|
||||||
|
|
||||||
LIB+=$(MKL)
|
LIB+=$(MKL)
|
||||||
|
|
||||||
SRC=#BiInts/map_module.f90 Bitmask/bitmasks_module.f90
|
SRC=BiInts/map_module.f90 Bitmask/bitmasks_module.f90
|
||||||
OBJ=#IRPF90_temp/BiInts/map_module.o IRPF90_temp/Bitmask/bitmasks_module.o
|
OBJ=IRPF90_temp/BiInts/map_module.o IRPF90_temp/Bitmask/bitmasks_module.o
|
||||||
PYTHON_SCRIPTS=
|
PYTHON_SCRIPTS=
|
||||||
|
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
@ -17,5 +17,7 @@ irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp
|
|||||||
$(IRPF90)
|
$(IRPF90)
|
||||||
|
|
||||||
all_clean:
|
all_clean:
|
||||||
for i in */ ; do $(MAKE) -C $$i veryclean clean_links ; done
|
for i in */ ; do unset INCLUDE_DIRS ; $(MAKE) -C $$i veryclean && $(MAKE) -C $$i clean_links ; done
|
||||||
|
|
||||||
|
all_modules:
|
||||||
|
for i in */ ; do unset INCLUDE_DIRS ; $(MAKE) -C $$i || exit 1 ; done
|
||||||
|
@ -1,7 +1,15 @@
|
|||||||
ifndef SCI_ROOT
|
ifndef QPACKAGE_ROOT
|
||||||
$(error SCI_ROOT undefined. Run the setup_environment.sh script)
|
$(error QPACKAGE_ROOT undefined. Run the setup_environment.sh script)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
INCLUDE_DIRS_OK=$(shell X=`$(QPACKAGE_ROOT)/scripts/check_dependencies.sh $(INCLUDE_DIRS)` && echo OK || echo $$X)
|
||||||
|
ifneq ($(INCLUDE_DIRS_OK),OK)
|
||||||
|
$(info ---------------------)
|
||||||
|
$(info Your INCLUDE_DIRS variable is inconsistent. It should be:)
|
||||||
|
$(info INCLUDE_DIRS = $(INCLUDE_DIRS_OK))
|
||||||
|
$(info ---------------------)
|
||||||
|
$(error )
|
||||||
|
endif
|
||||||
|
|
||||||
IRP_VERSION_OK=$(shell $(IRPF90) -v | python -c "import sys ; print float(sys.stdin.readline().rsplit('.',1)[0]) >= 1.3")
|
IRP_VERSION_OK=$(shell $(IRPF90) -v | python -c "import sys ; print float(sys.stdin.readline().rsplit('.',1)[0]) >= 1.3")
|
||||||
ifeq ($(IRP_VERSION_OK),False)
|
ifeq ($(IRP_VERSION_OK),False)
|
||||||
@ -9,25 +17,25 @@ $(error 'IRPF90 version >= 1.3 is required')
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
MAKEFILE_OK=$(shell ls $(SCI_ROOT)/src/Makefile.config 2> /dev/null && echo True || echo False)
|
MAKEFILE_OK=$(shell ls $(QPACKAGE_ROOT)/src/Makefile.config 2> /dev/null && echo True || echo False)
|
||||||
ifeq ($(MAKEFILE_OK),False)
|
ifeq ($(MAKEFILE_OK),False)
|
||||||
$(error 'Makefile.config is not present. Please modify Makefile.config.example to create Makefile.config')
|
$(error 'Makefile.config is not present. Please modify Makefile.config.example to create Makefile.config')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
EZFIO_DIR=$(SCI_ROOT)/EZFIO
|
EZFIO_DIR=$(QPACKAGE_ROOT)/EZFIO
|
||||||
EZFIO=$(EZFIO_DIR)/lib/libezfio_irp.a
|
EZFIO=$(EZFIO_DIR)/lib/libezfio_irp.a
|
||||||
|
|
||||||
$(EZFIO): $(wildcard $(SCI_ROOT)/src/*.ezfio_config) $(wildcard $(SCI_ROOT)/src/*/*.ezfio_config)
|
$(EZFIO): $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_ROOT)/src/*/*.ezfio_config)
|
||||||
@echo Building EZFIO library
|
@echo Building EZFIO library
|
||||||
@cp $(wildcard $(SCI_ROOT)/src/*.ezfio_config) $(wildcard $(SCI_ROOT)/src/*/*.ezfio_config) $(EZFIO_DIR)/config
|
@cp $(wildcard $(QPACKAGE_ROOT)/src/*.ezfio_config) $(wildcard $(QPACKAGE_ROOT)/src/*/*.ezfio_config) $(EZFIO_DIR)/config
|
||||||
@cd $(EZFIO_DIR) ; export FC="$(FC)" ; export FCFLAGS="$(FCFLAGS)" ; export IRPF90="$(IRPF90)" ; $(MAKE) ; $(MAKE) Python
|
@cd $(EZFIO_DIR) ; export FC="$(FC)" ; export FCFLAGS="$(FCFLAGS)" ; export IRPF90="$(IRPF90)" ; $(MAKE) ; $(MAKE) Python
|
||||||
|
|
||||||
INCLUDE_DIRS+=include
|
INCLUDE_DIRS+=include
|
||||||
|
|
||||||
|
|
||||||
ifneq ($(PWD),$(SCI_ROOT)/src)
|
ifneq ($(PWD),$(QPACKAGE_ROOT)/src)
|
||||||
$(shell $(SCI_ROOT)/scripts/prepare_module.sh $(INCLUDE_DIRS))
|
$(shell $(QPACKAGE_ROOT)/scripts/prepare_module.sh $(INCLUDE_DIRS))
|
||||||
clean_links:
|
clean_links:
|
||||||
rm $(INCLUDE_DIRS) $$(basename $$PWD)
|
rm $(INCLUDE_DIRS) $$(basename $$PWD)
|
||||||
else
|
else
|
||||||
|
@ -1,9 +1,20 @@
|
|||||||
default: all
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
INCLUDE_DIRS = Ezfio_files Utils
|
INCLUDE_DIRS = Ezfio_files Utils
|
||||||
|
|
||||||
include ../Makefile.config
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
include ../Makefile.common
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
include irpf90.make
|
include irpf90.make
|
||||||
|
|
||||||
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
$(IRPF90)
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
||||||
|
20
src/Output/Makefile
Normal file
20
src/Output/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
|
INCLUDE_DIRS =
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
|
include irpf90.make
|
||||||
|
|
||||||
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
3
src/Output/output.ezfio_config
Normal file
3
src/Output/output.ezfio_config
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
output
|
||||||
|
empty logical
|
||||||
|
|
22
src/Output/output.irp.f
Normal file
22
src/Output/output.irp.f
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
BEGIN_TEMPLATE
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer, output_$NAME ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Output file for $NAME
|
||||||
|
END_DOC
|
||||||
|
integer :: getUnitAndOpen
|
||||||
|
call ezfio_set_output_empty(.False.)
|
||||||
|
output_$NAME = getUnitAndOpen(trim(ezfio_filename)//'/output/'//'$NAME','w')
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
SUBST [ NAME ]
|
||||||
|
|
||||||
|
AO ;;
|
||||||
|
MO ;;
|
||||||
|
AO_integrals ;;
|
||||||
|
MO_integrals ;;
|
||||||
|
|
||||||
|
END_TEMPLATE
|
||||||
|
|
||||||
|
|
20
src/Utils/Makefile
Normal file
20
src/Utils/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
default: all
|
||||||
|
|
||||||
|
# Define here all other modules on which the current module depends
|
||||||
|
INCLUDE_DIRS =
|
||||||
|
|
||||||
|
# Define here all new external source files and objects.Don't forget to prefix the
|
||||||
|
# object files with IRPF90_temp/
|
||||||
|
SRC=
|
||||||
|
OBJ=
|
||||||
|
|
||||||
|
include Makefile.depend
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.config
|
||||||
|
include $(QPACKAGE_ROOT)/src/Makefile.common
|
||||||
|
include irpf90.make
|
||||||
|
|
||||||
|
irpf90.make: $(filter-out IRPF90_temp/%, $(wildcard */*.irp.f)) $(wildcard *.irp.f) $(wildcard *.inc.f) Makefile $(EZFIO)
|
||||||
|
$(IRPF90)
|
||||||
|
|
||||||
|
Makefile.depend: Makefile
|
||||||
|
$(QPACKAGE_ROOT)/scripts/create_Makefile_depend.sh
|
Loading…
Reference in New Issue
Block a user