Cleaned MRCC in MRCC_Utils
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 111 KiB After Width: | Height: | Size: 98 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 61 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 73 KiB |
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 57 KiB |
@ -1,28 +0,0 @@
|
|||||||
use bitmasks
|
|
||||||
BEGIN_SHELL [ /usr/bin/env python ]
|
|
||||||
from generate_h_apply import *
|
|
||||||
|
|
||||||
s = H_apply("mrcc")
|
|
||||||
s.data["parameters"] = ", delta_ij_, delta_ii_,Ndet_cas, Ndet_non_cas"
|
|
||||||
s.data["declarations"] += """
|
|
||||||
integer, intent(in) :: Ndet_cas,Ndet_non_cas
|
|
||||||
double precision, intent(in) :: delta_ij_(Ndet_cas,Ndet_non_cas,*)
|
|
||||||
double precision, intent(in) :: delta_ii_(Ndet_cas,*)
|
|
||||||
"""
|
|
||||||
s.data["keys_work"] = "call mrcc_dress(delta_ij_,delta_ii_,Ndet_cas,Ndet_non_cas,i_generator,key_idx,keys_out,N_int,iproc)"
|
|
||||||
s.data["params_post"] += ", delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas"
|
|
||||||
s.data["params_main"] += "delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas"
|
|
||||||
s.data["decls_main"] += """
|
|
||||||
integer, intent(in) :: Ndet_cas,Ndet_non_cas
|
|
||||||
double precision, intent(in) :: delta_ij_(Ndet_cas,Ndet_non_cas,*)
|
|
||||||
double precision, intent(in) :: delta_ii_(Ndet_cas,*)
|
|
||||||
"""
|
|
||||||
s.data["finalization"] = ""
|
|
||||||
s.data["copy_buffer"] = ""
|
|
||||||
s.data["generate_psi_guess"] = ""
|
|
||||||
s.data["size_max"] = "3072"
|
|
||||||
print s
|
|
||||||
|
|
||||||
|
|
||||||
END_SHELL
|
|
||||||
|
|
@ -1 +0,0 @@
|
|||||||
Perturbation Selectors_full Generators_full
|
|
@ -1,70 +0,0 @@
|
|||||||
program mrcc
|
|
||||||
implicit none
|
|
||||||
read_wf = .True.
|
|
||||||
TOUCH read_wf
|
|
||||||
call run
|
|
||||||
call run_mrcc
|
|
||||||
! call run_mrcc_test
|
|
||||||
end
|
|
||||||
|
|
||||||
subroutine run
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
integer :: i,j
|
|
||||||
print *, 'CAS'
|
|
||||||
print *, '==='
|
|
||||||
do i=1,N_det_cas
|
|
||||||
print *, psi_cas_coef(i,:)
|
|
||||||
call debug_det(psi_cas(1,1,i),N_int)
|
|
||||||
enddo
|
|
||||||
|
|
||||||
! print *, 'SD'
|
|
||||||
! print *, '=='
|
|
||||||
! do i=1,N_det_non_cas
|
|
||||||
! print *, psi_non_cas_coef(i,:)
|
|
||||||
! call debug_det(psi_non_cas(1,1,i),N_int)
|
|
||||||
! enddo
|
|
||||||
call write_double(6,ci_energy(1),"Initial CI energy")
|
|
||||||
end
|
|
||||||
subroutine run_mrcc_test
|
|
||||||
implicit none
|
|
||||||
integer :: i,j
|
|
||||||
double precision :: pt2
|
|
||||||
pt2 = 0.d0
|
|
||||||
do j=1,N_det
|
|
||||||
do i=1,N_det
|
|
||||||
pt2 += psi_coef(i,1)*psi_coef(j,1) * delta_ij(i,j,1)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
print *, ci_energy(1)
|
|
||||||
print *, ci_energy(1)+pt2
|
|
||||||
end
|
|
||||||
subroutine run_mrcc
|
|
||||||
implicit none
|
|
||||||
integer :: i,j
|
|
||||||
|
|
||||||
double precision :: E_new, E_old, delta_e
|
|
||||||
integer :: iteration
|
|
||||||
E_new = 0.d0
|
|
||||||
delta_E = 1.d0
|
|
||||||
iteration = 0
|
|
||||||
do while (delta_E > 1.d-10)
|
|
||||||
iteration += 1
|
|
||||||
print *, '==========================='
|
|
||||||
print *, 'MRCC Iteration', iteration
|
|
||||||
print *, '==========================='
|
|
||||||
print *, ''
|
|
||||||
E_old = sum(ci_energy_dressed)
|
|
||||||
call write_double(6,ci_energy_dressed(1),"MRCC energy")
|
|
||||||
call diagonalize_ci_dressed
|
|
||||||
E_new = sum(ci_energy_dressed)
|
|
||||||
delta_E = dabs(E_new - E_old)
|
|
||||||
if (iteration > 20) then
|
|
||||||
exit
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
call write_double(6,ci_energy_dressed(1),"Final MRCC energy")
|
|
||||||
call ezfio_set_mrcc_energy(ci_energy_dressed(1))
|
|
||||||
! call save_wavefunction
|
|
||||||
|
|
||||||
end
|
|
Before Width: | Height: | Size: 111 KiB |
4
plugins/MRCC_CASSD/EZFIO.cfg
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[energy]
|
||||||
|
type: double precision
|
||||||
|
doc: Calculated energy
|
||||||
|
interface: ezfio
|
1
plugins/MRCC_CASSD/NEEDED_CHILDREN_MODULES
Normal file
@ -0,0 +1 @@
|
|||||||
|
Perturbation Selectors_full Generators_full Psiref_CAS MRCC_Utils
|
@ -2,6 +2,8 @@
|
|||||||
MRCC Module
|
MRCC Module
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
MRCC as a coupled cluster on a CAS+SD wave function.
|
||||||
|
|
||||||
Needed Modules
|
Needed Modules
|
||||||
==============
|
==============
|
||||||
|
|
20
plugins/MRCC_CASSD/mrcc.irp.f
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
program mrcc
|
||||||
|
implicit none
|
||||||
|
call print_cas_coefs
|
||||||
|
call run_mrcc
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine print_cas_coefs
|
||||||
|
implicit none
|
||||||
|
|
||||||
|
integer :: i,j
|
||||||
|
print *, 'CAS'
|
||||||
|
print *, '==='
|
||||||
|
do i=1,N_det_cas
|
||||||
|
print *, psi_cas_coef(i,:)
|
||||||
|
call debug_det(psi_cas(1,1,i),N_int)
|
||||||
|
enddo
|
||||||
|
|
||||||
|
call write_double(6,ci_energy(1),"Initial CI energy")
|
||||||
|
end
|
||||||
|
|
31
plugins/MRCC_Utils/.gitignore
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
# Automatically created by $QP_ROOT/scripts/module/module_handler.py
|
||||||
|
.ninja_deps
|
||||||
|
.ninja_log
|
||||||
|
AO_Basis
|
||||||
|
Bitmask
|
||||||
|
Determinants
|
||||||
|
Electrons
|
||||||
|
Ezfio_files
|
||||||
|
Generators_full
|
||||||
|
Hartree_Fock
|
||||||
|
IRPF90_man
|
||||||
|
IRPF90_temp
|
||||||
|
Integrals_Bielec
|
||||||
|
Integrals_Monoelec
|
||||||
|
MOGuess
|
||||||
|
MO_Basis
|
||||||
|
Makefile
|
||||||
|
Makefile.depend
|
||||||
|
Nuclei
|
||||||
|
Perturbation
|
||||||
|
Properties
|
||||||
|
Pseudo
|
||||||
|
Psiref_CAS
|
||||||
|
Psiref_Utils
|
||||||
|
Selectors_full
|
||||||
|
Utils
|
||||||
|
ezfio_interface.irp.f
|
||||||
|
irpf90.make
|
||||||
|
irpf90_entities
|
||||||
|
mrcc_general
|
||||||
|
tags
|
28
plugins/MRCC_Utils/H_apply.irp.f
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
use bitmasks
|
||||||
|
BEGIN_SHELL [ /usr/bin/env python ]
|
||||||
|
from generate_h_apply import *
|
||||||
|
|
||||||
|
s = H_apply("mrcc")
|
||||||
|
s.data["parameters"] = ", delta_ij_, delta_ii_,Ndet_ref, Ndet_non_ref"
|
||||||
|
s.data["declarations"] += """
|
||||||
|
integer, intent(in) :: Ndet_ref,Ndet_non_ref
|
||||||
|
double precision, intent(in) :: delta_ij_(Ndet_ref,Ndet_non_ref,*)
|
||||||
|
double precision, intent(in) :: delta_ii_(Ndet_ref,*)
|
||||||
|
"""
|
||||||
|
s.data["keys_work"] = "call mrcc_dress(delta_ij_,delta_ii_,Ndet_ref,Ndet_non_ref,i_generator,key_idx,keys_out,N_int,iproc)"
|
||||||
|
s.data["params_post"] += ", delta_ij_, delta_ii_, Ndet_ref, Ndet_non_ref"
|
||||||
|
s.data["params_main"] += "delta_ij_, delta_ii_, Ndet_ref, Ndet_non_ref"
|
||||||
|
s.data["decls_main"] += """
|
||||||
|
integer, intent(in) :: Ndet_ref,Ndet_non_ref
|
||||||
|
double precision, intent(in) :: delta_ij_(Ndet_ref,Ndet_non_ref,*)
|
||||||
|
double precision, intent(in) :: delta_ii_(Ndet_ref,*)
|
||||||
|
"""
|
||||||
|
s.data["finalization"] = ""
|
||||||
|
s.data["copy_buffer"] = ""
|
||||||
|
s.data["generate_psi_guess"] = ""
|
||||||
|
s.data["size_max"] = "3072"
|
||||||
|
print s
|
||||||
|
|
||||||
|
|
||||||
|
END_SHELL
|
||||||
|
|
1
plugins/MRCC_Utils/NEEDED_CHILDREN_MODULES
Normal file
@ -0,0 +1 @@
|
|||||||
|
Perturbation Selectors_full Generators_full Psiref_Utils
|
161
plugins/MRCC_Utils/README.rst
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
===========
|
||||||
|
MRCC Module
|
||||||
|
===========
|
||||||
|
|
||||||
|
Needed Modules
|
||||||
|
==============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
.. image:: tree_dependency.png
|
||||||
|
|
||||||
|
* `Perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Perturbation>`_
|
||||||
|
* `Selectors_full <http://github.com/LCPQ/quantum_package/tree/master/src/Selectors_full>`_
|
||||||
|
* `Generators_full <http://github.com/LCPQ/quantum_package/tree/master/src/Generators_full>`_
|
||||||
|
* `Psiref_CAS <http://github.com/LCPQ/quantum_package/tree/master/src/Psiref_CAS>`_
|
||||||
|
* `Psiref_Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Psiref_Utils>`_
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
`ci_eigenvectors_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L76>`_
|
||||||
|
Eigenvectors/values of the CI matrix
|
||||||
|
|
||||||
|
|
||||||
|
`ci_eigenvectors_s2_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L77>`_
|
||||||
|
Eigenvectors/values of the CI matrix
|
||||||
|
|
||||||
|
|
||||||
|
`ci_electronic_energy_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L75>`_
|
||||||
|
Eigenvectors/values of the CI matrix
|
||||||
|
|
||||||
|
|
||||||
|
`ci_energy_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L142>`_
|
||||||
|
N_states lowest eigenvalues of the dressed CI matrix
|
||||||
|
|
||||||
|
|
||||||
|
`davidson_diag_hjj_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/davidson.irp.f#L56>`_
|
||||||
|
Davidson diagonalization with specific diagonal elements of the H matrix
|
||||||
|
.br
|
||||||
|
H_jj : specific diagonal H matrix elements to diagonalize de Davidson
|
||||||
|
.br
|
||||||
|
dets_in : bitmasks corresponding to determinants
|
||||||
|
.br
|
||||||
|
u_in : guess coefficients on the various states. Overwritten
|
||||||
|
on exit
|
||||||
|
.br
|
||||||
|
dim_in : leftmost dimension of u_in
|
||||||
|
.br
|
||||||
|
sze : Number of determinants
|
||||||
|
.br
|
||||||
|
N_st : Number of eigenstates
|
||||||
|
.br
|
||||||
|
iunit : Unit for the I/O
|
||||||
|
.br
|
||||||
|
Initial guess vectors are not necessarily orthonormal
|
||||||
|
|
||||||
|
|
||||||
|
`davidson_diag_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/davidson.irp.f#L1>`_
|
||||||
|
Davidson diagonalization.
|
||||||
|
.br
|
||||||
|
dets_in : bitmasks corresponding to determinants
|
||||||
|
.br
|
||||||
|
u_in : guess coefficients on the various states. Overwritten
|
||||||
|
on exit
|
||||||
|
.br
|
||||||
|
dim_in : leftmost dimension of u_in
|
||||||
|
.br
|
||||||
|
sze : Number of determinants
|
||||||
|
.br
|
||||||
|
N_st : Number of eigenstates
|
||||||
|
.br
|
||||||
|
iunit : Unit number for the I/O
|
||||||
|
.br
|
||||||
|
Initial guess vectors are not necessarily orthonormal
|
||||||
|
|
||||||
|
|
||||||
|
`delta_ii <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L39>`_
|
||||||
|
Dressing matrix in N_det basis
|
||||||
|
|
||||||
|
|
||||||
|
`delta_ij <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L38>`_
|
||||||
|
Dressing matrix in N_det basis
|
||||||
|
|
||||||
|
|
||||||
|
`diagonalize_ci_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L157>`_
|
||||||
|
Replace the coefficients of the CI states by the coefficients of the
|
||||||
|
eigenstates of the CI matrix
|
||||||
|
|
||||||
|
|
||||||
|
`find_triples_and_quadruples <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_dress.irp.f#L206>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`h_apply_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/H_apply.irp.f_shell_27#L416>`_
|
||||||
|
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_mrcc_diexc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/H_apply.irp.f_shell_27#L1>`_
|
||||||
|
Generate all double excitations of key_in using the bit masks of holes and
|
||||||
|
particles.
|
||||||
|
Assume N_int is already provided.
|
||||||
|
|
||||||
|
|
||||||
|
`h_apply_mrcc_monoexc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/H_apply.irp.f_shell_27#L268>`_
|
||||||
|
Generate all single excitations of key_in using the bit masks of holes and
|
||||||
|
particles.
|
||||||
|
Assume N_int is already provided.
|
||||||
|
|
||||||
|
|
||||||
|
`h_matrix_dressed <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L50>`_
|
||||||
|
Dressed H with Delta_ij
|
||||||
|
|
||||||
|
|
||||||
|
`h_u_0_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/davidson.irp.f#L360>`_
|
||||||
|
Computes v_0 = H|u_0>
|
||||||
|
.br
|
||||||
|
n : number of determinants
|
||||||
|
.br
|
||||||
|
H_jj : array of <j|H|j>
|
||||||
|
|
||||||
|
|
||||||
|
`lambda_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L1>`_
|
||||||
|
cm/<Psi_0|H|D_m> or perturbative 1/Delta_E(m)
|
||||||
|
|
||||||
|
|
||||||
|
`lambda_pert <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_utils.irp.f#L2>`_
|
||||||
|
cm/<Psi_0|H|D_m> or perturbative 1/Delta_E(m)
|
||||||
|
|
||||||
|
|
||||||
|
`mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_general.irp.f#L1>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`mrcc_dress <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_dress.irp.f#L15>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`mrcc_dress_simple <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_dress.irp.f#L160>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`psi_ref_lock <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_dress.irp.f#L3>`_
|
||||||
|
Locks on ref determinants to fill delta_ij
|
||||||
|
|
||||||
|
|
||||||
|
`run <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_general.irp.f#L10>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`run_mrcc <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_general.irp.f#L36>`_
|
||||||
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`run_mrcc_test <http://github.com/LCPQ/quantum_package/tree/master/src/MRCC_general/mrcc_general.irp.f#L23>`_
|
||||||
|
Undocumented
|
||||||
|
|
@ -35,7 +35,7 @@ subroutine davidson_diag_mrcc(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit,i
|
|||||||
allocate(H_jj(sze))
|
allocate(H_jj(sze))
|
||||||
|
|
||||||
!$OMP PARALLEL DEFAULT(NONE) &
|
!$OMP PARALLEL DEFAULT(NONE) &
|
||||||
!$OMP SHARED(sze,H_jj,N_det_cas,dets_in,Nint,istate,delta_ii,idx_cas) &
|
!$OMP SHARED(sze,H_jj,N_det_ref,dets_in,Nint,istate,delta_ii,idx_ref) &
|
||||||
!$OMP PRIVATE(i)
|
!$OMP PRIVATE(i)
|
||||||
!$OMP DO SCHEDULE(guided)
|
!$OMP DO SCHEDULE(guided)
|
||||||
do i=1,sze
|
do i=1,sze
|
||||||
@ -43,8 +43,8 @@ subroutine davidson_diag_mrcc(dets_in,u_in,energies,dim_in,sze,N_st,Nint,iunit,i
|
|||||||
enddo
|
enddo
|
||||||
!$OMP END DO
|
!$OMP END DO
|
||||||
!$OMP DO SCHEDULE(guided)
|
!$OMP DO SCHEDULE(guided)
|
||||||
do i=1,N_det_cas
|
do i=1,N_det_ref
|
||||||
H_jj(idx_cas(i)) += delta_ii(i,istate)
|
H_jj(idx_ref(i)) += delta_ii(i,istate)
|
||||||
enddo
|
enddo
|
||||||
!$OMP END DO
|
!$OMP END DO
|
||||||
!$OMP END PARALLEL
|
!$OMP END PARALLEL
|
||||||
@ -384,7 +384,7 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
|
|||||||
integer, parameter :: block_size = 157
|
integer, parameter :: block_size = 157
|
||||||
!$OMP PARALLEL DEFAULT(NONE) &
|
!$OMP PARALLEL DEFAULT(NONE) &
|
||||||
!$OMP PRIVATE(i,hij,j,k,idx,jj,ii,vt) &
|
!$OMP PRIVATE(i,hij,j,k,idx,jj,ii,vt) &
|
||||||
!$OMP SHARED(n_det_cas,n_det_non_cas,idx_cas,idx_non_cas,n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij)
|
!$OMP SHARED(n_det_ref,n_det_non_ref,idx_ref,idx_non_ref,n,H_jj,u_0,keys_tmp,Nint,v_0,istate,delta_ij)
|
||||||
!$OMP DO SCHEDULE(static)
|
!$OMP DO SCHEDULE(static)
|
||||||
do i=1,n
|
do i=1,n
|
||||||
v_0(i) = H_jj(i) * u_0(i)
|
v_0(i) = H_jj(i) * u_0(i)
|
||||||
@ -409,10 +409,10 @@ subroutine H_u_0_mrcc(v_0,u_0,H_jj,n,keys_tmp,Nint,istate)
|
|||||||
!$OMP END DO
|
!$OMP END DO
|
||||||
|
|
||||||
!$OMP DO SCHEDULE(guided)
|
!$OMP DO SCHEDULE(guided)
|
||||||
do ii=1,n_det_cas
|
do ii=1,n_det_ref
|
||||||
i = idx_cas(ii)
|
i = idx_ref(ii)
|
||||||
do jj = 1, n_det_non_cas
|
do jj = 1, n_det_non_ref
|
||||||
j = idx_non_cas(jj)
|
j = idx_non_ref(jj)
|
||||||
vt (i) = vt (i) + delta_ij(ii,jj,istate)*u_0(j)
|
vt (i) = vt (i) + delta_ij(ii,jj,istate)*u_0(j)
|
||||||
vt (j) = vt (j) + delta_ij(ii,jj,istate)*u_0(i)
|
vt (j) = vt (j) + delta_ij(ii,jj,istate)*u_0(i)
|
||||||
enddo
|
enddo
|
@ -1,25 +1,25 @@
|
|||||||
use omp_lib
|
use omp_lib
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(omp_lock_kind), psi_cas_lock, (psi_det_size) ]
|
BEGIN_PROVIDER [ integer(omp_lock_kind), psi_ref_lock, (psi_det_size) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Locks on CAS determinants to fill delta_ij
|
! Locks on ref determinants to fill delta_ij
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: i
|
integer :: i
|
||||||
do i=1,psi_det_size
|
do i=1,psi_det_size
|
||||||
call omp_init_lock( psi_cas_lock(i) )
|
call omp_init_lock( psi_ref_lock(i) )
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,i_generator,n_selected,det_buffer,Nint,iproc)
|
subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_ref, Ndet_non_ref,i_generator,n_selected,det_buffer,Nint,iproc)
|
||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer, intent(in) :: i_generator,n_selected, Nint, iproc
|
integer, intent(in) :: i_generator,n_selected, Nint, iproc
|
||||||
integer, intent(in) :: Ndet_cas, Ndet_non_cas
|
integer, intent(in) :: Ndet_ref, Ndet_non_ref
|
||||||
double precision, intent(inout) :: delta_ij_(Ndet_cas,Ndet_non_cas,*)
|
double precision, intent(inout) :: delta_ij_(Ndet_ref,Ndet_non_ref,*)
|
||||||
double precision, intent(inout) :: delta_ii_(Ndet_cas,*)
|
double precision, intent(inout) :: delta_ii_(Ndet_ref,*)
|
||||||
|
|
||||||
integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected)
|
integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected)
|
||||||
integer :: i,j,k,l
|
integer :: i,j,k,l
|
||||||
@ -43,18 +43,18 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,i_generator,n
|
|||||||
|
|
||||||
call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq)
|
call find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq,N_tq)
|
||||||
|
|
||||||
allocate (dIa_hla(N_states,Ndet_non_cas))
|
allocate (dIa_hla(N_states,Ndet_non_ref))
|
||||||
|
|
||||||
! |I>
|
! |I>
|
||||||
|
|
||||||
! |alpha>
|
! |alpha>
|
||||||
do i_alpha=1,N_tq
|
do i_alpha=1,N_tq
|
||||||
call get_excitation_degree_vector(psi_non_cas,tq(1,1,i_alpha),degree_alpha,Nint,N_det_non_cas,idx_alpha)
|
call get_excitation_degree_vector(psi_non_ref,tq(1,1,i_alpha),degree_alpha,Nint,N_det_non_ref,idx_alpha)
|
||||||
|
|
||||||
! |I>
|
! |I>
|
||||||
do i_I=1,N_det_cas
|
do i_I=1,N_det_ref
|
||||||
! Find triples and quadruple grand parents
|
! Find triples and quadruple grand parents
|
||||||
call get_excitation_degree(tq(1,1,i_alpha),psi_cas(1,1,i_I),degree,Nint)
|
call get_excitation_degree(tq(1,1,i_alpha),psi_ref(1,1,i_I),degree,Nint)
|
||||||
if (degree > 4) then
|
if (degree > 4) then
|
||||||
cycle
|
cycle
|
||||||
endif
|
endif
|
||||||
@ -65,22 +65,22 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,i_generator,n
|
|||||||
|
|
||||||
! <I| <> |alpha>
|
! <I| <> |alpha>
|
||||||
do k_sd=1,idx_alpha(0)
|
do k_sd=1,idx_alpha(0)
|
||||||
call get_excitation_degree(psi_cas(1,1,i_I),psi_non_cas(1,1,idx_alpha(k_sd)),degree,Nint)
|
call get_excitation_degree(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(k_sd)),degree,Nint)
|
||||||
if (degree > 2) then
|
if (degree > 2) then
|
||||||
cycle
|
cycle
|
||||||
endif
|
endif
|
||||||
! <I| /k\ |alpha>
|
! <I| /k\ |alpha>
|
||||||
! <I|H|k>
|
! <I|H|k>
|
||||||
call i_h_j(psi_cas(1,1,i_I),psi_non_cas(1,1,idx_alpha(k_sd)),Nint,hIk)
|
call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(k_sd)),Nint,hIk)
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
dIk(i_state) = hIk * lambda_mrcc(i_state,idx_alpha(k_sd))
|
dIk(i_state) = hIk * lambda_mrcc(i_state,idx_alpha(k_sd))
|
||||||
enddo
|
enddo
|
||||||
! |l> = Exc(k -> alpha) |I>
|
! |l> = Exc(k -> alpha) |I>
|
||||||
call get_excitation(psi_non_cas(1,1,idx_alpha(k_sd)),tq(1,1,i_alpha),exc,degree,phase,Nint)
|
call get_excitation(psi_non_ref(1,1,idx_alpha(k_sd)),tq(1,1,i_alpha),exc,degree,phase,Nint)
|
||||||
call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2)
|
call decode_exc(exc,degree,h1,p1,h2,p2,s1,s2)
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
tmp_det(k,1) = psi_cas(k,1,i_I)
|
tmp_det(k,1) = psi_ref(k,1,i_I)
|
||||||
tmp_det(k,2) = psi_cas(k,2,i_I)
|
tmp_det(k,2) = psi_ref(k,2,i_I)
|
||||||
enddo
|
enddo
|
||||||
! Hole (see list_to_bitstring)
|
! Hole (see list_to_bitstring)
|
||||||
iint = ishft(h1-1,-bit_kind_shift) + 1
|
iint = ishft(h1-1,-bit_kind_shift) + 1
|
||||||
@ -108,10 +108,10 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,i_generator,n
|
|||||||
dka(i_state) = 0.d0
|
dka(i_state) = 0.d0
|
||||||
enddo
|
enddo
|
||||||
do l_sd=k_sd+1,idx_alpha(0)
|
do l_sd=k_sd+1,idx_alpha(0)
|
||||||
call get_excitation_degree(tmp_det,psi_non_cas(1,1,idx_alpha(l_sd)),degree,Nint)
|
call get_excitation_degree(tmp_det,psi_non_ref(1,1,idx_alpha(l_sd)),degree,Nint)
|
||||||
if (degree == 0) then
|
if (degree == 0) then
|
||||||
call get_excitation(psi_cas(1,1,i_I),psi_non_cas(1,1,idx_alpha(l_sd)),exc,degree,phase2,Nint)
|
call get_excitation(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),exc,degree,phase2,Nint)
|
||||||
call i_h_j(psi_cas(1,1,i_I),psi_non_cas(1,1,idx_alpha(l_sd)),Nint,hIl)
|
call i_h_j(psi_ref(1,1,i_I),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hIl)
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
dka(i_state) = hIl * lambda_mrcc(i_state,idx_alpha(l_sd)) * phase * phase2
|
dka(i_state) = hIl * lambda_mrcc(i_state,idx_alpha(l_sd)) * phase * phase2
|
||||||
enddo
|
enddo
|
||||||
@ -124,28 +124,28 @@ subroutine mrcc_dress(delta_ij_, delta_ii_, Ndet_cas, Ndet_non_cas,i_generator,n
|
|||||||
enddo
|
enddo
|
||||||
|
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
ci_inv(i_state) = 1.d0/psi_cas_coef(i_I,i_state)
|
ci_inv(i_state) = 1.d0/psi_ref_coef(i_I,i_state)
|
||||||
enddo
|
enddo
|
||||||
do l_sd=1,idx_alpha(0)
|
do l_sd=1,idx_alpha(0)
|
||||||
k_sd = idx_alpha(l_sd)
|
k_sd = idx_alpha(l_sd)
|
||||||
call i_h_j(tq(1,1,i_alpha),psi_non_cas(1,1,idx_alpha(l_sd)),Nint,hla)
|
call i_h_j(tq(1,1,i_alpha),psi_non_ref(1,1,idx_alpha(l_sd)),Nint,hla)
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
dIa_hla(i_state,k_sd) = dIa(i_state) * hla
|
dIa_hla(i_state,k_sd) = dIa(i_state) * hla
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call omp_set_lock( psi_cas_lock(i_I) )
|
call omp_set_lock( psi_ref_lock(i_I) )
|
||||||
do l_sd=1,idx_alpha(0)
|
do l_sd=1,idx_alpha(0)
|
||||||
k_sd = idx_alpha(l_sd)
|
k_sd = idx_alpha(l_sd)
|
||||||
do i_state=1,N_states
|
do i_state=1,N_states
|
||||||
delta_ij_(i_I,k_sd,i_state) += dIa_hla(i_state,k_sd)
|
delta_ij_(i_I,k_sd,i_state) += dIa_hla(i_state,k_sd)
|
||||||
if(dabs(psi_cas_coef(i_I,i_state)).ge.5.d-5)then
|
if(dabs(psi_ref_coef(i_I,i_state)).ge.5.d-5)then
|
||||||
delta_ii_(i_I,i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_cas_coef(k_sd,i_state)
|
delta_ii_(i_I,i_state) -= dIa_hla(i_state,k_sd) * ci_inv(i_state) * psi_non_ref_coef(k_sd,i_state)
|
||||||
else
|
else
|
||||||
delta_ii_(i_I,i_state) = 0.d0
|
delta_ii_(i_I,i_state) = 0.d0
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call omp_unset_lock( psi_cas_lock(i_I) )
|
call omp_unset_lock( psi_ref_lock(i_I) )
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
deallocate (dIa_hla)
|
deallocate (dIa_hla)
|
||||||
@ -157,13 +157,13 @@ end
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
subroutine mrcc_dress_simple(delta_ij_non_cas_,Ndet_non_cas,i_generator,n_selected,det_buffer,Nint,iproc)
|
subroutine mrcc_dress_simple(delta_ij_non_ref_,Ndet_non_ref,i_generator,n_selected,det_buffer,Nint,iproc)
|
||||||
use bitmasks
|
use bitmasks
|
||||||
implicit none
|
implicit none
|
||||||
|
|
||||||
integer, intent(in) :: i_generator,n_selected, Nint, iproc
|
integer, intent(in) :: i_generator,n_selected, Nint, iproc
|
||||||
integer, intent(in) :: Ndet_non_cas
|
integer, intent(in) :: Ndet_non_ref
|
||||||
double precision, intent(inout) :: delta_ij_non_cas_(Ndet_non_cas,Ndet_non_cas,*)
|
double precision, intent(inout) :: delta_ij_non_ref_(Ndet_non_ref,Ndet_non_ref,*)
|
||||||
|
|
||||||
integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected)
|
integer(bit_kind), intent(in) :: det_buffer(Nint,2,n_selected)
|
||||||
integer :: i,j,k,m
|
integer :: i,j,k,m
|
||||||
@ -184,18 +184,18 @@ subroutine mrcc_dress_simple(delta_ij_non_cas_,Ndet_non_cas,i_generator,n_select
|
|||||||
double precision :: f(N_states)
|
double precision :: f(N_states)
|
||||||
|
|
||||||
do i=1,N_tq
|
do i=1,N_tq
|
||||||
call get_excitation_degree_vector(psi_non_cas,tq(1,1,i),degree,Nint,Ndet_non_cas,idx)
|
call get_excitation_degree_vector(psi_non_ref,tq(1,1,i),degree,Nint,Ndet_non_ref,idx)
|
||||||
call i_h_j(tq(1,1,i),tq(1,1,i),Nint,haa)
|
call i_h_j(tq(1,1,i),tq(1,1,i),Nint,haa)
|
||||||
do m=1,N_states
|
do m=1,N_states
|
||||||
f(m) = 1.d0/(ci_electronic_energy(m)-haa)
|
f(m) = 1.d0/(ci_electronic_energy(m)-haa)
|
||||||
enddo
|
enddo
|
||||||
do k=1,idx(0)
|
do k=1,idx(0)
|
||||||
call i_h_j(tq(1,1,i),psi_non_cas(1,1,idx(k)),Nint,hka)
|
call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(k)),Nint,hka)
|
||||||
do j=k,idx(0)
|
do j=k,idx(0)
|
||||||
call i_h_j(tq(1,1,i),psi_non_cas(1,1,idx(j)),Nint,haj)
|
call i_h_j(tq(1,1,i),psi_non_ref(1,1,idx(j)),Nint,haj)
|
||||||
do m=1,N_states
|
do m=1,N_states
|
||||||
delta_ij_non_cas_(idx(k), idx(j),m) += haj*hka* f(m)
|
delta_ij_non_ref_(idx(k), idx(j),m) += haj*hka* f(m)
|
||||||
delta_ij_non_cas_(idx(j), idx(k),m) += haj*hka* f(m)
|
delta_ij_non_ref_(idx(j), idx(k),m) += haj*hka* f(m)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -231,9 +231,9 @@ subroutine find_triples_and_quadruples(i_generator,n_selected,det_buffer,Nint,tq
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
! Select determinants that are triple or quadruple excitations
|
! Select determinants that are triple or quadruple excitations
|
||||||
! from the CAS
|
! from the ref
|
||||||
good = .True.
|
good = .True.
|
||||||
call get_excitation_degree_vector(psi_cas,det_buffer(1,1,i),degree,Nint,N_det_cas,idx)
|
call get_excitation_degree_vector(psi_ref,det_buffer(1,1,i),degree,Nint,N_det_ref,idx)
|
||||||
do k=1,idx(0)
|
do k=1,idx(0)
|
||||||
if (degree(k) < 3) then
|
if (degree(k) < 3) then
|
||||||
good = .False.
|
good = .False.
|
29
plugins/MRCC_Utils/mrcc_general.irp.f
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
subroutine run_mrcc
|
||||||
|
implicit none
|
||||||
|
integer :: i,j
|
||||||
|
|
||||||
|
double precision :: E_new, E_old, delta_e
|
||||||
|
integer :: iteration
|
||||||
|
E_new = 0.d0
|
||||||
|
delta_E = 1.d0
|
||||||
|
iteration = 0
|
||||||
|
do while (delta_E > 1.d-10)
|
||||||
|
iteration += 1
|
||||||
|
print *, '==========================='
|
||||||
|
print *, 'MRCC Iteration', iteration
|
||||||
|
print *, '==========================='
|
||||||
|
print *, ''
|
||||||
|
E_old = sum(ci_energy_dressed)
|
||||||
|
call write_double(6,ci_energy_dressed(1),"MRCC energy")
|
||||||
|
call diagonalize_ci_dressed
|
||||||
|
E_new = sum(ci_energy_dressed)
|
||||||
|
delta_E = dabs(E_new - E_old)
|
||||||
|
if (iteration > 20) then
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
call write_double(6,ci_energy_dressed(1),"Final MRCC energy")
|
||||||
|
call ezfio_set_mrcc_energy(ci_energy_dressed(1))
|
||||||
|
call save_wavefunction
|
||||||
|
|
||||||
|
end
|
@ -7,16 +7,16 @@
|
|||||||
integer :: i,k
|
integer :: i,k
|
||||||
double precision :: ihpsi(N_states), hii
|
double precision :: ihpsi(N_states), hii
|
||||||
|
|
||||||
do i=1,N_det_non_cas
|
do i=1,N_det_non_ref
|
||||||
call i_h_psi(psi_non_cas(1,1,i), psi_cas, psi_cas_coef, N_int, N_det_cas,&
|
call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,&
|
||||||
size(psi_cas_coef,1), n_states, ihpsi)
|
size(psi_ref_coef,1), n_states, ihpsi)
|
||||||
call i_h_j(psi_non_cas(1,1,i),psi_non_cas(1,1,i),N_int,hii)
|
call i_h_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii)
|
||||||
do k=1,N_states
|
do k=1,N_states
|
||||||
lambda_pert(k,i) = 1.d0 / (psi_cas_energy_diagonalized(k)-hii)
|
lambda_pert(k,i) = 1.d0 / (psi_ref_energy_diagonalized(k)-hii)
|
||||||
if (dabs(ihpsi(k)).le.1.d-3) then
|
if (dabs(ihpsi(k)).le.1.d-3) then
|
||||||
lambda_mrcc(k,i) = lambda_pert(k,i)
|
lambda_mrcc(k,i) = lambda_pert(k,i)
|
||||||
else
|
else
|
||||||
lambda_mrcc(k,i) = psi_non_cas_coef(i,k)/ihpsi(k)
|
lambda_mrcc(k,i) = psi_non_ref_coef(i,k)/ihpsi(k)
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -26,17 +26,17 @@ END_PROVIDER
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
!BEGIN_PROVIDER [ double precision, delta_ij_non_cas, (N_det_non_cas, N_det_non_cas,N_states) ]
|
!BEGIN_PROVIDER [ double precision, delta_ij_non_ref, (N_det_non_ref, N_det_non_ref,N_states) ]
|
||||||
!implicit none
|
!implicit none
|
||||||
!BEGIN_DOC
|
!BEGIN_DOC
|
||||||
!! Dressing matrix in SD basis
|
!! Dressing matrix in SD basis
|
||||||
!END_DOC
|
!END_DOC
|
||||||
!delta_ij_non_cas = 0.d0
|
!delta_ij_non_ref = 0.d0
|
||||||
!call H_apply_mrcc_simple(delta_ij_non_cas,N_det_non_cas)
|
!call H_apply_mrcc_simple(delta_ij_non_ref,N_det_non_ref)
|
||||||
!END_PROVIDER
|
!END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, delta_ij, (N_det_cas,N_det_non_cas,N_states) ]
|
BEGIN_PROVIDER [ double precision, delta_ij, (N_det_ref,N_det_non_ref,N_states) ]
|
||||||
&BEGIN_PROVIDER [ double precision, delta_ii, (N_det_cas,N_states) ]
|
&BEGIN_PROVIDER [ double precision, delta_ii, (N_det_ref,N_states) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Dressing matrix in N_det basis
|
! Dressing matrix in N_det basis
|
||||||
@ -44,7 +44,7 @@ END_PROVIDER
|
|||||||
integer :: i,j,m
|
integer :: i,j,m
|
||||||
delta_ij = 0.d0
|
delta_ij = 0.d0
|
||||||
delta_ii = 0.d0
|
delta_ii = 0.d0
|
||||||
call H_apply_mrcc(delta_ij,delta_ii,N_det_cas,N_det_non_cas)
|
call H_apply_mrcc(delta_ij,delta_ii,N_det_ref,N_det_non_ref)
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det,N_states) ]
|
BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det,N_states) ]
|
||||||
@ -59,11 +59,11 @@ BEGIN_PROVIDER [ double precision, h_matrix_dressed, (N_det,N_det,N_states) ]
|
|||||||
h_matrix_dressed(i,j,istate) = h_matrix_all_dets(i,j)
|
h_matrix_dressed(i,j,istate) = h_matrix_all_dets(i,j)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
do ii = 1, N_det_cas
|
do ii = 1, N_det_ref
|
||||||
i =idx_cas(ii)
|
i =idx_ref(ii)
|
||||||
h_matrix_dressed(i,i,istate) += delta_ii(ii,istate)
|
h_matrix_dressed(i,i,istate) += delta_ii(ii,istate)
|
||||||
do jj = 1, N_det_non_cas
|
do jj = 1, N_det_non_ref
|
||||||
j =idx_cas(jj)
|
j =idx_ref(jj)
|
||||||
h_matrix_dressed(i,j,istate) += delta_ij(ii,jj,istate)
|
h_matrix_dressed(i,j,istate) += delta_ij(ii,jj,istate)
|
||||||
h_matrix_dressed(j,i,istate) += delta_ij(ii,jj,istate)
|
h_matrix_dressed(j,i,istate) += delta_ij(ii,jj,istate)
|
||||||
enddo
|
enddo
|
BIN
plugins/MRCC_Utils/tree_dependency.png
Normal file
After Width: | Height: | Size: 112 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 60 KiB |
29
plugins/Psiref_CAS/.gitignore
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Automatically created by $QP_ROOT/scripts/module/module_handler.py
|
||||||
|
.ninja_deps
|
||||||
|
.ninja_log
|
||||||
|
AO_Basis
|
||||||
|
Bitmask
|
||||||
|
Determinants
|
||||||
|
Electrons
|
||||||
|
Ezfio_files
|
||||||
|
Generators_full
|
||||||
|
Hartree_Fock
|
||||||
|
IRPF90_man
|
||||||
|
IRPF90_temp
|
||||||
|
Integrals_Bielec
|
||||||
|
Integrals_Monoelec
|
||||||
|
MOGuess
|
||||||
|
MO_Basis
|
||||||
|
Makefile
|
||||||
|
Makefile.depend
|
||||||
|
Nuclei
|
||||||
|
Perturbation
|
||||||
|
Properties
|
||||||
|
Pseudo
|
||||||
|
Selectors_full
|
||||||
|
Utils
|
||||||
|
ezfio_interface.irp.f
|
||||||
|
irpf90.make
|
||||||
|
irpf90_entities
|
||||||
|
mrcc_general
|
||||||
|
tags
|
1
plugins/Psiref_CAS/NEEDED_CHILDREN_MODULES
Normal file
@ -0,0 +1 @@
|
|||||||
|
Psiref_Utils
|
24
plugins/Psiref_CAS/README.rst
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
=======================
|
||||||
|
Psiref_threshold Module
|
||||||
|
=======================
|
||||||
|
|
||||||
|
|
||||||
|
Reference wave function is defined as all determinants with coefficients
|
||||||
|
such that | c_i/c_max | > threshold.
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
Needed Modules
|
||||||
|
==============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
.. image:: tree_dependency.png
|
||||||
|
|
||||||
|
* `Psiref_Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Psiref_Utils>`_
|
||||||
|
|
28
plugins/Psiref_CAS/psi_ref.irp.f
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
use bitmasks
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_ref, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_ref_coef, (psi_det_size,n_states) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, idx_ref, (psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, N_det_ref ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! CAS wave function, defined from the application of the CAS bitmask on the
|
||||||
|
! determinants. idx_cas gives the indice of the CAS determinant in psi_det.
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,k
|
||||||
|
N_det_ref = N_det_cas
|
||||||
|
do i=1,N_det_ref
|
||||||
|
do k=1,N_int
|
||||||
|
psi_ref(k,1,i) = psi_cas(k,1,i)
|
||||||
|
psi_ref(k,2,i) = psi_cas(k,2,i)
|
||||||
|
enddo
|
||||||
|
idx_ref(i) = idx_cas(i)
|
||||||
|
enddo
|
||||||
|
do k=1,N_states
|
||||||
|
do i=1,N_det_ref
|
||||||
|
psi_ref_coef(i,k) = psi_cas_coef(i,k)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
BIN
plugins/Psiref_CAS/tree_dependency.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
29
plugins/Psiref_Utils/.gitignore
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Automatically created by $QP_ROOT/scripts/module/module_handler.py
|
||||||
|
.ninja_deps
|
||||||
|
.ninja_log
|
||||||
|
AO_Basis
|
||||||
|
Bitmask
|
||||||
|
Determinants
|
||||||
|
Electrons
|
||||||
|
Ezfio_files
|
||||||
|
Generators_full
|
||||||
|
Hartree_Fock
|
||||||
|
IRPF90_man
|
||||||
|
IRPF90_temp
|
||||||
|
Integrals_Bielec
|
||||||
|
Integrals_Monoelec
|
||||||
|
MOGuess
|
||||||
|
MO_Basis
|
||||||
|
Makefile
|
||||||
|
Makefile.depend
|
||||||
|
Nuclei
|
||||||
|
Perturbation
|
||||||
|
Properties
|
||||||
|
Pseudo
|
||||||
|
Selectors_full
|
||||||
|
Utils
|
||||||
|
ezfio_interface.irp.f
|
||||||
|
irpf90.make
|
||||||
|
irpf90_entities
|
||||||
|
mrcc_general
|
||||||
|
tags
|
0
plugins/Psiref_Utils/NEEDED_CHILDREN_MODULES
Normal file
15
plugins/Psiref_Utils/README.rst
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
===================
|
||||||
|
Psiref_utils Module
|
||||||
|
===================
|
||||||
|
|
||||||
|
|
||||||
|
Utilities related to the use of a reference wave function. This module
|
||||||
|
needs to be loaded with any psi_ref module.
|
||||||
|
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
36
plugins/Psiref_Utils/psi_ref.irp.f
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
use bitmasks
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_ref, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_ref_coef, (psi_det_size,n_states) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, idx_ref, (psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, N_det_ref ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reference wave function, defined as determinants with coefficients > 0.05
|
||||||
|
! idx_ref gives the indice of the ref determinant in psi_det.
|
||||||
|
END_DOC
|
||||||
|
integer :: i, k, l
|
||||||
|
logical :: good
|
||||||
|
N_det_ref = 0
|
||||||
|
do i=1,N_det
|
||||||
|
good = .False.
|
||||||
|
do l = 1, N_states
|
||||||
|
psi_ref_coef(i,l) = 0.d0
|
||||||
|
good = good.or.(dabs(psi_coef(i,l)) > 0.05d0)
|
||||||
|
enddo
|
||||||
|
if (good) then
|
||||||
|
N_det_ref = N_det_ref+1
|
||||||
|
do k=1,N_int
|
||||||
|
psi_ref(k,1,N_det_ref) = psi_det(k,1,i)
|
||||||
|
psi_ref(k,2,N_det_ref) = psi_det(k,2,i)
|
||||||
|
enddo
|
||||||
|
idx_ref(N_det_ref) = i
|
||||||
|
do k=1,N_states
|
||||||
|
psi_ref_coef(N_det_ref,k) = psi_coef(i,k)
|
||||||
|
enddo
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
call write_int(output_determinants,N_det_ref, 'Number of determinants in the reference')
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
123
plugins/Psiref_Utils/psi_ref_utils.irp.f
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
use bitmasks
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_ref_sorted_bit, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_ref_coef_sorted_bit, (psi_det_size,N_states) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reference determinants sorted to accelerate the search of a random determinant in the wave
|
||||||
|
! function.
|
||||||
|
END_DOC
|
||||||
|
call sort_dets_by_det_search_key(N_det_ref, psi_ref, psi_ref_coef, &
|
||||||
|
psi_ref_sorted_bit, psi_ref_coef_sorted_bit)
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_non_ref, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_non_ref_coef, (psi_det_size,n_states) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, idx_non_ref, (psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, N_det_non_ref ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Set of determinants which are not part of the reference, defined from the application
|
||||||
|
! of the reference bitmask on the determinants.
|
||||||
|
! idx_non_ref gives the indice of the determinant in psi_det.
|
||||||
|
END_DOC
|
||||||
|
integer :: i_non_ref,j,k
|
||||||
|
integer :: degree
|
||||||
|
logical :: in_ref
|
||||||
|
i_non_ref =0
|
||||||
|
do k=1,N_det
|
||||||
|
in_ref = .False.
|
||||||
|
do j=1,N_det_ref
|
||||||
|
call get_excitation_degree(psi_ref(1,1,j), psi_det(1,1,k), degree, N_int)
|
||||||
|
if (degree == 0) then
|
||||||
|
in_ref = .True.
|
||||||
|
exit
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
if (.not.in_ref) then
|
||||||
|
double precision :: hij
|
||||||
|
i_non_ref += 1
|
||||||
|
do j=1,N_int
|
||||||
|
psi_non_ref(j,1,i_non_ref) = psi_det(j,1,k)
|
||||||
|
psi_non_ref(j,2,i_non_ref) = psi_det(j,2,k)
|
||||||
|
enddo
|
||||||
|
do j=1,N_states
|
||||||
|
psi_non_ref_coef(i_non_ref,j) = psi_coef(k,j)
|
||||||
|
enddo
|
||||||
|
idx_non_ref(i_non_ref) = k
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
N_det_non_ref = i_non_ref
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_non_ref_sorted_bit, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_non_ref_coef_sorted_bit, (psi_det_size,N_states) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reference determinants sorted to accelerate the search of a random determinant in the wave
|
||||||
|
! function.
|
||||||
|
END_DOC
|
||||||
|
call sort_dets_by_det_search_key(N_det_ref, psi_non_ref, psi_non_ref_coef, &
|
||||||
|
psi_non_ref_sorted_bit, psi_non_ref_coef_sorted_bit)
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, H_matrix_ref, (N_det_ref,N_det_ref)]
|
||||||
|
implicit none
|
||||||
|
integer :: i,j
|
||||||
|
double precision :: hij
|
||||||
|
do i = 1, N_det_ref
|
||||||
|
do j = 1, N_det_ref
|
||||||
|
call i_H_j(psi_ref(1,1,i),psi_ref(1,1,j),N_int,hij)
|
||||||
|
H_matrix_ref(i,j) = hij
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, psi_coef_ref_diagonalized, (N_det_ref,N_states)]
|
||||||
|
&BEGIN_PROVIDER [double precision, psi_ref_energy_diagonalized, (N_states)]
|
||||||
|
implicit none
|
||||||
|
integer :: i,j
|
||||||
|
double precision, allocatable :: eigenvectors(:,:), eigenvalues(:)
|
||||||
|
allocate (eigenvectors(size(H_matrix_ref,1),N_det_ref))
|
||||||
|
allocate (eigenvalues(N_det_ref))
|
||||||
|
call lapack_diag(eigenvalues,eigenvectors, &
|
||||||
|
H_matrix_ref,size(H_matrix_ref,1),N_det_ref)
|
||||||
|
do i = 1, N_states
|
||||||
|
psi_ref_energy_diagonalized(i) = eigenvalues(i)
|
||||||
|
do j = 1, N_det_ref
|
||||||
|
psi_coef_ref_diagonalized(j,i) = eigenvectors(j,i)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [double precision, psi_ref_energy, (N_states)]
|
||||||
|
implicit none
|
||||||
|
integer :: i,j,k
|
||||||
|
double precision :: hij,norm,u_dot_v
|
||||||
|
psi_ref_energy = 0.d0
|
||||||
|
|
||||||
|
|
||||||
|
do k = 1, N_states
|
||||||
|
norm = 0.d0
|
||||||
|
do i = 1, N_det_ref
|
||||||
|
norm += psi_ref_coef(i,k) * psi_ref_coef(i,k)
|
||||||
|
do j = 1, N_det_ref
|
||||||
|
psi_ref_energy(k) += psi_ref_coef(i,k) * psi_ref_coef(j,k) * H_matrix_ref(i,j)
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
psi_ref_energy(k) = psi_ref_energy(k) /norm
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
BIN
plugins/Psiref_Utils/tree_dependency.png
Normal file
After Width: | Height: | Size: 3.4 KiB |
29
plugins/Psiref_threshold/.gitignore
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# Automatically created by $QP_ROOT/scripts/module/module_handler.py
|
||||||
|
.ninja_deps
|
||||||
|
.ninja_log
|
||||||
|
AO_Basis
|
||||||
|
Bitmask
|
||||||
|
Determinants
|
||||||
|
Electrons
|
||||||
|
Ezfio_files
|
||||||
|
Generators_full
|
||||||
|
Hartree_Fock
|
||||||
|
IRPF90_man
|
||||||
|
IRPF90_temp
|
||||||
|
Integrals_Bielec
|
||||||
|
Integrals_Monoelec
|
||||||
|
MOGuess
|
||||||
|
MO_Basis
|
||||||
|
Makefile
|
||||||
|
Makefile.depend
|
||||||
|
Nuclei
|
||||||
|
Perturbation
|
||||||
|
Properties
|
||||||
|
Pseudo
|
||||||
|
Selectors_full
|
||||||
|
Utils
|
||||||
|
ezfio_interface.irp.f
|
||||||
|
irpf90.make
|
||||||
|
irpf90_entities
|
||||||
|
mrcc_general
|
||||||
|
tags
|
1
plugins/Psiref_threshold/NEEDED_CHILDREN_MODULES
Normal file
@ -0,0 +1 @@
|
|||||||
|
Psiref_Utils
|
24
plugins/Psiref_threshold/README.rst
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
=======================
|
||||||
|
Psiref_threshold Module
|
||||||
|
=======================
|
||||||
|
|
||||||
|
|
||||||
|
Reference wave function is defined as all determinants with coefficients
|
||||||
|
such that | c_i/c_max | > threshold.
|
||||||
|
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
Needed Modules
|
||||||
|
==============
|
||||||
|
|
||||||
|
.. Do not edit this section. It was auto-generated from the
|
||||||
|
.. by the `update_README.py` script.
|
||||||
|
|
||||||
|
.. image:: tree_dependency.png
|
||||||
|
|
||||||
|
* `Psiref_Utils <http://github.com/LCPQ/quantum_package/tree/master/src/Psiref_Utils>`_
|
||||||
|
|
38
plugins/Psiref_threshold/psi_ref.irp.f
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
use bitmasks
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), psi_ref, (N_int,2,psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_ref_coef, (psi_det_size,n_states) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, idx_ref, (psi_det_size) ]
|
||||||
|
&BEGIN_PROVIDER [ integer, N_det_ref ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reference wave function, defined as determinants with coefficients > 0.05
|
||||||
|
! idx_ref gives the indice of the ref determinant in psi_det.
|
||||||
|
END_DOC
|
||||||
|
integer :: i, k, l
|
||||||
|
logical :: good
|
||||||
|
double precision, parameter :: threshold=0.05d0
|
||||||
|
N_det_ref = 0
|
||||||
|
t = threshold * abs_psi_coef_max
|
||||||
|
do i=1,N_det
|
||||||
|
good = .False.
|
||||||
|
do l = 1, N_states
|
||||||
|
psi_ref_coef(i,l) = 0.d0
|
||||||
|
good = good.or.(dabs(psi_coef(i,l)) > t)
|
||||||
|
enddo
|
||||||
|
if (good) then
|
||||||
|
N_det_ref = N_det_ref+1
|
||||||
|
do k=1,N_int
|
||||||
|
psi_ref(k,1,N_det_ref) = psi_det(k,1,i)
|
||||||
|
psi_ref(k,2,N_det_ref) = psi_det(k,2,i)
|
||||||
|
enddo
|
||||||
|
idx_ref(N_det_ref) = i
|
||||||
|
do k=1,N_states
|
||||||
|
psi_ref_coef(N_det_ref,k) = psi_coef(i,k)
|
||||||
|
enddo
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
call write_int(output_determinants,N_det_ref, 'Number of determinants in the reference')
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
BIN
plugins/Psiref_threshold/tree_dependency.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 28 KiB |
@ -47,6 +47,14 @@ Documentation
|
|||||||
Needed for diag_H_mat_elem
|
Needed for diag_H_mat_elem
|
||||||
|
|
||||||
|
|
||||||
|
`abs_psi_coef_max <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L451>`_
|
||||||
|
Max and min values of the coefficients
|
||||||
|
|
||||||
|
|
||||||
|
`abs_psi_coef_min <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L452>`_
|
||||||
|
Max and min values of the coefficients
|
||||||
|
|
||||||
|
|
||||||
`ac_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1007>`_
|
`ac_operator <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/slater_rules.irp.f#L1007>`_
|
||||||
Needed for diag_H_mat_elem
|
Needed for diag_H_mat_elem
|
||||||
|
|
||||||
@ -120,11 +128,11 @@ Documentation
|
|||||||
Initial guess vectors are not necessarily orthonormal
|
Initial guess vectors are not necessarily orthonormal
|
||||||
|
|
||||||
|
|
||||||
`connected_to_ref <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L155>`_
|
`connected_to_ref <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L157>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
`connected_to_ref_by_mono <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L253>`_
|
`connected_to_ref_by_mono <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L255>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
@ -133,7 +141,7 @@ Documentation
|
|||||||
After calling this subroutine, N_det, psi_det and psi_coef need to be touched
|
After calling this subroutine, N_det, psi_det and psi_coef need to be touched
|
||||||
|
|
||||||
|
|
||||||
`create_wf_of_psi_svd_matrix <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L483>`_
|
`create_wf_of_psi_svd_matrix <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L484>`_
|
||||||
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
||||||
|
|
||||||
|
|
||||||
@ -339,7 +347,7 @@ Documentation
|
|||||||
Determinants are taken from the psi_det_sorted_ab array
|
Determinants are taken from the psi_det_sorted_ab array
|
||||||
|
|
||||||
|
|
||||||
`generate_all_alpha_beta_det_products <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L538>`_
|
`generate_all_alpha_beta_det_products <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L539>`_
|
||||||
Create a wave function from all possible alpha x beta determinants
|
Create a wave function from all possible alpha x beta determinants
|
||||||
|
|
||||||
|
|
||||||
@ -359,15 +367,15 @@ Documentation
|
|||||||
Applies get_excitation_degree to an array of determinants
|
Applies get_excitation_degree to an array of determinants
|
||||||
|
|
||||||
|
|
||||||
`get_index_in_psi_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L139>`_
|
`get_index_in_psi_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L140>`_
|
||||||
Returns the index of the determinant in the ``psi_det_alpha_unique`` array
|
Returns the index of the determinant in the ``psi_det_alpha_unique`` array
|
||||||
|
|
||||||
|
|
||||||
`get_index_in_psi_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L221>`_
|
`get_index_in_psi_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L222>`_
|
||||||
Returns the index of the determinant in the ``psi_det_beta_unique`` array
|
Returns the index of the determinant in the ``psi_det_beta_unique`` array
|
||||||
|
|
||||||
|
|
||||||
`get_index_in_psi_det_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L48>`_
|
`get_index_in_psi_det_sorted_bit <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L50>`_
|
||||||
Returns the index of the determinant in the ``psi_det_sorted_bit`` array
|
Returns the index of the determinant in the ``psi_det_sorted_bit`` array
|
||||||
|
|
||||||
|
|
||||||
@ -480,7 +488,7 @@ Documentation
|
|||||||
.br
|
.br
|
||||||
|
|
||||||
|
|
||||||
`is_in_wavefunction <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L34>`_
|
`is_in_wavefunction <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L36>`_
|
||||||
True if the determinant ``det`` is in the wave function
|
True if the determinant ``det`` is in the wave function
|
||||||
|
|
||||||
|
|
||||||
@ -508,11 +516,11 @@ Documentation
|
|||||||
Number of determinants in the wave function
|
Number of determinants in the wave function
|
||||||
|
|
||||||
|
|
||||||
`n_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_134#L4>`_
|
`n_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_135#L4>`_
|
||||||
Unique alpha determinants
|
Unique alpha determinants
|
||||||
|
|
||||||
|
|
||||||
`n_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_134#L80>`_
|
`n_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_135#L80>`_
|
||||||
Unique beta determinants
|
Unique beta determinants
|
||||||
|
|
||||||
|
|
||||||
@ -565,7 +573,7 @@ Documentation
|
|||||||
Energy of the reference bitmask used in Slater rules
|
Energy of the reference bitmask used in Slater rules
|
||||||
|
|
||||||
|
|
||||||
`occ_pattern_search_key <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L17>`_
|
`occ_pattern_search_key <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/connected_to_ref.irp.f#L18>`_
|
||||||
Return an integer*8 corresponding to a determinant index for searching
|
Return an integer*8 corresponding to a determinant index for searching
|
||||||
|
|
||||||
|
|
||||||
@ -654,11 +662,19 @@ Documentation
|
|||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
|
`psi_coef_max <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L449>`_
|
||||||
|
Max and min values of the coefficients
|
||||||
|
|
||||||
|
|
||||||
|
`psi_coef_min <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L450>`_
|
||||||
|
Max and min values of the coefficients
|
||||||
|
|
||||||
|
|
||||||
`psi_coef_sorted <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L302>`_
|
`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)
|
Wave function sorted by determinants contribution to the norm (state-averaged)
|
||||||
|
|
||||||
|
|
||||||
`psi_coef_sorted_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L450>`_
|
`psi_coef_sorted_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L468>`_
|
||||||
Determinants on which we apply <i|H|j>.
|
Determinants on which we apply <i|H|j>.
|
||||||
They are sorted by the 3 highest electrons in the alpha part,
|
They are sorted by the 3 highest electrons in the alpha part,
|
||||||
then by the 3 highest electrons in the beta part to accelerate
|
then by the 3 highest electrons in the beta part to accelerate
|
||||||
@ -677,19 +693,19 @@ Documentation
|
|||||||
is empty
|
is empty
|
||||||
|
|
||||||
|
|
||||||
`psi_det_alpha <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L25>`_
|
`psi_det_alpha <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L26>`_
|
||||||
List of alpha determinants of psi_det
|
List of alpha determinants of psi_det
|
||||||
|
|
||||||
|
|
||||||
`psi_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_134#L3>`_
|
`psi_det_alpha_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_135#L3>`_
|
||||||
Unique alpha determinants
|
Unique alpha determinants
|
||||||
|
|
||||||
|
|
||||||
`psi_det_beta <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L39>`_
|
`psi_det_beta <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L40>`_
|
||||||
List of beta determinants of psi_det
|
List of beta determinants of psi_det
|
||||||
|
|
||||||
|
|
||||||
`psi_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_134#L79>`_
|
`psi_det_beta_unique <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f_template_135#L79>`_
|
||||||
Unique beta determinants
|
Unique beta determinants
|
||||||
|
|
||||||
|
|
||||||
@ -701,7 +717,7 @@ Documentation
|
|||||||
Wave function sorted by determinants contribution to the norm (state-averaged)
|
Wave function sorted by determinants contribution to the norm (state-averaged)
|
||||||
|
|
||||||
|
|
||||||
`psi_det_sorted_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L449>`_
|
`psi_det_sorted_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L467>`_
|
||||||
Determinants on which we apply <i|H|j>.
|
Determinants on which we apply <i|H|j>.
|
||||||
They are sorted by the 3 highest electrons in the alpha part,
|
They are sorted by the 3 highest electrons in the alpha part,
|
||||||
then by the 3 highest electrons in the beta part to accelerate
|
then by the 3 highest electrons in the beta part to accelerate
|
||||||
@ -715,7 +731,7 @@ Documentation
|
|||||||
function.
|
function.
|
||||||
|
|
||||||
|
|
||||||
`psi_det_sorted_next_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L451>`_
|
`psi_det_sorted_next_ab <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L469>`_
|
||||||
Determinants on which we apply <i|H|j>.
|
Determinants on which we apply <i|H|j>.
|
||||||
They are sorted by the 3 highest electrons in the alpha part,
|
They are sorted by the 3 highest electrons in the alpha part,
|
||||||
then by the 3 highest electrons in the beta part to accelerate
|
then by the 3 highest electrons in the beta part to accelerate
|
||||||
@ -750,31 +766,31 @@ Documentation
|
|||||||
psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation
|
psi_occ_pattern(:,2,j) = jth occ_pattern of the wave function : represent all the double occupation
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_alpha <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L578>`_
|
`psi_svd_alpha <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L579>`_
|
||||||
SVD wave function
|
SVD wave function
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_beta <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L579>`_
|
`psi_svd_beta <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L580>`_
|
||||||
SVD wave function
|
SVD wave function
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_coefs <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L580>`_
|
`psi_svd_coefs <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L581>`_
|
||||||
SVD wave function
|
SVD wave function
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_matrix <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L467>`_
|
`psi_svd_matrix <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L468>`_
|
||||||
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_matrix_columns <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L407>`_
|
`psi_svd_matrix_columns <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L408>`_
|
||||||
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_matrix_rows <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L406>`_
|
`psi_svd_matrix_rows <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L407>`_
|
||||||
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
||||||
|
|
||||||
|
|
||||||
`psi_svd_matrix_values <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L405>`_
|
`psi_svd_matrix_values <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L406>`_
|
||||||
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
Matrix of wf coefficients. Outer product of alpha and beta determinants
|
||||||
|
|
||||||
|
|
||||||
@ -782,7 +798,7 @@ Documentation
|
|||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
|
|
||||||
`read_dets <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L580>`_
|
`read_dets <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L598>`_
|
||||||
Reads the determinants from the EZFIO file
|
Reads the determinants from the EZFIO file
|
||||||
|
|
||||||
|
|
||||||
@ -835,15 +851,15 @@ Documentation
|
|||||||
Save natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis
|
Save natural orbitals, obtained by diagonalization of the one-body density matrix in the MO basis
|
||||||
|
|
||||||
|
|
||||||
`save_wavefunction <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L627>`_
|
`save_wavefunction <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L645>`_
|
||||||
Save the wave function into the EZFIO file
|
Save the wave function into the EZFIO file
|
||||||
|
|
||||||
|
|
||||||
`save_wavefunction_general <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L646>`_
|
`save_wavefunction_general <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L664>`_
|
||||||
Save the wave function into the EZFIO file
|
Save the wave function into the EZFIO file
|
||||||
|
|
||||||
|
|
||||||
`save_wavefunction_unsorted <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L637>`_
|
`save_wavefunction_unsorted <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L655>`_
|
||||||
Save the wave function into the EZFIO file
|
Save the wave function into the EZFIO file
|
||||||
|
|
||||||
|
|
||||||
@ -857,7 +873,7 @@ Documentation
|
|||||||
for a given couple of hole/particle excitations i.
|
for a given couple of hole/particle excitations i.
|
||||||
|
|
||||||
|
|
||||||
`sort_dets_by_3_highest_electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L471>`_
|
`sort_dets_by_3_highest_electrons <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/determinants.irp.f#L489>`_
|
||||||
Determinants on which we apply <i|H|j>.
|
Determinants on which we apply <i|H|j>.
|
||||||
They are sorted by the 3 highest electrons in the alpha part,
|
They are sorted by the 3 highest electrons in the alpha part,
|
||||||
then by the 3 highest electrons in the beta part to accelerate
|
then by the 3 highest electrons in the beta part to accelerate
|
||||||
@ -890,6 +906,6 @@ Documentation
|
|||||||
Thresholds on selectors (fraction of the norm)
|
Thresholds on selectors (fraction of the norm)
|
||||||
|
|
||||||
|
|
||||||
`write_spindeterminants <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L303>`_
|
`write_spindeterminants <http://github.com/LCPQ/quantum_package/tree/master/src/Determinants/spindeterminants.irp.f#L304>`_
|
||||||
Undocumented
|
Undocumented
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ integer*8 function det_search_key(det,Nint)
|
|||||||
do i=2,Nint
|
do i=2,Nint
|
||||||
det_search_key = ieor(det_search_key,iand(det(i,1),det(i,2)))
|
det_search_key = ieor(det_search_key,iand(det(i,1),det(i,2)))
|
||||||
enddo
|
enddo
|
||||||
|
det_search_key = iand(huge(det(1,1)),det_search_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -27,6 +28,7 @@ integer*8 function occ_pattern_search_key(det,Nint)
|
|||||||
do i=2,Nint
|
do i=2,Nint
|
||||||
occ_pattern_search_key = ieor(occ_pattern_search_key,iand(det(i,1),det(i,2)))
|
occ_pattern_search_key = ieor(occ_pattern_search_key,iand(det(i,1),det(i,2)))
|
||||||
enddo
|
enddo
|
||||||
|
occ_pattern_search_key = iand(huge(det(1,1)),occ_pattern_search_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -446,6 +446,24 @@ subroutine filter_3_highest_electrons( det_in, det_out, Nint )
|
|||||||
enddo
|
enddo
|
||||||
end
|
end
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, psi_coef_max, (N_states) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, psi_coef_min, (N_states) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, abs_psi_coef_max, (N_states) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, abs_psi_coef_min, (N_states) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Max and min values of the coefficients
|
||||||
|
END_DOC
|
||||||
|
integer:: i
|
||||||
|
do i=1,N_states
|
||||||
|
psi_coef_min(i) = minval(psi_coef(:,i))
|
||||||
|
psi_coef_max(i) = maxval(psi_coef(:,i))
|
||||||
|
abs_psi_coef_min(i) = dabs(psi_coef_min(i))
|
||||||
|
abs_psi_coef_max(i) = dabs(psi_coef_max(i))
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_ab, (N_int,2,psi_det_size) ]
|
BEGIN_PROVIDER [ integer(bit_kind), psi_det_sorted_ab, (N_int,2,psi_det_size) ]
|
||||||
&BEGIN_PROVIDER [ double precision, psi_coef_sorted_ab, (N_det,N_states) ]
|
&BEGIN_PROVIDER [ double precision, psi_coef_sorted_ab, (N_det,N_states) ]
|
||||||
&BEGIN_PROVIDER [ integer, psi_det_sorted_next_ab, (2,psi_det_size) ]
|
&BEGIN_PROVIDER [ integer, psi_det_sorted_next_ab, (2,psi_det_size) ]
|
||||||
|
@ -19,6 +19,7 @@ integer*8 function spin_det_search_key(det,Nint)
|
|||||||
do i=2,Nint
|
do i=2,Nint
|
||||||
spin_det_search_key = ieor(spin_det_search_key,det(i))
|
spin_det_search_key = ieor(spin_det_search_key,det(i))
|
||||||
enddo
|
enddo
|
||||||
|
spin_det_search_key = iand(huge(det(1)),spin_det_search_key)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 7.0 KiB |
@ -94,31 +94,47 @@ Documentation
|
|||||||
Output file for MRCC
|
Output file for MRCC
|
||||||
|
|
||||||
|
|
||||||
`output_nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L301>`_
|
`output_mrcc_general <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L301>`_
|
||||||
|
Output file for MRCC_general
|
||||||
|
|
||||||
|
|
||||||
|
`output_nuclei <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L321>`_
|
||||||
Output file for Nuclei
|
Output file for Nuclei
|
||||||
|
|
||||||
|
|
||||||
`output_perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L321>`_
|
`output_perturbation <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L341>`_
|
||||||
Output file for Perturbation
|
Output file for Perturbation
|
||||||
|
|
||||||
|
|
||||||
`output_properties <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L341>`_
|
`output_properties <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L361>`_
|
||||||
Output file for Properties
|
Output file for Properties
|
||||||
|
|
||||||
|
|
||||||
`output_pseudo <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L361>`_
|
`output_pseudo <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L381>`_
|
||||||
Output file for Pseudo
|
Output file for Pseudo
|
||||||
|
|
||||||
|
|
||||||
`output_qmcchem <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L381>`_
|
`output_psiref_cas <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L401>`_
|
||||||
|
Output file for Psiref_CAS
|
||||||
|
|
||||||
|
|
||||||
|
`output_psiref_threshold <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L421>`_
|
||||||
|
Output file for Psiref_threshold
|
||||||
|
|
||||||
|
|
||||||
|
`output_psiref_utils <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L441>`_
|
||||||
|
Output file for Psiref_Utils
|
||||||
|
|
||||||
|
|
||||||
|
`output_qmcchem <http://github.com/LCPQ/quantum_package/tree/master/src/Ezfio_files/output.irp.f_shell_40#L461>`_
|
||||||
Output file for QmcChem
|
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#L481>`_
|
||||||
Output file for Selectors_full
|
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#L501>`_
|
||||||
Output file for Utils
|
Output file for Utils
|
||||||
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.3 KiB |