10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 20:35:19 +01:00

Only 10k determinants max in qp_edit

This commit is contained in:
Anthony Scemama 2016-02-22 23:33:30 +01:00
parent d17af2fdc7
commit b019cd04f0
4 changed files with 36 additions and 24 deletions

View File

@ -79,6 +79,12 @@ let of_int64_list l =
List.map ~f:of_int64 l
|> List.concat
(* Create a bit list from an array of int64 *)
let of_int64_array l =
Array.map ~f:of_int64 l
|> Array.to_list
|> List.concat
(* Compute n_int *)
let n_int_of_mo_tot_num mo_tot_num =

View File

@ -18,6 +18,7 @@ val of_int64 : int64 -> t
val to_int64 : t -> int64
val of_int64_list : int64 list -> t
val of_int64_array : int64 array -> t
val to_int64_list : t -> int64 list
val to_int64_array : t -> int64 array

View File

@ -15,21 +15,25 @@ let to_alpha_beta x =
let to_bitlist_couple x =
let (xa,xb) = to_alpha_beta x in
let xa = to_int64_array xa
|> Array.to_list
|> Bitlist.of_int64_list
and xb = to_int64_array xb
|> Array.to_list
|> Bitlist.of_int64_list
let xa =
to_int64_array xa
|> Bitlist.of_int64_array
and xb =
to_int64_array xb
|> Bitlist.of_int64_array
in (xa,xb)
let bitlist_to_string ~mo_tot_num x =
List.map x ~f:(fun i -> match i with
let len =
MO_number.to_int mo_tot_num
in
List.map x ~f:(function
| Bit.Zero -> "-"
| Bit.One -> "+" )
| Bit.One -> "+"
)
|> String.concat
|> String.sub ~pos:0 ~len:(MO_number.to_int mo_tot_num)
|> String.sub ~pos:0 ~len
@ -71,8 +75,8 @@ let of_bitlist_couple ?n_int ~alpha ~beta (xa,xb) =
let to_string ~mo_tot_num x =
let (xa,xb) = to_bitlist_couple x in
[ bitlist_to_string ~mo_tot_num:mo_tot_num xa ;
bitlist_to_string ~mo_tot_num:mo_tot_num xb ]
|> String.concat ~sep:"\n"
[ " " ; bitlist_to_string ~mo_tot_num xa ; "\n" ;
" " ; bitlist_to_string ~mo_tot_num xb ]
|> String.concat

View File

@ -29,7 +29,7 @@ end = struct
let get_default = Qpackage.get_ezfio_default "determinants";;
let n_det_read_max = 50_000_000 ;;
let n_det_read_max = 10_000 ;;
let read_n_int () =
if not (Ezfio.has_determinants_n_int()) then
@ -258,11 +258,16 @@ end = struct
let to_rst b =
let mo_tot_num = Ezfio.get_mo_basis_mo_tot_num () in
let mo_tot_num = MO_number.of_int mo_tot_num ~max:mo_tot_num in
let max =
Ezfio.get_mo_basis_mo_tot_num ()
in
let mo_tot_num =
MO_number.of_int ~max max
in
let det_text =
let nstates =
read_n_states () |> States_number.to_int
read_n_states ()
|> States_number.to_int
and ndet =
Det_number.to_int b.n_det
in
@ -281,13 +286,9 @@ end = struct
|> String.concat_array ~sep:"\t"
in
Array.init ndet ~f:(fun i ->
Printf.sprintf " %s\n%s\n"
(coefs_string i)
(Determinant.to_string ~mo_tot_num:mo_tot_num b.psi_det.(i)
|> String.split ~on:'\n'
|> List.map ~f:(fun x -> " "^x)
|> String.concat ~sep:"\n"
)
String.concat [ " " ;
(coefs_string i) ; "\n" ;
(Determinant.to_string ~mo_tot_num b.psi_det.(i)) ; "\n" ]
)
|> String.concat_array ~sep:"\n"
in