10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-19 04:22:32 +01:00

Merge branch 'dev-stable' of https://github.com/QuantumPackage/qp2 into dev-stable

This commit is contained in:
eginer 2023-10-25 19:29:20 +02:00
commit 3f38c0a9da
60 changed files with 272 additions and 165 deletions

4
bin/python Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
exec python3 $@

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
export QP_ROOT=$(dirname "$(readlink -f "$0")")/.. REALPATH=$( cd "$(dirname "$0")" ; pwd -P )
export QP_ROOT=${REALPATH}/..
bash --init-file <(cat << EOF bash --init-file <(cat << EOF
[[ -f /etc/bashrc ]] && source /etc/bashrc [[ -f /etc/bashrc ]] && source /etc/bashrc

22
bin/zcat Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# On Darwin: try gzcat if available, otherwise use Python
if [[ $(uname -s) = Darwin ]] ; then
which gzcat &> /dev/null
if [[ $? -eq 0 ]] ; then
exec gzcat $@
else
exec python3 << EOF
import sys
import gzip
with gzip.open("$1", "rt") as f:
print(f.read())
EOF
fi
else
command=$(which -a zcat | grep -v 'qp2/bin/' | head -1)
exec $command $@
fi

View File

@ -10,7 +10,7 @@
# #
# #
[COMMON] [COMMON]
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
LAPACK_LIB : -lblas -llapack LAPACK_LIB : -lblas -llapack
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED

View File

@ -13,7 +13,7 @@
# #
# #
[COMMON] [COMMON]
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
LAPACK_LIB : -larmpl_lp64_mp LAPACK_LIB : -larmpl_lp64_mp
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED

View File

@ -10,7 +10,7 @@
# #
# #
[COMMON] [COMMON]
FC : gfortran -ffree-line-length-none -I . -mavx -g -fPIC FC : gfortran -ffree-line-length-none -I . -mavx -g -fPIC -std=legacy
LAPACK_LIB : -llapack -lblas LAPACK_LIB : -llapack -lblas
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED

View File

@ -10,7 +10,7 @@
# #
# #
[COMMON] [COMMON]
FC : gfortran -g -ffree-line-length-none -I . -fPIC FC : gfortran -g -ffree-line-length-none -I . -fPIC -std=legacy
LAPACK_LIB : -lblas -llapack LAPACK_LIB : -lblas -llapack
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED

62
config/gfortran_macos.cfg Normal file
View File

@ -0,0 +1,62 @@
# Common flags
##############
#
# -ffree-line-length-none : Needed for IRPF90 which produces long lines
# -lblas -llapack : Link with libblas and liblapack libraries provided by the system
# -I . : Include the curent directory (Mandatory)
#
# --ninja : Allow the utilisation of ninja. (Mandatory)
# --align=32 : Align all provided arrays on a 32-byte boundary
#
#
[COMMON]
FC : gfortran -ffree-line-length-none -I . -g -fPIC -std=legacy
LAPACK_LIB : -llapack -lblas
IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DSET_NESTED -DMACOS
# Global options
################
#
# 1 : Activate
# 0 : Deactivate
#
[OPTION]
MODE : OPT ; [ OPT | PROFILE | DEBUG ] : Chooses the section below
CACHE : 0 ; Enable cache_compile.py
OPENMP : 1 ; Append OpenMP flags
# Optimization flags
####################
#
# -Ofast : Disregard strict standards compliance. Enables all -O3 optimizations.
# It also enables optimizations that are not valid
# for all standard-compliant programs. It turns on
# -ffast-math and the Fortran-specific
# -fno-protect-parens and -fstack-arrays.
[OPT]
FCFLAGS : -Ofast -march=native
# Profiling flags
#################
#
[PROFILE]
FC : -p -g
FCFLAGS : -Ofast
# Debugging flags
#################
#
# -fcheck=all : Checks uninitialized variables, array subscripts, etc...
# -g : Extra debugging information
#
[DEBUG]
FCFLAGS : -fcheck=all -g
# OpenMP flags
#################
#
[OPENMP]
FC : -fopenmp
IRPF90_FLAGS : --openmp

View File

@ -10,7 +10,7 @@
# #
# #
[COMMON] [COMMON]
FC : mpif90 -ffree-line-length-none -I . -g -fPIC FC : mpif90 -ffree-line-length-none -I . -g -fPIC -std=legacy
LAPACK_LIB : -lblas -llapack LAPACK_LIB : -lblas -llapack
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 -DMPI -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 -DMPI -DSET_NESTED

View File

@ -10,7 +10,7 @@
# #
# #
[COMMON] [COMMON]
FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native FC : gfortran -g -ffree-line-length-none -I . -fPIC -march=native -std=legacy
LAPACK_LIB : -lopenblas LAPACK_LIB : -lopenblas
IRPF90 : irpf90 IRPF90 : irpf90
IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED IRPF90_FLAGS : --ninja --align=32 --assert -DSET_NESTED

26
configure vendored
View File

@ -19,7 +19,11 @@ git submodule init
git submodule update git submodule update
# Update ARM or x86 dependencies # Update ARM or x86 dependencies
ARCHITECTURE=$(uname -m) SYSTEM=$(uname -s)
if [[ $SYSTEM = "Linux" ]] ; then
SYSTEM=""
fi
ARCHITECTURE=$(uname -m)$SYSTEM
cd ${QP_ROOT}/external/qp2-dependencies cd ${QP_ROOT}/external/qp2-dependencies
git checkout master git checkout master
git pull git pull
@ -211,6 +215,7 @@ EOF
execute << EOF execute << EOF
cd "\${QP_ROOT}"/external cd "\${QP_ROOT}"/external
wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz
rm -rf trexio-${VERSION}
tar -zxf trexio-${VERSION}.tar.gz && rm trexio-${VERSION}.tar.gz tar -zxf trexio-${VERSION}.tar.gz && rm trexio-${VERSION}.tar.gz
cd trexio-${VERSION} cd trexio-${VERSION}
./configure --prefix=\${QP_ROOT} --without-hdf5 CFLAGS='-g' ./configure --prefix=\${QP_ROOT} --without-hdf5 CFLAGS='-g'
@ -224,6 +229,7 @@ EOF
execute << EOF execute << EOF
cd "\${QP_ROOT}"/external cd "\${QP_ROOT}"/external
wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz wget https://github.com/TREX-CoE/trexio/releases/download/v${VERSION}/trexio-${VERSION}.tar.gz
rm -rf trexio-${VERSION}
tar -zxf trexio-${VERSION}.tar.gz && rm trexio-${VERSION}.tar.gz tar -zxf trexio-${VERSION}.tar.gz && rm trexio-${VERSION}.tar.gz
cd trexio-${VERSION} cd trexio-${VERSION}
./configure --prefix=\${QP_ROOT} CFLAGS="-g" ./configure --prefix=\${QP_ROOT} CFLAGS="-g"
@ -235,11 +241,24 @@ EOF
execute << EOF execute << EOF
cd "\${QP_ROOT}"/external cd "\${QP_ROOT}"/external
wget https://github.com/TREX-CoE/qmckl/releases/download/v${VERSION}/qmckl-${VERSION}.tar.gz wget https://github.com/TREX-CoE/qmckl/releases/download/v${VERSION}/qmckl-${VERSION}.tar.gz
rm -rf qmckl-${VERSION}
tar -zxf qmckl-${VERSION}.tar.gz && rm qmckl-${VERSION}.tar.gz tar -zxf qmckl-${VERSION}.tar.gz && rm qmckl-${VERSION}.tar.gz
cd qmckl-${VERSION} cd qmckl-${VERSION}
./configure --prefix=\${QP_ROOT} --enable-hpc --disable-doc CFLAGS='-g' ./configure --prefix=\${QP_ROOT} --enable-hpc --disable-doc CFLAGS='-g'
make && make -j 4 check && make install make && make -j 4 check && make install
EOF EOF
elif [[ ${PACKAGE} = qmckl-intel ]] ; then
VERSION=0.5.4
execute << EOF
cd "\${QP_ROOT}"/external
wget https://github.com/TREX-CoE/qmckl/releases/download/v${VERSION}/qmckl-${VERSION}.tar.gz
rm -rf qmckl-${VERSION}
tar -zxf qmckl-${VERSION}.tar.gz && rm qmckl-${VERSION}.tar.gz
cd qmckl-${VERSION}
./configure --prefix=\${QP_ROOT} --enable-hpc --disable-doc --with-icc --with-ifort CFLAGS='-g'
make && make -j 4 check && make install
EOF
elif [[ ${PACKAGE} = gmp ]] ; then elif [[ ${PACKAGE} = gmp ]] ; then
@ -260,6 +279,7 @@ EOF
cd "\${QP_ROOT}"/external cd "\${QP_ROOT}"/external
tar --gunzip --extract --file qp2-dependencies/zeromq-4.2.5.tar.gz tar --gunzip --extract --file qp2-dependencies/zeromq-4.2.5.tar.gz
cd zeromq-* cd zeromq-*
[[ "${SYSTEM}" = "Darwin" ]] && ./autogen.sh
./configure --prefix="\$QP_ROOT" --without-libsodium --enable-libunwind=no ./configure --prefix="\$QP_ROOT" --without-libsodium --enable-libunwind=no
make -j 8 make -j 8
make install make install
@ -378,13 +398,13 @@ fi
TREXIO=$(find_lib -ltrexio) TREXIO=$(find_lib -ltrexio)
if [[ ${TREXIO} = $(not_found) ]] ; then if [[ ${TREXIO} = $(not_found) ]] ; then
error "TREXIO (trexio,trexio-nohdf5) is not installed. If you don't have HDF5, use trexio-nohdf5" error "TREXIO (trexio | trexio-nohdf5) is not installed. If you don't have HDF5, use trexio-nohdf5"
fail fail
fi fi
QMCKL=$(find_lib -lqmckl) QMCKL=$(find_lib -lqmckl)
if [[ ${QMCKL} = $(not_found) ]] ; then if [[ ${QMCKL} = $(not_found) ]] ; then
error "QMCkl (qmckl) is not installed." error "QMCkl (qmckl | qmckl-intel) is not installed."
fail fail
fi fi

2
external/irpf90 vendored

@ -1 +1 @@
Subproject commit 0007f72f677fe7d61c5e1ed461882cb239517102 Subproject commit 4ab1b175fc7ed0d96c1912f13dc53579b24157a6

View File

@ -11,7 +11,11 @@ fi
cd ${QP_ROOT}/data cd ${QP_ROOT}/data
rm -f executables rm -f executables
if [[ "$(uname -s)" = "Darwin" ]] ; then
EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -perm +111 -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
else
EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort ) EXES=$(find -L ${QP_ROOT}/src -maxdepth 2 -depth -executable -type f | grep -e "${QP_ROOT}/src/[^/]*/[^/]*$" |sort )
fi
for EXE in $EXES for EXE in $EXES
do do

View File

@ -115,9 +115,7 @@ def get_l_module_descendant(d_child, l_module):
except KeyError: except KeyError:
print("Error: ", file=sys.stderr) print("Error: ", file=sys.stderr)
print("`{0}` is not a submodule".format(module), file=sys.stderr) print("`{0}` is not a submodule".format(module), file=sys.stderr)
print("Check the typo (spelling, case, '/', etc.) ", file=sys.stderr) raise
# pass
sys.exit(1)
return list(set(l)) return list(set(l))

View File

@ -52,7 +52,7 @@
!$OMP DEFAULT(NONE) & !$OMP DEFAULT(NONE) &
!$OMP PRIVATE(A_center,B_center,power_A,power_B,& !$OMP PRIVATE(A_center,B_center,power_A,power_B,&
!$OMP overlap_y, overlap_z, overlap, & !$OMP overlap_y, overlap_z, overlap, &
!$OMP alpha, beta,i,j,c,d_a_2,d_2,deriv_tmp, & !$OMP alpha, beta, n, l, i,j,c,d_a_2,d_2,deriv_tmp, &
!$OMP overlap_x0,overlap_y0,overlap_z0) & !$OMP overlap_x0,overlap_y0,overlap_z0) &
!$OMP SHARED(nucl_coord,ao_power,ao_prim_num, & !$OMP SHARED(nucl_coord,ao_power,ao_prim_num, &
!$OMP ao_deriv2_x,ao_deriv2_y,ao_deriv2_z,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & !$OMP ao_deriv2_x,ao_deriv2_y,ao_deriv2_z,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, &

View File

@ -1,4 +1,4 @@
ao_two_e_erf_ints ao_two_e_ints
mo_one_e_ints mo_one_e_ints
ao_many_one_e_ints ao_many_one_e_ints
dft_utils_in_r dft_utils_in_r

View File

@ -1,13 +0,0 @@
[io_ao_two_e_integrals_erf]
type: Disk_access
doc: Read/Write |AO| integrals with the long range interaction from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None
[mu_erf]
type: double precision
doc: cutting of the interaction in the range separated model
interface: ezfio,provider,ocaml
default: 0.5
ezfio_name: mu_erf

View File

@ -1 +0,0 @@
ao_two_e_ints

View File

@ -1,19 +0,0 @@
======================
ao_two_e_erf_ints
======================
Here, all two-electron integrals (:math:`erf(\mu r_{12})/r_{12}`) are computed.
As they have 4 indices and many are zero, they are stored in a map, as defined
in :file:`utils/map_module.f90`.
The main parameter of this module is :option:`ao_two_e_erf_ints mu_erf` which is the range-separation parameter.
To fetch an |AO| integral, use the
`get_ao_two_e_integral_erf(i,j,k,l,ao_integrals_erf_map)` function.
The conventions are:
* For |AO| integrals : (ij|kl) = (11|22) = <ik|jl> = <12|12>

View File

@ -35,3 +35,15 @@ type: logical
doc: Perform Cholesky decomposition of AO integrals doc: Perform Cholesky decomposition of AO integrals
interface: ezfio,provider,ocaml interface: ezfio,provider,ocaml
default: False default: False
[io_ao_two_e_integrals_erf]
type: Disk_access
doc: Read/Write |AO| erf integrals from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None
[use_only_lr]
type: logical
doc: If true, use only the long range part of the two-electron integrals instead of 1/r12
interface: ezfio, provider, ocaml
default: False

View File

@ -1,3 +1,4 @@
hamiltonian
ao_one_e_ints ao_one_e_ints
pseudo pseudo
bitmask bitmask

View File

@ -90,7 +90,7 @@ BEGIN_PROVIDER [ logical, ao_two_e_integrals_erf_in_map ]
if (write_ao_two_e_integrals_erf) then if (write_ao_two_e_integrals_erf) then
call ezfio_set_work_empty(.False.) call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map)
call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf("Read") call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals_erf('Read')
endif endif
END_PROVIDER END_PROVIDER

View File

@ -4,7 +4,7 @@ subroutine save_erf_two_e_integrals_ao
PROVIDE ao_two_e_integrals_erf_in_map PROVIDE ao_two_e_integrals_erf_in_map
call ezfio_set_work_empty(.False.) call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map) call map_save_to_disk(trim(ezfio_filename)//'/work/ao_ints_erf',ao_integrals_erf_map)
call ezfio_set_ao_two_e_erf_ints_io_ao_two_e_integrals_erf('Read') call ezfio_set_ao_two_e_ints_io_ao_two_e_integrals_erf('Read')
end end
subroutine save_erf_two_e_ints_ao_into_ints_ao subroutine save_erf_two_e_ints_ao_into_ints_ao

View File

@ -21,9 +21,9 @@ double precision function ao_two_e_integral(i, j, k, l)
double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp double precision :: P_new(0:max_dim,3),P_center(3),fact_p,pp
double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq double precision :: Q_new(0:max_dim,3),Q_center(3),fact_q,qq
double precision :: ao_two_e_integral_schwartz_accel double precision, external :: ao_two_e_integral_erf
double precision, external :: ao_two_e_integral_cosgtos
double precision :: ao_two_e_integral_cosgtos double precision, external :: ao_two_e_integral_schwartz_accel
if(use_cosgtos) then if(use_cosgtos) then
@ -31,9 +31,11 @@ double precision function ao_two_e_integral(i, j, k, l)
ao_two_e_integral = ao_two_e_integral_cosgtos(i, j, k, l) ao_two_e_integral = ao_two_e_integral_cosgtos(i, j, k, l)
else else if (use_only_lr) then
if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then ao_two_e_integral = ao_two_e_integral_erf(i, j, k, l)
else if (ao_prim_num(i) * ao_prim_num(j) * ao_prim_num(k) * ao_prim_num(l) > 1024 ) then
ao_two_e_integral = ao_two_e_integral_schwartz_accel(i,j,k,l) ao_two_e_integral = ao_two_e_integral_schwartz_accel(i,j,k,l)
@ -121,8 +123,6 @@ double precision function ao_two_e_integral(i, j, k, l)
endif endif
endif
end end
! --- ! ---

View File

@ -10,8 +10,8 @@ function run() {
qp set perturbation do_pt2 False qp set perturbation do_pt2 False
qp set determinants n_det_max 8000 qp set determinants n_det_max 8000
qp set determinants n_states 1 qp set determinants n_states 1
qp set davidson threshold_davidson 1.e-10 qp set davidson_keywords threshold_davidson 1.e-10
qp set davidson n_states_diag 8 qp set davidson_keywords n_states_diag 8
qp run fci qp run fci
energy1="$(ezfio get fci energy | tr '[]' ' ' | cut -d ',' -f 1)" energy1="$(ezfio get fci energy | tr '[]' ' ' | cut -d ',' -f 1)"
eq $energy1 $1 $thresh eq $energy1 $1 $thresh

View File

@ -9,8 +9,8 @@ function run_stoch() {
test_exe casscf || skip test_exe casscf || skip
qp set perturbation do_pt2 True qp set perturbation do_pt2 True
qp set determinants n_det_max $3 qp set determinants n_det_max $3
qp set davidson threshold_davidson 1.e-10 qp set davidson_keywords threshold_davidson 1.e-10
qp set davidson n_states_diag 4 qp set davidson_keywords n_states_diag 4
qp run casscf | tee casscf.out qp run casscf | tee casscf.out
energy1="$(ezfio get casscf energy_pt2 | tr '[]' ' ' | cut -d ',' -f 1)" energy1="$(ezfio get casscf energy_pt2 | tr '[]' ' ' | cut -d ',' -f 1)"
eq $energy1 $1 $thresh eq $energy1 $1 $thresh

View File

@ -9,7 +9,7 @@ function run() {
qp set_file $1 qp set_file $1
qp edit --check qp edit --check
qp set determinants n_states 3 qp set determinants n_states 3
qp set davidson threshold_davidson 1.e-12 qp set davidson_keywords threshold_davidson 1.e-12
qp set mo_two_e_ints io_mo_two_e_integrals Write qp set mo_two_e_ints io_mo_two_e_integrals Write
qp set_frozen_core qp set_frozen_core
qp run cis qp run cis
@ -59,7 +59,7 @@ function run() {
@test "ClO" { # 1.65582s 2.06465s @test "ClO" { # 1.65582s 2.06465s
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
run clo.ezfio -534.263560525680 -534.256601571199 -534.062020844428 run clo.ezfio -534.2635737789097 -534.2566081298855 -534.0620070783308
} }
@test "SO" { # 1.9667s 2.91234s @test "SO" { # 1.9667s 2.91234s
@ -69,7 +69,7 @@ function run() {
@test "OH" { # 2.201s 2.65573s @test "OH" { # 2.201s 2.65573s
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
run oh.ezfio -75.4314648243896 -75.4254639668256 -75.2707675632313 run oh.ezfio -75.4314822573358 -75.4254733392003 -75.2707586997333
} }
@test "H2O2" { # 2.27079s 3.07875s @test "H2O2" { # 2.27079s 3.07875s
@ -109,7 +109,7 @@ function run() {
@test "DHNO" { # 6.42976s 12.9899s @test "DHNO" { # 6.42976s 12.9899s
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
run dhno.ezfio -130.4472288472718 -130.3571808164850 -130.2196257046987 run dhno.ezfio -130.447238897118 -130.357186843611 -130.219626716369
} }
@test "CH4" { # 6.4969s 10.9157s @test "CH4" { # 6.4969s 10.9157s
@ -129,7 +129,7 @@ function run() {
@test "[Cu(NH3)4]2+" { # 29.7711s 3.45478m @test "[Cu(NH3)4]2+" { # 29.7711s 3.45478m
[[ -n ${TRAVIS} ]] && skip [[ -n ${TRAVIS} ]] && skip
run cu_nh3_4_2plus.ezfio -1862.97958885180 -1862.92457657404 -1862.91134959451 run cu_nh3_4_2plus.ezfio -1862.97958844302 -1862.92454785007 -1862.91130869967
} }

View File

@ -8,9 +8,8 @@ function run() {
test_exe cisd || skip test_exe cisd || skip
qp edit --check qp edit --check
qp set determinants n_states 2 qp set determinants n_states 2
qp set davidson threshold_davidson 1.e-12 qp set davidson_keywords threshold_davidson 1.e-12
qp set davidson n_states_diag 24 qp set davidson_keywords n_states_diag 24
qp run cis
qp run cisd qp run cisd
energy1="$(qp get cisd energy | tr '[]' ' ' | cut -d ',' -f 1)" energy1="$(qp get cisd energy | tr '[]' ' ' | cut -d ',' -f 1)"
energy2="$(qp get cisd energy | tr '[]' ' ' | cut -d ',' -f 2)" energy2="$(qp get cisd energy | tr '[]' ' ' | cut -d ',' -f 2)"
@ -78,7 +77,7 @@ function run() {
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
qp set_file oh.ezfio qp set_file oh.ezfio
qp set_frozen_core qp set_frozen_core
run -75.6087472926588 -75.5370393736601 run -75.6088105201621 -75.5370802925698
} }
@test "CH4" { # 19.821s 1.38648m @test "CH4" { # 19.821s 1.38648m
@ -106,7 +105,8 @@ function run() {
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
qp set_file dhno.ezfio qp set_file dhno.ezfio
qp set_mo_class --core="[1-7]" --act="[8-64]" qp set_mo_class --core="[1-7]" --act="[8-64]"
run -130.458814562403 -130.356308303681 run -130.4659881027444 -130.2692384198501
# run -130.458814562403 -130.356308303681
} }
@test "H3COH" { # 24.7248s 1.85043m @test "H3COH" { # 24.7248s 1.85043m
@ -120,7 +120,7 @@ function run() {
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
qp set_file cu_nh3_4_2plus.ezfio qp set_file cu_nh3_4_2plus.ezfio
qp set_mo_class --core="[1-24]" --act="[25-45]" --del="[46-87]" qp set_mo_class --core="[1-24]" --act="[25-45]" --del="[46-87]"
run -1862.98689579931 -1862.6883044626563 run -1862.98310702274 -1862.88506319755
} }
@ -142,7 +142,7 @@ function run() {
[[ -n $TRAVIS ]] && skip [[ -n $TRAVIS ]] && skip
qp set_file clo.ezfio qp set_file clo.ezfio
qp set_frozen_core qp set_frozen_core
run -534.5404021326773 -534.3818725793897 run -534.540464615019 -534.381904487587
} }
@test "F2" { # 45.2078s @test "F2" { # 45.2078s

View File

@ -4,6 +4,4 @@ mo_one_e_ints
mo_two_e_ints mo_two_e_ints
ao_one_e_ints ao_one_e_ints
ao_two_e_ints ao_two_e_ints
mo_two_e_erf_ints
ao_two_e_erf_ints
mu_of_r mu_of_r

View File

@ -3,7 +3,7 @@ BEGIN_PROVIDER [double precision, mu_erf_dft]
BEGIN_DOC BEGIN_DOC
! range separation parameter used in RS-DFT. ! range separation parameter used in RS-DFT.
! !
! It is set to mu_erf in order to be consistent with the module "ao_two_e_erf_ints" ! It is set to mu_erf in order to be consistent with the module "hamiltonian"
END_DOC END_DOC
mu_erf_dft = mu_erf mu_erf_dft = mu_erf

View File

@ -1,6 +1,5 @@
ao_basis ao_basis
ao_one_e_ints ao_one_e_ints
ao_two_e_erf_ints
ao_two_e_ints ao_two_e_ints
aux_quantities aux_quantities
becke_numerical_grid becke_numerical_grid
@ -24,13 +23,13 @@ functionals
generators_cas generators_cas
generators_full generators_full
hartree_fock hartree_fock
hamiltonian
iterations iterations
kohn_sham kohn_sham
kohn_sham_rs kohn_sham_rs
mo_basis mo_basis
mo_guess mo_guess
mo_one_e_ints mo_one_e_ints
mo_two_e_erf_ints
mo_two_e_ints mo_two_e_ints
mpi mpi
nuclei nuclei

View File

@ -53,7 +53,6 @@ function run {
@test "B-B" { @test "B-B" {
qp set_file b2_stretched.ezfio
run b2_stretched.zmt 1 0 6-31g run b2_stretched.zmt 1 0 6-31g
} }

View File

@ -33,6 +33,8 @@ BEGIN_PROVIDER [ character*(1024), ezfio_filename ]
call ezfio_set_file(ezfio_filename) call ezfio_set_file(ezfio_filename)
IRP_IF MACOS
IRP_ELSE
! Adjust out-of-memory killer flag such that the current process will be ! Adjust out-of-memory killer flag such that the current process will be
! killed first by the OOM killer, allowing compute nodes to survive ! killed first by the OOM killer, allowing compute nodes to survive
integer :: getpid integer :: getpid
@ -40,6 +42,7 @@ BEGIN_PROVIDER [ character*(1024), ezfio_filename ]
write(pidc,*) getpid() write(pidc,*) getpid()
write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj' write(command,*) 'echo 15 > /proc//'//trim(adjustl(pidc))//'/oom_adj'
call system(command) call system(command)
IRP_ENDIF
PROVIDE file_lock PROVIDE file_lock

View File

@ -0,0 +1,8 @@
[mu_erf]
type: double precision
doc: cutting of the interaction in the range separated model
interface: ezfio,provider,ocaml
default: 0.5
ezfio_name: mu_erf

0
src/hamiltonian/NEED Normal file
View File

View File

@ -0,0 +1,5 @@
===========
hamiltonian
===========
Parameters of the Hamiltonian.

View File

@ -39,7 +39,7 @@ rm -rf $EZFIO
qp create_ezfio -b def2-svp hcn.xyz -o $EZFIO qp create_ezfio -b def2-svp hcn.xyz -o $EZFIO
qp run scf qp run scf
mv hcn_charges.xyz ${EZFIO}_point_charges.xyz mv hcn_charges.xyz ${EZFIO}_point_charges.xyz
python write_pt_charges.py ${EZFIO} python3 write_pt_charges.py ${EZFIO}
qp set nuclei point_charges True qp set nuclei point_charges True
qp run scf | tee ${EZFIO}.pt_charges.out qp run scf | tee ${EZFIO}.pt_charges.out
energy="$(ezfio get hartree_fock energy)" energy="$(ezfio get hartree_fock energy)"

View File

@ -13,7 +13,7 @@ function run() {
qp set scf_utils thresh_scf 1.e-10 qp set scf_utils thresh_scf 1.e-10
qp set dft_keywords exchange_functional $functional qp set dft_keywords exchange_functional $functional
qp set dft_keywords correlation_functional $functional qp set dft_keywords correlation_functional $functional
qp set ao_two_e_erf_ints mu_erf 0.5 qp set hamiltonian mu_erf 0.5
qp set becke_numerical_grid grid_type_sgn 1 qp set becke_numerical_grid grid_type_sgn 1
qp_reset --mos $1 qp_reset --mos $1
qp run rs_ks_scf qp run rs_ks_scf

View File

@ -1,6 +0,0 @@
[io_mo_two_e_integrals_erf]
type: Disk_access
doc: Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None

View File

@ -1,3 +0,0 @@
ao_two_e_erf_ints
mo_two_e_ints
mo_basis

View File

@ -1,20 +0,0 @@
======================
mo_two_e_erf_ints
======================
Here, all two-electron integrals (:math:`erf({\mu}_{erf} * r_{12})/r_{12}`) are computed.
As they have 4 indices and many are zero, they are stored in a map, as defined
in :file:`Utils/map_module.f90`.
The range separation parameter :math:`{\mu}_{erf}` is the variable :option:`ao_two_e_erf_ints mu_erf`.
To fetch an |MO| integral, use
`get_mo_two_e_integral_erf(i,j,k,l,mo_integrals_map_erf)`
The conventions are:
* For |MO| integrals : <ij|kl> = <12|12>
Be aware that it might not be the same conventions for |MO| and |AO| integrals.

View File

@ -17,3 +17,10 @@ doc: If `True`, computes all integrals except for the integrals having 3 or 4 vi
interface: ezfio,provider,ocaml interface: ezfio,provider,ocaml
default: false default: false
[io_mo_two_e_integrals_erf]
type: Disk_access
doc: Read/Write MO integrals with the long range interaction from/to disk [ Write | Read | None ]
interface: ezfio,provider,ocaml
default: None

View File

@ -9,25 +9,27 @@ subroutine mo_two_e_integrals_erf_index(i,j,k,l,i1)
integer(key_kind) :: p,q,r,s,i2 integer(key_kind) :: p,q,r,s,i2
p = min(i,k) p = min(i,k)
r = max(i,k) r = max(i,k)
p = p+ishft(r*r-r,-1) p = p+shiftr(r*r-r,1)
q = min(j,l) q = min(j,l)
s = max(j,l) s = max(j,l)
q = q+ishft(s*s-s,-1) q = q+shiftr(s*s-s,1)
i1 = min(p,q) i1 = min(p,q)
i2 = max(p,q) i2 = max(p,q)
i1 = i1+ishft(i2*i2-i2,-1) i1 = i1+shiftr(i2*i2-i2,1)
end end
BEGIN_PROVIDER [ logical, mo_two_e_integrals_erf_in_map ] BEGIN_PROVIDER [ logical, mo_two_e_integrals_erf_in_map ]
use map_module use map_module
implicit none implicit none
integer(bit_kind) :: mask_ijkl(N_int,4)
integer(bit_kind) :: mask_ijk(N_int,3)
BEGIN_DOC BEGIN_DOC
! If True, the map of MO two-electron integrals is provided ! If True, the map of MO two-electron integrals is provided
END_DOC END_DOC
integer(bit_kind) :: mask_ijkl(N_int,4)
integer(bit_kind) :: mask_ijk(N_int,3)
double precision :: cpu_1, cpu_2, wall_1, wall_2
PROVIDE mo_class
real :: map_mb real :: map_mb
@ -55,7 +57,7 @@ BEGIN_PROVIDER [ logical, mo_two_e_integrals_erf_in_map ]
if (write_mo_two_e_integrals_erf) then if (write_mo_two_e_integrals_erf) then
call ezfio_set_work_empty(.False.) call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map)
call ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf("Read") call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals_erf("Read")
endif endif
END_PROVIDER END_PROVIDER

View File

@ -4,7 +4,7 @@ subroutine save_erf_two_e_integrals_mo
PROVIDE mo_two_e_integrals_erf_in_map PROVIDE mo_two_e_integrals_erf_in_map
call ezfio_set_work_empty(.False.) call ezfio_set_work_empty(.False.)
call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map) call map_save_to_disk(trim(ezfio_filename)//'/work/mo_ints_erf',mo_integrals_erf_map)
call ezfio_set_mo_two_e_erf_ints_io_mo_two_e_integrals_erf('Read') call ezfio_set_mo_two_e_ints_io_mo_two_e_integrals_erf('Read')
end end

View File

@ -128,7 +128,7 @@
BEGIN_PROVIDER [double precision, mu_average_prov, (N_states)] BEGIN_PROVIDER [double precision, mu_average_prov, (N_states)]
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! average value of mu(r) weighted with the total one-e density and divised by the number of electrons ! average value of mu(r) weighted with the total one-e density and divided by the number of electrons
! !
! !!!!!! WARNING !!!!!! if no_core_density == .True. then all contributions from the core orbitals ! !!!!!! WARNING !!!!!! if no_core_density == .True. then all contributions from the core orbitals
! !

View File

@ -47,7 +47,7 @@
call total_memory(mem) call total_memory(mem)
mem = max(1.d0, qp_max_mem - mem) mem = max(1.d0, qp_max_mem - mem)
n_double = mem * 1.d8 n_double = mem * 1.d8
n_blocks = min(n_double / (n_points_extra_final_grid * 4), 1.d0*n_points_final_grid) n_blocks = int(min(n_double / (n_points_extra_final_grid * 4.d0), 1.d0*n_points_final_grid))
n_rest = int(mod(n_points_final_grid, n_blocks)) n_rest = int(mod(n_points_final_grid, n_blocks))
n_pass = int((n_points_final_grid - n_rest) / n_blocks) n_pass = int((n_points_final_grid - n_rest) / n_blocks)

View File

@ -17,6 +17,19 @@ program tc_natorb_bi_ortho
my_n_pt_a_grid = tc_grid1_a my_n_pt_a_grid = tc_grid1_a
touch my_grid_becke my_n_pt_r_grid my_n_pt_a_grid touch my_grid_becke my_n_pt_r_grid my_n_pt_a_grid
if(j1b_type .ge. 100) then
my_extra_grid_becke = .True.
PROVIDE tc_grid2_a tc_grid2_r
my_n_pt_r_extra_grid = tc_grid2_r
my_n_pt_a_extra_grid = tc_grid2_a
touch my_extra_grid_becke my_n_pt_r_extra_grid my_n_pt_a_extra_grid
call write_int(6, my_n_pt_r_extra_grid, 'radial internal grid over')
call write_int(6, my_n_pt_a_extra_grid, 'angular internal grid over')
endif
read_wf = .True. read_wf = .True.
touch read_wf touch read_wf

View File

@ -29,6 +29,12 @@
write(*, '(100(F16.10,X))') -dm_tmp(:,i) write(*, '(100(F16.10,X))') -dm_tmp(:,i)
enddo enddo
print *, ' Transition density matrix AO'
do i = 1, ao_num
write(*, '(100(F16.10,X))') tc_transition_matrix_ao(:,i,1,1)
enddo
stop
thr_d = 1.d-6 thr_d = 1.d-6
thr_nd = 1.d-6 thr_nd = 1.d-6
thr_deg = 1.d-3 thr_deg = 1.d-3

View File

@ -10,7 +10,7 @@ function run_Ne() {
qp create_ezfio -b cc-pcvdz Ne.xyz -o Ne_tc_scf qp create_ezfio -b cc-pcvdz Ne.xyz -o Ne_tc_scf
qp run scf qp run scf
qp set ao_two_e_erf_ints mu_erf 0.87 qp set hamiltonian mu_erf 0.87
qp set tc_keywords j1b_type 3 qp set tc_keywords j1b_type 3
qp set tc_keywords j1b_pen [1.5] qp set tc_keywords j1b_pen [1.5]
qp set tc_keywords bi_ortho True qp set tc_keywords bi_ortho True
@ -33,7 +33,7 @@ function run_C() {
qp create_ezfio -b cc-pcvdz C.xyz -o C_tc_scf -m 3 qp create_ezfio -b cc-pcvdz C.xyz -o C_tc_scf -m 3
qp run scf qp run scf
qp set ao_two_e_erf_ints mu_erf 0.87 qp set hamiltonian mu_erf 0.87
qp set tc_keywords j1b_type 3 qp set tc_keywords j1b_type 3
qp set tc_keywords j1b_pen [1.5] qp set tc_keywords j1b_pen [1.5]
qp set tc_keywords bi_ortho True qp set tc_keywords bi_ortho True
@ -57,7 +57,7 @@ function run_O() {
qp create_ezfio -b cc-pcvdz O.xyz -o O_tc_scf -m 3 qp create_ezfio -b cc-pcvdz O.xyz -o O_tc_scf -m 3
qp run scf qp run scf
qp set ao_two_e_erf_ints mu_erf 0.87 qp set hamiltonian mu_erf 0.87
qp set tc_keywords j1b_type 3 qp set tc_keywords j1b_type 3
qp set tc_keywords j1b_pen [1.5] qp set tc_keywords j1b_pen [1.5]
qp set tc_keywords bi_ortho True qp set tc_keywords bi_ortho True
@ -82,7 +82,7 @@ function run_ch2() {
qp create_ezfio -b "C:cc-pcvdz|H:cc-pvdz" ch2.xyz -o ch2_tc_scf qp create_ezfio -b "C:cc-pcvdz|H:cc-pvdz" ch2.xyz -o ch2_tc_scf
qp run scf qp run scf
qp set ao_two_e_erf_ints mu_erf 0.87 qp set hamiltonian mu_erf 0.87
qp set tc_keywords j1b_type 3 qp set tc_keywords j1b_type 3
qp set tc_keywords j1b_pen '[1.5,10000,10000]' qp set tc_keywords j1b_pen '[1.5,10000,10000]'
qp set tc_keywords bi_ortho True qp set tc_keywords bi_ortho True

View File

@ -95,7 +95,12 @@ BEGIN_PROVIDER [double precision, diag_three_elem_hf]
if(.not. three_body_h_tc) then if(.not. three_body_h_tc) then
if(noL_standard) then
PROVIDE noL_0e
diag_three_elem_hf = noL_0e
else
diag_three_elem_hf = 0.d0 diag_three_elem_hf = 0.d0
endif
else else

View File

@ -71,10 +71,7 @@ subroutine rh_tcscf_diis()
etc_tot = TC_HF_energy etc_tot = TC_HF_energy
etc_1e = TC_HF_one_e_energy etc_1e = TC_HF_one_e_energy
etc_2e = TC_HF_two_e_energy etc_2e = TC_HF_two_e_energy
etc_3e = 0.d0
if(three_body_h_tc) then
etc_3e = diag_three_elem_hf etc_3e = diag_three_elem_hf
endif
!tc_grad = grad_non_hermit !tc_grad = grad_non_hermit
er_DIIS = maxval(abs(FQS_SQF_mo)) er_DIIS = maxval(abs(FQS_SQF_mo))
e_delta = dabs(etc_tot - e_save) e_delta = dabs(etc_tot - e_save)
@ -202,10 +199,7 @@ subroutine rh_tcscf_diis()
etc_tot = TC_HF_energy etc_tot = TC_HF_energy
etc_1e = TC_HF_one_e_energy etc_1e = TC_HF_one_e_energy
etc_2e = TC_HF_two_e_energy etc_2e = TC_HF_two_e_energy
etc_3e = 0.d0
if(three_body_h_tc) then
etc_3e = diag_three_elem_hf etc_3e = diag_three_elem_hf
endif
!tc_grad = grad_non_hermit !tc_grad = grad_non_hermit
er_DIIS = maxval(abs(FQS_SQF_mo)) er_DIIS = maxval(abs(FQS_SQF_mo))
e_delta = dabs(etc_tot - e_save) e_delta = dabs(etc_tot - e_save)

View File

@ -1,5 +1,4 @@
fci fci
mo_two_e_erf_ints
aux_quantities aux_quantities
hartree_fock hartree_fock
two_body_rdm two_body_rdm

View File

@ -33,6 +33,8 @@ subroutine resident_memory(value)
call usleep(10) call usleep(10)
value = 0.d0 value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r') iunit = getUnitAndOpen('/proc/self/status','r')
do do
read(iunit,*,err=10,end=20) key, value read(iunit,*,err=10,end=20) key, value
@ -43,6 +45,7 @@ subroutine resident_memory(value)
end do end do
20 continue 20 continue
close(iunit) close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0) value = value / (1024.d0*1024.d0)
call unlock_io() call unlock_io()
end function end function
@ -58,6 +61,9 @@ subroutine total_memory(value)
double precision, intent(out) :: value double precision, intent(out) :: value
call lock_io() call lock_io()
value = 0.d0
IRP_IF MACOS
IRP_ELSE
iunit = getUnitAndOpen('/proc/self/status','r') iunit = getUnitAndOpen('/proc/self/status','r')
do do
read(iunit,*,err=10,end=20) key, value read(iunit,*,err=10,end=20) key, value
@ -68,6 +74,7 @@ subroutine total_memory(value)
end do end do
20 continue 20 continue
close(iunit) close(iunit)
IRP_ENDIF
value = value / (1024.d0*1024.d0) value = value / (1024.d0*1024.d0)
call unlock_io() call unlock_io()
end function end function