10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-11-14 18:13:40 +01:00
QCaml/CI/Spindeterminant_space.ml

27 lines
566 B
OCaml
Raw Normal View History

2019-02-19 17:36:07 +01:00
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 "]@]"