[ase-users] "RuntimeError: Could not find k+q!"

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Wed May 21 08:56:29 CEST 2014


Den 20-05-2014 15:10, Robert Campana skrev:
> Hello everybody,
>
> I have been attempting to run  a script that can calculate the EELS 
> spectra for a silver slab.  As a base, I am trying to use the GPAW 
> wiki EELS calculation for graphite 
> (https://svn.fysik.dtu.dk/projects/gpaw/trunk/doc/tutorials/dielectric_response/graphite_EELS.py). 
>
>
> I have so far been unable to overcome the error "RuntimeError: Could 
> not find k+q!".  This error occurs somewhere around line 26 in the 
> script at the end of this message.  When the script is run, 
> silverslab.gpw (line 24) writes successfully.  However, 
> silverslab_q_list is written but is blank.  Then the for loop 
> beginning in line 27 begins iterating but only partially generates 
> out_df_1.txt (line 35) before stopping at that point.
>
> I have no idea what is going on here.  I already spoke about this with 
> someone I know who has worked with GPAW quite a bit, and he cannot 
> figure it out.  So, I need to ask the highest source.  Do any of you 
> have any ideas about how to fix this error?  If you can offer any 
> advice, I'd really appreciate it!

I'm moving this to the gpaw-users ML where this belongs.

Your can only evaluate EELS spectra for q vectors that can be expressed 
as k1-k2, where k1 and k2 are two of you k-points from the groundstate 
calculation.  So, with a 8*8*1 Monkhorst-Pack sampling, you can use 
q=(i/8,0,0).  q=(i/20,0,0) would require a 20*20*1 sampling.

Jens Jørgen

>
> Thanks so much,
> Robert
>
> 1 from math import sqrt
> 2 import numpy as np
> 3 from ase import Atoms
> 4 from ase.units import Bohr
> 5 from ase.parallel import paropen
> 6 from gpaw import GPAW, FermiDirac
> 7 from gpaw.response.df import DF
> 8 from ase.lattice.surface import fcc111
> 9 from ase.lattice.surface import surface
>
>
> 10 # Part 1: Ground state calculation
> 11 
> atoms=fcc111(symbol='Ag',size[1,1,10],a=4.167,vacuum=10,orthogonal=False)
> 12 atoms.set_pbc([1,1,1])
>
> 13 calc = GPAW(xc='LDA',
> 14             kpts=(8,8,1),
> 15             h=0.2,
> 16             basis='dzp',
> 17             nbands=180,
> 18             convergence={'bands':175},
> 19             eigensolver='cg',
> 20             occupations=FermiDirac(0.05),
> 21             txt='out_gs.txt')
>
> 22 atoms.set_calculator(calc)
> 23 atoms.get_potential_energy()
> 24 calc.write('silverslab.gpw',mode='all')
>
> 25 # Part 2: Spectra calculations
> 26 f = paropen('silverslab_q_list', 'w')
>
> 27 for i in range(1,8):
> 28     df = DF(calc='silverslab.gpw',
> 29             nbands=175,
> 30             q=np.array([i/20., 0., 0.]),
> 31             #q=np.array([i/20., -i/20., 0.])
> 32             w=np.linspace(0, 40, 401),
> 33             eta=0.2,
> 34             ecut=40+(i-1)*10,
> 35             txt='out_df_%d.txt' %(i))
>
> 36     df.get_EELS_spectrum(filename='silverslab_EELS_%d' %(i))
> 37     df.check_sum_rule()         # Check f-sum rule.
>
> 38     print >> f, sqrt(np.inner(df.qq_v / Bohr, df.qq_v / Bohr))
>
>
>
>
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20140521/592244ab/attachment.html>


More information about the ase-users mailing list