mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-12-22 04:13:33 +01:00
Using less memory
This commit is contained in:
parent
a976bacfdf
commit
355aa9f166
33
CI/CI.ml
33
CI/CI.ml
@ -53,17 +53,6 @@ let make det_space =
|
||||
let ndet = Ds.size det_space in
|
||||
let det = Ds.determinants det_space in
|
||||
let mo_basis = Ds.mo_basis det_space in
|
||||
|
||||
let m_H = lazy (
|
||||
Array.init ndet (fun i -> let ki = det.(i) in
|
||||
Vec.init ndet (fun j -> let kj = det.(j-1) in
|
||||
h_ij mo_basis ki kj
|
||||
)
|
||||
|> Vector.sparse_of_vec
|
||||
)
|
||||
|> Matrix.sparse_of_vector_array
|
||||
)
|
||||
in
|
||||
|
||||
|
||||
(*
|
||||
@ -124,13 +113,23 @@ let make det_space =
|
||||
Parallel.broadcast (lazy h)
|
||||
) in
|
||||
*)
|
||||
let m_S2 = lazy (
|
||||
|
||||
|
||||
let m_H = lazy (
|
||||
let v = Vec.make0 ndet in
|
||||
Array.init ndet (fun i -> let ki = det.(i) in
|
||||
Vec.init ndet (fun j -> let kj = det.(j-1) in
|
||||
CIMatrixElement.make_s2 ki kj
|
||||
)
|
||||
|> Vector.sparse_of_vec
|
||||
)
|
||||
Array.iteri (fun j kj ->
|
||||
v.{j+1} <- h_ij mo_basis ki kj) det;
|
||||
Vector.sparse_of_vec v)
|
||||
|> Matrix.sparse_of_vector_array
|
||||
)
|
||||
in
|
||||
let m_S2 = lazy (
|
||||
let v = Vec.make0 ndet in
|
||||
Array.init ndet (fun i -> let ki = det.(i) in
|
||||
Array.iteri (fun j kj ->
|
||||
v.{j+1} <- CIMatrixElement.make_s2 ki kj) det;
|
||||
Vector.sparse_of_vec v)
|
||||
|> Matrix.sparse_of_vector_array
|
||||
)
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user