10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-29 16:34:50 +02:00

Merge pull request #17 from LCPQ/master

Working MRCC
This commit is contained in:
Anthony Scemama 2015-07-03 14:37:59 +02:00
commit 8b9a3d6507
40 changed files with 922 additions and 348 deletions

56
configure vendored
View File

@ -45,7 +45,7 @@ QP_ROOT = os.getcwd()
QP_ROOT_BIN = join(QP_ROOT, "bin")
QP_ROOT_INSTALL = join(QP_ROOT, "install")
os.environ["PATH"] = os.environ["PATH"] + ":"+QP_ROOT_BIN
os.environ["PATH"] = os.environ["PATH"] + ":" + QP_ROOT_BIN
d_dependency = {
"ocaml": ["m4", "curl", "zlib", "patch", "gcc"],
@ -128,12 +128,12 @@ ezfio = Info(
d_info = dict()
for m in ["ocaml", "m4", "curl", "zlib", "path", "irpf90", "docopt",
for m in ["ocaml", "m4", "curl", "zlib", "path", "irpf90", "docopt",
"resultsFile", "ninja", "emsl", "ezfio"]:
exec ("d_info['{0}']={0}".format(m))
def find_path(bin_, l_installed):
def find_path(bin_, l_installed, var_for_qp_root=False):
"""Use the global variable
* l_installed
* d_info
@ -143,6 +143,10 @@ def find_path(bin_, l_installed):
locate = l_installed[bin_]
except KeyError:
locate = d_info[bin_].default_path
if var_for_qp_root:
locate = locate.replace(QP_ROOT, "${QP_ROOT}")
return locate
@ -158,7 +162,8 @@ def check_output(*popenargs, **kwargs):
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.2
"""
process = subprocess.Popen(stdout=subprocess.PIPE,stderr=subprocess.PIPE, *popenargs, **kwargs)
process = subprocess.Popen(stdout=subprocess.PIPE,
stderr=subprocess.PIPE, *popenargs, **kwargs)
output, unused_err = process.communicate()
retcode = process.poll()
if retcode:
@ -277,7 +282,8 @@ def installation(l_install_descendant):
def create_rule_ninja():
l_rules = [
"rule download", " command = wget --no-check-certificate ${url} -O ${out} -o /dev/null",
"rule download",
" command = wget --no-check-certificate ${url} -O ${out} -o /dev/null",
" description = Downloading ${descr}", ""
]
@ -409,10 +415,8 @@ def create_ninja_and_rc(l_installed):
"""
d_print = {
"qp_root": "Creating quantum_package.rc...",
"build": "Creating build.ninja..."
}
d_print = {"qp_root": "Creating quantum_package.rc...",
"build": "Creating build.ninja..."}
length = max(map(len, d_print.values()))
@ -429,12 +433,15 @@ def create_ninja_and_rc(l_installed):
if os.path.isdir(path):
l_python.append(path)
l_rc = [ 'export QP_ROOT={0}'.format(QP_ROOT) ] + \
[ i.replace(QP_ROOT,"${QP_ROOT}") for i in
[
'export QP_EZFIO={0}'.format(find_path('ezfio', l_installed)),
'export IRPF90={0}'.format(find_path("irpf90", l_installed)),
'export NINJA={0}'.format(find_path("ninja", l_installed)),
path_ezfio = find_path('ezfio', l_installed, var_for_qp_root=True)
path_irpf90 = find_path("irpf90", l_installed, var_for_qp_root=True)
path_ninja = find_path("ninja", l_installed, var_for_qp_root=True)
l_rc = [
'export QP_ROOT={0}'.format(QP_ROOT),
'export QP_EZFIO={0}'.format(path_ezfio),
'export IRPF90={0}'.format(path_irpf90),
'export NINJA={0}'.format(path_ninja),
'export QP_PYTHON={0}'.format(":".join(l_python)), "",
'export PYTHONPATH="${QP_PYTHON}":"${PYTHONPATH}"',
'export PATH="${QP_PYTHON}":"${QP_ROOT}"/bin:"${QP_ROOT}"/ocaml:"${PATH}"',
@ -443,7 +450,7 @@ def create_ninja_and_rc(l_installed):
'source ${QP_ROOT}/install/EZFIO/Bash/ezfio.sh', "",
'source ${HOME}/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true',
""
] ]
]
path = join(QP_ROOT, "quantum_package.rc")
with open(path, "w+") as f:
@ -451,30 +458,33 @@ def create_ninja_and_rc(l_installed):
print "[ OK ] ({0})".format(path)
print str_info("build"),
command = ['bash', '-c', 'source {0} && env'.format(path)]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
for line in proc.stdout:
(key, _, value) = line.partition("=")
os.environ[key] = value.strip()
print str_info("build"),
qp_create_ninja = os.path.join(QP_ROOT, "scripts", "compilation",
"qp_create_ninja.py")
l = [qp_create_ninja, "create"] + sys.argv[1:]
try:
subprocess.check_call(" ".join(l), shell=True)
with open('/dev/null', 'w') as dnull:
subprocess.check_call(" ".join(l), shell=True,stderr=dnull)
except:
raise
print "[ FAIL ]"
print "Check the valididy of the config file provided ({0})".format(sys.argv[1])
print "Exit..."
sys.exit(1)
else:
print "[ OK ]"
def recommendation():
print "Last Step:"
path = join(QP_ROOT, "quantum_package.rc")
print "Now :"
print " source {0}".format(path)

View File

@ -18,7 +18,7 @@ MLIFILES=$(wildcard *.mli)
ALL_TESTS=$(patsubst %.ml,%.byte,$(wildcard test_*.ml))
ALL_EXE=$(patsubst %.ml,%.native,$(wildcard qp_*.ml)) qp_edit.native
.PHONY: executables default
.PHONY: executables default remake_executables
default: $(ALL_TESTS) $(ALL_EXE) .gitignore
@ -34,7 +34,7 @@ default: $(ALL_TESTS) $(ALL_EXE) .gitignore
executables: $(QP_ROOT)/data/executables
$(QP_ROOT)/data/executables:
$(QP_ROOT)/data/executables: remake_executables
$(QP_ROOT)/scripts/module/create_executables_list.sh
external_libs:

23
plugins/Casino/.gitignore vendored Normal file
View File

@ -0,0 +1,23 @@
# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py
IRPF90_temp
IRPF90_man
irpf90_entities
tags
irpf90.make
Makefile
Makefile.depend
.ninja_log
.ninja_deps
ezfio_interface.irp.f
Ezfio_files
Determinants
Integrals_Monoelec
MO_Basis
Utils
Pseudo
Bitmask
AO_Basis
Electrons
Nuclei
Integrals_Bielec
save_for_casino

View File

@ -0,0 +1 @@
Determinants

27
plugins/Casino/README.rst Normal file
View File

@ -0,0 +1,27 @@
======
Casino
======
Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
`prog_save_casino <http://github.com/LCPQ/quantum_package/tree/master/src/Casino/save_for_casino.irp.f#L266>`_
Undocumented
`save_casino <http://github.com/LCPQ/quantum_package/tree/master/src/Casino/save_for_casino.irp.f#L1>`_
Undocumented
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
.. image:: tree_dependency.png
* `Determinants <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants>`_

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -1,4 +1,4 @@
program full_ci
program ddci
implicit none
integer :: i,k

View File

@ -1,4 +1,4 @@
# Automatically created by /home/scemama/quantum_package/scripts/module/module_handler.py
# Automatically created by /home/razoa/quantum_package/scripts/module/module_handler.py
IRPF90_temp
IRPF90_man
irpf90_entities
@ -27,6 +27,6 @@ Nuclei
Hartree_Fock
Properties
target_pt2
full_ci_no_skip
full_ci
var_pt2_ratio
full_ci
full_ci_no_skip

View File

@ -14,7 +14,7 @@ Documentation
Undocumented
`h_apply_fci <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L519>`_
`h_apply_fci <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L521>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
@ -25,126 +25,126 @@ Documentation
Assume N_int is already provided.
`h_apply_fci_mono <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2712>`_
`h_apply_fci_mono <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2720>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_mono_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2192>`_
`h_apply_fci_mono_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2198>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_mono_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2515>`_
`h_apply_fci_mono_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2522>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L324>`_
`h_apply_fci_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L325>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_no_skip <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1974>`_
`h_apply_fci_no_skip <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1980>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1456>`_
`h_apply_fci_no_skip_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1460>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1779>`_
`h_apply_fci_no_skip_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1784>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_pt2 <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1249>`_
`h_apply_fci_pt2 <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1253>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_fci_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L765>`_
`h_apply_fci_pt2_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L767>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_fci_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1068>`_
`h_apply_fci_pt2_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L1071>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_pt2_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4210>`_
`h_apply_pt2_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4222>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_pt2_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3724>`_
`h_apply_pt2_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3734>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_pt2_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4027>`_
`h_apply_pt2_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4038>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_pt2_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5665>`_
`h_apply_pt2_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5681>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_pt2_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5181>`_
`h_apply_pt2_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5195>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_pt2_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5484>`_
`h_apply_pt2_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L5499>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_select_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3478>`_
`h_apply_select_mono_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3488>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_select_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2958>`_
`h_apply_select_mono_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L2966>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_select_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3281>`_
`h_apply_select_mono_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L3290>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_select_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4935>`_
`h_apply_select_mono_di_delta_rho <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4949>`_
Calls H_apply on the HF determinant and selects all connected single and double
excitations (of the same symmetry). Auto-generated by the ``generate_h_apply`` script.
`h_apply_select_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4417>`_
`h_apply_select_mono_di_delta_rho_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4429>`_
Generate all double excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.
`h_apply_select_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4740>`_
`h_apply_select_mono_di_delta_rho_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/Full_CI/H_apply.irp.f_shell_43#L4753>`_
Generate all single excitations of key_in using the bit masks of holes and
particles.
Assume N_int is already provided.

View File

@ -6,7 +6,6 @@ tags
irpf90.make
Makefile
Makefile.depend
build.ninja
.ninja_log
.ninja_deps
ezfio_interface.irp.f

View File

@ -389,16 +389,17 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
Vt = 0.d0
!$OMP DO SCHEDULE(guided)
do i=1,n
idx(0) = i
call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx)
do jj=1,idx(0)
j = idx(jj)
if ( (dabs(u_0(j)) > 1.d-7).or.((dabs(u_0(i)) > 1.d-7)) ) then
! idx(0) = i
! call filter_connected_davidson(keys_tmp,keys_tmp(1,1,i),Nint,i-1,idx)
! do jj=1,idx(0)
! j = idx(jj)
! if ( (dabs(u_0(j)) > 1.d-7).or.((dabs(u_0(i)) > 1.d-7)) ) then
do j = 1, i-1
call i_H_j(keys_tmp(1,1,j),keys_tmp(1,1,i),Nint,hij)
hij = hij + delta_ij(j,i,istate)
vt (i) = vt (i) + hij*u_0(j)
vt (j) = vt (j) + hij*u_0(i)
endif
! endif
enddo
enddo
!$OMP END DO

View File

@ -48,7 +48,7 @@ subroutine run_mrcc
E_new = 0.d0
delta_E = 1.d0
iteration = 0
do while (delta_E > 1.d-8)
do while (delta_E > 1.d-10)
iteration += 1
print *, '==========================='
print *, 'MRCC Iteration', iteration

View File

@ -138,7 +138,11 @@ subroutine mrcc_dress(delta_ij_,Ndet,i_generator,n_selected,det_buffer,Nint,ipro
do i_state=1,N_states
delta_ij_(idx_non_cas(k_sd),idx_cas(i_I),i_state) += dIa_hla(i_state,k_sd)
delta_ij_(idx_cas(i_I),idx_non_cas(k_sd),i_state) += dIa_hla(i_state,k_sd)
delta_ij_(idx_cas(i_I),idx_cas(i_I),i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_cas_coef(k_sd,i_state)
if(dabs(psi_cas_coef(i_I,i_state)).ge.5.d-5)then
delta_ij_(idx_cas(i_I),idx_cas(i_I),i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_cas_coef(k_sd,i_state)
else
delta_ij_(idx_cas(i_I),idx_cas(i_I),i_state) = 0.d0
endif
enddo
enddo
call omp_unset_lock( psi_cas_lock(i_I) )

View File

@ -1,35 +1,28 @@
BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
BEGIN_PROVIDER [ double precision, lambda_mrcc, (N_states,psi_det_size) ]
&BEGIN_PROVIDER [ double precision, lambda_pert, (N_states,psi_det_size) ]
implicit none
BEGIN_DOC
! cm/<Psi_0|H|D_m>
! cm/<Psi_0|H|D_m> or perturbative 1/Delta_E(m)
END_DOC
integer :: i,k
double precision :: ihpsi(N_states), hij(N_states)
double precision :: ihpsi(N_states), hii
do i=1,N_det_non_cas
call i_h_psi(psi_non_cas(1,1,i), psi_cas, psi_cas_coef, N_int, N_det_cas, &
size(psi_cas_coef,1), n_states, ihpsi)
call i_h_j(psi_non_cas(1,1,i),psi_non_cas(1,1,i),N_int,hij)
call i_h_j(psi_non_cas(1,1,i),psi_non_cas(1,1,i),N_int,hii)
do k=1,N_states
lambda_pert(k,i) = 1d0 / (CI_electronic_energy(k)-hij(k))
lambda_pert(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii)
lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k)
if ((lambda_mrcc(k,i)/lambda_pert(k,i))<0.d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>4.d0) then
lambda_mrcc(k,i) = lambda_pert(k,i)
else
if ((lambda_mrcc(k,i)/lambda_pert(k,i))<0.1d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>=0d0) then
lambda_mrcc(k,i) = lambda_mrcc(k,i)*((cos((lambda_mrcc(k,i)/lambda_pert(k,i))*3.141592653589793d0/0.1d0+3.141592653589793d0)+1d0)/2.d0) &
+ lambda_pert(k,i)*(1.d0-((cos((lambda_mrcc(k,i)/lambda_pert(k,i))*3.141592653589793d0/0.1d0+3.141592653589793d0)+1.d0)/2.d0))
elseif ((lambda_mrcc(k,i)/lambda_pert(k,i))<=4.0d0 .or. (lambda_mrcc(k,i)/lambda_pert(k,i))>2.0d0) then
lambda_mrcc(k,i) = lambda_mrcc(k,i)*(1.d0-(cos(abs(2.d0-(lambda_mrcc(k,i)/lambda_pert(k,i)))*3.141592653589793d0/2.0d0+3.141592653589793d0)+1.d0)/2d0) &
+ lambda_pert(k,i)*((cos(abs(2.d0-(lambda_mrcc(k,i)/lambda_pert(k,i)))*3.141592653589793d0/2.0d0+3.141592653589793d0)+1.d0)/2.d0)
else
lambda_mrcc(k,i) = lambda_mrcc(k,i)
endif
endif
if (dabs(ihpsi(k)).le.1.d-3) then
lambda_mrcc(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii)
icount_manu = icount_manu+1
cycle
endif
enddo
enddo
END_PROVIDER
@ -71,6 +64,16 @@ BEGIN_PROVIDER [ double precision, delta_ij, (N_det,N_det,N_states) ]
enddo
enddo
endif
do i = 1, N_det
do j = 1, N_det
do m = 1, N_states
if(isnan(delta_ij(j,i,m)))then
delta_ij(j,i,m) = 0.d0
endif
enddo
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det) ]

View File

@ -85,92 +85,92 @@ Documentation
Undocumented
`perturb_buffer_by_mono_delta_rho_one_point <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L791>`_
`perturb_buffer_by_mono_delta_rho_one_point <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L161>`_
Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_dipole_moment_z <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L686>`_
`perturb_buffer_by_mono_dipole_moment_z <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L896>`_
Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_epstein_nesbet <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L476>`_
`perturb_buffer_by_mono_epstein_nesbet <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L686>`_
Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_epstein_nesbet_2x2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L581>`_
`perturb_buffer_by_mono_epstein_nesbet_2x2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L791>`_
Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_epstein_nesbet_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L371>`_
`perturb_buffer_by_mono_epstein_nesbet_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L581>`_
Applly pertubration ``epstein_nesbet_sc2`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_epstein_nesbet_sc2_no_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L266>`_
`perturb_buffer_by_mono_epstein_nesbet_sc2_no_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L476>`_
Applly pertubration ``epstein_nesbet_sc2_no_projected`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L161>`_
`perturb_buffer_by_mono_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L371>`_
Applly pertubration ``epstein_nesbet_sc2_projected`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_h_core <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L56>`_
`perturb_buffer_by_mono_h_core <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L266>`_
Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_by_mono_moller_plesset <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L896>`_
`perturb_buffer_by_mono_moller_plesset <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L56>`_
Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_delta_rho_one_point <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L740>`_
`perturb_buffer_delta_rho_one_point <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L110>`_
Applly pertubration ``delta_rho_one_point`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_dipole_moment_z <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L635>`_
`perturb_buffer_dipole_moment_z <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L845>`_
Applly pertubration ``dipole_moment_z`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_epstein_nesbet <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L425>`_
`perturb_buffer_epstein_nesbet <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L635>`_
Applly pertubration ``epstein_nesbet`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_epstein_nesbet_2x2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L530>`_
`perturb_buffer_epstein_nesbet_2x2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L740>`_
Applly pertubration ``epstein_nesbet_2x2`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_epstein_nesbet_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L320>`_
`perturb_buffer_epstein_nesbet_sc2 <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L530>`_
Applly pertubration ``epstein_nesbet_sc2`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_epstein_nesbet_sc2_no_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L215>`_
`perturb_buffer_epstein_nesbet_sc2_no_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L425>`_
Applly pertubration ``epstein_nesbet_sc2_no_projected`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L110>`_
`perturb_buffer_epstein_nesbet_sc2_projected <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L320>`_
Applly pertubration ``epstein_nesbet_sc2_projected`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_h_core <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L5>`_
`perturb_buffer_h_core <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L215>`_
Applly pertubration ``h_core`` to the buffer of determinants generated in the H_apply
routine.
`perturb_buffer_moller_plesset <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L845>`_
`perturb_buffer_moller_plesset <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation/perturbation.irp.f_shell_13#L5>`_
Applly pertubration ``moller_plesset`` to the buffer of determinants generated in the H_apply
routine.

View File

@ -0,0 +1 @@
MO_Basis

View File

@ -0,0 +1,22 @@
Documentation
=============
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
`loc_rasorb <http://github.com/LCPQ/quantum_package/tree/master/src/loc_cele/loc_cele.irp.f#L1>`_
This program performs a localization of the active orbitals
of a CASSCF wavefunction, reading the orbitals from a RASORB
file of molcas.
id1=max number of MO in a given symmetry.
Needed Modules
==============
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
.. image:: tree_dependency.png
* `MO_Basis <http://github.com/LCPQ/quantum_package/tree/master/src/MO_Basis>`_

163
plugins/loc_cele/loc.f Normal file
View File

@ -0,0 +1,163 @@
c************************************************************************
subroutine maxovl(n,m,s,t,w)
C
C This subprogram contains an iterative procedure to find the
C unitary transformation of a set of n vectors which maximizes
C the sum of their square overlaps with a set of m reference
C vectors (m.le.n)
C
C S: overlap matrix <ref|vec>
C T: rotation matrix
C W: new overlap matrix
C
C
implicit real*8(a-h,o-y),logical*1(z)
parameter (id1=300)
dimension s(id1,id1),t(id1,id1),w(id1,id1)
data small/1.d-6/
zprt=.true.
niter=100
conv=1.d-8
write (6,5) n,m,conv
5 format (//5x,'Unitary transformation of',i3,' vectors'/
* 5x,'following the principle of maximum overlap with a set of',
* i3,' reference vectors'/5x,'required convergence on rotation ',
* 'angle =',f13.10///5x,'Starting overlap matrix'/)
do 6 i=1,m
write (6,145) i
6 write (6,150) (s(i,j),j=1,n)
8 mm=m-1
if (m.lt.n) mm=m
iter=0
do 20 j=1,n
do 16 i=1,n
t(i,j)=0.d0
16 continue
do 18 i=1,m
18 w(i,j)=s(i,j)
20 t(j,j)=1.d0
sum=0.d0
do 10 i=1,m
sum=sum+s(i,i)*s(i,i)
10 continue
sum=sum/m
if (zprt) write (6,12) sum
12 format (//5x,'Average square overlap =',f10.6)
if (n.eq.1) goto 100
last=n
j=1
21 if (j.ge.last) goto 30
sum=0.d0
do 22 i=1,n
22 sum=sum+s(i,j)*s(i,j)
if (sum.gt.small) goto 28
do 24 i=1,n
sij=s(i,j)
s(i,j)=-s(i,last)
s(i,last)=sij
tij=t(i,j)
t(i,j)=-t(i,last)
t(i,last)=tij
24 continue
last=last-1
goto 21
28 j=j+1
goto 21
30 iter=iter+1
imax=0
jmax=0
dmax=0.d0
amax=0.d0
do 60 i=1,mm
ip=i+1
do 50 j=ip,n
a=s(i,j)*s(i,j)-s(i,i)*s(i,i)
b=-s(i,i)*s(i,j)
if (j.gt.m) goto 31
a=a+s(j,i)*s(j,i)-s(j,j)*s(j,j)
b=b+s(j,i)*s(j,j)
31 b=b+b
if (a.eq.0.d0) goto 32
ba=b/a
if (dabs(ba).gt.small) goto 32
if (a.gt.0.d0) goto 33
tang=-0.5d0*ba
cosine=1.d0/dsqrt(1.d0+tang*tang)
sine=tang*cosine
goto 34
32 tang=0.d0
if (b.ne.0.d0) tang=(a+dsqrt(a*a+b*b))/b
cosine=1.d0/dsqrt(1.d0+tang*tang)
sine=tang*cosine
goto 34
33 cosine=0.d0
sine=1.d0
34 delta=sine*(a*sine+b*cosine)
if (zprt.and.delta.lt.0.d0) write (6,71) i,j,a,b,sine,cosine,delta
do 35 k=1,m
p=s(k,i)*cosine-s(k,j)*sine
q=s(k,i)*sine+s(k,j)*cosine
s(k,i)=p
35 s(k,j)=q
do 40 k=1,n
p=t(k,i)*cosine-t(k,j)*sine
q=t(k,i)*sine+t(k,j)*cosine
t(k,i)=p
t(k,j)=q
40 continue
45 d=dabs(sine)
if (d.le.amax) goto 50
imax=i
jmax=j
amax=d
dmax=delta
50 continue
60 continue
if (zprt) write (6,70) iter,amax,imax,jmax,dmax
70 format (' iter=',i4,' largest rotation=',f12.8,
* ', vectors',i3,' and',i3,', incr. of diag. squares=',g12.5)
71 format (' i,j,a,b,sin,cos,delta =',2i3,5f10.5)
if (amax.lt.conv) goto 100
if (iter.lt.niter) goto 30
write (6,80)
write (6,*) 'niter=',niter
80 format (//5x,'*** maximum number of cycles exceeded ',
* 'in subroutine maxovl ***'//)
stop
100 continue
do 120 j=1,n
if (s(j,j).gt.0.d0) goto 120
do 105 i=1,m
105 s(i,j)=-s(i,j)
do 110 i=1,n
110 t(i,j)=-t(i,j)
120 continue
sum=0.d0
do 125 i=1,m
125 sum=sum+s(i,i)*s(i,i)
sum=sum/m
do 122 i=1,m
do 122 j=1,n
sw=s(i,j)
s(i,j)=w(i,j)
122 w(i,j)=sw
if (.not.zprt) return
write (6,12) sum
write (6,130)
130 format (//5x,'transformation matrix')
do 140 i=1,n
write (6,145) i
140 write (6,150) (t(i,j),j=1,n)
145 format (i8)
150 format (2x,10f12.8)
write (6,160)
160 format (//5x,'new overlap matrix'/)
do 170 i=1,m
write (6,145) i
170 write (6,150) (w(i,j),j=1,n)
return
end

View File

@ -0,0 +1,320 @@
program loc_rasorb
implicit none
BEGIN_DOC
! This program performs a localization of the active orbitals
! of a CASSCF wavefunction, reading the orbitals from a RASORB
! file of molcas.
! id1=max is the number of MO in a given symmetry.
END_DOC
integer id1
parameter (id1=300)
character*1 jobz,uplo
character*64 file1,file2
character*72 string(id1,8),cdum
double precision :: cmo(id1,id1,1),cmoref(id1,id1,1),newcmo(id1,id1,1)
double precision ::s(id1,id1,1),dum,ddum(id1,id1),ovl(id1,id1)
double precision :: w(id1),work(3*id1),t(id1,id1),wi(id1,id1)
integer n,i,j,k,l,nmo(8),isym,nsym,idum,nrot(8),irot(id1,8)
integer ipiv(id1),info,lwork
logical *1 z54
print*,'passed the first copy'
z54=.false.
!Read the name of the RasOrb file
print*,'Entering in the loc program'
! read(5,*) z54
print*,'before = '
accu_norm = 0.d0
do i =1,mo_tot_num
accu_norm += dabs(mo_overlap(i,i))
enddo
print*,'accu_norm = ',accu_norm
nsym = 1
nmo(1) = mo_tot_num
print*,'nmo(1) = ',nmo(1)
cmo = 0.d0
do isym=1,nsym
do i=1,nmo(isym)
do j = 1, ao_num
cmo(j,i,isym) = mo_coef(j,i)
enddo
enddo
enddo
print*,'passed the first copy'
do isym=1,nsym
do j=1,mo_tot_num
do i=1,ao_num
newcmo(i,j,isym)=cmo(i,j,isym)
enddo
enddo
enddo
print*,'passed the copy'
nrot(1) = 6 ! number of orbitals to be localized
integer :: index_rot(1000,1)
cmoref = 0.d0
! Definition of the index of the MO to be rotated
irot(1,1) = 20 ! the first mo to be rotated is the 19 th MO
irot(2,1) = 21 ! the first mo to be rotated is the 20 th MO
irot(3,1) = 22 ! etc....
irot(4,1) = 23 !
irot(5,1) = 24 !
irot(6,1) = 25 !
! you define the guess vectors that you want
! the new MO to be close to
! cmore(i,j,1) = < AO_i | guess_vector_MO(j) >
! i goes from 1 to ao_num
! j goes from 1 to nrot(1)
! Here you must go to the GAMESS output file
! where the AOs are listed and explicited
! From the basis of this knowledge you can build your
! own guess vectors for the MOs
! The new MOs are provided in output
! in the same order than the guess MOs
cmoref(3,1,1) = 1.d0 !
cmoref(12,1,1) = 1.d0 !
cmoref(21,2,1) = 1.d0 !
cmoref(30,2,1) = 1.d0 !
cmoref(39,3,1) = 1.d0 !
cmoref(48,3,1) = 1.d0 !
cmoref(3,4,1) = 1.d0 !
cmoref(12,4,1) =-1.d0 !
cmoref(21,5,1) = 1.d0 !
cmoref(30,5,1) =-1.d0 !
cmoref(39,6,1) = 1.d0 !
cmoref(48,6,1) =-1.d0 !
print*,'passed the definition of the referent vectors '
!Building the S (overlap) matrix in the AO basis.
do isym=1,nsym
if (nrot(isym).eq.0) cycle
do i=1,ao_num
s(i,i,isym)=1.d0
do j=1,ao_num
if (i.ne.j) s(i,j,isym)=0.d0
ddum(i,j)=0.d0
do k=1,nmo(isym)
ddum(i,j)=ddum(i,j)+cmo(i,k,isym)*cmo(j,k,isym)
enddo
enddo
enddo
call dgesv(ao_num,ao_num,ddum,id1,ipiv,s(1,1,isym),id1,info)
if (info.ne.0) then
write (6,*) 'Something wrong in dgsev',isym
stop
endif
enddo
!Now big loop over symmetry
do isym=1,nsym
if (nrot(isym).eq.0) cycle
write (6,*)
write (6,*)
write (6,*)
write (6,*) 'WORKING ON SYMMETRY',isym
write (6,*)
!Compute the overlap matrix <ref|vec>
! do i=1,nmo(isym)
do i=1,ao_num
do j=1,nrot(isym)
ddum(i,j)=0.d0
do k=1,ao_num
ddum(i,j)=ddum(i,j)+s(i,k,isym)*cmo(k,irot(j,isym),isym)
enddo
enddo
enddo
do i=1,nrot(isym)
do j=1,nrot(isym)
ovl(i,j)=0.d0
do k=1,ao_num
! do k=1,mo_tot_num
ovl(i,j)=ovl(i,j)+cmoref(k,i,isym)*ddum(k,j)
enddo
enddo
enddo
call maxovl(nrot(isym),nrot(isym),ovl,t,wi)
do i=1,nrot(isym)
do j=1,ao_num
write (6,*) 'isym,',isym,nrot(isym),nmo(isym)
newcmo(j,irot(i,isym),isym)=0.d0
do k=1,nrot(isym)
newcmo(j,irot(i,isym),isym)=newcmo(j,irot(i,isym),isym) + cmo(j,irot(k,isym),isym)*t(k,i)
enddo
enddo
enddo
! if(dabs(newcmo(3,19,1) - mo_coef(3,19)) .gt.1.d-10 )then
! print*,'Something wrong bitch !!'
! print*,'newcmo(3,19,1) = ',newcmo(3,19,1)
! print*,'mo_coef(3,19) = ',mo_coef(3,19)
! stop
! endif
enddo !big loop over symmetry
10 format (4E18.12)
! Now we copyt the newcmo into the mo_coef
mo_coef = 0.d0
do isym=1,nsym
do i=1,nmo(isym)
do j = 1, ao_num
mo_coef(j,i) = newcmo(j,i,isym)
enddo
enddo
enddo
! if(dabs(newcmo(3,19,1) - mo_coef(3,19)) .gt.1.d-10 )then
print*,'mo_coef(3,19)',mo_coef(3,19)
pause
! we say that it hase been touched, and valid and that everything that
! depends on mo_coef must not be reprovided
double precision :: accu_norm
touch mo_coef
print*,'after = '
accu_norm = 0.d0
do i =1,mo_tot_num
accu_norm += dabs(mo_overlap(i,i))
enddo
print*,'accu_norm = ',accu_norm
! We call the routine that saves mo_coef in the ezfio format
call save_mos
stop
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View File

@ -520,11 +520,14 @@ def ninja_readme_build(path_module, d_irp, dict_root_path):
root_module = dict_root_path[module]
tags = join(root_module.abs, "tags")
str_depend = " ".join(d_irp[path_module]["l_depend"])
tree = join(root_module.abs, "tree_dependency.png")
l_string = ["build {0}: build_readme {1} {2}".format(path_readme,
tags,
tree),
l_string = ["build {0}: build_readme {1} {2} {3}".format(path_readme,
tags,
str_depend,
tree),
" module_root = {0}".format(root_module.abs),
" module_abs = {0}".format(path_module.abs),
" module_rel = {0}".format(path_module.rel), ""]

View File

@ -239,13 +239,13 @@ def get_dict_config_file(module_obj):
# Check if type is avalaible
try:
type_ = config_file.get(section, "type")
type_ = config_file.get(section, "type").strip()
except ConfigParser.NoOptionError:
error("type", pvd, module_obj.path)
sys.exit(1)
if type_ not in type_dict:
print "{0} not avalaible. Choose in:".format(type_)
print "{0} not avalaible. Choose in:".format(type_).strip()
print ", ".join(sorted([i for i in type_dict]))
sys.exit(1)
else:
@ -279,13 +279,16 @@ def get_dict_config_file(module_obj):
d[pvd][option] = d_default[option]
# If interface is input we need a default value information
if "ocaml" in d[pvd]["interface"]:
try:
default_raw = config_file.get(section, "default")
except ConfigParser.NoOptionError:
try:
default_raw = config_file.get(section, "default")
except ConfigParser.NoOptionError:
if "ocaml" in d[pvd]["interface"]:
error("default", pvd, module_obj.path)
sys.exit(1)
else:
pass
else:
try:
d[pvd]["default"] = is_bool(default_raw)
except TypeError:
@ -367,7 +370,7 @@ def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"):
size_raw = str(size_raw)
if size_raw.startswith('='):
size_convert = size_raw
size_convert = size_raw.replace('.', '_')
else:
size_raw = provider_info["size"].translate(None, "()")
size_raw = size_raw.replace('.', '_')
@ -435,13 +438,18 @@ def create_ezfio_stuff(dict_ezfio_cfg, config_or_default="config"):
# It is the last so we don't need to right align it
str_size = size_format_to_ezfio(size_raw) if size_raw else ""
if "default" in provider_info and provider_info["default"].fortran.startswith("="):
str_default = provider_info["default"].fortran.replace('.', '_')
else:
str_default = ""
# Get the string in to good format (left align and co)
str_name = str_name_format(name_raw)
str_fortran_type = str_type_format(fortran_type_raw)
# Return the string
if config_or_default == "config":
s = " {0} {1} {2}".format(str_name, str_fortran_type, str_size)
s = " {0} {1} {2} {3}".format(str_name, str_fortran_type, str_size, str_default)
elif config_or_default == "default":
try:
str_value = provider_info["default"].ocaml

View File

@ -43,7 +43,8 @@ class H_apply(object):
self.perturbation = None
#s["omp_parallel"] = """!$OMP PARALLEL DEFAULT(NONE) &
s["omp_parallel"] = """!$OMP PARALLEL DEFAULT(SHARED) &
s["omp_parallel"] = """ PROVIDE elec_num_tab
!$OMP PARALLEL DEFAULT(SHARED) &
!$OMP PRIVATE(i,j,k,l,keys_out,hole,particle, &
!$OMP occ_particle,occ_hole,j_a,k_a,other_spin, &
!$OMP hole_save,ispin,jj,l_a,ib_jb_pairs,array_pairs, &

View File

@ -23,10 +23,10 @@ try:
from module_handler import get_l_module_descendant
from update_README import Doc_key, Needed_key
from qp_path import QP_SRC, QP_PLUGINS
except ImportError:
print "source .quantum_package.rc"
raise
print "Please check if you have source the .quantum_package.rc"
print "(`source .quantum_package.rc`)"
print sys.exit(1)
def save_new_module(path, l_child):
@ -79,7 +79,7 @@ if __name__ == '__main__':
l_children = arguments["<children_module>"]
path = os.path.join(QP_SRC, arguments["<name>"])
path = os.path.join(QP_PLUGINS, arguments["<name>"][0])
print "You will create the module:"
print path
@ -103,6 +103,7 @@ if __name__ == '__main__':
print l_child_reduce
save_new_module(path, l_child_reduce)
print "This was a plugin, you can install it now"
elif arguments["download"]:
pass
# d_local = get_dict_child([QP_SRC])

1
src/.gitignore vendored
View File

@ -23,3 +23,4 @@ QmcChem
Selectors_full
Selectors_no_sorted
SingleRefMethod
Casino

50
src/AO_Basis/EZFIO.cfg Normal file
View File

@ -0,0 +1,50 @@
[ao_basis]
type: character*(256)
doc: name of the ao basis
interface: ezfio
[ao_num]
type: integer
doc: number of ao
interface: ezfio, provider
[ao_prim_num]
type: integer
doc: Number of primitives per atomic orbital
size: (ao_basis.ao_num)
interface: ezfio, provider
[ao_prim_num_max]
type: integer
doc: number of primitive maximun
default: =maxval(ao_basis.ao_prim_num)
interface: ezfio
[ao_nucl]
type: integer
doc: Index of the nuclei on which the ao is centered
size: (ao_basis.ao_num)
interface: ezfio, provider
[ao_power]
type: integer
doc: power for each dimension for each ao_basis
size: (ao_basis.ao_num,3)
interface: ezfio, provider
[ao_coef]
type: double precision
doc: AO Coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs.
size: (ao_basis.ao_num,ao_basis.ao_prim_num_max)
interface: ezfio, provider
[ao_expo]
type: double precision
doc: expo for each primitive of each ao_basis
size: (ao_basis.ao_num,ao_basis.ao_prim_num_max)
interface: ezfio, provider
[ao_md5]
type: character*(32)
doc: MD5 key characteristic of the AO basis
interface: ezfio, provider

View File

@ -46,61 +46,60 @@ Documentation
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
`ao_coef <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L62>`_
AO Coefficients, read from input. Those should not be used directly, as
the MOs are expressed on the basis of **normalized** AOs.
`ao_coef <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L24>`_
AO Coefficients, read from input. Those should not be used directly, as the MOs are expressed on the basis of **normalized** AOs.
`ao_coef_normalized <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L84>`_
`ao_coef_normalized <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L22>`_
Coefficients including the AO normalization
`ao_coef_normalized_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L107>`_
`ao_coef_normalized_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L45>`_
Sorted primitives to accelerate 4 index MO transformation
`ao_coef_normalized_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L133>`_
`ao_coef_normalized_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L71>`_
Transposed ao_coef_normalized_ordered
`ao_expo <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L41>`_
AO Exponents read from input
`ao_expo <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L134>`_
expo for each primitive of each ao_basis
`ao_expo_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L108>`_
`ao_expo_ordered <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L46>`_
Sorted primitives to accelerate 4 index MO transformation
`ao_expo_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L147>`_
`ao_expo_ordered_transp <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L85>`_
Transposed ao_expo_ordered
`ao_l <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L162>`_
`ao_l <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L99>`_
ao_l = l value of the AO: a+b+c in x^a y^b z^c
`ao_l_char <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L163>`_
`ao_l_char <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L100>`_
ao_l = l value of the AO: a+b+c in x^a y^b z^c
`ao_l_char_space <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L311>`_
`ao_l_char_space <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L216>`_
Undocumented
`ao_md5 <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L403>`_
`ao_md5 <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L6>`_
MD5 key characteristic of the AO basis
`ao_nucl <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L209>`_
`ao_nucl <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L112>`_
Index of the nuclei on which the ao is centered
`ao_num <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L1>`_
Number of atomic orbitals
`ao_num <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L68>`_
number of ao
`ao_num_align <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L2>`_
Number of atomic orbitals
`ao_num_align <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L1>`_
Number of atomic orbitals align
`ao_overlap <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ao_overlap.irp.f#L1>`_
@ -128,27 +127,27 @@ Documentation
:math:`\int \chi_i(r) \chi_j(r) dr)`
`ao_power <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L19>`_
Powers of x,y and z read from input
`ao_power <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L46>`_
power for each dimension for each ao_basis
`ao_prim_num <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L177>`_
`ao_prim_num <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/ezfio_interface.irp.f#L90>`_
Number of primitives per atomic orbital
`ao_prim_num_max <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L199>`_
`ao_prim_num_max <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L12>`_
Undocumented
`ao_prim_num_max_align <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L200>`_
Undocumented
`ao_prim_num_max_align <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L112>`_
Number of primitives per atomic orbital aligned
`l_to_charater <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L218>`_
`l_to_charater <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L123>`_
character corresponding to the "L" value of an AO orbital
`n_aos_max <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L231>`_
`n_aos_max <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L136>`_
Number of AOs per atom
@ -160,21 +159,21 @@ Documentation
Undocumented
`nucl_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L244>`_
`nucl_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L149>`_
List of AOs attached on each atom
`nucl_list_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L262>`_
`nucl_list_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L167>`_
Index of the shell type Aos and of the corresponding Aos
Per convention, for P,D,F and G AOs, we take the index
of the AO with the the corresponding power in the "X" axis
`nucl_n_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L230>`_
`nucl_n_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L135>`_
Number of AOs per atom
`nucl_num_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L263>`_
`nucl_num_shell_aos <http://github.com/LCPQ/quantum_package/tree/master/src/AO_Basis/aos.irp.f#L168>`_
Index of the shell type Aos and of the corresponding Aos
Per convention, for P,D,F and G AOs, we take the index
of the AO with the the corresponding power in the "X" axis

View File

@ -1,12 +0,0 @@
ao_basis
ao_basis character*(256)
ao_num integer
ao_prim_num integer (ao_basis_ao_num)
ao_nucl integer (ao_basis_ao_num)
ao_power integer (ao_basis_ao_num,3)
ao_prim_num_max integer = maxval(ao_basis_ao_prim_num)
ao_coef double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max)
ao_expo double precision (ao_basis_ao_num,ao_basis_ao_prim_num_max)
ao_md5 character*(32)

View File

@ -1,85 +1,23 @@
BEGIN_PROVIDER [ integer, ao_num ]
&BEGIN_PROVIDER [ integer, ao_num_align ]
BEGIN_PROVIDER [ integer, ao_num_align ]
implicit none
BEGIN_DOC
! Number of atomic orbitals
! Number of atomic orbitals align
END_DOC
ao_num = -1
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_num(ao_num)
if (ao_num <= 0) then
stop 'Number of contracted gaussians should be > 0'
endif
integer :: align_double
ao_num_align = align_double(ao_num)
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_power, (ao_num_align,3) ]
implicit none
BEGIN_DOC
! Powers of x,y and z read from input
END_DOC
PROVIDE ezfio_filename
integer :: i,j,k
integer, allocatable :: ibuffer(:,:)
allocate ( ibuffer(ao_num,3) )
ibuffer = 0
call ezfio_get_ao_basis_ao_power(ibuffer)
ao_power = 0
do j = 1, 3
do i = 1, ao_num
ao_power(i,j) = ibuffer(i,j)
enddo
enddo
deallocate(ibuffer)
END_PROVIDER
END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_expo, (ao_num_align,ao_prim_num_max) ]
implicit none
BEGIN_DOC
! AO Exponents read from input
END_DOC
PROVIDE ezfio_filename
double precision, allocatable :: buffer(:,:)
allocate ( buffer(ao_num,ao_prim_num_max) )
integer :: i,j,k
ao_expo = 0.d0
buffer = 0.d0
call ezfio_get_ao_basis_ao_expo(buffer)
do j = 1, ao_prim_num_max
do i = 1, ao_num
ao_expo(i,j) = buffer(i,j)
enddo
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_coef, (ao_num_align,ao_prim_num_max) ]
implicit none
BEGIN_DOC
! AO Coefficients, read from input. Those should not be used directly, as
! the MOs are expressed on the basis of **normalized** AOs.
END_DOC
PROVIDE ezfio_filename
double precision, allocatable :: buffer(:,:)
allocate ( buffer(ao_num,ao_prim_num_max) )
integer :: i,j,k
ao_coef = 0.d0
buffer = 0.d0
call ezfio_get_ao_basis_ao_coef(buffer)
do j = 1, ao_prim_num_max
do i = 1, ao_num
ao_coef(i,j) = buffer(i,j)
enddo
enddo
deallocate(buffer)
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_prim_num_max ]
&BEGIN_PROVIDER [ integer, ao_prim_num_max_align ]
implicit none
ao_prim_num_max = 0
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_prim_num_max(ao_prim_num_max)
integer :: align_double
ao_prim_num_max_align = align_double(ao_prim_num_max)
END_PROVIDER
BEGIN_PROVIDER [ double precision, ao_coef_normalized, (ao_num_align,ao_prim_num_max) ]
implicit none
@ -158,7 +96,6 @@ BEGIN_PROVIDER [ double precision, ao_expo_ordered_transp, (ao_prim_num_max_alig
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_l, (ao_num) ]
&BEGIN_PROVIDER [ character*(128), ao_l_char, (ao_num) ]
implicit none
@ -172,49 +109,17 @@ END_PROVIDER
enddo
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_prim_num, (ao_num_align) ]
BEGIN_PROVIDER [ integer, ao_prim_num_max_align ]
implicit none
BEGIN_DOC
! Number of primitives per atomic orbital
! Number of primitives per atomic orbital aligned
END_DOC
ao_prim_num = 0
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_prim_num(ao_prim_num)
integer :: i
character*(80) :: message
do i=1,ao_num
if (ao_prim_num(i) <= 0) then
write(message,'(A,I6,A)') 'Number of primitives of contraction ',i,' should be > 0'
print *, message
stop
endif
enddo
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_prim_num_max ]
&BEGIN_PROVIDER [ integer, ao_prim_num_max_align ]
implicit none
ao_prim_num_max = 0
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_prim_num_max(ao_prim_num_max)
integer :: align_double
ao_prim_num_max_align = align_double(ao_prim_num_max)
END_PROVIDER
BEGIN_PROVIDER [ integer, ao_nucl, (ao_num)]
BEGIN_DOC
! Index of the nuclei on which the ao is centered
END_DOC
implicit none
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_nucl(ao_nucl)
END_PROVIDER
BEGIN_PROVIDER [ character*(128), l_to_charater, (0:4)]
BEGIN_DOC
! character corresponding to the "L" value of an AO orbital
@ -399,13 +304,3 @@ BEGIN_PROVIDER [ character*(4), ao_l_char_space, (ao_num) ]
ao_l_char_space(i) = give_ao_character_space
enddo
END_PROVIDER
BEGIN_PROVIDER [ character*(32), ao_md5 ]
BEGIN_DOC
! MD5 key characteristic of the AO basis
END_DOC
implicit none
PROVIDE ezfio_filename
call ezfio_get_ao_basis_ao_md5(ao_md5)
END_PROVIDER

View File

@ -24,6 +24,5 @@ guess_singlet
truncate_wf
save_natorb
program_initial_determinants
save_for_casino
det_svd
guess_doublet

View File

@ -401,6 +401,10 @@ Documentation
H matrix on the basis of the slater determinants defined by psi_det
`h_matrix_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L115>`_
Undocumented
`h_u_0 <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1071>`_
Computes v_0 = H|u_0>
.br
@ -458,7 +462,7 @@ Documentation
determinants. idx_cas gives the indice of the CAS determinant in psi_det.
`idx_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L62>`_
`idx_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L65>`_
Set of determinants which are not part of the CAS, defined from the application
of the CAS bitmask on the determinants.
idx_non_cas gives the indice of the determinant in psi_det.
@ -529,7 +533,7 @@ Documentation
Max number of determinants in the wave function when you select for a given property
`n_det_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L63>`_
`n_det_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L66>`_
Set of determinants which are not part of the CAS, defined from the application
of the CAS bitmask on the determinants.
idx_non_cas gives the indice of the determinant in psi_det.
@ -605,10 +609,6 @@ Documentation
Undocumented
`prog_save_casino <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/save_for_casino.irp.f#L266>`_
Undocumented
`psi_average_norm_contrib <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L273>`_
Contribution of determinants to the state-averaged density
@ -627,12 +627,20 @@ Documentation
determinants. idx_cas gives the indice of the CAS determinant in psi_det.
`psi_cas_coef_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L47>`_
`psi_cas_coef_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L50>`_
CAS determinants sorted to accelerate the search of a random determinant in the wave
function.
`psi_cas_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L46>`_
`psi_cas_energy <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L146>`_
Undocumented
`psi_cas_energy_diagonalized <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L128>`_
Undocumented
`psi_cas_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L49>`_
CAS determinants sorted to accelerate the search of a random determinant in the wave
function.
@ -642,6 +650,10 @@ Documentation
is empty
`psi_coef_cas_diagonalized <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L127>`_
Undocumented
`psi_coef_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L302>`_
Wave function sorted by determinants contribution to the norm (state-averaged)
@ -710,24 +722,24 @@ Documentation
the research of connected determinants.
`psi_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L60>`_
`psi_non_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L63>`_
Set of determinants which are not part of the CAS, defined from the application
of the CAS bitmask on the determinants.
idx_non_cas gives the indice of the determinant in psi_det.
`psi_non_cas_coef <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L61>`_
`psi_non_cas_coef <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L64>`_
Set of determinants which are not part of the CAS, defined from the application
of the CAS bitmask on the determinants.
idx_non_cas gives the indice of the determinant in psi_det.
`psi_non_cas_coef_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L100>`_
`psi_non_cas_coef_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L103>`_
CAS determinants sorted to accelerate the search of a random determinant in the wave
function.
`psi_non_cas_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L99>`_
`psi_non_cas_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/psi_cas.irp.f#L102>`_
CAS determinants sorted to accelerate the search of a random determinant in the wave
function.
@ -815,10 +827,6 @@ Documentation
z component of the Spin
`save_casino <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/save_for_casino.irp.f#L1>`_
Undocumented
`save_natorb <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/save_natorb.irp.f#L1>`_
Undocumented

View File

@ -376,7 +376,7 @@ end
! Can be : [ energy | residual | both | wall_time | cpu_time | iterations ]
END_DOC
davidson_criterion = 'residual'
davidson_threshold = 1.d-6
davidson_threshold = 1.d-9
END_PROVIDER
subroutine davidson_converged(energy,residual,wall,iterations,cpu,N_st,converged)

View File

@ -256,6 +256,7 @@ subroutine make_s2_eigenfunction
integer :: N_det_new
integer, parameter :: bufsze = 1000
logical, external :: is_in_wavefunction
return
! !TODO DEBUG
! do i=1,N_det

View File

@ -13,6 +13,9 @@ use bitmasks
logical :: good
N_det_cas = 0
do i=1,N_det
do l = 1, N_states
psi_cas_coef(i,l) = 0.d0
enddo
do l=1,n_cas_bitmask
good = .True.
do k=1,N_int
@ -109,6 +112,57 @@ END_PROVIDER
END_PROVIDER
BEGIN_PROVIDER [double precision, H_matrix_cas, (N_det_cas,N_det_cas)]
implicit none
integer :: i,j
double precision :: hij
do i = 1, N_det_cas
do j = 1, N_det_cas
call i_H_j(psi_cas(1,1,i),psi_cas(1,1,j),N_int,hij)
H_matrix_cas(i,j) = hij
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, psi_coef_cas_diagonalized, (N_det_cas,N_states)]
&BEGIN_PROVIDER [double precision, psi_cas_energy_diagonalized, (N_states)]
implicit none
integer :: i,j
double precision, allocatable :: eigenvectors(:,:), eigenvalues(:)
allocate (eigenvectors(size(H_matrix_cas,1),N_det_cas))
allocate (eigenvalues(N_det_cas))
call lapack_diag(eigenvalues,eigenvectors, &
H_matrix_cas,size(H_matrix_cas,1),N_det_cas)
do i = 1, N_states
psi_cas_energy_diagonalized(i) = eigenvalues(i)
do j = 1, N_det_cas
psi_coef_cas_diagonalized(j,i) = eigenvectors(j,i)
enddo
enddo
END_PROVIDER
BEGIN_PROVIDER [double precision, psi_cas_energy, (N_states)]
implicit none
integer :: i,j,k
double precision :: hij,norm,u_dot_v
psi_cas_energy = 0.d0
do k = 1, N_states
norm = 0.d0
do i = 1, N_det_cas
norm += psi_cas_coef(i,k) * psi_cas_coef(i,k)
do j = 1, N_det_cas
psi_cas_energy(k) += psi_cas_coef(i,k) * psi_cas_coef(j,k) * H_matrix_cas(i,j)
enddo
enddo
psi_cas_energy(k) = psi_cas_energy(k) /norm
enddo
END_PROVIDER

15
src/Electrons/EZFIO.cfg Normal file
View File

@ -0,0 +1,15 @@
[elec_alpha_num]
type: Positive_int
doc: Numbers of electrons alpha ("up")
interface: ezfio, provider
[elec_beta_num]
type: Positive_int
doc: Numbers of electrons beta ("down")
interface: ezfio, provider
[elec_num]
type: Positive_int
doc: Numbers total of electrons (alpha + beta)
default: = electrons.elec_alpha_num + electrons.elec_beta_num
interface: ezfio

View File

@ -34,18 +34,18 @@ Documentation
.. Do not edit this section. It was auto-generated from the
.. by the `update_README.py` script.
`elec_alpha_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L1>`_
`elec_alpha_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/ezfio_interface.irp.f#L28>`_
Numbers of electrons alpha ("up")
`elec_beta_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/ezfio_interface.irp.f#L6>`_
Numbers of electrons beta ("down")
`elec_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L1>`_
Numbers of alpha ("up") , beta ("down") and total electrons
`elec_beta_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L2>`_
Numbers of alpha ("up") , beta ("down") and total electrons
`elec_num <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L3>`_
Numbers of alpha ("up") , beta ("down") and total electrons
`elec_num_tab <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L4>`_
`elec_num_tab <http://github.com/LCPQ/quantum_package/tree/master/src/Electrons/electrons.irp.f#L2>`_
Numbers of alpha ("up") , beta ("down") and total electrons

View File

@ -1,5 +0,0 @@
electrons
elec_alpha_num integer
elec_beta_num integer
elec_num integer = electrons_elec_alpha_num + electrons_elec_beta_num

View File

@ -1,29 +1,15 @@
BEGIN_PROVIDER [ integer, elec_alpha_num ]
&BEGIN_PROVIDER [ integer, elec_beta_num ]
&BEGIN_PROVIDER [ integer, elec_num ]
&BEGIN_PROVIDER [ integer, elec_num_tab, (2) ]
BEGIN_PROVIDER [ integer, elec_num]
&BEGIN_PROVIDER [ integer, elec_num_tab, (2)]
implicit none
BEGIN_DOC
! Numbers of alpha ("up") , beta ("down") and total electrons
END_DOC
PROVIDE ezfio_filename
call ezfio_get_electrons_elec_alpha_num(elec_alpha_num)
call ezfio_get_electrons_elec_beta_num(elec_beta_num)
call ezfio_get_electrons_elec_num(elec_num)
elec_num_tab(1) = elec_alpha_num
elec_num_tab(2) = elec_beta_num
ASSERT (elec_alpha_num > 0)
ASSERT (elec_beta_num >= 0)
call write_time(output_Electrons)
call write_int(output_Electrons,elec_num, &
'Number of electrons' )
call write_int(output_Electrons,elec_alpha_num, &
'Number of alpha electrons' )
call write_int(output_Electrons,elec_beta_num, &
'Number of beta electrons' )
write(output_Electrons,*)
END_PROVIDER

View File

@ -38,8 +38,8 @@ Documentation
Output file for Bitmask
`output_cas_sd <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L41>`_
Output file for CAS_SD
`output_casino <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L41>`_
Output file for Casino
`output_cpu_time_0 <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f#L2>`_
@ -62,26 +62,26 @@ Documentation
Output file for Full_CI
`output_generators_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L141>`_
Output file for Generators_CAS
`output_generators_full <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L161>`_
`output_generators_full <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L141>`_
Output file for Generators_full
`output_hartree_fock <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L181>`_
`output_hartree_fock <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L161>`_
Output file for Hartree_Fock
`output_integrals_bielec <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L201>`_
`output_integrals_bielec <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L181>`_
Output file for Integrals_Bielec
`output_integrals_monoelec <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L221>`_
`output_integrals_monoelec <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L201>`_
Output file for Integrals_Monoelec
`output_loc_cele <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L221>`_
Output file for loc_cele
`output_mo_basis <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L241>`_
Output file for MO_Basis
@ -90,8 +90,8 @@ Documentation
Output file for MOGuess
`output_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L281>`_
Output file for MRCC
`output_molden <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L281>`_
Output file for Molden
`output_nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L301>`_
@ -110,15 +110,11 @@ Documentation
Output file for Pseudo
`output_qmcchem <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L381>`_
Output file for QmcChem
`output_selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L401>`_
`output_selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L381>`_
Output file for Selectors_full
`output_utils <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L421>`_
`output_utils <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L401>`_
Output file for Utils