mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-14 18:13:40 +01:00
27 lines
566 B
OCaml
27 lines
566 B
OCaml
|
type t =
|
||
|
{
|
||
|
elec_num : int;
|
||
|
mo_basis : MOBasis.t;
|
||
|
spindets : Spindeterminant.t array;
|
||
|
}
|
||
|
|
||
|
let fci_of_mo_basis mo_basis elec_num =
|
||
|
let mo_num = MOBasis.size mo_basis in
|
||
|
let spindets =
|
||
|
Util.bit_permtutations elec_num mo_num
|
||
|
|> List.map (fun b -> Spindeterminant.of_bitstring b)
|
||
|
|> Array.of_list
|
||
|
in
|
||
|
{ elec_num ; mo_basis ; spindets }
|
||
|
|
||
|
|
||
|
let pp_spindet_space ppf t =
|
||
|
Format.fprintf ppf "@[<v>[";
|
||
|
Array.iteri (fun i d -> Format.fprintf ppf "@[<h>@[%d@]@;@[%a@]@]@," i Spindeterminant.pp_spindet d) t.spindets;
|
||
|
Format.fprintf ppf "]@]"
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|