mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-06-02 03:15:19 +02:00
Add Multipole.to_file
This commit is contained in:
parent
62eacf4146
commit
fa3a407253
|
@ -27,7 +27,6 @@ in quantum chemistry.")
|
||||||
(depends
|
(depends
|
||||||
(ocaml (>= 4.10))
|
(ocaml (>= 4.10))
|
||||||
(dune (>= 1.10))
|
(dune (>= 1.10))
|
||||||
str
|
|
||||||
lacaml
|
lacaml
|
||||||
getopt
|
getopt
|
||||||
zarith
|
zarith
|
||||||
|
|
|
@ -222,3 +222,19 @@ let of_basis basis =
|
||||||
Array.iter Matrix.detri_inplace result;
|
Array.iter Matrix.detri_inplace result;
|
||||||
result
|
result
|
||||||
|
|
||||||
|
|
||||||
|
let to_file ~filename eni_array =
|
||||||
|
let n = Matrix.dim1 eni_array in
|
||||||
|
let eni_array = Matrix.to_bigarray_inplace eni_array in
|
||||||
|
let oc = open_out filename in
|
||||||
|
|
||||||
|
for j=1 to n do
|
||||||
|
for i=1 to j do
|
||||||
|
let value = eni_array.{i,j} in
|
||||||
|
if (value <> 0.) then
|
||||||
|
Printf.fprintf oc " %5d %5d %20.15f\n" i j value;
|
||||||
|
done;
|
||||||
|
done;
|
||||||
|
close_out oc
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,3 +60,7 @@ val matrix_z4 : t -> (Basis.t, Basis.t) Matrix.t
|
||||||
(** {% $$ \langle \chi_i | z^4 | \chi_j \rangle $$ %} *)
|
(** {% $$ \langle \chi_i | z^4 | \chi_j \rangle $$ %} *)
|
||||||
|
|
||||||
val of_basis : Basis.t -> t
|
val of_basis : Basis.t -> t
|
||||||
|
|
||||||
|
val to_file : filename:string -> (Basis.t, Basis.t) Matrix.t -> unit
|
||||||
|
(** Write a matrix to a file *)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user