All pastes #1977756 Raw Edit

naromero

public text v1 · immutable
#1977756 ·published 2010-10-31 04:18 UTC
rendered paste body
Index: rmm_diis.py===================================================================--- rmm_diis.py	(revision 7248)+++ rmm_diis.py	(working copy)@@ -52,10 +52,16 @@             else:                 R_xG = self.gd.empty(n2 - n1, wfs.dtype)                 psit_xG = kpt.psit_nG[n_x]+                self.timer.start('apply_pseudo_H1')                 wfs.apply_pseudo_hamiltonian(kpt, hamiltonian, psit_xG, R_xG)+                self.timer.stop('apply_pseudo_H1')+                self.timer.start('integrate1')                 wfs.pt.integrate(psit_xG, P_axi)+                self.timer.stop('integrate1')+                self.timer.start('residuals1')                 self.calculate_residuals(kpt, wfs, hamiltonian, psit_xG,                                          P_axi, kpt.eps_n[n_x], R_xG, n_x)+                self.timer.stop('residuals1')              for n in n_x:                 if kpt.f_n is None:@@ -75,13 +81,18 @@             self.timer.stop('precondition')              # Calculate the residual of dpsit_G, dR_G = (H - e S) dpsit_G:+            self.timer.start('apply_pseudo_H2')             wfs.apply_pseudo_hamiltonian(kpt, hamiltonian, dpsit_xG,                                          dR_xG[:n2 - n1])+            self.timer.stop('apply_pseudo_H2')+            self.timer.start('integrate2')             wfs.pt.integrate(dpsit_xG, P_axi, kpt.q)+            self.timer.stop('integrate2')+            self.timer.start('residuals2')             self.calculate_residuals(kpt, wfs, hamiltonian, dpsit_xG,                                      P_axi, kpt.eps_n[n_x], dR_xG, n_x,                                      calculate_change=True)-            +            self.timer.stop('residuals2')             # Find lam that minimizes the norm of R'_G = R_G + lam dR_G             RdR_x = np.array([np.vdot(R_G, dR_G).real                               for R_G, dR_G in zip(R_xG, dR_xG)])