...

parent 0aa9a12f
Pipeline #98595774 failed with stage
in 3 minutes and 34 seconds
......@@ -12,5 +12,5 @@ master:
- su user -c 'gpaw install-data --register gpaw-datasets'
- su user -c 'gpaw -P 1 info'
- su user -c 'gpaw test --range linalg/gemm_complex.py,lcao/dos.py'
- flake8 --ignore E722,E303,E221,E731,E203,E262,E202,E402,E502,E127,E201,E305,E241,W291,E302,E225,E128,E261,E251,E501,E265,E226,E231,E129,E741,W293,W503,W504 --exclude "doc/platforms/*" gpaw doc
- flake8 --ignore E722,E303,E221,E731,E203,E262,E202,E402,E502,E127,E201,E305,E241,W291,E302,E225,E128,E261,E251,E265,E226,E231,E129,E741,W293,W503,W504 --exclude "doc/platforms/*" gpaw doc
- python -We:invalid -m compileall -f -q gpaw/
......@@ -77,15 +77,9 @@ class AllElectron:
f = 1.0
else:
f = float(conf[2:])
#try:
assert n == self.n_j[j]
assert l == self.l_j[j]
self.f_j[j] = f
#except IndexError:
# self.n_j.append(n)
# self.l_j.append(l)
# self.f_j.append(f)
# self.e_j.append(self.e_j[-1])
j += 1
else:
j += {'He': 1,
......@@ -107,7 +101,6 @@ class AllElectron:
self.f_j = [self.Z]
self.e_j = [self.e_j[-1]]
t = self.text
t()
if scalarrel:
......@@ -251,7 +244,7 @@ class AllElectron:
mix = 0.01
nitermax = 2000
e_j[0] /= self.tw_coeff
if Z > 10 : #help convergence for third row elements
if Z > 10: # help convergence for third row elements
mix = 0.002
nitermax = 10000
......@@ -342,11 +335,12 @@ class AllElectron:
if self.orbital_free:
# e and vr are not scaled back
# instead Ekin is scaled for total energy (printed and inside setup)
# instead Ekin is scaled for total energy
# (printed and inside setup)
Ekin *= self.tw_coeff
t()
t('Lambda:{0}'.format(self.tw_coeff))
t('Correct eigenvalue:{0}'.format(e_j[0]*self.tw_coeff))
t('Correct eigenvalue:{0}'.format(e_j[0] * self.tw_coeff))
t()
t()
......@@ -891,6 +885,7 @@ guess for the density).
return nodes, A
if __name__ == '__main__':
a = AllElectron('Cu', scalarrel=True)
a.run()
......@@ -15,7 +15,6 @@ from ase.io import Trajectory
from gpaw import GPAW
from gpaw.mpi import serial_comm, rank
from gpaw.kpt_descriptor import KPointDescriptor
#from gpaw.dfpt.poisson import PoissonSolver, FFTPoissonSolver
from gpaw.poisson import PoissonSolver, FFTPoissonSolver
from gpaw.dfpt.responsecalculator import ResponseCalculator
from gpaw.dfpt.phononperturbation import PhononPerturbation
......@@ -25,6 +24,7 @@ from gpaw.dfpt.electronphononcoupling import ElectronPhononCoupling
from gpaw.symmetry import Symmetry
class PhononCalculator:
"""This class defines the interface for phonon calculations."""
......@@ -294,8 +294,10 @@ class PhononCalculator:
def get_filename_string(self):
"""Return string template for force constant filenames."""
name_str = (self.name + '.' + 'q_%%0%ii_' % len(str(self.kd.nibzkpts)) +
'a_%%0%ii_' % len(str(len(self.atoms))) + 'v_%i' + '.pckl')
name_str = (self.name + '.' +
'q_%%0%ii_' % len(str(self.kd.nibzkpts)) +
'a_%%0%ii_' % len(str(len(self.atoms))) +
'v_%i' + '.pckl')
return name_str
......@@ -416,7 +418,7 @@ class PhononCalculator:
# multiply with mass prefactor
u_nav = u_avn[:, omega2_n.argsort()].T.copy() * m_inv_av
# Multiply with mass prefactor
u_kn.append(u_nav.reshape((3*N, -1, 3)))
u_kn.append(u_nav.reshape((3 * N, -1, 3)))
else:
omega2_n = la.eigvalsh(D_q, UPLO='L')
......@@ -448,7 +450,7 @@ class PhononCalculator:
return omega_kn
def write_modes(self, q_c, branches=0, kT=units.kB*300, repeat=(1, 1, 1),
def write_modes(self, q_c, branches=0, kT=units.kB * 300, repeat=(1, 1, 1),
nimages=30, acoustic=True):
"""Write mode to trajectory file.
......@@ -511,11 +513,12 @@ class PhononCalculator:
mode_av = np.zeros((len(self.atoms), 3), dtype=self.dtype)
indices = self.dyn.get_indices()
mode_av[indices] = u_av
mode_mav = (np.vstack([mode_av]*M) * phase_ma[:, np.newaxis]).real
mode_mav = (np.vstack([mode_av] * M) *
phase_ma[:, np.newaxis]).real
traj = Trajectory('%s.mode.%d.traj' % (self.name, n), 'w')
for x in np.linspace(0, 2*pi, nimages, endpoint=False):
for x in np.linspace(0, 2 * pi, nimages, endpoint=False):
# XXX Is it correct to take out the sine component here ?
atoms.set_positions(pos_mav + sin(x) * mode_mav)
traj.write(atoms)
......
......@@ -250,7 +250,8 @@ class FDTDPoissonSolver:
def estimate_memory(self, mem):
# self.cl.poisson_solver.estimate_memory(mem)
#print(self.qm.poisson_solver.estimate_memory.__code__.co_varnames)
# WTF? How can this shabby method suddenly be unbound? It needs both self and mem.
# WTF? How can this shabby method suddenly be unbound?
# It needs both self and mem.
# Ferchrissakes!
#self.qm.poisson_solver.estimate_memory(mem=mem)
pass
......
......@@ -246,7 +246,8 @@ class ADM12PoissonSolver(SolvationPoissonSolver):
raise NotImplementedError(
'charged periodic systems are not implemented')
return FDPoissonSolver.solve(
self, phi, rho, charge, eps, maxcharge, zero_initial_phi, timer=timer)
self, phi, rho, charge, eps, maxcharge, zero_initial_phi,
timer=timer)
def solve_neutral(self, phi, rho, eps=2e-10, timer=None):
self._init()
......
......@@ -67,5 +67,7 @@ dyn6.run(fmax=0.02)
e_cocluster_paw = cluster.get_potential_energy()
#Print results
print('Adsorption energy of CO on Au cluster (lcao):', e_cocluster_lcao - e_CO_lcao - e_cluster_lcao)
print('Adsorption energy of CO on Au cluster (paw):', e_cocluster_paw - e_CO_paw - e_cluster_paw)
print('Adsorption energy of CO on Au cluster (lcao):',
e_cocluster_lcao - e_CO_lcao - e_cluster_lcao)
print('Adsorption energy of CO on Au cluster (paw):',
e_cocluster_paw - e_CO_paw - e_cluster_paw)
......@@ -10,7 +10,10 @@ mol = Atoms('OHH',
(b, 0.7633 + b, -0.4876 + b),
(b, -0.7633 + b, -0.4876 + b)],
pbc=False, cell=[a, a, a])
calc = GPAW(gpts=(32, 32, 32), nbands=4, mode='lcao', poissonsolver=FDPoissonSolver())
calc = GPAW(gpts=(32, 32, 32),
nbands=4,
mode='lcao',
poissonsolver=FDPoissonSolver())
mol.set_calculator(calc)
e = mol.get_potential_energy()
niter = calc.get_number_of_iterations()
......@@ -19,7 +22,10 @@ equal(e, -10.271, 2e-3)
equal(niter, 8, 1)
# Check that complex wave functions are allowed with gamma point calculations
calc = GPAW(gpts=(32, 32, 32), nbands=4, mode=LCAO(force_complex_dtype=True), poissonsolver=FDPoissonSolver())
calc = GPAW(gpts=(32, 32, 32),
nbands=4,
mode=LCAO(force_complex_dtype=True),
poissonsolver=FDPoissonSolver())
mol.set_calculator(calc)
ec = mol.get_potential_energy()
equal(e, ec, 1e-5)
# { -1, -1}: On entry to PDLASRT parameter number 9 had an illegal value
# { -1, -1}: On entry to PDLASRT parameter number 9 had an illegal value
# works with 'sl_default': (2, 2, 32)
......
......@@ -9,7 +9,6 @@ from gpaw.lfc import LocalizedFunctionsCollection as LFC
from gpaw.wavefunctions.pw import PWDescriptor, PWLFC
from gpaw.kpt_descriptor import KPointDescriptor
x = 2.0
rc = 3.5
r = np.linspace(0, rc, 100)
......@@ -24,11 +23,9 @@ spos_ac = np.array([(0.15, 0.5, 0.95)])
pd = PWDescriptor(45, gd, complex, kd)
eikr = np.ascontiguousarray(np.exp(2j * np.pi * np.dot(np.indices(gd.N_c).T,
(kpts / gd.N_c).T).T)[0])
from gpaw.fftw import FFTPlan
print(FFTPlan)
eikr = np.ascontiguousarray(
np.exp(2j * np.pi * np.dot(np.indices(gd.N_c).T,
(kpts / gd.N_c).T).T)[0])
for l in range(3):
print(l)
......@@ -36,7 +33,7 @@ for l in range(3):
lfc1 = LFC(gd, [[s]], kd, dtype=complex)
lfc2 = PWLFC([[s]], pd)
c_axi = {0: np.zeros((1, 2 * l + 1), complex)}
c_axi[0][0, 0] = 1.9 - 4.5j
c_axiv = {0: np.zeros((1, 2 * l + 1, 3), complex)}
......@@ -49,8 +46,8 @@ for l in range(3):
lfc.add(b, c_axi, 0)
b2 = pd.ifft(b2[0]) * eikr
equal(abs(b2-b1[0]).max(), 0, 0.001)
equal(abs(b2 - b1[0]).max(), 0, 0.001)
b1 = eikr[None]
b2 = pd.fft(b1[0] * 0 + 1).reshape((1, -1))
......
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