Fix scfsic_h2.py test

parent 66259661
Pipeline #21748745 passed with stage
in 2 minutes and 33 seconds
......@@ -20,7 +20,7 @@ molecule.set_calculator(calc)
e2 = molecule.get_potential_energy()
F_ac = molecule.get_forces()
de = 2 * e1 - e2
#equal(de, 4.5, 0.1)
# equal(de, 4.5, 0.1)
# Test forces ...
......
......@@ -806,17 +806,18 @@ class SICSpin:
V_u = ...
"""
if self.gd.comm.rank > 0:
return
nocc = self.nocc
nvirt = H_nn.shape[0] - nocc
W_mn = self.W_mn
# R_mk = self.R_mk
V_mm = 0.5 * (self.V_mm + self.V_mm.T)
H_nn[:nocc, :nocc] += np.dot(W_mn.T, np.dot(V_mm, W_mn))
if self.gd.comm.rank == 0:
V_mm = 0.5 * (self.V_mm + self.V_mm.T)
H_nn[:nocc, :nocc] += np.dot(W_mn.T, np.dot(V_mm, W_mn))
if self.stabpot != 0.0:
H_nn[nocc:, nocc:] += np.eye(nvirt) * self.stabpot
if nvirt != 0:
H_nn[:nocc, nocc:] = 0.0 # R_nk
......@@ -825,9 +826,6 @@ class SICSpin:
# H_nn[:nocc, nocc:] += R_nk
# H_nn[nocc:, :nocc] += R_nk.T
if self.stabpot != 0.0:
H_nn[self.nocc:, self.nocc:] += np.eye(nvirt) * self.stabpot
def calculate_residual(self, psit_nG, Htpsit_nG, P_ani, c_ani):
""" Calculate the action of the unified Hamiltonian on an
arbitrary state:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment