diff --git a/README.md b/README.md
index b8141b88..b03f2ecc 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
# Quantum Package 2.2
-
+
+
[![DOI](https://zenodo.org/badge/167513335.svg)](https://zenodo.org/badge/latestdoi/167513335)
@@ -34,6 +35,12 @@ https://arxiv.org/abs/1902.08154
* [Download the latest release](http://github.com/QuantumPackage/qp2/releases)
* [Read the documentation](https://quantum-package.readthedocs.io)
+# Discussion list
+
+For any questions or announcements regarding QuantumPackage, you can join our discussion list by registering [here](https://groupes.renater.fr/sympa/subscribe/quantum_package) or by sending an email to `quantum_package-request@groupes.renater.fr` .
+You can also look over its [archives](https://groupes.renater.fr/sympa/arc/quantum_package).
+
+
# Build status
* Master [![master build status](https://travis-ci.com/QuantumPackage/qp2.svg?branch=master)](https://travis-ci.org/QuantumPackage/qp2)
@@ -44,9 +51,19 @@ https://arxiv.org/abs/1902.08154
# Credits
+* [TREX Center of Excellence](https://trex-coe.eu)
+* [ERC PTEROSOR](https://lcpq.github.io/PTEROSOR)
* [CNRS](http://www.cnrs.fr)
* [Laboratoire de Chimie et Physique Quantiques](http://lcpq.ups-tlse.fr)
* [Laboratoire de Chimie Théorique](http://www.lct.jussieu.fr)
* [Argonne Leadership Computing Facility](http://alcf.anl.gov)
* [CALMIP](https://www.calmip.univ-toulouse.fr)
+
+------------------------------
+
+
+
+[TREX: Targeting Real Chemical Accuracy at the Exascale](https://trex-coe.eu) project has received funding from the European Union’s Horizon 2020 - Research and Innovation program - under grant agreement no. 952165. The content of this document does not represent the opinion of the European Union, and the European Union is not responsible for any use that might be made of such content.
+
+[PTEROSOR](https://lcpq.github.io/PTEROSOR) project has received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 863481).
diff --git a/bin/qp_convert_output_to_ezfio b/bin/qp_convert_output_to_ezfio
index 07ad2236..e7c44b37 100755
--- a/bin/qp_convert_output_to_ezfio
+++ b/bin/qp_convert_output_to_ezfio
@@ -146,6 +146,17 @@ def write_ezfio(res, filename):
ezfio.set_ao_basis_ao_nucl(at)
ezfio.set_ao_basis_ao_prim_num(num_prim)
ezfio.set_ao_basis_ao_power(power_x + power_y + power_z)
+ try:
+ normf = res.normf
+ if normf == 0:
+ ezfio.set_ao_basis_ao_normalized(True)
+ elif normf == 1:
+ ezfio.set_ao_basis_ao_normalized(False)
+ else:
+ print("BUG in NORMF")
+ sys.exit(0)
+ except AttributeError:
+ ezfio.set_ao_basis_ao_normalized(True)
# ~#~#~#~#~#~#~ #
# P a r s i n g #
diff --git a/configure b/configure
index 5c38b9f2..b3ed7758 100755
--- a/configure
+++ b/configure
@@ -180,7 +180,7 @@ if [[ "${PACKAGES}.x" != ".x" ]] ; then
fi
if [[ ${PACKAGES} = all ]] ; then
- PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats"
+ PACKAGES="zlib ninja zeromq f77zmq gmp ocaml docopt resultsFile bats bse"
fi
@@ -354,12 +354,6 @@ echo " ||----w | "
echo " || || "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo ""
-echo "If you have PIP, you can install the Basis Set Exchange command-line tool:"
-echo ""
-echo " ./configure -i bse"
-echo ""
-echo "This will enable the usage of qp_basis to install extra basis sets."
-echo ""
echo ""
printf "\e[m\n"
diff --git a/data/basis/cc-pv5z_ecp_bfd b/data/basis/cc-pv5z_ecp_bfd
index a19ce9d8..84b0300e 100644
--- a/data/basis/cc-pv5z_ecp_bfd
+++ b/data/basis/cc-pv5z_ecp_bfd
@@ -555,7 +555,7 @@ g 1 1.00
g 1 1.00
1 0.457496 1.000000
-MAGNESIUM
+MAGNESIUM
s 9 1.00
1 0.030975 0.165290
2 0.062959 0.506272
diff --git a/etc/qp.rc b/etc/qp.rc
index c56661c7..064ca3f7 100644
--- a/etc/qp.rc
+++ b/etc/qp.rc
@@ -80,8 +80,6 @@ function qp()
if [[ -d $NAME ]] ; then
[[ -d $EZFIO_FILE ]] && ezfio unset_file
ezfio set_file $NAME
- else
- qp_create_ezfio -h | more
fi
unset _ARGS
;;
diff --git a/ocaml/Command_line.ml b/ocaml/Command_line.ml
index 1dd57892..602315c6 100644
--- a/ocaml/Command_line.ml
+++ b/ocaml/Command_line.ml
@@ -1,3 +1,5 @@
+exception Error of string
+
type short_opt = char
type long_opt = string
type optional = Mandatory | Optional
@@ -181,15 +183,16 @@ let set_specs specs_in =
Getopt.parse_cmdline cmd_specs (fun x -> anon_args := !anon_args @ [x]);
if show_help () then
- (help () ; exit 0);
+ help ()
+ else
+ (* Check that all mandatory arguments are set *)
+ List.filter (fun x -> x.short <> ' ' && x.opt = Mandatory) !specs
+ |> List.iter (fun x ->
+ match get x.long with
+ | Some _ -> ()
+ | None -> raise (Error ("--"^x.long^" option is missing."))
+ )
- (* Check that all mandatory arguments are set *)
- List.filter (fun x -> x.short <> ' ' && x.opt = Mandatory) !specs
- |> List.iter (fun x ->
- match get x.long with
- | Some _ -> ()
- | None -> failwith ("Error: --"^x.long^" option is missing.")
- )
;;
diff --git a/ocaml/Command_line.mli b/ocaml/Command_line.mli
index 9f6e7022..5ad4ee08 100644
--- a/ocaml/Command_line.mli
+++ b/ocaml/Command_line.mli
@@ -59,6 +59,8 @@ let () =
*)
+exception Error of string
+
type short_opt = char
type long_opt = string
diff --git a/ocaml/Molecule.ml b/ocaml/Molecule.ml
index 9b01ac3a..603244c8 100644
--- a/ocaml/Molecule.ml
+++ b/ocaml/Molecule.ml
@@ -101,7 +101,7 @@ let to_string_general ~f m =
|> String.concat "\n"
let to_string =
- to_string_general ~f:(fun x -> Atom.to_string Units.Angstrom x)
+ to_string_general ~f:(fun x -> Atom.to_string ~units:Units.Angstrom x)
let to_xyz =
to_string_general ~f:Atom.to_xyz
@@ -113,7 +113,7 @@ let of_xyz_string
s =
let l = String_ext.split s ~on:'\n'
|> List.filter (fun x -> x <> "")
- |> list_map (fun x -> Atom.of_string units x)
+ |> list_map (fun x -> Atom.of_string ~units x)
in
let ne = ( get_charge {
nuclei=l ;
diff --git a/ocaml/qp_create_ezfio.ml b/ocaml/qp_create_ezfio.ml
index be6c305b..4583b118 100644
--- a/ocaml/qp_create_ezfio.ml
+++ b/ocaml/qp_create_ezfio.ml
@@ -677,6 +677,7 @@ let run ?o b au c d m p cart xyz_file =
let () =
+ try (
let open Command_line in
begin
@@ -734,7 +735,7 @@ If a file with the same name as the basis set exists, this file will be read. O
let basis =
match Command_line.get "basis" with
- | None -> assert false
+ | None -> ""
| Some x -> x
in
@@ -773,10 +774,14 @@ If a file with the same name as the basis set exists, this file will be read. O
let xyz_filename =
match Command_line.anon_args () with
- | [x] -> x
- | _ -> (Command_line.help () ; failwith "input file is missing")
+ | [] -> failwith "input file is missing"
+ | x::_ -> x
in
run ?o:output basis au charge dummy multiplicity pseudo cart xyz_filename
+ )
+ with
+ | Failure txt -> Printf.eprintf "Fatal error: %s\n%!" txt
+ | Command_line.Error txt -> Printf.eprintf "Command line error: %s\n%!" txt
diff --git a/ocaml/qp_run.ml b/ocaml/qp_run.ml
index d096b15b..dfbab167 100644
--- a/ocaml/qp_run.ml
+++ b/ocaml/qp_run.ml
@@ -110,7 +110,7 @@ let run slave ?prefix exe ezfio_file =
let task_thread =
let thread =
Thread.create ( fun () ->
- TaskServer.run port_number )
+ TaskServer.run ~port:port_number )
in
thread ();
in
diff --git a/src/cisd/30.cisd.bats b/src/cisd/30.cisd.bats
index 6e110aa3..f4e8018b 100644
--- a/src/cisd/30.cisd.bats
+++ b/src/cisd/30.cisd.bats
@@ -4,7 +4,7 @@ source $QP_ROOT/tests/bats/common.bats.sh
source $QP_ROOT/quantum_package.rc
function run() {
- thresh=1.e-5
+ thresh=2.e-5
test_exe cisd || skip
qp edit --check
qp set determinants n_states 2
diff --git a/src/davidson/diagonalization_hcsf_dressed.irp.f b/src/davidson/diagonalization_hcsf_dressed.irp.f
index 7ef2018e..3c5224a2 100644
--- a/src/davidson/diagonalization_hcsf_dressed.irp.f
+++ b/src/davidson/diagonalization_hcsf_dressed.irp.f
@@ -1,4 +1,5 @@
-subroutine davidson_diag_h_csf(dets_in,u_in,dim_in,energies,sze,sze_csf,N_st,N_st_diag,Nint,dressing_state,converged)
+subroutine davidson_diag_h_csf(dets_in, u_in, dim_in, energies, sze, sze_csf, &
+ N_st, N_st_diag, Nint, dressing_state,converged)
use bitmasks
implicit none
BEGIN_DOC
diff --git a/src/davidson/diagonalize_ci.irp.f b/src/davidson/diagonalize_ci.irp.f
index 78478c57..8ec6cd7e 100644
--- a/src/davidson/diagonalize_ci.irp.f
+++ b/src/davidson/diagonalize_ci.irp.f
@@ -69,13 +69,21 @@ END_PROVIDER
do_csf = s2_eig .and. only_expected_s2 .and. csf_based
- if (diag_algorithm == "Davidson") then
+ if (diag_algorithm == 'Davidson') then
if (do_csf) then
if (sigma_vector_algorithm == 'det') then
- call davidson_diag_H_csf(psi_det,CI_eigenvectors, &
- size(CI_eigenvectors,1),CI_electronic_energy, &
- N_det,N_csf,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged)
+ call davidson_diag_H_csf (psi_det, &
+ CI_eigenvectors, &
+ size(CI_eigenvectors,1), &
+ CI_electronic_energy, &
+ N_det, &
+ N_csf, &
+ min(N_csf,N_states), &
+ min(N_csf,N_states_diag), &
+ N_int, &
+ 0, &
+ converged)
else if (sigma_vector_algorithm == 'cfg') then
call davidson_diag_H_cfg(psi_det,CI_eigenvectors, &
size(CI_eigenvectors,1),CI_electronic_energy, &
@@ -85,9 +93,17 @@ END_PROVIDER
stop 'bug'
endif
else
- call davidson_diag_HS2(psi_det,CI_eigenvectors, CI_s2, &
- size(CI_eigenvectors,1),CI_electronic_energy, &
- N_det,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged)
+ call davidson_diag_HS2(psi_det, &
+ CI_eigenvectors, &
+ CI_s2, &
+ size(CI_eigenvectors,1), &
+ CI_electronic_energy, &
+ N_det, &
+ min(N_det,N_states), &
+ min(N_det,N_states_diag), &
+ N_int, &
+ 0, &
+ converged)
endif
integer :: N_states_diag_save
@@ -108,9 +124,17 @@ END_PROVIDER
CI_electronic_energy_tmp(1:N_states_diag_save) = CI_electronic_energy(1:N_states_diag_save)
CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) = CI_eigenvectors(1:N_det,1:N_states_diag_save)
- call davidson_diag_H_csf(psi_det,CI_eigenvectors_tmp, &
- size(CI_eigenvectors_tmp,1),CI_electronic_energy_tmp, &
- N_det,N_csf,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged)
+ call davidson_diag_H_csf (psi_det, &
+ CI_eigenvectors_tmp, &
+ size(CI_eigenvectors_tmp,1), &
+ CI_electronic_energy_tmp, &
+ N_det, &
+ N_csf, &
+ min(N_csf,N_states), &
+ min(N_csf,N_states_diag), &
+ N_int, &
+ 0, &
+ converged)
CI_electronic_energy(1:N_states_diag_save) = CI_electronic_energy_tmp(1:N_states_diag_save)
CI_eigenvectors(1:N_det,1:N_states_diag_save) = CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save)
@@ -128,9 +152,17 @@ END_PROVIDER
CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save) = CI_eigenvectors(1:N_det,1:N_states_diag_save)
CI_s2_tmp(1:N_states_diag_save) = CI_s2(1:N_states_diag_save)
- call davidson_diag_HS2(psi_det,CI_eigenvectors_tmp, CI_s2_tmp, &
- size(CI_eigenvectors_tmp,1),CI_electronic_energy_tmp, &
- N_det,min(N_det,N_states),min(N_det,N_states_diag),N_int,0,converged)
+ call davidson_diag_HS2(psi_det, &
+ CI_eigenvectors_tmp, &
+ CI_s2_tmp, &
+ size(CI_eigenvectors_tmp,1), &
+ CI_electronic_energy_tmp, &
+ N_det, &
+ min(N_det,N_states), &
+ min(N_det,N_states_diag), &
+ N_int, &
+ 0, &
+ converged)
CI_electronic_energy(1:N_states_diag_save) = CI_electronic_energy_tmp(1:N_states_diag_save)
CI_eigenvectors(1:N_det,1:N_states_diag_save) = CI_eigenvectors_tmp(1:N_det,1:N_states_diag_save)
diff --git a/src/fci/40.fci.bats b/src/fci/40.fci.bats
index ac34251f..95a1724c 100644
--- a/src/fci/40.fci.bats
+++ b/src/fci/40.fci.bats
@@ -40,7 +40,14 @@ function run_stoch() {
run_stoch -49.14097596 0.0001 10000
}
-@test "NH3" { # 0:00:11
+@test "F2" { # 4.07m
+ [[ -n $TRAVIS ]] && skip
+ qp set_file f2.ezfio
+ qp set_frozen_core
+ run_stoch -199.307512211742 0.002 100000
+}
+
+@test "NH3" { # 10.6657s
qp set_file nh3.ezfio
qp set_mo_class --core="[1-4]" --act="[5-72]"
run -56.24474908 1.e-5 10000
@@ -179,10 +186,3 @@ function run_stoch() {
run_stoch -93.0980746734051 5.e-4 50000
}
-@test "F2" { # 0:03:34
- [[ -n $TRAVIS ]] && skip
- qp set_file f2.ezfio
- qp set_frozen_core
- run_stoch -199.307512211742 0.002 100000
-}
-
diff --git a/src/tools/truncate_wf.irp.f b/src/tools/truncate_wf.irp.f
index 6c66c8ec..64c15bf7 100644
--- a/src/tools/truncate_wf.irp.f
+++ b/src/tools/truncate_wf.irp.f
@@ -54,11 +54,23 @@ subroutine routine_s2
double precision, allocatable :: psi_coef_tmp(:,:)
integer :: i,j,k
double precision :: accu(N_states)
+ integer :: weights(0:16), ix
+ double precision :: x
- print *, 'Weights of the CFG'
+ weights(:) = 0
do i=1,N_det
- print *, i, real(weight_configuration(det_to_configuration(i),:)), real(sum(weight_configuration(det_to_configuration(i),:)))
+ x = -dlog(1.d-32+sum(weight_configuration(det_to_configuration(i),:)))/dlog(10.d0)
+ ix = min(int(x), 16)
+ weights(ix) += 1
enddo
+
+ print *, 'Histogram of the weights of the CFG'
+ do i=0,15
+ print *, ' 10^{-', i, '} ', weights(i)
+ end do
+ print *, '< 10^{-', 15, '} ', weights(16)
+
+
print*, 'Min weight of the configuration?'
read(5,*) wmin