mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-08-30 00:03:42 +02:00
Fixed DIIS
This commit is contained in:
parent
1db40e023f
commit
be8b2d8b2b
@ -319,16 +319,26 @@ let make
|
||||
xt_o_x (Mat.sub fps spf) m_X
|
||||
in
|
||||
|
||||
let diis, m_F_diis =
|
||||
let diis =
|
||||
DIIS.append ~p:(Mat.as_vec m_F_ortho) ~e:(Mat.as_vec error_fock) diis
|
||||
in
|
||||
|
||||
try
|
||||
let m_F_diis =
|
||||
let x =
|
||||
Bigarray.genarray_of_array1 (DIIS.next diis)
|
||||
in
|
||||
Bigarray.reshape_2 x (Mat.dim1 m_F_ortho) (Mat.dim2 m_F_ortho)
|
||||
in
|
||||
diis, m_F_diis
|
||||
|
||||
with Failure _ -> (* Failure in DIIS.next *)
|
||||
DIIS.make (), m_F_ortho
|
||||
in
|
||||
let diis =
|
||||
DIIS.append ~p:(Mat.as_vec m_F_ortho) ~e:(Mat.as_vec error_fock) diis
|
||||
in
|
||||
|
||||
|
||||
(* MOs in orthogonal MO basis *)
|
||||
@ -515,16 +525,23 @@ let make
|
||||
xt_o_x (Mat.sub fps spf) m_X
|
||||
in
|
||||
|
||||
let diis, m_F_diis =
|
||||
let diis =
|
||||
DIIS.append ~p:(Mat.as_vec m_F_ortho) ~e:(Mat.as_vec error_fock) diis
|
||||
in
|
||||
|
||||
try
|
||||
let m_F_diis =
|
||||
let x =
|
||||
Bigarray.genarray_of_array1 (DIIS.next diis)
|
||||
in
|
||||
Bigarray.reshape_2 x (Mat.dim1 m_F_ortho) (Mat.dim2 m_F_ortho)
|
||||
in
|
||||
diis, m_F_diis
|
||||
|
||||
with Failure _ -> (* Failure in DIIS.next *)
|
||||
DIIS.make (), m_F_ortho
|
||||
in
|
||||
|
||||
|
||||
(* MOs in orthogonal MO basis *)
|
||||
|
Loading…
Reference in New Issue
Block a user