9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 03:23:29 +01:00

Merge branch 'QuantumPackage-dev-stable' into dev-stable-tc-scf

This commit is contained in:
AbdAmmar 2023-12-23 09:26:29 +01:00
commit a6c26a75e9
306 changed files with 446 additions and 118 deletions

4
bin/python Executable file
View File

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

View File

@ -256,6 +256,7 @@ def write_ezfio(res, filename):
MoTag = res.determinants_mo_type MoTag = res.determinants_mo_type
ezfio.set_mo_basis_mo_label('Orthonormalized') ezfio.set_mo_basis_mo_label('Orthonormalized')
ezfio.set_determinants_mo_label('Orthonormalized')
MO_type = MoTag MO_type = MoTag
allMOs = res.mo_sets[MO_type] allMOs = res.mo_sets[MO_type]

View File

@ -127,6 +127,7 @@ def main(arguments):
l_repository = list(d_tmp.keys()) l_repository = list(d_tmp.keys())
if l_repository == []: if l_repository == []:
l_result = [] l_result = []
l_plugins = []
else: else:
m_instance = ModuleHandler(l_repository) m_instance = ModuleHandler(l_repository)
l_plugins = [module for module in m_instance.l_module] l_plugins = [module for module in m_instance.l_module]

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

23
bin/zcat Executable file
View File

@ -0,0 +1,23 @@
#!/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
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
command=$(which -a zcat | grep -v "$SCRIPTPATH/" | 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

19
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
@ -191,7 +195,7 @@ if [[ "${PACKAGES}.x" != ".x" ]] ; then
fi fi
if [[ ${PACKAGES} = all ]] ; then if [[ ${PACKAGES} = all ]] ; then
PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats trexio qmckl" PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats trexio"
fi fi
@ -275,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
@ -397,11 +402,11 @@ if [[ ${TREXIO} = $(not_found) ]] ; then
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 | qmckl-intel) is not installed." # error "QMCkl (qmckl | qmckl-intel) is not installed."
fail # fail
fi #fi
F77ZMQ=$(find_lib -lzmq -lf77zmq -lpthread) F77ZMQ=$(find_lib -lzmq -lf77zmq -lpthread)
if [[ ${F77ZMQ} = $(not_found) ]] ; then if [[ ${F77ZMQ} = $(not_found) ]] ; then

View File

@ -32,7 +32,7 @@ export PYTHONPATH=$(qp_prepend_export "PYTHONPATH" "${QP_EZFIO}/Python":"${QP_PY
export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml) export PATH=$(qp_prepend_export "PATH" "${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml)
export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib) export LD_LIBRARY_PATH=$(qp_prepend_export "LD_LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)
export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64) export LIBRARY_PATH=$(qp_prepend_export "LIBRARY_PATH" "${QP_ROOT}"/lib:"${QP_ROOT}"/lib64)

2
external/irpf90 vendored

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

View File

@ -13,6 +13,7 @@ module Determinants_by_hand : sig
psi_coef : Det_coef.t array; psi_coef : Det_coef.t array;
psi_det : Determinant.t array; psi_det : Determinant.t array;
state_average_weight : Positive_float.t array; state_average_weight : Positive_float.t array;
mo_label : MO_label.t;
} [@@deriving sexp] } [@@deriving sexp]
val read : ?full:bool -> unit -> t option val read : ?full:bool -> unit -> t option
val write : ?force:bool -> t -> unit val write : ?force:bool -> t -> unit
@ -34,11 +35,21 @@ end = struct
psi_coef : Det_coef.t array; psi_coef : Det_coef.t array;
psi_det : Determinant.t array; psi_det : Determinant.t array;
state_average_weight : Positive_float.t array; state_average_weight : Positive_float.t array;
mo_label : MO_label.t;
} [@@deriving sexp] } [@@deriving sexp]
;; ;;
let get_default = Qpackage.get_ezfio_default "determinants";; let get_default = Qpackage.get_ezfio_default "determinants";;
let read_mo_label () =
if not (Ezfio.has_determinants_mo_label ()) then
if Ezfio.has_mo_basis_mo_label () then (
let label = Ezfio.get_mo_basis_mo_label () in
Ezfio.set_determinants_mo_label label) ;
Ezfio.get_determinants_mo_label ()
|> MO_label.of_string
;;
let read_n_int () = let read_n_int () =
if not (Ezfio.has_determinants_n_int()) then if not (Ezfio.has_determinants_n_int()) then
Ezfio.get_mo_basis_mo_num () Ezfio.get_mo_basis_mo_num ()
@ -290,6 +301,10 @@ end = struct
Ezfio.set_determinants_psi_det_qp_edit r Ezfio.set_determinants_psi_det_qp_edit r
;; ;;
let write_mo_label a =
MO_label.to_string a
|> Ezfio.set_determinants_mo_label
let read ?(full=true) () = let read ?(full=true) () =
@ -311,6 +326,7 @@ end = struct
psi_det = read_psi_det ~read_only () ; psi_det = read_psi_det ~read_only () ;
n_states = read_n_states () ; n_states = read_n_states () ;
state_average_weight = read_state_average_weight () ; state_average_weight = read_state_average_weight () ;
mo_label = read_mo_label () ;
} }
with _ -> None with _ -> None
else else
@ -328,6 +344,7 @@ end = struct
psi_det ; psi_det ;
n_states ; n_states ;
state_average_weight ; state_average_weight ;
mo_label ;
} = } =
write_n_int n_int ; write_n_int n_int ;
write_bit_kind bit_kind; write_bit_kind bit_kind;
@ -340,7 +357,9 @@ end = struct
write_psi_coef ~n_det:n_det ~n_states:n_states psi_coef ; write_psi_coef ~n_det:n_det ~n_states:n_states psi_coef ;
write_psi_det ~n_int:n_int ~n_det:n_det psi_det write_psi_det ~n_int:n_int ~n_det:n_det psi_det
end; end;
write_state_average_weight state_average_weight write_state_average_weight state_average_weight ;
write_mo_label mo_label ;
()
;; ;;
@ -545,6 +564,8 @@ psi_det = %s
let bitkind = let bitkind =
Printf.sprintf "(bit_kind %d)" (Lazy.force Qpackage.bit_kind Printf.sprintf "(bit_kind %d)" (Lazy.force Qpackage.bit_kind
|> Bit_kind.to_int) |> Bit_kind.to_int)
and mo_label =
Printf.sprintf "(mo_label %s)" (MO_label.to_string @@ read_mo_label ())
and n_int = and n_int =
Printf.sprintf "(n_int %d)" (N_int_number.get_max ()) Printf.sprintf "(n_int %d)" (N_int_number.get_max ())
and n_states = and n_states =
@ -553,7 +574,7 @@ psi_det = %s
Printf.sprintf "(n_det_qp_edit %d)" (Det_number.to_int @@ read_n_det_qp_edit ()) Printf.sprintf "(n_det_qp_edit %d)" (Det_number.to_int @@ read_n_det_qp_edit ())
in in
let s = let s =
String.concat "" [ header ; bitkind ; n_int ; n_states ; psi_coef ; psi_det ; n_det_qp_edit ] String.concat "" [ header ; mo_label ; bitkind ; n_int ; n_states ; psi_coef ; psi_det ; n_det_qp_edit ]
in in

View File

@ -154,8 +154,8 @@ let input_ezfio = "
* N_int_number : int * N_int_number : int
determinants_n_int determinants_n_int
1 : 30 1 : 128
N_int > 30 N_int > 128
* Det_number : int * Det_number : int
determinants_n_det determinants_n_det

1
plugins/.gitignore vendored
View File

@ -1,2 +1 @@
*

View File

@ -12,7 +12,7 @@ This basis set correction relies mainy on :
When HF is a qualitative representation of the electron pairs (i.e. weakly correlated systems), such an approach for \mu(r) is OK. When HF is a qualitative representation of the electron pairs (i.e. weakly correlated systems), such an approach for \mu(r) is OK.
See for instance JPCL, 10, 2931-2937 (2019) for typical flavours of the results. See for instance JPCL, 10, 2931-2937 (2019) for typical flavours of the results.
Thanks to the trivial nature of such a two-body rdm, the equation (22) of J. Chem. Phys. 149, 194301 (2018) can be rewritten in a very efficient way, and therefore the limiting factor of such an approach is the AO->MO four-index transformation of the two-electron integrals. Thanks to the trivial nature of such a two-body rdm, the equation (22) of J. Chem. Phys. 149, 194301 (2018) can be rewritten in a very efficient way, and therefore the limiting factor of such an approach is the AO->MO four-index transformation of the two-electron integrals.
b) "mu_of_r_potential = cas_ful" uses the two-body rdm of CAS-like wave function (i.e. linear combination of Slater determinants developped in an active space with the MOs stored in the EZFIO folder). b) "mu_of_r_potential = cas_full" uses the two-body rdm of CAS-like wave function (i.e. linear combination of Slater determinants developped in an active space with the MOs stored in the EZFIO folder).
If the CAS is properly chosen (i.e. the CAS-like wave function qualitatively represents the wave function of the systems), then such an approach is OK for \mu(r) even in the case of strong correlation. If the CAS is properly chosen (i.e. the CAS-like wave function qualitatively represents the wave function of the systems), then such an approach is OK for \mu(r) even in the case of strong correlation.
+) The use of DFT correlation functionals with multi-determinant reference (Ecmd). These functionals are originally defined in the RS-DFT framework (see for instance Theor. Chem. Acc.114, 305(2005)) and design to capture short-range correlation effects. A important quantity arising in the Ecmd is the exact on-top pair density of the system, and the main differences of approximated Ecmd relies on different approximations for the exact on-top pair density. +) The use of DFT correlation functionals with multi-determinant reference (Ecmd). These functionals are originally defined in the RS-DFT framework (see for instance Theor. Chem. Acc.114, 305(2005)) and design to capture short-range correlation effects. A important quantity arising in the Ecmd is the exact on-top pair density of the system, and the main differences of approximated Ecmd relies on different approximations for the exact on-top pair density.

View File

@ -39,7 +39,7 @@
grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate) grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate)
grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate) grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate)
if(mu_of_r_potential == "cas_ful")then if(mu_of_r_potential == "cas_full")then
! You take the on-top of the CAS wave function which is computed with mu(r) ! You take the on-top of the CAS wave function which is computed with mu(r)
on_top = on_top_cas_mu_r(ipoint,istate) on_top = on_top_cas_mu_r(ipoint,istate)
else else
@ -101,7 +101,7 @@
grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate) grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate)
grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate) grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate)
if(mu_of_r_potential == "cas_ful")then if(mu_of_r_potential == "cas_full")then
! You take the on-top of the CAS wave function which is computed with mu(r) ! You take the on-top of the CAS wave function which is computed with mu(r)
on_top = on_top_cas_mu_r(ipoint,istate) on_top = on_top_cas_mu_r(ipoint,istate)
else else
@ -163,7 +163,7 @@
grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate) grad_rho_a(1:3) = one_e_dm_and_grad_alpha_in_r(1:3,ipoint,istate)
grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate) grad_rho_b(1:3) = one_e_dm_and_grad_beta_in_r(1:3,ipoint,istate)
if(mu_of_r_potential == "cas_ful")then if(mu_of_r_potential == "cas_full")then
! You take the on-top of the CAS wave function which is computed with mu(r) ! You take the on-top of the CAS wave function which is computed with mu(r)
on_top = on_top_cas_mu_r(ipoint,istate) on_top = on_top_cas_mu_r(ipoint,istate)
else else

View File

@ -4,7 +4,7 @@ subroutine print_basis_correction
provide mu_average_prov provide mu_average_prov
if(mu_of_r_potential.EQ."hf")then if(mu_of_r_potential.EQ."hf")then
provide ecmd_lda_mu_of_r ecmd_pbe_ueg_mu_of_r provide ecmd_lda_mu_of_r ecmd_pbe_ueg_mu_of_r
else if(mu_of_r_potential.EQ."cas_ful".or.mu_of_r_potential.EQ."cas_truncated")then else if(mu_of_r_potential.EQ."cas_full".or.mu_of_r_potential.EQ."cas_truncated")then
provide ecmd_lda_mu_of_r ecmd_pbe_ueg_mu_of_r provide ecmd_lda_mu_of_r ecmd_pbe_ueg_mu_of_r
provide ecmd_pbe_on_top_mu_of_r ecmd_pbe_on_top_su_mu_of_r provide ecmd_pbe_on_top_mu_of_r ecmd_pbe_on_top_su_mu_of_r
endif endif
@ -38,7 +38,7 @@ subroutine print_basis_correction
write(*, '(A29,X,I3,X,A3,X,F16.10)') ' ECMD PBE-UEG , state ',istate,' = ',ecmd_pbe_ueg_mu_of_r(istate) write(*, '(A29,X,I3,X,A3,X,F16.10)') ' ECMD PBE-UEG , state ',istate,' = ',ecmd_pbe_ueg_mu_of_r(istate)
enddo enddo
else if(mu_of_r_potential.EQ."cas_ful".or.mu_of_r_potential.EQ."cas_truncated".or.mu_of_r_potential.EQ."pure_act")then else if(mu_of_r_potential.EQ."cas_full".or.mu_of_r_potential.EQ."cas_truncated".or.mu_of_r_potential.EQ."pure_act")then
print*, '' print*, ''
print*,'Using a CAS-like two-body density to define mu(r)' print*,'Using a CAS-like two-body density to define mu(r)'
print*,'This assumes that the CAS is a qualitative representation of the wave function ' print*,'This assumes that the CAS is a qualitative representation of the wave function '

Some files were not shown because too many files have changed in this diff Show More