[gpaw-users] Error of STM Simulation in GPAW

Jens Jørgen Mortensen jjmo at dtu.dk
Fri Aug 9 11:21:44 CEST 2019


On 7/8/19 7:46 AM, Shuang Leung via gpaw-users wrote:
> Dear gpaw-users,
> 
> I tried to use GPAW to do some STM simulations, but I got a trobule and 
> may need your help.
> I firstly did a STM simulation of clean Ag(111) surface(3x3x1 
> surpercell) and it worked. My gpaw run_script is:
> ******************************
> from gpaw import *
> from gpaw import GPAW
> from ase.io <http://ase.io> import read
> from ase.dft.stm import STM
> import matplotlib.pyplot as plt
> import numpy as np
> 
> name = 'Ag111'
> atoms = read(name+'.cif')
> 
> calc = GPAW(mode=PW(800),
>              xc='PBE',
>              kpts=(3, 3, 3),
>              symmetry='off',
>              txt='Ag111-log')
> atoms.set_calculator(calc)
> energy = atoms.get_potential_energy()
> calc.write('Ag111-wav.gpw', 'all')
> 
> #STM_simulation
> atoms,calc = restart('Ag111-wav.gpw',txt=None)
> stm = STM(atoms)
> z = 8.0
> bias = -0.6
> c = stm.get_averaged_current(bias, z)
> x, y, h = stm.scan(bias, c, repeat=(5, 5))
> 
> #STM-image_constant height
> plt.figure()
> plt.gca(aspect='equal')
> x, y, I = stm.scan2(bias, z, repeat=(5, 5))
> plt.contourf(x, y, I, 100)
> plt.colorbar()
> plt.savefig('2d_I.png')
> *************************
> 
> But when I applied the same run_script (only changed the file names and 
> z value)to another adsorption system: Ag(110)/Tetracene, an error 
> appeared (as shown below ), even though the output file showed .gpw had 
> been wirrten successfully.
> ------------------------------------------------------------------------------------------------
> rank=33 L00: Traceback (most recent call last):
> rank=33 L01:   File 
> "/usr/local/python3/lib/python3.6/site-packages/gpaw/__init__.py", line 
> 200, in main
> rank=33 L02:     runpy.run_path(gpaw_args.script, run_name='__main__')
> rank=33 L03:   File "/usr/local/python3/lib/python3.6/runpy.py", line 
> 263, in run_path
> rank=33 L04:     pkg_name=pkg_name, script_name=fname)
> rank=33 L05:   File "/usr/local/python3/lib/python3.6/runpy.py", line 
> 96, in _run_module_code
> rank=33 L06:     mod_name, mod_spec, pkg_name, script_name)
> rank=33 L07:   File "/usr/local/python3/lib/python3.6/runpy.py", line 
> 85, in _run_code
> rank=33 L08:     exec(code, run_globals)
> rank=33 L09:   File "Ag-2dSTM.py", line 24, in <module>
> rank=33 L10:     calc = GPAW('Ag111-Org_wav.gpw')
> rank=33 L11:   File 
> "/usr/local/python3/lib/python3.6/site-packages/gpaw/calculator.py", 
> line 146, in __init__
> rank=33 L12:     atoms, **kwargs)
> rank=33 L13:   File 
> "/usr/local/python3/lib/python3.6/site-packages/ase/calculators/calculator.py", 
> line 359, in __init__
> rank=33 L14:     self.read(restart)  # read parameters, atoms and results
> rank=33 L15:   File 
> "/usr/local/python3/lib/python3.6/site-packages/gpaw/calculator.py", 
> line 226, in read
> rank=33 L16:     self.wfs.read(reader)
> rank=33 L17:   File 
> "/usr/local/python3/lib/python3.6/site-packages/gpaw/wavefunctions/pw.py", 
> line 768, in read
> rank=33 L18:     spin=kpt.s, collinear=self.collinear)
> rank=33 L19:   File 
> "/usr/local/python3/lib/python3.6/site-packages/gpaw/wavefunctions/arrays.py", 
> line 166, in __init__
> rank=33 L20:     data = data.view(float)
> rank=33 L21: AttributeError: 'NDArrayReader' object has no attribute 'view'
> GPAW CLEANUP (node 33): <class 'AttributeError'> occurred.  Calling 
> MPI_Abort!
> application called MPI_Abort(MPI_COMM_WORLD, 42) - process 1
> ----------------------------------------------------------------------------------------------
> 
> Can someone correct this error? Thanks a lot!

What version of GPAW is this?  On how many cores do you run it?  Can you 
show us the log file?

Jens Jørgen

> 
> PS: I have attched my atomic coordinate file in this letter.
> 
> Shuang Leung
> 
> _______________________________________________
> gpaw-users mailing list
> gpaw-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/gpaw-users
> 



More information about the gpaw-users mailing list