Remove old RMM-DIIS solver

parent d6e1bd1e
#!/usr/bin/env python
from ase import Atoms
from gpaw import GPAW
from gpaw import ConvergenceError
from gpaw.mpi import rank
from gpaw.eigensolvers.rmm_diis_old import RMM_DIIS
from gpaw import setup_paths
from gpaw import GPAW, ConvergenceError, RMMDIIS, setup_paths
# Use setups from the $PWD and $PWD/.. first
setup_paths.insert(0, '.')
setup_paths.insert(0, '../')
positions=[
(-0.069, 0.824,-1.295), ( 0.786, 0.943,-0.752), (-0.414,-0.001,-0.865),
(-0.282,-0.674,-3.822), ( 0.018,-0.147,-4.624), (-0.113,-0.080,-3.034),
( 2.253, 1.261, 0.151), ( 2.606, 0.638,-0.539), ( 2.455, 0.790, 1.019),
( 3.106,-0.276,-1.795), ( 2.914, 0.459,-2.386), ( 2.447,-1.053,-1.919),
( 6.257,-0.625,-0.626), ( 7.107,-1.002,-0.317), ( 5.526,-1.129,-0.131),
( 5.451,-1.261,-2.937), ( 4.585,-0.957,-2.503), ( 6.079,-0.919,-2.200),
(-0.515, 3.689, 0.482), (-0.218, 3.020,-0.189), ( 0.046, 3.568, 1.382),
(-0.205, 2.640,-3.337), (-1.083, 2.576,-3.771), (-0.213, 1.885,-2.680),
( 0.132, 6.301,-0.278), ( 1.104, 6.366,-0.068), (-0.148, 5.363,-0.112),
(-0.505, 6.680,-3.285), (-0.674, 7.677,-3.447), (-0.965, 6.278,-2.517),
( 4.063, 3.342,-0.474), ( 4.950, 2.912,-0.663), ( 3.484, 2.619,-0.125),
( 2.575, 2.404,-3.170), ( 1.694, 2.841,-3.296), ( 3.049, 2.956,-2.503),
( 6.666, 2.030,-0.815), ( 7.476, 2.277,-0.316), ( 6.473, 1.064,-0.651),
( 6.860, 2.591,-3.584), ( 6.928, 3.530,-3.176), ( 6.978, 2.097,-2.754),
( 2.931, 6.022,-0.243), ( 3.732, 6.562,-0.004), ( 3.226, 5.115,-0.404),
( 2.291, 7.140,-2.455), ( 1.317, 6.937,-2.532), ( 2.586, 6.574,-1.669),
( 6.843, 5.460, 1.065), ( 7.803, 5.290, 0.852), ( 6.727, 5.424, 2.062),
( 6.896, 4.784,-2.130), ( 6.191, 5.238,-2.702), ( 6.463, 4.665,-1.259),
( 0.398, 0.691, 4.098), ( 0.047, 1.567, 3.807), ( 1.268, 0.490, 3.632),
( 2.687, 0.272, 2.641), ( 3.078, 1.126, 3.027), ( 3.376,-0.501, 2.793),
( 6.002,-0.525, 4.002), ( 6.152, 0.405, 3.660), ( 5.987,-0.447, 4.980),
( 0.649, 3.541, 2.897), ( 0.245, 4.301, 3.459), ( 1.638, 3.457, 3.084),
(-0.075, 5.662, 4.233), (-0.182, 6.512, 3.776), (-0.241, 5.961, 5.212),
( 3.243, 2.585, 3.878), ( 3.110, 2.343, 4.817), ( 4.262, 2.718, 3.780),
( 5.942, 2.582, 3.712), ( 6.250, 3.500, 3.566), ( 6.379, 2.564, 4.636),
( 2.686, 5.638, 5.164), ( 1.781, 5.472, 4.698), ( 2.454, 6.286, 5.887),
( 6.744, 5.276, 3.826), ( 6.238, 5.608, 4.632), ( 7.707, 5.258, 4.110),
( 8.573, 8.472, 0.407), ( 9.069, 7.656, 0.067), ( 8.472, 8.425, 1.397),
( 8.758, 8.245, 2.989), ( 9.294, 9.091, 3.172), ( 7.906, 8.527, 3.373),
( 4.006, 7.734, 3.021), ( 4.685, 8.238, 3.547), ( 3.468, 7.158, 3.624),
( 5.281, 6.089, 6.035), ( 5.131, 7.033, 6.378), ( 4.428, 5.704, 5.720),
( 5.067, 7.323, 0.662), ( 5.785, 6.667, 0.703), ( 4.718, 7.252, 1.585)]
positions = [
(-0.069, 0.824, -1.295), (0.786, 0.943, -0.752), (-0.414, -0.001, -0.865),
(-0.282, -0.674, -3.822), (0.018, -0.147, -4.624),
(-0.113, -0.080, -3.034),
(2.253, 1.261, 0.151), (2.606, 0.638, -0.539), (2.455, 0.790, 1.019),
(3.106, -0.276, -1.795), (2.914, 0.459, -2.386), (2.447, -1.053, -1.919),
(6.257, -0.625, -0.626), (7.107, -1.002, -0.317), (5.526, -1.129, -0.131),
(5.451, -1.261, -2.937), (4.585, -0.957, -2.503), (6.079, -0.919, -2.200),
(-0.515, 3.689, 0.482), (-0.218, 3.020, -0.189), (0.046, 3.568, 1.382),
(-0.205, 2.640, -3.337), (-1.083, 2.576, -3.771), (-0.213, 1.885, -2.680),
(0.132, 6.301, -0.278), (1.104, 6.366, -0.068), (-0.148, 5.363, -0.112),
(-0.505, 6.680, -3.285), (-0.674, 7.677, -3.447), (-0.965, 6.278, -2.517),
(4.063, 3.342, -0.474), (4.950, 2.912, -0.663), (3.484, 2.619, -0.125),
(2.575, 2.404, -3.170), (1.694, 2.841, -3.296), (3.049, 2.956, -2.503),
(6.666, 2.030, -0.815), (7.476, 2.277, -0.316), (6.473, 1.064, -0.651),
(6.860, 2.591, -3.584), (6.928, 3.530, -3.176), (6.978, 2.097, -2.754),
(2.931, 6.022, -0.243), (3.732, 6.562, -0.004), (3.226, 5.115, -0.404),
(2.291, 7.140, -2.455), (1.317, 6.937, -2.532), (2.586, 6.574, -1.669),
(6.843, 5.460, 1.065), (7.803, 5.290, 0.852), (6.727, 5.424, 2.062),
(6.896, 4.784, -2.130), (6.191, 5.238, -2.702), (6.463, 4.665, -1.259),
(0.398, 0.691, 4.098), (0.047, 1.567, 3.807), (1.268, 0.490, 3.632),
(2.687, 0.272, 2.641), (3.078, 1.126, 3.027), (3.376, -0.501, 2.793),
(6.002, -0.525, 4.002), (6.152, 0.405, 3.660), (5.987, -0.447, 4.980),
(0.649, 3.541, 2.897), (0.245, 4.301, 3.459), (1.638, 3.457, 3.084),
(-0.075, 5.662, 4.233), (-0.182, 6.512, 3.776), (-0.241, 5.961, 5.212),
(3.243, 2.585, 3.878), (3.110, 2.343, 4.817), (4.262, 2.718, 3.780),
(5.942, 2.582, 3.712), (6.250, 3.500, 3.566), (6.379, 2.564, 4.636),
(2.686, 5.638, 5.164), (1.781, 5.472, 4.698), (2.454, 6.286, 5.887),
(6.744, 5.276, 3.826), (6.238, 5.608, 4.632), (7.707, 5.258, 4.110),
(8.573, 8.472, 0.407), (9.069, 7.656, 0.067), (8.472, 8.425, 1.397),
(8.758, 8.245, 2.989), (9.294, 9.091, 3.172), (7.906, 8.527, 3.373),
(4.006, 7.734, 3.021), (4.685, 8.238, 3.547), (3.468, 7.158, 3.624),
(5.281, 6.089, 6.035), (5.131, 7.033, 6.378), (4.428, 5.704, 5.720),
(5.067, 7.323, 0.662), (5.785, 6.667, 0.703), (4.718, 7.252, 1.585)]
prefix = 'b256H2O'
L = 9.8553729
atoms = Atoms('32(OH2)',
positions=positions)
atoms.set_cell((L,L,L),scale_atoms=False)
positions=positions)
atoms.set_cell((L, L, L), scale_atoms=False)
atoms.set_pbc(1)
r = [2, 2, 2]
atoms = atoms.repeat(r)
n = [56 * ri for ri in r]
# nbands (>=128) is the number of bands per 32 water molecules
nbands = 2*6*11 # 132
for ri in r: nbands = nbands*ri
nbands = 2 * 6 * 11 # 132
for ri in r:
nbands = nbands * ri
# the next line decreases memory usage
es = RMM_DIIS(keep_htpsit=False)
es = RMMDIIS(keep_htpsit=False)
calc = GPAW(nbands=nbands,
# uncomment next two lines to use lcao/sz
#mode='lcao',
#basis='sz',
# mode='lcao',
# basis='sz',
gpts=tuple(n),
maxiter=5,
width = 0.01,
eigensolver = es,
txt=prefix + '.txt',
)
width=0.01,
eigensolver=es,
txt=prefix + '.txt')
atoms.set_calculator(calc)
from gpaw.mpi import rank
try:
pot = atoms.get_potential_energy()
except ConvergenceError:
......
#!/usr/bin/env python
from ase import Atoms
from ase.io.xyz import read_xyz
from gpaw import GPAW
from gpaw.mixer import Mixer
from gpaw import ConvergenceError
from gpaw.mpi import rank
from gpaw.eigensolvers.rmm_diis_old import RMM_DIIS
from gpaw import setup_paths
from gpaw import GPAW, Mixer, ConvergenceError, RMMDIIS, setup_paths
# Use setups from the $PWD and $PWD/.. first
setup_paths.insert(0, '.')
......@@ -20,34 +10,32 @@ atoms = read_xyz('../Au102_revised.xyz')
prefix = 'Au_cluster'
L = 32.0
atoms.set_cell((L,L,L),scale_atoms=False)
atoms.set_cell((L, L, L), scale_atoms=False)
atoms.center()
atoms.set_pbc(1)
r = [1, 1, 1]
atoms = atoms.repeat(r)
n = [240 * ri for ri in r]
# nbands (>=1683) is the number of bands per cluster
nbands = 3*6*6*16 # 1728
for ri in r: nbands = nbands*ri
nbands = 3 * 6 * 6 * 16 # 1728
for ri in r:
nbands = nbands * ri
mixer = Mixer(beta=0.1, nmaxold=5, weight=100.0)
# the next three lines decrease memory usage
es = RMM_DIIS(keep_htpsit=False)
from gpaw.hs_operators import MatrixOperator
MatrixOperator.nblocks = 16
es = RMMDIIS(keep_htpsit=False)
calc = GPAW(nbands=nbands,
# uncomment next two lines to use lcao/sz
#mode='lcao',
#basis='sz',
# mode='lcao',
# basis='sz',
gpts=tuple(n),
maxiter=5,
width = 0.1,
width=0.1,
xc='LDA',
mixer=mixer,
eigensolver = es,
txt=prefix + '.txt',
)
eigensolver=es,
txt=prefix + '.txt')
atoms.set_calculator(calc)
from gpaw.mpi import rank
try:
pot = atoms.get_potential_energy()
except ConvergenceError:
......
"""Module defining ``Eigensolver`` classes."""
import numpy as np
from gpaw.utilities.blas import axpy
from gpaw.eigensolvers.eigensolver import Eigensolver
from gpaw import extra_parameters
class RMM_DIIS(Eigensolver):
"""RMM-DIIS eigensolver
It is expected that the trial wave functions are orthonormal
and the integrals of projector functions and wave functions
``nucleus.P_uni`` are already calculated
Solution steps are:
* Subspace diagonalization
* Calculation of residuals
* Improvement of wave functions: psi' = psi + lambda PR + lambda PR'
* Orthonormalization"""
def __init__(self, keep_htpsit=True, blocksize=10,
fixed_trial_step=None):
self.fixed_trial_step = fixed_trial_step
Eigensolver.__init__(self, keep_htpsit, blocksize)
def iterate_one_k_point(self, hamiltonian, wfs, kpt):
"""Do a single RMM-DIIS iteration for the kpoint"""
psit_nG, R_nG = self.subspace_diagonalize(hamiltonian, wfs, kpt)
self.timer.start('RMM-DIIS')
if self.keep_htpsit:
self.calculate_residuals(kpt, wfs, hamiltonian, psit_nG,
kpt.P_ani, kpt.eps_n, R_nG)
def integrate(a_G, b_G):
return np.real(wfs.integrate(a_G, b_G, global_integral=False))
comm = wfs.gd.comm
B = self.blocksize
dR_xG = wfs.empty(B, q=kpt.q)
P_axi = wfs.pt.dict(B)
error = 0.0
for n1 in range(0, wfs.bd.mynbands, B):
n2 = n1 + B
if n2 > wfs.bd.mynbands:
n2 = wfs.bd.mynbands
B = n2 - n1
P_axi = dict((a, P_xi[:B]) for a, P_xi in P_axi.items())
dR_xG = dR_xG[:B]
n_x = np.arange(n1, n2)
psit_xG = psit_nG[n1:n2]
if self.keep_htpsit:
R_xG = R_nG[n1:n2]
else:
R_xG = wfs.empty(B, q=kpt.q)
wfs.apply_pseudo_hamiltonian(kpt, hamiltonian, psit_xG, R_xG)
wfs.pt.integrate(psit_xG, P_axi, kpt.q)
self.calculate_residuals(kpt, wfs, hamiltonian, psit_xG,
P_axi, kpt.eps_n[n_x], R_xG, n_x)
for n in n_x:
if kpt.f_n is None:
weight = kpt.weight
else:
weight = kpt.f_n[n]
if self.nbands_converge != 'occupied':
if wfs.bd.global_index(n) < self.nbands_converge:
weight = kpt.weight
else:
weight = 0.0
error += weight * integrate(R_xG[n - n1], R_xG[n - n1])
# Precondition the residual:
self.timer.start('precondition')
ekin_x = self.preconditioner.calculate_kinetic_energy(
psit_xG, kpt)
dpsit_xG = self.preconditioner(R_xG, kpt, ekin_x)
self.timer.stop('precondition')
# Calculate the residual of dpsit_G, dR_G = (H - e S) dpsit_G:
wfs.apply_pseudo_hamiltonian(kpt, hamiltonian, dpsit_xG, dR_xG)
self.timer.start('projections')
wfs.pt.integrate(dpsit_xG, P_axi, kpt.q)
self.timer.stop('projections')
self.calculate_residuals(kpt, wfs, hamiltonian, dpsit_xG,
P_axi, kpt.eps_n[n_x], dR_xG, n_x,
calculate_change=True)
# Find lam that minimizes the norm of R'_G = R_G + lam dR_G
RdR_x = np.array([integrate(dR_G, R_G)
for R_G, dR_G in zip(R_xG, dR_xG)])
dRdR_x = np.array([integrate(dR_G, dR_G) for dR_G in dR_xG])
comm.sum(RdR_x)
comm.sum(dRdR_x)
lam_x = -RdR_x / dRdR_x
if extra_parameters.get('PK', False):
lam_x[:] = np.where(lam_x>0.0, lam_x, 0.2)
# Calculate new psi'_G = psi_G + lam pR_G + lam2 pR'_G
# = psi_G + p((lam+lam2) R_G + lam*lam2 dR_G)
for lam, R_G, dR_G in zip(lam_x, R_xG, dR_xG):
if self.fixed_trial_step is None:
lam2 = lam
else:
lam2 = self.fixed_trial_step
R_G *= lam + lam2
axpy(lam * lam2, dR_G, R_G)
self.timer.start('precondition')
psit_xG[:] += self.preconditioner(R_xG, kpt, ekin_x)
self.timer.stop('precondition')
self.timer.stop('RMM-DIIS')
error = comm.sum(error)
return error, psit_nG
......@@ -23,11 +23,7 @@ import sys
from ase import Atoms
from gpaw import GPAW
from gpaw.eigensolvers.rmm_diis_old import RMM_DIIS
from gpaw import setup_paths
from gpaw import GPAW, RMMDIIS, setup_paths
if len(sys.argv) == 1:
run = 'A'
......@@ -40,64 +36,65 @@ assert run in ['A', 'B']
setup_paths.insert(0, '.')
setup_paths.insert(0, '../')
positions=[
(-0.069, 0.824,-1.295), ( 0.786, 0.943,-0.752), (-0.414,-0.001,-0.865),
(-0.282,-0.674,-3.822), ( 0.018,-0.147,-4.624), (-0.113,-0.080,-3.034),
( 2.253, 1.261, 0.151), ( 2.606, 0.638,-0.539), ( 2.455, 0.790, 1.019),
( 3.106,-0.276,-1.795), ( 2.914, 0.459,-2.386), ( 2.447,-1.053,-1.919),
( 6.257,-0.625,-0.626), ( 7.107,-1.002,-0.317), ( 5.526,-1.129,-0.131),
( 5.451,-1.261,-2.937), ( 4.585,-0.957,-2.503), ( 6.079,-0.919,-2.200),
(-0.515, 3.689, 0.482), (-0.218, 3.020,-0.189), ( 0.046, 3.568, 1.382),
(-0.205, 2.640,-3.337), (-1.083, 2.576,-3.771), (-0.213, 1.885,-2.680),
( 0.132, 6.301,-0.278), ( 1.104, 6.366,-0.068), (-0.148, 5.363,-0.112),
(-0.505, 6.680,-3.285), (-0.674, 7.677,-3.447), (-0.965, 6.278,-2.517),
( 4.063, 3.342,-0.474), ( 4.950, 2.912,-0.663), ( 3.484, 2.619,-0.125),
( 2.575, 2.404,-3.170), ( 1.694, 2.841,-3.296), ( 3.049, 2.956,-2.503),
( 6.666, 2.030,-0.815), ( 7.476, 2.277,-0.316), ( 6.473, 1.064,-0.651),
( 6.860, 2.591,-3.584), ( 6.928, 3.530,-3.176), ( 6.978, 2.097,-2.754),
( 2.931, 6.022,-0.243), ( 3.732, 6.562,-0.004), ( 3.226, 5.115,-0.404),
( 2.291, 7.140,-2.455), ( 1.317, 6.937,-2.532), ( 2.586, 6.574,-1.669),
( 6.843, 5.460, 1.065), ( 7.803, 5.290, 0.852), ( 6.727, 5.424, 2.062),
( 6.896, 4.784,-2.130), ( 6.191, 5.238,-2.702), ( 6.463, 4.665,-1.259),
( 0.398, 0.691, 4.098), ( 0.047, 1.567, 3.807), ( 1.268, 0.490, 3.632),
( 2.687, 0.272, 2.641), ( 3.078, 1.126, 3.027), ( 3.376,-0.501, 2.793),
( 6.002,-0.525, 4.002), ( 6.152, 0.405, 3.660), ( 5.987,-0.447, 4.980),
( 0.649, 3.541, 2.897), ( 0.245, 4.301, 3.459), ( 1.638, 3.457, 3.084),
(-0.075, 5.662, 4.233), (-0.182, 6.512, 3.776), (-0.241, 5.961, 5.212),
( 3.243, 2.585, 3.878), ( 3.110, 2.343, 4.817), ( 4.262, 2.718, 3.780),
( 5.942, 2.582, 3.712), ( 6.250, 3.500, 3.566), ( 6.379, 2.564, 4.636),
( 2.686, 5.638, 5.164), ( 1.781, 5.472, 4.698), ( 2.454, 6.286, 5.887),
( 6.744, 5.276, 3.826), ( 6.238, 5.608, 4.632), ( 7.707, 5.258, 4.110),
( 8.573, 8.472, 0.407), ( 9.069, 7.656, 0.067), ( 8.472, 8.425, 1.397),
( 8.758, 8.245, 2.989), ( 9.294, 9.091, 3.172), ( 7.906, 8.527, 3.373),
( 4.006, 7.734, 3.021), ( 4.685, 8.238, 3.547), ( 3.468, 7.158, 3.624),
( 5.281, 6.089, 6.035), ( 5.131, 7.033, 6.378), ( 4.428, 5.704, 5.720),
( 5.067, 7.323, 0.662), ( 5.785, 6.667, 0.703), ( 4.718, 7.252, 1.585)]
positions = [
(-0.069, 0.824, -1.295), (0.786, 0.943, -0.752), (-0.414, -0.001, -0.865),
(-0.282, -0.674, -3.822), (0.018, -0.147, -4.624),
(-0.113, -0.080, -3.034),
(2.253, 1.261, 0.151), (2.606, 0.638, -0.539), (2.455, 0.790, 1.019),
(3.106, -0.276, -1.795), (2.914, 0.459, -2.386), (2.447, -1.053, -1.919),
(6.257, -0.625, -0.626), (7.107, -1.002, -0.317), (5.526, -1.129, -0.131),
(5.451, -1.261, -2.937), (4.585, -0.957, -2.503), (6.079, -0.919, -2.200),
(-0.515, 3.689, 0.482), (-0.218, 3.020, -0.189), (0.046, 3.568, 1.382),
(-0.205, 2.640, -3.337), (-1.083, 2.576, -3.771), (-0.213, 1.885, -2.680),
(0.132, 6.301, -0.278), (1.104, 6.366, -0.068), (-0.148, 5.363, -0.112),
(-0.505, 6.680, -3.285), (-0.674, 7.677, -3.447), (-0.965, 6.278, -2.517),
(4.063, 3.342, -0.474), (4.950, 2.912, -0.663), (3.484, 2.619, -0.125),
(2.575, 2.404, -3.170), (1.694, 2.841, -3.296), (3.049, 2.956, -2.503),
(6.666, 2.030, -0.815), (7.476, 2.277, -0.316), (6.473, 1.064, -0.651),
(6.860, 2.591, -3.584), (6.928, 3.530, -3.176), (6.978, 2.097, -2.754),
(2.931, 6.022, -0.243), (3.732, 6.562, -0.004), (3.226, 5.115, -0.404),
(2.291, 7.140, -2.455), (1.317, 6.937, -2.532), (2.586, 6.574, -1.669),
(6.843, 5.460, 1.065), (7.803, 5.290, 0.852), (6.727, 5.424, 2.062),
(6.896, 4.784, -2.130), (6.191, 5.238, -2.702), (6.463, 4.665, -1.259),
(0.398, 0.691, 4.098), (0.047, 1.567, 3.807), (1.268, 0.490, 3.632),
(2.687, 0.272, 2.641), (3.078, 1.126, 3.027), (3.376, -0.501, 2.793),
(6.002, -0.525, 4.002), (6.152, 0.405, 3.660), (5.987, -0.447, 4.980),
(0.649, 3.541, 2.897), (0.245, 4.301, 3.459), (1.638, 3.457, 3.084),
(-0.075, 5.662, 4.233), (-0.182, 6.512, 3.776), (-0.241, 5.961, 5.212),
(3.243, 2.585, 3.878), (3.110, 2.343, 4.817), (4.262, 2.718, 3.780),
(5.942, 2.582, 3.712), (6.250, 3.500, 3.566), (6.379, 2.564, 4.636),
(2.686, 5.638, 5.164), (1.781, 5.472, 4.698), (2.454, 6.286, 5.887),
(6.744, 5.276, 3.826), (6.238, 5.608, 4.632), (7.707, 5.258, 4.110),
(8.573, 8.472, 0.407), (9.069, 7.656, 0.067), (8.472, 8.425, 1.397),
(8.758, 8.245, 2.989), (9.294, 9.091, 3.172), (7.906, 8.527, 3.373),
(4.006, 7.734, 3.021), (4.685, 8.238, 3.547), (3.468, 7.158, 3.624),
(5.281, 6.089, 6.035), (5.131, 7.033, 6.378), (4.428, 5.704, 5.720),
(5.067, 7.323, 0.662), (5.785, 6.667, 0.703), (4.718, 7.252, 1.585)]
prefix = 'b256H2O'
L = 9.8553729
atoms = Atoms('32(OH2)',
positions=positions)
atoms.set_cell((L,L,L),scale_atoms=False)
positions=positions)
atoms.set_cell((L, L, L), scale_atoms=False)
atoms.set_pbc(1)
r = [1, 1, 2]
atoms = atoms.repeat(r)
n = [56 * ri for ri in r]
# nbands (>=128) is the number of bands per 32 water molecules
nbands = 2*6*11 # 132
for ri in r: nbands = nbands*ri
nbands = 2 * 6 * 11 # 132
for ri in r:
nbands = nbands * ri
# the next line decreases memory usage
es = RMM_DIIS(keep_htpsit=False)
es = RMMDIIS(keep_htpsit=False)
calc = GPAW(nbands=nbands,
# uncomment next two lines to use lcao/sz
#mode='lcao',
#basis='sz',
# mode='lcao',
# basis='sz',
gpts=tuple(n),
#maxiter=5,
width = 0.01,
eigensolver = es,
txt=prefix + '.txt',
)
# maxiter=5,
width=0.01,
eigensolver=es,
txt=prefix + '.txt')
if run == 'A':
atoms.set_calculator(calc)
pot = atoms.get_potential_energy()
......
from gpaw import GPAW
from gpaw.eigensolvers.rmm_diis_old import RMM_DIIS
from gpaw.eigensolvers.rmmdiis import RMMDIIS
from ase import Atoms
from gpaw.test import equal
......@@ -9,7 +9,7 @@ atoms.center(3.0)
convergence = {'eigenstates': 1e-2, 'density': 1e-2}
# Keep htpsit
calc = GPAW(nbands=2,
eigensolver=RMM_DIIS(keep_htpsit=True),
eigensolver=RMMDIIS(keep_htpsit=True),
convergence=convergence,
maxiter=20)
atoms.set_calculator(calc)
......@@ -17,7 +17,7 @@ e0 = atoms.get_potential_energy()
# Do not keep htpsit
calc = GPAW(nbands=2,
eigensolver=RMM_DIIS(keep_htpsit=False),
eigensolver=RMMDIIS(keep_htpsit=False),
convergence=convergence,
maxiter=20)
atoms.set_calculator(calc)
......
from ase import Atoms
from gpaw import GPAW, FermiDirac
from gpaw.eigensolvers.rmm_diis_old import RMM_DIIS
from gpaw.mixer import MixerSum
from gpaw.test import equal
......@@ -12,10 +11,10 @@ bulk = Atoms('Fe2',
pbc=True)
mom0 = sum(bulk.get_initial_magnetic_moments())
h = 0.2
conv = {'eigenstates': 0.1, 'density':0.1, 'energy':0.01}
conv = {'eigenstates': 0.1, 'density': 0.1, 'energy': 0.01}
calc = GPAW(h=h,
eigensolver=RMM_DIIS(),
mixer=MixerSum(0.1,3),
eigensolver='rmmdiis',
mixer=MixerSum(0.1, 3),
nbands=11,
kpts=(3, 3, 3),
convergence=conv,
......
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