mirror of
https://github.com/QuantumPackage/qp2.git
synced 2024-08-24 21:21:47 +02:00
removed generators bitmaks, and casscf with not continuous orbital windows is working
This commit is contained in:
parent
40239f100c
commit
9ba571a910
@ -6,10 +6,6 @@ module Bitmasks : sig
|
|||||||
type t =
|
type t =
|
||||||
{ n_int : N_int_number.t;
|
{ n_int : N_int_number.t;
|
||||||
bit_kind : Bit_kind.t;
|
bit_kind : Bit_kind.t;
|
||||||
n_mask_gen : Bitmask_number.t;
|
|
||||||
generators : int64 array;
|
|
||||||
n_mask_cas : Bitmask_number.t;
|
|
||||||
cas : int64 array;
|
|
||||||
} [@@deriving sexp]
|
} [@@deriving sexp]
|
||||||
;;
|
;;
|
||||||
val read : unit -> t option
|
val read : unit -> t option
|
||||||
@ -18,12 +14,7 @@ end = struct
|
|||||||
type t =
|
type t =
|
||||||
{ n_int : N_int_number.t;
|
{ n_int : N_int_number.t;
|
||||||
bit_kind : Bit_kind.t;
|
bit_kind : Bit_kind.t;
|
||||||
n_mask_gen : Bitmask_number.t;
|
|
||||||
generators : int64 array;
|
|
||||||
n_mask_cas : Bitmask_number.t;
|
|
||||||
cas : int64 array;
|
|
||||||
} [@@deriving sexp]
|
} [@@deriving sexp]
|
||||||
;;
|
|
||||||
|
|
||||||
let get_default = Qpackage.get_ezfio_default "bitmasks";;
|
let get_default = Qpackage.get_ezfio_default "bitmasks";;
|
||||||
|
|
||||||
@ -36,7 +27,6 @@ end = struct
|
|||||||
;
|
;
|
||||||
Ezfio.get_bitmasks_n_int ()
|
Ezfio.get_bitmasks_n_int ()
|
||||||
|> N_int_number.of_int
|
|> N_int_number.of_int
|
||||||
;;
|
|
||||||
|
|
||||||
let read_bit_kind () =
|
let read_bit_kind () =
|
||||||
if not (Ezfio.has_bitmasks_bit_kind ()) then
|
if not (Ezfio.has_bitmasks_bit_kind ()) then
|
||||||
@ -46,89 +36,12 @@ end = struct
|
|||||||
;
|
;
|
||||||
Ezfio.get_bitmasks_bit_kind ()
|
Ezfio.get_bitmasks_bit_kind ()
|
||||||
|> Bit_kind.of_int
|
|> Bit_kind.of_int
|
||||||
;;
|
|
||||||
|
|
||||||
let read_n_mask_gen () =
|
|
||||||
if not (Ezfio.has_bitmasks_n_mask_gen ()) then
|
|
||||||
Ezfio.set_bitmasks_n_mask_gen 1
|
|
||||||
;
|
|
||||||
Ezfio.get_bitmasks_n_mask_gen ()
|
|
||||||
|> Bitmask_number.of_int
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
|
||||||
let full_mask n_int =
|
|
||||||
let range = "[1-"^
|
|
||||||
(string_of_int (Ezfio.get_mo_basis_mo_num ()))^"]"
|
|
||||||
in
|
|
||||||
MO_class.create_active range
|
|
||||||
|> MO_class.to_bitlist n_int
|
|
||||||
;;
|
|
||||||
|
|
||||||
let read_generators () =
|
|
||||||
if not (Ezfio.has_bitmasks_generators ()) then
|
|
||||||
begin
|
|
||||||
let n_int =
|
|
||||||
read_n_int ()
|
|
||||||
in
|
|
||||||
let act =
|
|
||||||
full_mask n_int
|
|
||||||
in
|
|
||||||
let result = [ act ; act ; act ; act ; act ; act ]
|
|
||||||
|> List.map (fun x ->
|
|
||||||
let y = Bitlist.to_int64_list x in y@y )
|
|
||||||
|> List.concat
|
|
||||||
in
|
|
||||||
let generators = Ezfio.ezfio_array_of_list ~rank:4
|
|
||||||
~dim:([| (N_int_number.to_int n_int) ; 2; 6; 1|]) ~data:result
|
|
||||||
in
|
|
||||||
Ezfio.set_bitmasks_generators generators
|
|
||||||
end;
|
|
||||||
Ezfio.get_bitmasks_generators ()
|
|
||||||
|> Ezfio.flattened_ezfio
|
|
||||||
;;
|
|
||||||
|
|
||||||
let read_n_mask_cas () =
|
|
||||||
if not (Ezfio.has_bitmasks_n_mask_cas ()) then
|
|
||||||
Ezfio.set_bitmasks_n_mask_cas 1
|
|
||||||
;
|
|
||||||
Ezfio.get_bitmasks_n_mask_cas ()
|
|
||||||
|> Bitmask_number.of_int
|
|
||||||
;;
|
|
||||||
|
|
||||||
|
|
||||||
let read_cas () =
|
|
||||||
if not (Ezfio.has_bitmasks_cas ()) then
|
|
||||||
begin
|
|
||||||
let n_int =
|
|
||||||
read_n_int ()
|
|
||||||
in
|
|
||||||
let act =
|
|
||||||
full_mask n_int
|
|
||||||
in
|
|
||||||
let result = [ act ; act ]
|
|
||||||
|> List.map (fun x ->
|
|
||||||
let y = Bitlist.to_int64_list x in y@y )
|
|
||||||
|> List.concat
|
|
||||||
in
|
|
||||||
let cas = Ezfio.ezfio_array_of_list ~rank:3
|
|
||||||
~dim:([| (N_int_number.to_int n_int) ; 2; 1|]) ~data:result
|
|
||||||
in
|
|
||||||
Ezfio.set_bitmasks_cas cas
|
|
||||||
end;
|
|
||||||
Ezfio.get_bitmasks_cas ()
|
|
||||||
|> Ezfio.flattened_ezfio
|
|
||||||
;;
|
|
||||||
|
|
||||||
let read () =
|
let read () =
|
||||||
if (Ezfio.has_mo_basis_mo_num ()) then
|
if (Ezfio.has_mo_basis_mo_num ()) then
|
||||||
Some
|
Some
|
||||||
{ n_int = read_n_int ();
|
{ n_int = read_n_int ();
|
||||||
bit_kind = read_bit_kind ();
|
bit_kind = read_bit_kind ();
|
||||||
n_mask_gen = read_n_mask_gen ();
|
|
||||||
generators = read_generators ();
|
|
||||||
n_mask_cas = read_n_mask_cas ();
|
|
||||||
cas = read_cas ();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
None
|
None
|
||||||
@ -138,21 +51,9 @@ end = struct
|
|||||||
Printf.sprintf "
|
Printf.sprintf "
|
||||||
n_int = %s
|
n_int = %s
|
||||||
bit_kind = %s
|
bit_kind = %s
|
||||||
n_mask_gen = %s
|
|
||||||
generators = %s
|
|
||||||
n_mask_cas = %s
|
|
||||||
cas = %s
|
|
||||||
"
|
"
|
||||||
(N_int_number.to_string b.n_int)
|
(N_int_number.to_string b.n_int)
|
||||||
(Bit_kind.to_string b.bit_kind)
|
(Bit_kind.to_string b.bit_kind)
|
||||||
(Bitmask_number.to_string b.n_mask_gen)
|
|
||||||
(Array.to_list b.generators
|
|
||||||
|> List.map (fun x-> Int64.to_string x)
|
|
||||||
|> String.concat ", ")
|
|
||||||
(Bitmask_number.to_string b.n_mask_cas)
|
|
||||||
(Array.to_list b.cas
|
|
||||||
|> List.map (fun x-> Int64.to_string x)
|
|
||||||
|> String.concat ", ")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,96 +106,6 @@ let set ~core ~inact ~act ~virt ~del =
|
|||||||
MO_class.to_string virt |> print_endline ;
|
MO_class.to_string virt |> print_endline ;
|
||||||
MO_class.to_string del |> print_endline ;
|
MO_class.to_string del |> print_endline ;
|
||||||
|
|
||||||
(* Create masks *)
|
|
||||||
let ia = Excitation.create_single inact act
|
|
||||||
and aa = Excitation.create_single act act
|
|
||||||
and av = Excitation.create_single act virt
|
|
||||||
in
|
|
||||||
let single_excitations = [ ia ; aa ; av ]
|
|
||||||
|> List.map (fun z ->
|
|
||||||
let open Excitation in
|
|
||||||
match z with
|
|
||||||
| Single (x,y) ->
|
|
||||||
( MO_class.to_bitlist n_int (Hole.to_mo_class x),
|
|
||||||
MO_class.to_bitlist n_int (Particle.to_mo_class y) )
|
|
||||||
| Double _ -> assert false
|
|
||||||
)
|
|
||||||
|
|
||||||
and double_excitations = [
|
|
||||||
Excitation.double_of_singles ia ia ;
|
|
||||||
Excitation.double_of_singles ia aa ;
|
|
||||||
Excitation.double_of_singles ia av ;
|
|
||||||
Excitation.double_of_singles aa aa ;
|
|
||||||
Excitation.double_of_singles aa av ;
|
|
||||||
Excitation.double_of_singles av av ]
|
|
||||||
|> List.map (fun x ->
|
|
||||||
let open Excitation in
|
|
||||||
match x with
|
|
||||||
| Single _ -> assert false
|
|
||||||
| Double (x,y,z,t) ->
|
|
||||||
( MO_class.to_bitlist n_int (Hole.to_mo_class x),
|
|
||||||
MO_class.to_bitlist n_int (Particle.to_mo_class y) ,
|
|
||||||
MO_class.to_bitlist n_int (Hole.to_mo_class z),
|
|
||||||
MO_class.to_bitlist n_int (Particle.to_mo_class t) )
|
|
||||||
)
|
|
||||||
in
|
|
||||||
|
|
||||||
let extract_hole (h,_) = h
|
|
||||||
and extract_particle (_,p) = p
|
|
||||||
and extract_hole1 (h,_,_,_) = h
|
|
||||||
and extract_particle1 (_,p,_,_) = p
|
|
||||||
and extract_hole2 (_,_,h,_) = h
|
|
||||||
and extract_particle2 (_,_,_,p) = p
|
|
||||||
in
|
|
||||||
let init = Bitlist.zero n_int in
|
|
||||||
let result = [
|
|
||||||
List.map extract_hole single_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
List.map extract_particle single_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
List.map extract_hole1 double_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
List.map extract_particle1 double_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
List.map extract_hole2 double_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
List.map extract_particle2 double_excitations
|
|
||||||
|> List.fold_left Bitlist.or_operator init;
|
|
||||||
]
|
|
||||||
in
|
|
||||||
|
|
||||||
(* Debug masks in output
|
|
||||||
List.iter ~f:(fun x-> print_endline (Bitlist.to_string x)) result;
|
|
||||||
*)
|
|
||||||
|
|
||||||
(* Write masks *)
|
|
||||||
let result =
|
|
||||||
List.map (fun x ->
|
|
||||||
let y = Bitlist.to_int64_list x in y@y )
|
|
||||||
result
|
|
||||||
|> List.concat
|
|
||||||
in
|
|
||||||
|
|
||||||
Ezfio.set_bitmasks_n_int (N_int_number.to_int n_int);
|
|
||||||
Ezfio.set_bitmasks_bit_kind 8;
|
|
||||||
Ezfio.set_bitmasks_n_mask_gen 1;
|
|
||||||
Ezfio.ezfio_array_of_list ~rank:4 ~dim:([| (N_int_number.to_int n_int) ; 2; 6; 1|]) ~data:result
|
|
||||||
|> Ezfio.set_bitmasks_generators ;
|
|
||||||
|
|
||||||
let result =
|
|
||||||
let open Excitation in
|
|
||||||
match aa with
|
|
||||||
| Double _ -> assert false
|
|
||||||
| Single (x,y) ->
|
|
||||||
Bitlist.to_int64_list
|
|
||||||
( MO_class.to_bitlist n_int ( Hole.to_mo_class x) ) @
|
|
||||||
Bitlist.to_int64_list
|
|
||||||
( MO_class.to_bitlist n_int (Particle.to_mo_class y) )
|
|
||||||
in
|
|
||||||
Ezfio.set_bitmasks_n_mask_cas 1;
|
|
||||||
Ezfio.ezfio_array_of_list ~rank:3 ~dim:([| (N_int_number.to_int n_int) ; 2; 1|]) ~data:result
|
|
||||||
|> Ezfio.set_bitmasks_cas;
|
|
||||||
|
|
||||||
let data =
|
let data =
|
||||||
Array.to_list mo_class
|
Array.to_list mo_class
|
||||||
|> List.map (fun x -> match x with
|
|> List.map (fun x -> match x with
|
||||||
|
@ -78,9 +78,6 @@ let input_data = "
|
|||||||
| _ -> raise (Invalid_argument \"Bit_kind should be (1|2|4|8).\")
|
| _ -> raise (Invalid_argument \"Bit_kind should be (1|2|4|8).\")
|
||||||
end;
|
end;
|
||||||
|
|
||||||
* Bitmask_number : int
|
|
||||||
assert (x > 0) ;
|
|
||||||
|
|
||||||
* MO_coef : float
|
* MO_coef : float
|
||||||
|
|
||||||
* MO_occ : float
|
* MO_occ : float
|
||||||
|
@ -11,12 +11,12 @@ integer function number_of_holes(key_in)
|
|||||||
! key_in(1,1),
|
! key_in(1,1),
|
||||||
! iand(
|
! iand(
|
||||||
! key_in(1,1),
|
! key_in(1,1),
|
||||||
! cas_bitmask(1,1,1))
|
! act_bitmask(1,1))
|
||||||
! )
|
! )
|
||||||
! ),
|
! ),
|
||||||
! reunion_of_core_inact_bitmask(1,1)) )
|
! reunion_of_core_inact_bitmask(1,1)) )
|
||||||
!
|
!
|
||||||
! (key_in && cas_bitmask)
|
! (key_in && act_bitmask)
|
||||||
! +---------------------+
|
! +---------------------+
|
||||||
! electrons in cas xor key_in
|
! electrons in cas xor key_in
|
||||||
! +---------------------------------+
|
! +---------------------------------+
|
||||||
@ -33,32 +33,32 @@ integer function number_of_holes(key_in)
|
|||||||
|
|
||||||
if(N_int == 1)then
|
if(N_int == 1)then
|
||||||
number_of_holes = number_of_holes &
|
number_of_holes = number_of_holes &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) )
|
||||||
else if(N_int == 2)then
|
else if(N_int == 2)then
|
||||||
number_of_holes = number_of_holes &
|
number_of_holes = number_of_holes &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) )
|
||||||
else if(N_int == 3)then
|
else if(N_int == 3)then
|
||||||
number_of_holes = number_of_holes &
|
number_of_holes = number_of_holes &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1)))), reunion_of_core_inact_bitmask(3,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1)))), reunion_of_core_inact_bitmask(3,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1)))), reunion_of_core_inact_bitmask(3,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2)))), reunion_of_core_inact_bitmask(3,2)) )
|
||||||
else if(N_int == 4)then
|
else if(N_int == 4)then
|
||||||
number_of_holes = number_of_holes &
|
number_of_holes = number_of_holes &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1)))), reunion_of_core_inact_bitmask(3,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1)))), reunion_of_core_inact_bitmask(3,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1)))), reunion_of_core_inact_bitmask(3,2)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2)))), reunion_of_core_inact_bitmask(3,2)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,1), xor(key_in(4,1),iand(key_in(4,1),cas_bitmask(4,1,1)))), reunion_of_core_inact_bitmask(4,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,1), xor(key_in(4,1),iand(key_in(4,1),act_bitmask(4,1)))), reunion_of_core_inact_bitmask(4,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,2), xor(key_in(4,2),iand(key_in(4,2),cas_bitmask(4,2,1)))), reunion_of_core_inact_bitmask(4,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,2), xor(key_in(4,2),iand(key_in(4,2),act_bitmask(4,2)))), reunion_of_core_inact_bitmask(4,2)) )
|
||||||
else
|
else
|
||||||
do i = 1, N_int
|
do i = 1, N_int
|
||||||
number_of_holes = number_of_holes &
|
number_of_holes = number_of_holes &
|
||||||
@ -69,11 +69,11 @@ integer function number_of_holes(key_in)
|
|||||||
xor( &
|
xor( &
|
||||||
key_in(i,1), & ! MOs of key_in not in the CAS
|
key_in(i,1), & ! MOs of key_in not in the CAS
|
||||||
iand( & ! MOs of key_in in the CAS
|
iand( & ! MOs of key_in in the CAS
|
||||||
key_in(i,1), cas_bitmask(i,1,1) &
|
key_in(i,1), act_bitmask(i,1) &
|
||||||
) &
|
) &
|
||||||
) &
|
) &
|
||||||
), reunion_of_core_inact_bitmask(i,1)) ) &
|
), reunion_of_core_inact_bitmask(i,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,2), xor(key_in(i,2),iand(key_in(i,2),cas_bitmask(i,2,1)))), reunion_of_core_inact_bitmask(i,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,2), xor(key_in(i,2),iand(key_in(i,2),act_bitmask(i,2)))), reunion_of_core_inact_bitmask(i,2)) )
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
end
|
end
|
||||||
@ -89,37 +89,37 @@ integer function number_of_particles(key_in)
|
|||||||
number_of_particles= 0
|
number_of_particles= 0
|
||||||
if(N_int == 1)then
|
if(N_int == 1)then
|
||||||
number_of_particles= number_of_particles &
|
number_of_particles= number_of_particles &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) )) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ))
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ))
|
||||||
else if(N_int == 2)then
|
else if(N_int == 2)then
|
||||||
number_of_particles= number_of_particles &
|
number_of_particles= number_of_particles &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) ) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) ) ) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ) )
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) ) )
|
||||||
else if(N_int == 3)then
|
else if(N_int == 3)then
|
||||||
number_of_particles= number_of_particles &
|
number_of_particles= number_of_particles &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) )) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) )) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) )) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) )) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) )) &
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) )) &
|
||||||
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1))), virt_bitmask(3,1) )) &
|
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1))), virt_bitmask(3,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1))), virt_bitmask(3,2) ))
|
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2))), virt_bitmask(3,2) ))
|
||||||
else if(N_int == 4)then
|
else if(N_int == 4)then
|
||||||
number_of_particles= number_of_particles &
|
number_of_particles= number_of_particles &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) ) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) ) ) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ) ) &
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1))), virt_bitmask(3,1) ) ) &
|
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1))), virt_bitmask(3,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1))), virt_bitmask(3,2) ) ) &
|
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2))), virt_bitmask(3,2) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(4,1),iand(key_in(4,1),cas_bitmask(4,1,1))), virt_bitmask(4,1) ) ) &
|
+ popcnt( iand( xor(key_in(4,1),iand(key_in(4,1),act_bitmask(4,1))), virt_bitmask(4,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(4,2),iand(key_in(4,2),cas_bitmask(4,2,1))), virt_bitmask(4,2) ) )
|
+ popcnt( iand( xor(key_in(4,2),iand(key_in(4,2),act_bitmask(4,2))), virt_bitmask(4,2) ) )
|
||||||
else
|
else
|
||||||
do i = 1, N_int
|
do i = 1, N_int
|
||||||
number_of_particles= number_of_particles &
|
number_of_particles= number_of_particles &
|
||||||
+ popcnt( iand( xor(key_in(i,1),iand(key_in(i,1),cas_bitmask(i,1,1))), virt_bitmask(i,1) )) &
|
+ popcnt( iand( xor(key_in(i,1),iand(key_in(i,1),act_bitmask(i,1))), virt_bitmask(i,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(i,2),iand(key_in(i,2),cas_bitmask(i,2,1))), virt_bitmask(i,2) ))
|
+ popcnt( iand( xor(key_in(i,2),iand(key_in(i,2),act_bitmask(i,2))), virt_bitmask(i,2) ))
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
end
|
end
|
||||||
@ -128,7 +128,7 @@ logical function is_a_two_holes_two_particles(key_in)
|
|||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! logical function that returns True if the determinant 'key_in'
|
! logical function that returns True if the determinant 'key_in'
|
||||||
! belongs to the 2h-2p excitation class of the DDCI space
|
! belongs to the 2h-2p excitation class of the DDCI space
|
||||||
! this is calculated using the CAS_bitmask that defines the active
|
! this is calculated using the act_bitmask that defines the active
|
||||||
! orbital space, the inact_bitmasl that defines the inactive oribital space
|
! orbital space, the inact_bitmasl that defines the inactive oribital space
|
||||||
! and the virt_bitmask that defines the virtual orbital space
|
! and the virt_bitmask that defines the virtual orbital space
|
||||||
END_DOC
|
END_DOC
|
||||||
@ -144,62 +144,62 @@ logical function is_a_two_holes_two_particles(key_in)
|
|||||||
i_diff = 0
|
i_diff = 0
|
||||||
if(N_int == 1)then
|
if(N_int == 1)then
|
||||||
i_diff = i_diff &
|
i_diff = i_diff &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) )
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) )
|
||||||
else if(N_int == 2)then
|
else if(N_int == 2)then
|
||||||
i_diff = i_diff &
|
i_diff = i_diff &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) ) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) )) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ))
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) ))
|
||||||
|
|
||||||
else if(N_int == 3)then
|
else if(N_int == 3)then
|
||||||
i_diff = i_diff &
|
i_diff = i_diff &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) ) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) ) ) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ) ) &
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1)))), reunion_of_core_inact_bitmask(3,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1)))), reunion_of_core_inact_bitmask(3,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1)))), reunion_of_core_inact_bitmask(3,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2)))), reunion_of_core_inact_bitmask(3,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1))), virt_bitmask(3,1) ) ) &
|
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1))), virt_bitmask(3,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1))), virt_bitmask(3,2) ) )
|
+ popcnt( iand( xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2))), virt_bitmask(3,2) ) )
|
||||||
else if(N_int == 4)then
|
else if(N_int == 4)then
|
||||||
i_diff = i_diff &
|
i_diff = i_diff &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ) ) &
|
+ popcnt( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ) ) &
|
+ popcnt( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,1), xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1)))), reunion_of_core_inact_bitmask(2,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(2,2), xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2)))), reunion_of_core_inact_bitmask(2,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),cas_bitmask(2,1,1))), virt_bitmask(2,1) ) ) &
|
+ popcnt( iand( xor(key_in(2,1),iand(key_in(2,1),act_bitmask(2,1))), virt_bitmask(2,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),cas_bitmask(2,2,1))), virt_bitmask(2,2) ) ) &
|
+ popcnt( iand( xor(key_in(2,2),iand(key_in(2,2),act_bitmask(2,2))), virt_bitmask(2,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1)))), reunion_of_core_inact_bitmask(3,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,1), xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1)))), reunion_of_core_inact_bitmask(3,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),cas_bitmask(3,2,1)))), reunion_of_core_inact_bitmask(3,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(3,2), xor(key_in(3,2),iand(key_in(3,2),act_bitmask(3,2)))), reunion_of_core_inact_bitmask(3,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),cas_bitmask(3,1,1))), virt_bitmask(3,1) ) ) &
|
+ popcnt( iand( xor(key_in(3,1),iand(key_in(3,1),act_bitmask(3,1))), virt_bitmask(3,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(4,2),iand(key_in(3,2),cas_bitmask(3,2,1))), virt_bitmask(3,2) ) ) &
|
+ popcnt( iand( xor(key_in(4,2),iand(key_in(3,2),act_bitmask(3,2))), virt_bitmask(3,2) ) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,1), xor(key_in(4,1),iand(key_in(4,1),cas_bitmask(4,1,1)))), reunion_of_core_inact_bitmask(4,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,1), xor(key_in(4,1),iand(key_in(4,1),act_bitmask(4,1)))), reunion_of_core_inact_bitmask(4,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,2), xor(key_in(4,2),iand(key_in(4,2),cas_bitmask(4,2,1)))), reunion_of_core_inact_bitmask(4,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(4,2), xor(key_in(4,2),iand(key_in(4,2),act_bitmask(4,2)))), reunion_of_core_inact_bitmask(4,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(4,1),iand(key_in(4,1),cas_bitmask(4,1,1))), virt_bitmask(4,1) ) ) &
|
+ popcnt( iand( xor(key_in(4,1),iand(key_in(4,1),act_bitmask(4,1))), virt_bitmask(4,1) ) ) &
|
||||||
+ popcnt( iand( xor(key_in(4,2),iand(key_in(4,2),cas_bitmask(4,2,1))), virt_bitmask(4,2) ) )
|
+ popcnt( iand( xor(key_in(4,2),iand(key_in(4,2),act_bitmask(4,2))), virt_bitmask(4,2) ) )
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
do i = 1, N_int
|
do i = 1, N_int
|
||||||
i_diff = i_diff &
|
i_diff = i_diff &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,1), xor(key_in(i,1),iand(key_in(i,1),cas_bitmask(i,1,1)))), reunion_of_core_inact_bitmask(i,1)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,1), xor(key_in(i,1),iand(key_in(i,1),act_bitmask(i,1)))), reunion_of_core_inact_bitmask(i,1)) ) &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,2), xor(key_in(i,2),iand(key_in(i,2),cas_bitmask(i,2,1)))), reunion_of_core_inact_bitmask(i,2)) ) &
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(i,2), xor(key_in(i,2),iand(key_in(i,2),act_bitmask(i,2)))), reunion_of_core_inact_bitmask(i,2)) ) &
|
||||||
+ popcnt( iand( xor(key_in(i,1),iand(key_in(i,1),cas_bitmask(i,1,1))), virt_bitmask(i,1) )) &
|
+ popcnt( iand( xor(key_in(i,1),iand(key_in(i,1),act_bitmask(i,1))), virt_bitmask(i,1) )) &
|
||||||
+ popcnt( iand( xor(key_in(i,2),iand(key_in(i,2),cas_bitmask(i,2,1))), virt_bitmask(i,2) ))
|
+ popcnt( iand( xor(key_in(i,2),iand(key_in(i,2),act_bitmask(i,2))), virt_bitmask(i,2) ))
|
||||||
enddo
|
enddo
|
||||||
endif
|
endif
|
||||||
is_a_two_holes_two_particles = (i_diff >3)
|
is_a_two_holes_two_particles = (i_diff >3)
|
||||||
@ -220,8 +220,8 @@ integer function number_of_holes_verbose(key_in)
|
|||||||
print*,'jey_in = '
|
print*,'jey_in = '
|
||||||
call debug_det(key_in,N_int)
|
call debug_det(key_in,N_int)
|
||||||
number_of_holes_verbose = 0
|
number_of_holes_verbose = 0
|
||||||
key_tmp(1,1) = xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))
|
key_tmp(1,1) = xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))
|
||||||
key_tmp(1,2) = xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,1,1)))
|
key_tmp(1,2) = xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,1)))
|
||||||
call debug_det(key_tmp,N_int)
|
call debug_det(key_tmp,N_int)
|
||||||
key_tmp(1,1) = iand(key_tmp(1,1),reunion_of_core_inact_bitmask(1,1))
|
key_tmp(1,1) = iand(key_tmp(1,1),reunion_of_core_inact_bitmask(1,1))
|
||||||
key_tmp(1,2) = iand(key_tmp(1,2),reunion_of_core_inact_bitmask(1,2))
|
key_tmp(1,2) = iand(key_tmp(1,2),reunion_of_core_inact_bitmask(1,2))
|
||||||
@ -232,8 +232,8 @@ integer function number_of_holes_verbose(key_in)
|
|||||||
! number_of_holes_verbose = number_of_holes_verbose + popcnt(key_tmp(1,1)) &
|
! number_of_holes_verbose = number_of_holes_verbose + popcnt(key_tmp(1,1)) &
|
||||||
! + popcnt(key_tmp(1,2))
|
! + popcnt(key_tmp(1,2))
|
||||||
number_of_holes_verbose = number_of_holes_verbose &
|
number_of_holes_verbose = number_of_holes_verbose &
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,1), xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1)))), reunion_of_core_inact_bitmask(1,1)) )&
|
||||||
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1)))), reunion_of_core_inact_bitmask(1,2)) )
|
+ popcnt( xor( iand(reunion_of_core_inact_bitmask(1,2), xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2)))), reunion_of_core_inact_bitmask(1,2)) )
|
||||||
print*,'----------------------'
|
print*,'----------------------'
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -250,8 +250,8 @@ integer function number_of_particles_verbose(key_in)
|
|||||||
print*,'jey_in = '
|
print*,'jey_in = '
|
||||||
call debug_det(key_in,N_int)
|
call debug_det(key_in,N_int)
|
||||||
number_of_particles_verbose = 0
|
number_of_particles_verbose = 0
|
||||||
key_tmp(1,1) = xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,1,1)))
|
key_tmp(1,1) = xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,1)))
|
||||||
key_tmp(1,2) = xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,1,1)))
|
key_tmp(1,2) = xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,1)))
|
||||||
call debug_det(key_tmp,N_int)
|
call debug_det(key_tmp,N_int)
|
||||||
key_tmp(1,1) = iand(key_tmp(1,2),virt_bitmask(1,2))
|
key_tmp(1,1) = iand(key_tmp(1,2),virt_bitmask(1,2))
|
||||||
key_tmp(1,2) = iand(key_tmp(1,2),virt_bitmask(1,2))
|
key_tmp(1,2) = iand(key_tmp(1,2),virt_bitmask(1,2))
|
||||||
@ -262,8 +262,8 @@ integer function number_of_particles_verbose(key_in)
|
|||||||
! number_of_particles_verbose = number_of_particles_verbose + popcnt(key_tmp(1,1)) &
|
! number_of_particles_verbose = number_of_particles_verbose + popcnt(key_tmp(1,1)) &
|
||||||
! + popcnt(key_tmp(1,2))
|
! + popcnt(key_tmp(1,2))
|
||||||
number_of_particles_verbose = number_of_particles_verbose &
|
number_of_particles_verbose = number_of_particles_verbose &
|
||||||
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),cas_bitmask(1,1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
|
+ popcnt( iand( iand( xor(key_in(1,1),iand(key_in(1,1),act_bitmask(1,1))), virt_bitmask(1,1) ), virt_bitmask(1,1)) ) &
|
||||||
+ popcnt( iand( iand( xor(key_in(1,2),iand(key_in(1,2),cas_bitmask(1,2,1))), virt_bitmask(1,2) ), virt_bitmask(1,2)) )
|
+ popcnt( iand( iand( xor(key_in(1,2),iand(key_in(1,2),act_bitmask(1,2))), virt_bitmask(1,2) ), virt_bitmask(1,2)) )
|
||||||
end
|
end
|
||||||
|
|
||||||
logical function is_a_1h1p(key_in)
|
logical function is_a_1h1p(key_in)
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
bitmasks
|
bitmasks
|
||||||
N_int integer
|
N_int integer
|
||||||
bit_kind integer
|
bit_kind integer
|
||||||
N_mask_gen integer
|
|
||||||
generators integer*8 (bitmasks_N_int*bitmasks_bit_kind/8,2,6,bitmasks_N_mask_gen)
|
|
||||||
N_mask_cas integer
|
|
||||||
cas integer*8 (bitmasks_N_int*bitmasks_bit_kind/8,2,bitmasks_N_mask_cas)
|
|
||||||
|
|
||||||
|
@ -97,103 +97,9 @@ BEGIN_PROVIDER [ integer(bit_kind), ref_bitmask, (N_int,2)]
|
|||||||
ref_bitmask = HF_bitmask
|
ref_bitmask = HF_bitmask
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, N_generators_bitmask ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Number of bitmasks for generators
|
|
||||||
END_DOC
|
|
||||||
logical :: exists
|
|
||||||
PROVIDE ezfio_filename N_int
|
|
||||||
|
|
||||||
if (mpi_master) then
|
|
||||||
call ezfio_has_bitmasks_N_mask_gen(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_N_mask_gen(N_generators_bitmask)
|
|
||||||
integer :: N_int_check
|
|
||||||
integer :: bit_kind_check
|
|
||||||
call ezfio_get_bitmasks_bit_kind(bit_kind_check)
|
|
||||||
if (bit_kind_check /= bit_kind) then
|
|
||||||
print *, bit_kind_check, bit_kind
|
|
||||||
print *, 'Error: bit_kind is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
call ezfio_get_bitmasks_N_int(N_int_check)
|
|
||||||
if (N_int_check /= N_int) then
|
|
||||||
print *, N_int_check, N_int
|
|
||||||
print *, 'Error: N_int is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
N_generators_bitmask = 1
|
|
||||||
endif
|
|
||||||
ASSERT (N_generators_bitmask > 0)
|
|
||||||
call write_int(6,N_generators_bitmask,'N_generators_bitmask')
|
|
||||||
endif
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( N_generators_bitmask, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read N_generators_bitmask with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
|
|
||||||
END_PROVIDER
|
BEGIN_PROVIDER [ integer(bit_kind), generators_bitmask, (N_int,2,6) ]
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, N_generators_bitmask_restart ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Number of bitmasks for generators
|
|
||||||
END_DOC
|
|
||||||
logical :: exists
|
|
||||||
PROVIDE ezfio_filename N_int
|
|
||||||
|
|
||||||
if (mpi_master) then
|
|
||||||
call ezfio_has_bitmasks_N_mask_gen(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_N_mask_gen(N_generators_bitmask_restart)
|
|
||||||
integer :: N_int_check
|
|
||||||
integer :: bit_kind_check
|
|
||||||
call ezfio_get_bitmasks_bit_kind(bit_kind_check)
|
|
||||||
if (bit_kind_check /= bit_kind) then
|
|
||||||
print *, bit_kind_check, bit_kind
|
|
||||||
print *, 'Error: bit_kind is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
call ezfio_get_bitmasks_N_int(N_int_check)
|
|
||||||
if (N_int_check /= N_int) then
|
|
||||||
print *, N_int_check, N_int
|
|
||||||
print *, 'Error: N_int is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
N_generators_bitmask_restart = 1
|
|
||||||
endif
|
|
||||||
ASSERT (N_generators_bitmask_restart > 0)
|
|
||||||
call write_int(6,N_generators_bitmask_restart,'N_generators_bitmask_restart')
|
|
||||||
endif
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( N_generators_bitmask_restart, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read N_generators_bitmask_restart with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), generators_bitmask_restart, (N_int,2,6,N_generators_bitmask_restart) ]
|
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Bitmasks for generator determinants.
|
! Bitmasks for generator determinants.
|
||||||
@ -215,231 +121,19 @@ BEGIN_PROVIDER [ integer(bit_kind), generators_bitmask_restart, (N_int,2,6,N_gen
|
|||||||
!
|
!
|
||||||
END_DOC
|
END_DOC
|
||||||
logical :: exists
|
logical :: exists
|
||||||
PROVIDE ezfio_filename full_ijkl_bitmask N_generators_bitmask N_int
|
PROVIDE ezfio_filename full_ijkl_bitmask
|
||||||
PROVIDE generators_bitmask_restart
|
|
||||||
|
|
||||||
if (mpi_master) then
|
integer :: ispin, i
|
||||||
call ezfio_has_bitmasks_generators(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_generators(generators_bitmask_restart)
|
|
||||||
else
|
|
||||||
integer :: k, ispin
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do i=1,N_int
|
do i=1,N_int
|
||||||
generators_bitmask_restart(i,ispin,s_hole ,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,s_hole ) = reunion_of_inact_act_bitmask(i,ispin)
|
||||||
generators_bitmask_restart(i,ispin,s_part ,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,s_part ) = reunion_of_act_virt_bitmask(i,ispin)
|
||||||
generators_bitmask_restart(i,ispin,d_hole1,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,d_hole1) = reunion_of_inact_act_bitmask(i,ispin)
|
||||||
generators_bitmask_restart(i,ispin,d_part1,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,d_part1) = reunion_of_act_virt_bitmask(i,ispin)
|
||||||
generators_bitmask_restart(i,ispin,d_hole2,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,d_hole2) = reunion_of_inact_act_bitmask(i,ispin)
|
||||||
generators_bitmask_restart(i,ispin,d_part2,k) = full_ijkl_bitmask(i)
|
generators_bitmask(i,ispin,d_part2) = reunion_of_act_virt_bitmask(i,ispin)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
|
|
||||||
integer :: i
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do ispin=1,2
|
|
||||||
do i=1,N_int
|
|
||||||
generators_bitmask_restart(i,ispin,s_hole ,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,s_hole,k) )
|
|
||||||
generators_bitmask_restart(i,ispin,s_part ,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,s_part,k) )
|
|
||||||
generators_bitmask_restart(i,ispin,d_hole1,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,d_hole1,k) )
|
|
||||||
generators_bitmask_restart(i,ispin,d_part1,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,d_part1,k) )
|
|
||||||
generators_bitmask_restart(i,ispin,d_hole2,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,d_hole2,k) )
|
|
||||||
generators_bitmask_restart(i,ispin,d_part2,k) = iand(full_ijkl_bitmask(i),generators_bitmask_restart(i,ispin,d_part2,k) )
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( generators_bitmask_restart, N_int*2*6*N_generators_bitmask_restart, MPI_BIT_KIND, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read generators_bitmask_restart with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), generators_bitmask, (N_int,2,6,N_generators_bitmask) ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Bitmasks for generator determinants.
|
|
||||||
! (N_int, alpha/beta, hole/particle, generator).
|
|
||||||
!
|
|
||||||
! 3rd index is :
|
|
||||||
!
|
|
||||||
! * 1 : hole for single exc
|
|
||||||
!
|
|
||||||
! * 2 : particle for single exc
|
|
||||||
!
|
|
||||||
! * 3 : hole for 1st exc of double
|
|
||||||
!
|
|
||||||
! * 4 : particle for 1st exc of double
|
|
||||||
!
|
|
||||||
! * 5 : hole for 2nd exc of double
|
|
||||||
!
|
|
||||||
! * 6 : particle for 2nd exc of double
|
|
||||||
!
|
|
||||||
END_DOC
|
|
||||||
logical :: exists
|
|
||||||
PROVIDE ezfio_filename full_ijkl_bitmask N_generators_bitmask
|
|
||||||
|
|
||||||
if (mpi_master) then
|
|
||||||
call ezfio_has_bitmasks_generators(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_generators(generators_bitmask)
|
|
||||||
else
|
|
||||||
integer :: k, ispin, i
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do ispin=1,2
|
|
||||||
do i=1,N_int
|
|
||||||
generators_bitmask(i,ispin,s_hole ,k) = full_ijkl_bitmask(i)
|
|
||||||
generators_bitmask(i,ispin,s_part ,k) = full_ijkl_bitmask(i)
|
|
||||||
generators_bitmask(i,ispin,d_hole1,k) = full_ijkl_bitmask(i)
|
|
||||||
generators_bitmask(i,ispin,d_part1,k) = full_ijkl_bitmask(i)
|
|
||||||
generators_bitmask(i,ispin,d_hole2,k) = full_ijkl_bitmask(i)
|
|
||||||
generators_bitmask(i,ispin,d_part2,k) = full_ijkl_bitmask(i)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do ispin=1,2
|
|
||||||
do i=1,N_int
|
|
||||||
generators_bitmask(i,ispin,s_hole ,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,s_hole,k) )
|
|
||||||
generators_bitmask(i,ispin,s_part ,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,s_part,k) )
|
|
||||||
generators_bitmask(i,ispin,d_hole1,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,d_hole1,k) )
|
|
||||||
generators_bitmask(i,ispin,d_part1,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,d_part1,k) )
|
|
||||||
generators_bitmask(i,ispin,d_hole2,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,d_hole2,k) )
|
|
||||||
generators_bitmask(i,ispin,d_part2,k) = iand(full_ijkl_bitmask(i),generators_bitmask(i,ispin,d_part2,k) )
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( generators_bitmask, N_int*2*6*N_generators_bitmask, MPI_BIT_KIND, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read generators_bitmask with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, N_cas_bitmask ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Number of bitmasks for CAS
|
|
||||||
END_DOC
|
|
||||||
logical :: exists
|
|
||||||
PROVIDE ezfio_filename
|
|
||||||
PROVIDE N_cas_bitmask N_int
|
|
||||||
if (mpi_master) then
|
|
||||||
call ezfio_has_bitmasks_N_mask_cas(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_N_mask_cas(N_cas_bitmask)
|
|
||||||
integer :: N_int_check
|
|
||||||
integer :: bit_kind_check
|
|
||||||
call ezfio_get_bitmasks_bit_kind(bit_kind_check)
|
|
||||||
if (bit_kind_check /= bit_kind) then
|
|
||||||
print *, bit_kind_check, bit_kind
|
|
||||||
print *, 'Error: bit_kind is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
call ezfio_get_bitmasks_N_int(N_int_check)
|
|
||||||
if (N_int_check /= N_int) then
|
|
||||||
print *, N_int_check, N_int
|
|
||||||
print *, 'Error: N_int is not correct in EZFIO file'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
N_cas_bitmask = 1
|
|
||||||
endif
|
|
||||||
call write_int(6,N_cas_bitmask,'N_cas_bitmask')
|
|
||||||
endif
|
|
||||||
ASSERT (N_cas_bitmask > 0)
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( N_cas_bitmask, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read N_cas_bitmask with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), cas_bitmask, (N_int,2,N_cas_bitmask) ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Bitmasks for CAS reference determinants. (N_int, alpha/beta, CAS reference)
|
|
||||||
END_DOC
|
|
||||||
logical :: exists
|
|
||||||
integer :: i,i_part,i_gen,j,k
|
|
||||||
PROVIDE ezfio_filename generators_bitmask_restart full_ijkl_bitmask
|
|
||||||
PROVIDE n_generators_bitmask HF_bitmask
|
|
||||||
|
|
||||||
if (mpi_master) then
|
|
||||||
call ezfio_has_bitmasks_cas(exists)
|
|
||||||
if (exists) then
|
|
||||||
call ezfio_get_bitmasks_cas(cas_bitmask)
|
|
||||||
else
|
|
||||||
if(N_generators_bitmask == 1)then
|
|
||||||
do j=1, N_cas_bitmask
|
|
||||||
do i=1, N_int
|
|
||||||
cas_bitmask(i,1,j) = iand(not(HF_bitmask(i,1)),full_ijkl_bitmask(i))
|
|
||||||
cas_bitmask(i,2,j) = iand(not(HF_bitmask(i,2)),full_ijkl_bitmask(i))
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
else
|
|
||||||
i_part = 2
|
|
||||||
i_gen = 1
|
|
||||||
do j=1, N_cas_bitmask
|
|
||||||
do i=1, N_int
|
|
||||||
cas_bitmask(i,1,j) = generators_bitmask_restart(i,1,i_part,i_gen)
|
|
||||||
cas_bitmask(i,2,j) = generators_bitmask_restart(i,2,i_part,i_gen)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
do i=1,N_cas_bitmask
|
|
||||||
do j = 1, N_cas_bitmask
|
|
||||||
do k=1,N_int
|
|
||||||
cas_bitmask(k,j,i) = iand(cas_bitmask(k,j,i),full_ijkl_bitmask(k))
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
write(*,*) 'Read CAS bitmask'
|
|
||||||
endif
|
|
||||||
IRP_IF MPI_DEBUG
|
|
||||||
print *, irp_here, mpi_rank
|
|
||||||
call MPI_BARRIER(MPI_COMM_WORLD, ierr)
|
|
||||||
IRP_ENDIF
|
|
||||||
IRP_IF MPI
|
|
||||||
include 'mpif.h'
|
|
||||||
integer :: ierr
|
|
||||||
call MPI_BCAST( cas_bitmask, N_int*2*N_cas_bitmask, MPI_BIT_KIND, 0, MPI_COMM_WORLD, ierr)
|
|
||||||
if (ierr /= MPI_SUCCESS) then
|
|
||||||
stop 'Unable to read cas_bitmask with MPI'
|
|
||||||
endif
|
|
||||||
IRP_ENDIF
|
|
||||||
|
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -469,6 +163,19 @@ BEGIN_PROVIDER [integer(bit_kind), reunion_of_inact_act_bitmask, (N_int,2)]
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [integer(bit_kind), reunion_of_act_virt_bitmask, (N_int,2)]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Reunion of the inactive and active bitmasks
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j
|
||||||
|
|
||||||
|
do i = 1, N_int
|
||||||
|
reunion_of_act_virt_bitmask(i,1) = ior(virt_bitmask(i,1),act_bitmask(i,1))
|
||||||
|
reunion_of_act_virt_bitmask(i,2) = ior(virt_bitmask(i,2),act_bitmask(i,2))
|
||||||
|
enddo
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [integer(bit_kind), reunion_of_core_inact_act_bitmask, (N_int,2)]
|
BEGIN_PROVIDER [integer(bit_kind), reunion_of_core_inact_act_bitmask, (N_int,2)]
|
||||||
implicit none
|
implicit none
|
||||||
@ -491,8 +198,8 @@ BEGIN_PROVIDER [ integer(bit_kind), reunion_of_bitmask, (N_int,2)]
|
|||||||
END_DOC
|
END_DOC
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
do i = 1, N_int
|
do i = 1, N_int
|
||||||
reunion_of_bitmask(i,1) = ior(ior(cas_bitmask(i,1,1),inact_bitmask(i,1)),virt_bitmask(i,1))
|
reunion_of_bitmask(i,1) = ior(ior(act_bitmask(i,1),inact_bitmask(i,1)),virt_bitmask(i,1))
|
||||||
reunion_of_bitmask(i,2) = ior(ior(cas_bitmask(i,2,1),inact_bitmask(i,2)),virt_bitmask(i,2))
|
reunion_of_bitmask(i,2) = ior(ior(act_bitmask(i,2),inact_bitmask(i,2)),virt_bitmask(i,2))
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
@ -512,14 +219,6 @@ END_PROVIDER
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer, i_bitmask_gen ]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Current bitmask for the generators
|
|
||||||
END_DOC
|
|
||||||
i_bitmask_gen = 1
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), unpaired_alpha_electrons, (N_int)]
|
BEGIN_PROVIDER [ integer(bit_kind), unpaired_alpha_electrons, (N_int)]
|
||||||
implicit none
|
implicit none
|
||||||
@ -537,21 +236,7 @@ BEGIN_PROVIDER [integer(bit_kind), closed_shell_ref_bitmask, (N_int,2)]
|
|||||||
implicit none
|
implicit none
|
||||||
integer :: i,j
|
integer :: i,j
|
||||||
do i = 1, N_int
|
do i = 1, N_int
|
||||||
closed_shell_ref_bitmask(i,1) = ior(ref_bitmask(i,1),cas_bitmask(i,1,1))
|
closed_shell_ref_bitmask(i,1) = ior(ref_bitmask(i,1),act_bitmask(i,1))
|
||||||
closed_shell_ref_bitmask(i,2) = ior(ref_bitmask(i,2),cas_bitmask(i,2,1))
|
closed_shell_ref_bitmask(i,2) = ior(ref_bitmask(i,2),act_bitmask(i,2))
|
||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), reunion_of_cas_inact_bitmask, (N_int,2)]
|
|
||||||
implicit none
|
|
||||||
BEGIN_DOC
|
|
||||||
! Reunion of the inactive, active and virtual bitmasks
|
|
||||||
END_DOC
|
|
||||||
integer :: i,j
|
|
||||||
do i = 1, N_int
|
|
||||||
reunion_of_cas_inact_bitmask(i,1) = ior(act_bitmask(i,1),inact_bitmask(i,1))
|
|
||||||
reunion_of_cas_inact_bitmask(i,2) = ior(act_bitmask(i,2),inact_bitmask(i,2))
|
|
||||||
enddo
|
|
||||||
END_PROVIDER
|
|
||||||
|
|
||||||
|
@ -177,43 +177,67 @@ END_PROVIDER
|
|||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [ integer(bit_kind), core_bitmask , (N_int,2) ]
|
BEGIN_PROVIDER [ integer(bit_kind), core_bitmask , (N_int,2) ]
|
||||||
&BEGIN_PROVIDER [ integer(bit_kind), inact_bitmask, (N_int,2) ]
|
|
||||||
&BEGIN_PROVIDER [ integer(bit_kind), act_bitmask , (N_int,2) ]
|
|
||||||
&BEGIN_PROVIDER [ integer(bit_kind), virt_bitmask , (N_int,2) ]
|
|
||||||
&BEGIN_PROVIDER [ integer(bit_kind), del_bitmask , (N_int,2) ]
|
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Bitmask identifying the core/inactive/active/virtual/deleted MOs
|
! Bitmask identifying the core MOs
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
core_bitmask = 0_bit_kind
|
core_bitmask = 0_bit_kind
|
||||||
inact_bitmask = 0_bit_kind
|
|
||||||
act_bitmask = 0_bit_kind
|
|
||||||
virt_bitmask = 0_bit_kind
|
|
||||||
del_bitmask = 0_bit_kind
|
|
||||||
|
|
||||||
if(n_core_orb > 0)then
|
if(n_core_orb > 0)then
|
||||||
call list_to_bitstring( core_bitmask(1,1), list_core, n_core_orb, N_int)
|
call list_to_bitstring( core_bitmask(1,1), list_core, n_core_orb, N_int)
|
||||||
call list_to_bitstring( core_bitmask(1,2), list_core, n_core_orb, N_int)
|
call list_to_bitstring( core_bitmask(1,2), list_core, n_core_orb, N_int)
|
||||||
endif
|
endif
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), inact_bitmask, (N_int,2) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Bitmask identifying the inactive MOs
|
||||||
|
END_DOC
|
||||||
|
inact_bitmask = 0_bit_kind
|
||||||
if(n_inact_orb > 0)then
|
if(n_inact_orb > 0)then
|
||||||
call list_to_bitstring( inact_bitmask(1,1), list_inact, n_inact_orb, N_int)
|
call list_to_bitstring( inact_bitmask(1,1), list_inact, n_inact_orb, N_int)
|
||||||
call list_to_bitstring( inact_bitmask(1,2), list_inact, n_inact_orb, N_int)
|
call list_to_bitstring( inact_bitmask(1,2), list_inact, n_inact_orb, N_int)
|
||||||
endif
|
endif
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), act_bitmask , (N_int,2) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Bitmask identifying the active MOs
|
||||||
|
END_DOC
|
||||||
|
act_bitmask = 0_bit_kind
|
||||||
if(n_act_orb > 0)then
|
if(n_act_orb > 0)then
|
||||||
call list_to_bitstring( act_bitmask(1,1), list_act, n_act_orb, N_int)
|
call list_to_bitstring( act_bitmask(1,1), list_act, n_act_orb, N_int)
|
||||||
call list_to_bitstring( act_bitmask(1,2), list_act, n_act_orb, N_int)
|
call list_to_bitstring( act_bitmask(1,2), list_act, n_act_orb, N_int)
|
||||||
endif
|
endif
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), virt_bitmask , (N_int,2) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Bitmask identifying the virtual MOs
|
||||||
|
END_DOC
|
||||||
|
virt_bitmask = 0_bit_kind
|
||||||
if(n_virt_orb > 0)then
|
if(n_virt_orb > 0)then
|
||||||
call list_to_bitstring( virt_bitmask(1,1), list_virt, n_virt_orb, N_int)
|
call list_to_bitstring( virt_bitmask(1,1), list_virt, n_virt_orb, N_int)
|
||||||
call list_to_bitstring( virt_bitmask(1,2), list_virt, n_virt_orb, N_int)
|
call list_to_bitstring( virt_bitmask(1,2), list_virt, n_virt_orb, N_int)
|
||||||
endif
|
endif
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ integer(bit_kind), del_bitmask , (N_int,2) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! Bitmask identifying the deleted MOs
|
||||||
|
END_DOC
|
||||||
|
|
||||||
|
del_bitmask = 0_bit_kind
|
||||||
|
|
||||||
if(n_del_orb > 0)then
|
if(n_del_orb > 0)then
|
||||||
call list_to_bitstring( del_bitmask(1,1), list_del, n_del_orb, N_int)
|
call list_to_bitstring( del_bitmask(1,1), list_del, n_del_orb, N_int)
|
||||||
call list_to_bitstring( del_bitmask(1,2), list_del, n_del_orb, N_int)
|
call list_to_bitstring( del_bitmask(1,2), list_del, n_del_orb, N_int)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -331,7 +355,6 @@ END_PROVIDER
|
|||||||
enddo
|
enddo
|
||||||
print *, 'Active MOs:'
|
print *, 'Active MOs:'
|
||||||
print *, list_act(1:n_act_orb)
|
print *, list_act(1:n_act_orb)
|
||||||
print*, list_act_reverse(1:n_act_orb)
|
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
@ -1,26 +1,5 @@
|
|||||||
|
|
||||||
use bitmasks
|
use bitmasks
|
||||||
subroutine initialize_bitmask_to_restart_ones
|
|
||||||
implicit none
|
|
||||||
integer :: i,j,k,l,m
|
|
||||||
integer :: ispin
|
|
||||||
BEGIN_DOC
|
|
||||||
! Initialization of the generators_bitmask to the restart bitmask
|
|
||||||
END_DOC
|
|
||||||
do i = 1, N_int
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do ispin=1,2
|
|
||||||
generators_bitmask(i,ispin,s_hole ,k) = generators_bitmask_restart(i,ispin,s_hole ,k)
|
|
||||||
generators_bitmask(i,ispin,s_part ,k) = generators_bitmask_restart(i,ispin,s_part ,k)
|
|
||||||
generators_bitmask(i,ispin,d_hole1,k) = generators_bitmask_restart(i,ispin,d_hole1,k)
|
|
||||||
generators_bitmask(i,ispin,d_part1,k) = generators_bitmask_restart(i,ispin,d_part1,k)
|
|
||||||
generators_bitmask(i,ispin,d_hole2,k) = generators_bitmask_restart(i,ispin,d_hole2,k)
|
|
||||||
generators_bitmask(i,ispin,d_part2,k) = generators_bitmask_restart(i,ispin,d_part2,k)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
subroutine modify_bitmasks_for_hole(i_hole)
|
subroutine modify_bitmasks_for_hole(i_hole)
|
||||||
implicit none
|
implicit none
|
||||||
@ -33,25 +12,21 @@ subroutine modify_bitmasks_for_hole(i_hole)
|
|||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
! Set to Zero the holes
|
! Set to Zero the holes
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_holes_bitmask(l)
|
i = index_holes_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
generators_bitmask(j,ispin,i,k) = 0_bit_kind
|
generators_bitmask(j,ispin,i) = 0_bit_kind
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
k = shiftr(i_hole-1,bit_kind_shift)+1
|
k = shiftr(i_hole-1,bit_kind_shift)+1
|
||||||
j = i_hole-shiftl(k-1,bit_kind_shift)-1
|
j = i_hole-shiftl(k-1,bit_kind_shift)-1
|
||||||
do m = 1, N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_holes_bitmask(l)
|
i = index_holes_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
generators_bitmask(k,ispin,i,m) = ibset(generators_bitmask(k,ispin,i,m),j)
|
generators_bitmask(k,ispin,i) = ibset(generators_bitmask(k,ispin,i),j)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -69,12 +44,10 @@ subroutine modify_bitmasks_for_hole_in_out(i_hole)
|
|||||||
|
|
||||||
k = shiftr(i_hole-1,bit_kind_shift)+1
|
k = shiftr(i_hole-1,bit_kind_shift)+1
|
||||||
j = i_hole-shiftl(k-1,bit_kind_shift)-1
|
j = i_hole-shiftl(k-1,bit_kind_shift)-1
|
||||||
do m = 1, N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_holes_bitmask(l)
|
i = index_holes_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
generators_bitmask(k,ispin,i,m) = ibset(generators_bitmask(k,ispin,i,m),j)
|
generators_bitmask(k,ispin,i) = ibset(generators_bitmask(k,ispin,i),j)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -91,48 +64,42 @@ subroutine modify_bitmasks_for_particl(i_part)
|
|||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
! Set to Zero the particles
|
! Set to Zero the particles
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_particl_bitmask(l)
|
i = index_particl_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
generators_bitmask(j,ispin,i,k) = 0_bit_kind
|
generators_bitmask(j,ispin,i) = 0_bit_kind
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
k = shiftr(i_part-1,bit_kind_shift)+1
|
k = shiftr(i_part-1,bit_kind_shift)+1
|
||||||
j = i_part-shiftl(k-1,bit_kind_shift)-1
|
j = i_part-shiftl(k-1,bit_kind_shift)-1
|
||||||
do m = 1, N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_particl_bitmask(l)
|
i = index_particl_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
generators_bitmask(k,ispin,i,m) = ibset(generators_bitmask(k,ispin,i,m),j)
|
generators_bitmask(k,ispin,i) = ibset(generators_bitmask(k,ispin,i),j)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
subroutine set_bitmask_particl_as_input(input_bimask)
|
subroutine set_bitmask_particl_as_input(input_bitmask)
|
||||||
implicit none
|
implicit none
|
||||||
integer(bit_kind), intent(in) :: input_bimask(N_int,2)
|
integer(bit_kind), intent(in) :: input_bitmask(N_int,2)
|
||||||
integer :: i,j,k,l,m
|
integer :: i,j,k,l,m
|
||||||
integer :: ispin
|
integer :: ispin
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! set the generators_bitmask for the particles
|
! set the generators_bitmask for the particles
|
||||||
! as the input_bimask
|
! as the input_bitmask
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_particl_bitmask(l)
|
i = index_particl_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
generators_bitmask(j,ispin,i,k) = input_bimask(j,ispin)
|
generators_bitmask(j,ispin,i) = input_bitmask(j,ispin)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -141,23 +108,21 @@ subroutine set_bitmask_particl_as_input(input_bimask)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
subroutine set_bitmask_hole_as_input(input_bimask)
|
subroutine set_bitmask_hole_as_input(input_bitmask)
|
||||||
implicit none
|
implicit none
|
||||||
integer(bit_kind), intent(in) :: input_bimask(N_int,2)
|
integer(bit_kind), intent(in) :: input_bitmask(N_int,2)
|
||||||
integer :: i,j,k,l,m
|
integer :: i,j,k,l,m
|
||||||
integer :: ispin
|
integer :: ispin
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! set the generators_bitmask for the holes
|
! set the generators_bitmask for the holes
|
||||||
! as the input_bimask
|
! as the input_bitmask
|
||||||
END_DOC
|
END_DOC
|
||||||
|
|
||||||
do k=1,N_generators_bitmask
|
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
i = index_holes_bitmask(l)
|
i = index_holes_bitmask(l)
|
||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
generators_bitmask(j,ispin,i,k) = input_bimask(j,ispin)
|
generators_bitmask(j,ispin,i) = input_bitmask(j,ispin)
|
||||||
enddo
|
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -173,11 +138,10 @@ subroutine print_generators_bitmasks_holes
|
|||||||
|
|
||||||
allocate(key_tmp(N_int,2))
|
allocate(key_tmp(N_int,2))
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
k = 1
|
|
||||||
i = index_holes_bitmask(l)
|
i = index_holes_bitmask(l)
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
key_tmp(j,1) = generators_bitmask(j,1,i,k)
|
key_tmp(j,1) = generators_bitmask(j,1,i)
|
||||||
key_tmp(j,2) = generators_bitmask(j,2,i,k)
|
key_tmp(j,2) = generators_bitmask(j,2,i)
|
||||||
enddo
|
enddo
|
||||||
print*,''
|
print*,''
|
||||||
print*,'index hole = ',i
|
print*,'index hole = ',i
|
||||||
@ -195,57 +159,10 @@ subroutine print_generators_bitmasks_particles
|
|||||||
|
|
||||||
allocate(key_tmp(N_int,2))
|
allocate(key_tmp(N_int,2))
|
||||||
do l = 1, 3
|
do l = 1, 3
|
||||||
k = 1
|
|
||||||
i = index_particl_bitmask(l)
|
i = index_particl_bitmask(l)
|
||||||
do j = 1, N_int
|
do j = 1, N_int
|
||||||
key_tmp(j,1) = generators_bitmask(j,1,i,k)
|
key_tmp(j,1) = generators_bitmask(j,1,i)
|
||||||
key_tmp(j,2) = generators_bitmask(j,2,i,k)
|
key_tmp(j,2) = generators_bitmask(j,2,i)
|
||||||
enddo
|
|
||||||
print*,''
|
|
||||||
print*,'index particl ',i
|
|
||||||
call print_det(key_tmp,N_int)
|
|
||||||
print*,''
|
|
||||||
enddo
|
|
||||||
deallocate(key_tmp)
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
subroutine print_generators_bitmasks_holes_for_one_generator(i_gen)
|
|
||||||
implicit none
|
|
||||||
integer, intent(in) :: i_gen
|
|
||||||
integer :: i,j,k,l
|
|
||||||
integer(bit_kind),allocatable :: key_tmp(:,:)
|
|
||||||
|
|
||||||
allocate(key_tmp(N_int,2))
|
|
||||||
do l = 1, 3
|
|
||||||
k = i_gen
|
|
||||||
i = index_holes_bitmask(l)
|
|
||||||
do j = 1, N_int
|
|
||||||
key_tmp(j,1) = generators_bitmask(j,1,i,k)
|
|
||||||
key_tmp(j,2) = generators_bitmask(j,2,i,k)
|
|
||||||
enddo
|
|
||||||
print*,''
|
|
||||||
print*,'index hole = ',i
|
|
||||||
call print_det(key_tmp,N_int)
|
|
||||||
print*,''
|
|
||||||
enddo
|
|
||||||
deallocate(key_tmp)
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
subroutine print_generators_bitmasks_particles_for_one_generator(i_gen)
|
|
||||||
implicit none
|
|
||||||
integer, intent(in) :: i_gen
|
|
||||||
integer :: i,j,k,l
|
|
||||||
integer(bit_kind),allocatable :: key_tmp(:,:)
|
|
||||||
|
|
||||||
allocate(key_tmp(N_int,2))
|
|
||||||
do l = 1, 3
|
|
||||||
k = i_gen
|
|
||||||
i = index_particl_bitmask(l)
|
|
||||||
do j = 1, N_int
|
|
||||||
key_tmp(j,1) = generators_bitmask(j,1,i,k)
|
|
||||||
key_tmp(j,2) = generators_bitmask(j,2,i,k)
|
|
||||||
enddo
|
enddo
|
||||||
print*,''
|
print*,''
|
||||||
print*,'index particl ',i
|
print*,'index particl ',i
|
||||||
@ -257,7 +174,7 @@ subroutine print_generators_bitmasks_particles_for_one_generator(i_gen)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
BEGIN_PROVIDER [integer, index_holes_bitmask, (3)]
|
BEGIN_PROVIDER [integer, index_holes_bitmask, (3)]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! Index of the holes in the generators_bitmasks
|
! Index of the holes in the generators_bitmasks
|
||||||
|
@ -3,6 +3,7 @@ program casscf
|
|||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
! TODO : Put the documentation of the program here
|
! TODO : Put the documentation of the program here
|
||||||
END_DOC
|
END_DOC
|
||||||
|
call reorder_orbitals_for_casscf
|
||||||
no_vvvv_integrals = .True.
|
no_vvvv_integrals = .True.
|
||||||
pt2_max = 0.02
|
pt2_max = 0.02
|
||||||
SOFT_TOUCH no_vvvv_integrals pt2_max
|
SOFT_TOUCH no_vvvv_integrals pt2_max
|
||||||
@ -37,6 +38,7 @@ subroutine run
|
|||||||
pt2_max = dabs(energy_improvement / pt2_relative_error)
|
pt2_max = dabs(energy_improvement / pt2_relative_error)
|
||||||
|
|
||||||
mo_coef = NewOrbs
|
mo_coef = NewOrbs
|
||||||
|
mo_occ = occnum
|
||||||
call save_mos
|
call save_mos
|
||||||
iteration += 1
|
iteration += 1
|
||||||
N_det = N_det/2
|
N_det = N_det/2
|
||||||
|
70
src/casscf/reorder_orb.irp.f
Normal file
70
src/casscf/reorder_orb.irp.f
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
subroutine reorder_orbitals_for_casscf
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! routine that reorders the orbitals of the CASSCF in terms block of core, active and virtual
|
||||||
|
END_DOC
|
||||||
|
integer :: i,j,iorb
|
||||||
|
integer, allocatable :: iorder(:),array(:)
|
||||||
|
allocate(iorder(mo_num),array(mo_num))
|
||||||
|
do i = 1, n_core_orb
|
||||||
|
iorb = list_core(i)
|
||||||
|
array(iorb) = i
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do i = 1, n_inact_orb
|
||||||
|
iorb = list_inact(i)
|
||||||
|
array(iorb) = mo_num + i
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do i = 1, n_act_orb
|
||||||
|
iorb = list_act(i)
|
||||||
|
array(iorb) = 2 * mo_num + i
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do i = 1, n_virt_orb
|
||||||
|
iorb = list_virt(i)
|
||||||
|
array(iorb) = 3 * mo_num + i
|
||||||
|
enddo
|
||||||
|
|
||||||
|
do i = 1, mo_num
|
||||||
|
iorder(i) = i
|
||||||
|
enddo
|
||||||
|
call isort(array,iorder,mo_num)
|
||||||
|
double precision, allocatable :: mo_coef_new(:,:)
|
||||||
|
allocate(mo_coef_new(ao_num,mo_num))
|
||||||
|
do i = 1, mo_num
|
||||||
|
mo_coef_new(:,i) = mo_coef(:,iorder(i))
|
||||||
|
enddo
|
||||||
|
mo_coef = mo_coef_new
|
||||||
|
touch mo_coef
|
||||||
|
|
||||||
|
list_core_reverse = 0
|
||||||
|
do i = 1, n_core_orb
|
||||||
|
list_core(i) = i
|
||||||
|
list_core_reverse(i) = i
|
||||||
|
mo_class(i) = "Core"
|
||||||
|
enddo
|
||||||
|
|
||||||
|
list_inact_reverse = 0
|
||||||
|
do i = 1, n_inact_orb
|
||||||
|
list_inact(i) = i + n_core_orb
|
||||||
|
list_inact_reverse(i+n_core_orb) = i
|
||||||
|
mo_class(i+n_core_orb) = "Inactive"
|
||||||
|
enddo
|
||||||
|
|
||||||
|
list_act_reverse = 0
|
||||||
|
do i = 1, n_act_orb
|
||||||
|
list_act(i) = n_core_inact_orb + i
|
||||||
|
list_act_reverse(n_core_inact_orb + i) = i
|
||||||
|
mo_class(n_core_inact_orb + i) = "Active"
|
||||||
|
enddo
|
||||||
|
|
||||||
|
list_virt_reverse = 0
|
||||||
|
do i = 1, n_virt_orb
|
||||||
|
list_virt(i) = n_core_inact_orb + n_act_orb + i
|
||||||
|
list_virt_reverse(n_core_inact_orb + n_act_orb + i) = i
|
||||||
|
mo_class(n_core_inact_orb + n_act_orb + i) = "Virtual"
|
||||||
|
enddo
|
||||||
|
touch list_core_reverse list_core list_inact list_inact_reverse list_act list_act_reverse list_virt list_virt_reverse
|
||||||
|
|
||||||
|
end
|
@ -129,7 +129,7 @@ subroutine ZMQ_pt2(E, pt2,relative_error, error, variance, norm, N_in)
|
|||||||
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
PROVIDE psi_bilinear_matrix_rows psi_det_sorted_order psi_bilinear_matrix_order
|
||||||
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
PROVIDE psi_bilinear_matrix_transp_rows_loc psi_bilinear_matrix_transp_columns
|
||||||
PROVIDE psi_bilinear_matrix_transp_order psi_selectors_coef_transp psi_det_sorted
|
PROVIDE psi_bilinear_matrix_transp_order psi_selectors_coef_transp psi_det_sorted
|
||||||
PROVIDE psi_det_hii N_generators_bitmask selection_weight pseudo_sym
|
PROVIDE psi_det_hii selection_weight pseudo_sym
|
||||||
|
|
||||||
if (h0_type == 'SOP') then
|
if (h0_type == 'SOP') then
|
||||||
PROVIDE psi_occ_pattern_hii det_to_occ_pattern
|
PROVIDE psi_occ_pattern_hii det_to_occ_pattern
|
||||||
|
@ -173,15 +173,13 @@ subroutine select_connected(i_generator,E0,pt2,variance,norm,b,subset,csubset)
|
|||||||
|
|
||||||
call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int)
|
call build_fock_tmp(fock_diag_tmp,psi_det_generators(1,1,i_generator),N_int)
|
||||||
|
|
||||||
do l=1,N_generators_bitmask
|
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
hole_mask(k,1) = iand(generators_bitmask(k,1,s_hole,l), psi_det_generators(k,1,i_generator))
|
hole_mask(k,1) = iand(generators_bitmask(k,1,s_hole), psi_det_generators(k,1,i_generator))
|
||||||
hole_mask(k,2) = iand(generators_bitmask(k,2,s_hole,l), psi_det_generators(k,2,i_generator))
|
hole_mask(k,2) = iand(generators_bitmask(k,2,s_hole), psi_det_generators(k,2,i_generator))
|
||||||
particle_mask(k,1) = iand(generators_bitmask(k,1,s_part,l), not(psi_det_generators(k,1,i_generator)) )
|
particle_mask(k,1) = iand(generators_bitmask(k,1,s_part), not(psi_det_generators(k,1,i_generator)) )
|
||||||
particle_mask(k,2) = iand(generators_bitmask(k,2,s_part,l), not(psi_det_generators(k,2,i_generator)) )
|
particle_mask(k,2) = iand(generators_bitmask(k,2,s_part), not(psi_det_generators(k,2,i_generator)) )
|
||||||
enddo
|
enddo
|
||||||
call select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,b,subset,csubset)
|
call select_singles_and_doubles(i_generator,hole_mask,particle_mask,fock_diag_tmp,E0,pt2,variance,norm,b,subset,csubset)
|
||||||
enddo
|
|
||||||
deallocate(fock_diag_tmp)
|
deallocate(fock_diag_tmp)
|
||||||
end subroutine
|
end subroutine
|
||||||
|
|
||||||
|
@ -198,6 +198,7 @@ subroutine make_selection_buffer_s2(b)
|
|||||||
|
|
||||||
deallocate(b%det)
|
deallocate(b%det)
|
||||||
|
|
||||||
|
print*,'n_d = ',n_d
|
||||||
call i8sort(bit_tmp,iorder,n_d)
|
call i8sort(bit_tmp,iorder,n_d)
|
||||||
|
|
||||||
do i=1,n_d
|
do i=1,n_d
|
||||||
|
@ -10,7 +10,7 @@ subroutine run_stochastic_cipsi
|
|||||||
|
|
||||||
double precision :: rss
|
double precision :: rss
|
||||||
double precision, external :: memory_of_double
|
double precision, external :: memory_of_double
|
||||||
PROVIDE H_apply_buffer_allocated N_generators_bitmask
|
PROVIDE H_apply_buffer_allocated
|
||||||
|
|
||||||
N_iter = 1
|
N_iter = 1
|
||||||
threshold_generators = 1.d0
|
threshold_generators = 1.d0
|
||||||
|
@ -1,17 +1,3 @@
|
|||||||
subroutine only_act_bitmask
|
|
||||||
implicit none
|
|
||||||
integer :: i,j,k
|
|
||||||
do k = 1, N_generators_bitmask
|
|
||||||
do j = 1, 6
|
|
||||||
do i = 1, N_int
|
|
||||||
generators_bitmask(i,1,j,k) = act_bitmask(i,1)
|
|
||||||
generators_bitmask(i,2,j,k) = act_bitmask(i,2)
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
enddo
|
|
||||||
touch generators_bitmask
|
|
||||||
end
|
|
||||||
|
|
||||||
subroutine run_cisd
|
subroutine run_cisd
|
||||||
implicit none
|
implicit none
|
||||||
integer :: i
|
integer :: i
|
||||||
|
@ -33,22 +33,22 @@ subroutine $subroutine($params_main)
|
|||||||
do ispin=1,2
|
do ispin=1,2
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
mask(k,ispin,s_hole) = &
|
mask(k,ispin,s_hole) = &
|
||||||
iand(generators_bitmask(k,ispin,s_hole,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,s_hole), &
|
||||||
psi_det_generators(k,ispin,i_generator) )
|
psi_det_generators(k,ispin,i_generator) )
|
||||||
mask(k,ispin,s_part) = &
|
mask(k,ispin,s_part) = &
|
||||||
iand(generators_bitmask(k,ispin,s_part,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,s_part), &
|
||||||
not(psi_det_generators(k,ispin,i_generator)) )
|
not(psi_det_generators(k,ispin,i_generator)) )
|
||||||
mask(k,ispin,d_hole1) = &
|
mask(k,ispin,d_hole1) = &
|
||||||
iand(generators_bitmask(k,ispin,d_hole1,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,d_hole1), &
|
||||||
psi_det_generators(k,ispin,i_generator) )
|
psi_det_generators(k,ispin,i_generator) )
|
||||||
mask(k,ispin,d_part1) = &
|
mask(k,ispin,d_part1) = &
|
||||||
iand(generators_bitmask(k,ispin,d_part1,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,d_part1), &
|
||||||
not(psi_det_generators(k,ispin,i_generator)) )
|
not(psi_det_generators(k,ispin,i_generator)) )
|
||||||
mask(k,ispin,d_hole2) = &
|
mask(k,ispin,d_hole2) = &
|
||||||
iand(generators_bitmask(k,ispin,d_hole2,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,d_hole2), &
|
||||||
psi_det_generators(k,ispin,i_generator) )
|
psi_det_generators(k,ispin,i_generator) )
|
||||||
mask(k,ispin,d_part2) = &
|
mask(k,ispin,d_part2) = &
|
||||||
iand(generators_bitmask(k,ispin,d_part2,i_bitmask_gen), &
|
iand(generators_bitmask(k,ispin,d_part2), &
|
||||||
not(psi_det_generators(k,ispin,i_generator)) )
|
not(psi_det_generators(k,ispin,i_generator)) )
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
@ -16,19 +16,17 @@ use bitmasks
|
|||||||
do l = 1, N_states
|
do l = 1, N_states
|
||||||
psi_cas_coef(i,l) = 0.d0
|
psi_cas_coef(i,l) = 0.d0
|
||||||
enddo
|
enddo
|
||||||
do l=1,n_cas_bitmask
|
|
||||||
good = .True.
|
good = .True.
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
good = good .and. ( &
|
good = good .and. ( &
|
||||||
iand(not(cas_bitmask(k,1,l)), psi_det(k,1,i)) == &
|
iand(not(act_bitmask(k,1)), psi_det(k,1,i)) == &
|
||||||
iand(not(cas_bitmask(k,1,l)), hf_bitmask(k,1)) ) .and. ( &
|
iand(not(act_bitmask(k,1)), hf_bitmask(k,1)) ) .and. ( &
|
||||||
iand(not(cas_bitmask(k,2,l)), psi_det(k,2,i)) == &
|
iand(not(act_bitmask(k,2)), psi_det(k,2,i)) == &
|
||||||
iand(not(cas_bitmask(k,2,l)), hf_bitmask(k,2)) )
|
iand(not(act_bitmask(k,2)), hf_bitmask(k,2)) )
|
||||||
enddo
|
enddo
|
||||||
if (good) then
|
if (good) then
|
||||||
exit
|
exit
|
||||||
endif
|
endif
|
||||||
enddo
|
|
||||||
if (good) then
|
if (good) then
|
||||||
N_det_cas = N_det_cas+1
|
N_det_cas = N_det_cas+1
|
||||||
do k=1,N_int
|
do k=1,N_int
|
||||||
|
@ -58,6 +58,8 @@ BEGIN_TEMPLATE
|
|||||||
integer :: itmp
|
integer :: itmp
|
||||||
integer :: i, j
|
integer :: i, j
|
||||||
|
|
||||||
|
if(isize<2)return
|
||||||
|
|
||||||
c = x( shiftr(first+last,1) )
|
c = x( shiftr(first+last,1) )
|
||||||
i = first
|
i = first
|
||||||
j = last
|
j = last
|
||||||
|
4
tests/input/n2_stretched.xyz
Normal file
4
tests/input/n2_stretched.xyz
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
2
|
||||||
|
N2 stretched
|
||||||
|
N 0. 0. 0.
|
||||||
|
N 0. 0. 2.1167090
|
Loading…
Reference in New Issue
Block a user