10
1
mirror of https://gitlab.com/scemama/QCaml.git synced 2024-07-11 22:03:37 +02:00
QCaml/Utils/FourIdxStorage.mli

37 lines
945 B
OCaml
Raw Normal View History

2018-03-27 19:32:37 +02:00
(** Storage for four-index data (integrals, density matrices, ...).
There are two kinds of ordering of indices:
2018-03-28 01:50:19 +02:00
- Physicist's : {% $\langle i j | k l \rangle$ %}
- Chemist's : {% $(ij|kl)$ %}
2018-03-27 19:32:37 +02:00
*)
type t
2018-06-28 14:43:24 +02:00
type element = (** Element for the stream *)
{
i_r1: int ;
j_r2: int ;
k_r1: int ;
l_r2: int ;
value: float
}
2018-03-27 19:32:37 +02:00
val create : size:int -> [< `Dense | `Sparse ] -> t
(** If [`Dense] is chosen, internally the data is stored as a 4-dimensional
[Bigarray]. Else, it is stored as a hash table.
*)
(** {2 Accessors} *)
val get_chem : t -> int -> int -> int -> int -> float
val get_phys : t -> int -> int -> int -> int -> float
val set_chem : t -> int -> int -> int -> int -> float -> unit
val set_phys : t -> int -> int -> int -> int -> float -> unit
2018-06-28 14:43:24 +02:00
val to_stream : t -> element Stream.t
2018-03-27 19:32:37 +02:00
(** {2 I/O} *)
val to_file : ?cutoff:float -> filename:string -> t -> unit
(** Write the data to file, using the physicist's ordering. *)