mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-12-22 20:34:58 +01:00
Merge branch 'dev-stable' of github.com:quantumpackage/qp2 into dev-stable
This commit is contained in:
commit
6bac69abac
@ -260,6 +260,7 @@ def write_ezfio(res, filename):
|
|||||||
|
|
||||||
MoTag = res.determinants_mo_type
|
MoTag = res.determinants_mo_type
|
||||||
ezfio.set_mo_basis_mo_label('Orthonormalized')
|
ezfio.set_mo_basis_mo_label('Orthonormalized')
|
||||||
|
ezfio.set_determinants_mo_label('Orthonormalized')
|
||||||
MO_type = MoTag
|
MO_type = MoTag
|
||||||
allMOs = res.mo_sets[MO_type]
|
allMOs = res.mo_sets[MO_type]
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ module Determinants_by_hand : sig
|
|||||||
psi_coef : Det_coef.t array;
|
psi_coef : Det_coef.t array;
|
||||||
psi_det : Determinant.t array;
|
psi_det : Determinant.t array;
|
||||||
state_average_weight : Positive_float.t array;
|
state_average_weight : Positive_float.t array;
|
||||||
|
mo_label : MO_label.t;
|
||||||
} [@@deriving sexp]
|
} [@@deriving sexp]
|
||||||
val read : ?full:bool -> unit -> t option
|
val read : ?full:bool -> unit -> t option
|
||||||
val write : ?force:bool -> t -> unit
|
val write : ?force:bool -> t -> unit
|
||||||
@ -34,11 +35,21 @@ end = struct
|
|||||||
psi_coef : Det_coef.t array;
|
psi_coef : Det_coef.t array;
|
||||||
psi_det : Determinant.t array;
|
psi_det : Determinant.t array;
|
||||||
state_average_weight : Positive_float.t array;
|
state_average_weight : Positive_float.t array;
|
||||||
|
mo_label : MO_label.t;
|
||||||
} [@@deriving sexp]
|
} [@@deriving sexp]
|
||||||
;;
|
;;
|
||||||
|
|
||||||
let get_default = Qpackage.get_ezfio_default "determinants";;
|
let get_default = Qpackage.get_ezfio_default "determinants";;
|
||||||
|
|
||||||
|
let read_mo_label () =
|
||||||
|
if not (Ezfio.has_determinants_mo_label ()) then
|
||||||
|
if Ezfio.has_mo_basis_mo_label () then (
|
||||||
|
let label = Ezfio.get_mo_basis_mo_label () in
|
||||||
|
Ezfio.set_determinants_mo_label label) ;
|
||||||
|
Ezfio.get_determinants_mo_label ()
|
||||||
|
|> MO_label.of_string
|
||||||
|
;;
|
||||||
|
|
||||||
let read_n_int () =
|
let read_n_int () =
|
||||||
if not (Ezfio.has_determinants_n_int()) then
|
if not (Ezfio.has_determinants_n_int()) then
|
||||||
Ezfio.get_mo_basis_mo_num ()
|
Ezfio.get_mo_basis_mo_num ()
|
||||||
@ -290,6 +301,10 @@ end = struct
|
|||||||
Ezfio.set_determinants_psi_det_qp_edit r
|
Ezfio.set_determinants_psi_det_qp_edit r
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
let write_mo_label a =
|
||||||
|
MO_label.to_string a
|
||||||
|
|> Ezfio.set_determinants_mo_label
|
||||||
|
|
||||||
|
|
||||||
let read ?(full=true) () =
|
let read ?(full=true) () =
|
||||||
|
|
||||||
@ -311,6 +326,7 @@ end = struct
|
|||||||
psi_det = read_psi_det ~read_only () ;
|
psi_det = read_psi_det ~read_only () ;
|
||||||
n_states = read_n_states () ;
|
n_states = read_n_states () ;
|
||||||
state_average_weight = read_state_average_weight () ;
|
state_average_weight = read_state_average_weight () ;
|
||||||
|
mo_label = read_mo_label () ;
|
||||||
}
|
}
|
||||||
with _ -> None
|
with _ -> None
|
||||||
else
|
else
|
||||||
@ -328,6 +344,7 @@ end = struct
|
|||||||
psi_det ;
|
psi_det ;
|
||||||
n_states ;
|
n_states ;
|
||||||
state_average_weight ;
|
state_average_weight ;
|
||||||
|
mo_label ;
|
||||||
} =
|
} =
|
||||||
write_n_int n_int ;
|
write_n_int n_int ;
|
||||||
write_bit_kind bit_kind;
|
write_bit_kind bit_kind;
|
||||||
@ -340,7 +357,9 @@ end = struct
|
|||||||
write_psi_coef ~n_det:n_det ~n_states:n_states psi_coef ;
|
write_psi_coef ~n_det:n_det ~n_states:n_states psi_coef ;
|
||||||
write_psi_det ~n_int:n_int ~n_det:n_det psi_det
|
write_psi_det ~n_int:n_int ~n_det:n_det psi_det
|
||||||
end;
|
end;
|
||||||
write_state_average_weight state_average_weight
|
write_state_average_weight state_average_weight ;
|
||||||
|
write_mo_label mo_label ;
|
||||||
|
()
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
||||||
@ -545,6 +564,8 @@ psi_det = %s
|
|||||||
let bitkind =
|
let bitkind =
|
||||||
Printf.sprintf "(bit_kind %d)" (Lazy.force Qpackage.bit_kind
|
Printf.sprintf "(bit_kind %d)" (Lazy.force Qpackage.bit_kind
|
||||||
|> Bit_kind.to_int)
|
|> Bit_kind.to_int)
|
||||||
|
and mo_label =
|
||||||
|
Printf.sprintf "(mo_label %s)" (MO_label.to_string @@ read_mo_label ())
|
||||||
and n_int =
|
and n_int =
|
||||||
Printf.sprintf "(n_int %d)" (N_int_number.get_max ())
|
Printf.sprintf "(n_int %d)" (N_int_number.get_max ())
|
||||||
and n_states =
|
and n_states =
|
||||||
@ -553,7 +574,7 @@ psi_det = %s
|
|||||||
Printf.sprintf "(n_det_qp_edit %d)" (Det_number.to_int @@ read_n_det_qp_edit ())
|
Printf.sprintf "(n_det_qp_edit %d)" (Det_number.to_int @@ read_n_det_qp_edit ())
|
||||||
in
|
in
|
||||||
let s =
|
let s =
|
||||||
String.concat "" [ header ; bitkind ; n_int ; n_states ; psi_coef ; psi_det ; n_det_qp_edit ]
|
String.concat "" [ header ; mo_label ; bitkind ; n_int ; n_states ; psi_coef ; psi_det ; n_det_qp_edit ]
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
|
@ -453,6 +453,36 @@ END_PROVIDER
|
|||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, one_e_dm_ao_alpha_nstates, (ao_num,ao_num,N_states) ]
|
||||||
|
&BEGIN_PROVIDER [ double precision, one_e_dm_ao_beta_nstates, (ao_num,ao_num,N_states) ]
|
||||||
|
BEGIN_DOC
|
||||||
|
! One body density matrix on the |AO| basis : $\rho_{AO}(\alpha), \rho_{AO}(\beta)$.
|
||||||
|
END_DOC
|
||||||
|
implicit none
|
||||||
|
integer :: i,j,k,l,istate
|
||||||
|
double precision :: mo_alpha,mo_beta
|
||||||
|
|
||||||
|
one_e_dm_ao_alpha_nstates = 0.d0
|
||||||
|
one_e_dm_ao_beta_nstates = 0.d0
|
||||||
|
do istate = 1, N_states
|
||||||
|
do k = 1, ao_num
|
||||||
|
do l = 1, ao_num
|
||||||
|
do i = 1, mo_num
|
||||||
|
do j = 1, mo_num
|
||||||
|
mo_alpha = one_e_dm_mo_alpha(j,i,istate)
|
||||||
|
mo_beta = one_e_dm_mo_beta(j,i,istate)
|
||||||
|
! if(dabs(dm_mo).le.1.d-10)cycle
|
||||||
|
one_e_dm_ao_alpha_nstates(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_alpha
|
||||||
|
one_e_dm_ao_beta_nstates(l,k,istate) += mo_coef(k,i) * mo_coef(l,j) * mo_beta
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, one_e_dm_ao, (ao_num, ao_num)]
|
BEGIN_PROVIDER [ double precision, one_e_dm_ao, (ao_num, ao_num)]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
list='ls *.org'
|
|
||||||
for element in $list
|
|
||||||
do
|
|
||||||
emacs --batch $element -f org-babel-tangle
|
|
||||||
done
|
|
@ -18,7 +18,7 @@ default: True
|
|||||||
|
|
||||||
[export_mos]
|
[export_mos]
|
||||||
type: logical
|
type: logical
|
||||||
doc: If True, export basis set and AOs
|
doc: If True, export MO coefficients
|
||||||
interface: ezfio, ocaml, provider
|
interface: ezfio, ocaml, provider
|
||||||
default: True
|
default: True
|
||||||
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
list='ls *.org'
|
|
||||||
for element in $list
|
|
||||||
do
|
|
||||||
emacs --batch $element -f org-babel-tangle
|
|
||||||
done
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
list='ls *.org'
|
|
||||||
for element in $list
|
|
||||||
do
|
|
||||||
emacs --batch $element -f org-babel-tangle
|
|
||||||
done
|
|
Loading…
Reference in New Issue
Block a user