From cbf39830bc3e0cc213ad3e3890ee3791e89ea355 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 29 May 2014 01:46:50 +0200 Subject: [PATCH] Added Generators_full module --- src/Generators_full/ASSUMPTIONS.rst | 0 src/Generators_full/Makefile | 8 +++++ src/Generators_full/NEEDED_MODULES | 1 + src/Generators_full/README.rst | 7 +++++ src/Generators_full/generators.irp.f | 44 ++++++++++++++++++++++++++++ src/Generators_full/tests/Makefile | 33 +++++++++++++++++++++ 6 files changed, 93 insertions(+) create mode 100644 src/Generators_full/ASSUMPTIONS.rst create mode 100644 src/Generators_full/Makefile create mode 100644 src/Generators_full/NEEDED_MODULES create mode 100644 src/Generators_full/README.rst create mode 100644 src/Generators_full/generators.irp.f create mode 100644 src/Generators_full/tests/Makefile diff --git a/src/Generators_full/ASSUMPTIONS.rst b/src/Generators_full/ASSUMPTIONS.rst new file mode 100644 index 00000000..e69de29b diff --git a/src/Generators_full/Makefile b/src/Generators_full/Makefile new file mode 100644 index 00000000..b2ea1de1 --- /dev/null +++ b/src/Generators_full/Makefile @@ -0,0 +1,8 @@ +default: all + +# Define here all new external source files and objects.Don't forget to prefix the +# object files with IRPF90_temp/ +SRC= +OBJ= + +include $(QPACKAGE_ROOT)/src/Makefile.common diff --git a/src/Generators_full/NEEDED_MODULES b/src/Generators_full/NEEDED_MODULES new file mode 100644 index 00000000..f6551dd9 --- /dev/null +++ b/src/Generators_full/NEEDED_MODULES @@ -0,0 +1 @@ +AOs BiInts Bitmask Dets Electrons Ezfio_files Hartree_Fock MonoInts MOs Nuclei Output Utils diff --git a/src/Generators_full/README.rst b/src/Generators_full/README.rst new file mode 100644 index 00000000..e3ba2312 --- /dev/null +++ b/src/Generators_full/README.rst @@ -0,0 +1,7 @@ +====================== +Generators_full Module +====================== + +All the determinants of the wave function are generators. In this way, the Full CI +space is explored. + diff --git a/src/Generators_full/generators.irp.f b/src/Generators_full/generators.irp.f new file mode 100644 index 00000000..00930ae6 --- /dev/null +++ b/src/Generators_full/generators.irp.f @@ -0,0 +1,44 @@ +use bitmasks + +BEGIN_PROVIDER [ double precision, generators_threshold ] + implicit none + BEGIN_DOC + ! Percentage of the norm of the state-averaged wave function to + ! consider for the generators + END_DOC + generators_threshold = 0.97d0 +END_PROVIDER + +BEGIN_PROVIDER [ integer, N_det_generators ] + implicit none + BEGIN_DOC + ! For Single reference wave functions, the number of generators is 1 : the + ! Hartree-Fock determinant + END_DOC + integer :: i + double precision :: norm + call write_time(output_dets) + norm = 0.d0 + N_det_generators = N_det + do i=1,N_det + norm = norm + psi_average_norm_contrib_sorted(i) + if (norm > generators_threshold) then + N_det_generators = i-1 + exit + endif + enddo + N_det_generators = max(N_det_generators,1) + call write_int(output_dets,N_det_generators,'Number of generators') +END_PROVIDER + +BEGIN_PROVIDER [ integer(bit_kind), psi_generators, (N_int,2,psi_det_size) ] + implicit none + BEGIN_DOC + ! For Single reference wave functions, the generator is the + ! Hartree-Fock determinant + END_DOC + psi_generators = psi_det_sorted + +END_PROVIDER + + diff --git a/src/Generators_full/tests/Makefile b/src/Generators_full/tests/Makefile new file mode 100644 index 00000000..77bd84ba --- /dev/null +++ b/src/Generators_full/tests/Makefile @@ -0,0 +1,33 @@ +OPENMP =1 +PROFILE =0 +DEBUG = 0 + +IRPF90+= -I tests + +REF_FILES=$(subst %.irp.f, %.ref, $(wildcard *.irp.f)) + +.PHONY: clean executables serial_tests parallel_tests + +all: clean executables serial_tests parallel_tests + +parallel_tests: $(REF_FILES) + @echo ; echo " ---- Running parallel tests ----" ; echo + @OMP_NUM_THREADS=10 ${QPACKAGE_ROOT}/scripts/run_tests.py + +serial_tests: $(REF_FILES) + @echo ; echo " ---- Running serial tests ----" ; echo + @OMP_NUM_THREADS=1 ${QPACKAGE_ROOT}/scripts/run_tests.py + +executables: $(wildcard *.irp.f) veryclean + $(MAKE) -C .. + +%.ref: $(wildcard $(QPACKAGE_ROOT)/data/inputs/*.md5) executables + $(QPACKAGE_ROOT)/scripts/create_test_ref.sh $* + +clean: + $(MAKE) -C .. clean + +veryclean: + $(MAKE) -C .. veryclean + +