mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-03 18:16:12 +01:00
Merge branch 'master' into develop
This commit is contained in:
commit
5da6a5afa1
7
configure
vendored
7
configure
vendored
@ -46,7 +46,12 @@ if len(sys.argv) != 3:
|
||||
# \_| |_ (_) |_) (_| | | | | | (_)
|
||||
#
|
||||
|
||||
QP_ROOT = os.getcwd()
|
||||
try:
|
||||
QP_ROOT = os.environ["QP_ROOT"]
|
||||
except KeyError:
|
||||
QP_ROOT = os.getcwd()
|
||||
os.environ["QP_ROOT"] = QP_ROOT
|
||||
|
||||
QP_ROOT_BIN = join(QP_ROOT, "bin")
|
||||
QP_ROOT_LIB = join(QP_ROOT, "lib")
|
||||
QP_ROOT_INSTALL = join(QP_ROOT, "install")
|
||||
|
@ -49,20 +49,20 @@ let t_to_string = function
|
||||
| None -> assert false
|
||||
;;
|
||||
|
||||
let run ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename =
|
||||
let set ~core ~inact ~act ~virt ~del =
|
||||
|
||||
Ezfio.set_file ezfio_filename ;
|
||||
if not (Ezfio.has_mo_basis_mo_tot_num ()) then
|
||||
failwith "mo_basis/mo_tot_num not found" ;
|
||||
|
||||
let mo_tot_num = Ezfio.get_mo_basis_mo_tot_num () in
|
||||
let mo_tot_num =
|
||||
Ezfio.get_mo_basis_mo_tot_num ()
|
||||
in
|
||||
let n_int =
|
||||
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
|
||||
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
|
||||
in
|
||||
|
||||
|
||||
let mo_class = Array.init mo_tot_num ~f:(fun i -> None) in
|
||||
let mo_class =
|
||||
Array.init mo_tot_num ~f:(fun i -> None)
|
||||
in
|
||||
|
||||
(* Check input data *)
|
||||
let apply_class l =
|
||||
@ -196,6 +196,49 @@ let run ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_fi
|
||||
|> Ezfio.set_bitmasks_cas;
|
||||
;;
|
||||
|
||||
let get () =
|
||||
|
||||
let mo_tot_num =
|
||||
Ezfio.get_mo_basis_mo_tot_num ()
|
||||
in
|
||||
let n_int =
|
||||
try N_int_number.of_int (Ezfio.get_determinants_n_int ())
|
||||
with _ -> Bitlist.n_int_of_mo_tot_num mo_tot_num
|
||||
in
|
||||
|
||||
let bitmasks =
|
||||
match Input.Bitmasks.read () with
|
||||
| Some x -> x
|
||||
| None -> failwith "No data to print"
|
||||
in
|
||||
assert (bitmasks.Input.Bitmasks.n_mask_gen |> Bitmask_number.to_int = 1);
|
||||
assert (bitmasks.Input.Bitmasks.n_mask_cas |> Bitmask_number.to_int = 1);
|
||||
|
||||
let (generators,cas) =
|
||||
Bitlist.of_int64_array bitmasks.Input.Bitmasks.generators,
|
||||
Bitlist.of_int64_array bitmasks.Input.Bitmasks.cas
|
||||
in
|
||||
|
||||
Printf.printf "MO : %d\n" mo_tot_num;
|
||||
Printf.printf "n_int: %d\n" (N_int_number.to_int n_int);
|
||||
Printf.printf "Gen : %s\nCAS : %s\n"
|
||||
(Bitlist.to_string generators)
|
||||
(Bitlist.to_string cas)
|
||||
|
||||
;;
|
||||
|
||||
let run ~print ?(core="[]") ?(inact="[]") ?(act="[]") ?(virt="[]") ?(del="[]") ezfio_filename =
|
||||
|
||||
Ezfio.set_file ezfio_filename ;
|
||||
if not (Ezfio.has_mo_basis_mo_tot_num ()) then
|
||||
failwith "mo_basis/mo_tot_num not found" ;
|
||||
|
||||
if print then
|
||||
get ()
|
||||
else
|
||||
set ~core ~inact ~act ~virt ~del
|
||||
;;
|
||||
|
||||
let ezfio_file =
|
||||
let failure filename =
|
||||
eprintf "'%s' is not an EZFIO file.\n%!" filename;
|
||||
@ -240,6 +283,7 @@ let spec =
|
||||
+> flag "act" (optional string) ~doc:"range Range of active orbitals"
|
||||
+> flag "virt" (optional string) ~doc:"range Range of virtual orbitals"
|
||||
+> flag "del" (optional string) ~doc:"range Range of deleted orbitals"
|
||||
+> flag "print" no_arg ~doc:" Print the current masks"
|
||||
+> anon ("ezfio_filename" %: ezfio_file)
|
||||
;;
|
||||
|
||||
@ -251,7 +295,7 @@ let command =
|
||||
The range of MOs has the form : \"[36-53,72-107,126-131]\"
|
||||
")
|
||||
spec
|
||||
(fun core inact act virt del ezfio_filename () -> run ?core ?inact ?act ?virt ?del ezfio_filename )
|
||||
(fun core inact act virt del print ezfio_filename () -> run ~print ?core ?inact ?act ?virt ?del ezfio_filename )
|
||||
;;
|
||||
|
||||
let () =
|
||||
|
@ -273,7 +273,8 @@ subroutine H_apply_dressed_pert_monoexc(key_in, hole_1,particl_1,i_generator,ipr
|
||||
integer,parameter :: size_max = 3072
|
||||
|
||||
integer, intent(in) :: Ndet_generators
|
||||
double precision, intent(in) :: delta_ij_generators_(Ndet_generators,Ndet_generators),E_ref
|
||||
double precision, intent(in) :: E_ref
|
||||
double precision, intent(inout) :: delta_ij_generators_(Ndet_generators,Ndet_generators)
|
||||
integer(bit_kind), intent(in) :: psi_det_generators_input(N_int,2,Ndet_generators)
|
||||
|
||||
integer ,intent(in) :: i_generator
|
||||
@ -437,8 +438,9 @@ subroutine H_apply_dressed_pert(delta_ij_generators_, Ndet_generators,psi_det_g
|
||||
|
||||
|
||||
integer, intent(in) :: Ndet_generators
|
||||
integer(bit_kind), intent(in) :: psi_det_generators_input(N_int,2,Ndet_generators),E_ref
|
||||
double precision, intent(in) :: delta_ij_generators_(Ndet_generators,Ndet_generators)
|
||||
double precision, intent(in) :: E_ref
|
||||
double precision, intent(inout) :: delta_ij_generators_(Ndet_generators,Ndet_generators)
|
||||
integer(bit_kind), intent(in) :: psi_det_generators_input(N_int,2,Ndet_generators)
|
||||
|
||||
|
||||
integer :: i_generator, nmax
|
||||
|
@ -16,7 +16,7 @@
|
||||
lambda_mrcc_pt2(0) = 0
|
||||
|
||||
do i=1,N_det_non_ref
|
||||
call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef_normalized, N_int, N_det_ref,&
|
||||
call i_h_psi(psi_non_ref(1,1,i), psi_ref, psi_ref_coef, N_int, N_det_ref,&
|
||||
size(psi_ref_coef,1), N_states,ihpsi_current)
|
||||
call i_H_j(psi_non_ref(1,1,i),psi_non_ref(1,1,i),N_int,hii)
|
||||
do k=1,N_states
|
||||
|
3
plugins/Psiref_CAS/overwrite_with_cas.irp.f
Normal file
3
plugins/Psiref_CAS/overwrite_with_cas.irp.f
Normal file
@ -0,0 +1,3 @@
|
||||
program overwrite_w_cas
|
||||
call extract_ref
|
||||
end
|
@ -26,20 +26,6 @@ use bitmasks
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ double precision, psi_ref_coef_normalized, (psi_det_size,n_states) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Normalized coefficients of the reference
|
||||
END_DOC
|
||||
integer :: i,j,k
|
||||
do k=1,N_states
|
||||
do j=1,N_det_ref
|
||||
psi_ref_coef_normalized(j,k) = psi_ref_coef(j,k)
|
||||
enddo
|
||||
call normalize(psi_ref_coef_normalized(1,k), N_det_ref)
|
||||
enddo
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ integer(bit_kind), psi_ref_restart, (N_int,2,psi_det_size) ]
|
||||
&BEGIN_PROVIDER [ double precision, psi_ref_coef_restart, (psi_det_size,n_states) ]
|
||||
|
@ -0,0 +1 @@
|
||||
Bitmask Determinants
|
24
plugins/Psiref_Utils/extract_ref.irp.f
Normal file
24
plugins/Psiref_Utils/extract_ref.irp.f
Normal file
@ -0,0 +1,24 @@
|
||||
subroutine extract_ref
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Replaces the total wave function by the normalized projection on the reference
|
||||
END_DOC
|
||||
|
||||
integer :: i,j,k
|
||||
do k=1,N_states
|
||||
do j=1,N_det_ref
|
||||
psi_coef(j,k) = psi_ref_coef_normalized(j,k)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
do j=1,N_det_ref
|
||||
do k=1,N_int
|
||||
psi_det(k,1,j) = psi_ref(k,1,j)
|
||||
psi_det(k,2,j) = psi_ref(k,2,j)
|
||||
enddo
|
||||
enddo
|
||||
N_det = N_det_ref
|
||||
|
||||
call save_wavefunction
|
||||
|
||||
end
|
@ -27,6 +27,22 @@ BEGIN_PROVIDER [ double precision, psi_ref_coef_transp, (n_states,psi_det_size)
|
||||
enddo
|
||||
END_PROVIDER
|
||||
|
||||
BEGIN_PROVIDER [ double precision, psi_ref_coef_normalized, (psi_det_size,n_states) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
! Normalized coefficients of the reference
|
||||
END_DOC
|
||||
integer :: i,j,k
|
||||
do k=1,N_states
|
||||
do j=1,N_det_ref
|
||||
psi_ref_coef_normalized(j,k) = psi_ref_coef(j,k)
|
||||
enddo
|
||||
call normalize(psi_ref_coef_normalized(1,k), N_det_ref)
|
||||
enddo
|
||||
|
||||
END_PROVIDER
|
||||
|
||||
|
||||
BEGIN_PROVIDER [ double precision, psi_non_ref_coef_transp, (n_states,psi_det_size) ]
|
||||
implicit none
|
||||
BEGIN_DOC
|
||||
|
@ -186,7 +186,7 @@ def ninja_ezfio_config_rule():
|
||||
|
||||
def get_children_of_ezfio_cfg(l_module_with_ezfio_cfg):
|
||||
"""
|
||||
From a module list of ezfio_cfg return all the stuff create by him
|
||||
From a module list of ezfio_cfg return all the stuff created by it
|
||||
"""
|
||||
config_folder = join(QP_EZFIO, "config")
|
||||
|
||||
|
14
src/MO_Basis/swap_mos.irp.f
Normal file
14
src/MO_Basis/swap_mos.irp.f
Normal file
@ -0,0 +1,14 @@
|
||||
program swap_mos
|
||||
implicit none
|
||||
integer :: i,j, i1, i2
|
||||
double precision :: x
|
||||
print *, 'MOs to swap?'
|
||||
read(*,*) i1, i2
|
||||
do i=1,ao_num_align
|
||||
x = mo_coef(i,i1)
|
||||
mo_coef(i,i1) = mo_coef(i,i2)
|
||||
mo_coef(i,i2) = x
|
||||
enddo
|
||||
call save_mos
|
||||
|
||||
end
|
Loading…
Reference in New Issue
Block a user