[ase-users] Problems reading XCrysDen-files in ASE-gui

Jakob Blomqvist jakob.blomqvist at mah.se
Tue Jan 15 16:21:53 CET 2013


Dear all,

I will take this to the user-list too.

I've tried to use ag to read xsf-files converted from Quantum Espresso 
output files using QE's own xsf-converter script.
There seem to be several problem illustrated with the attached xsf-file 
QE_Au.xsf.
The first problem is that io/xsf.py doesn't allow for symbols in it but 
only atom number. xsf-file format, however, allows for both. Another 
problem is that xsf.py requires that the file contains 
BEGIN_BLOCK_DATAGRID_3D through the:
"assert 'BEGIN_BLOCK_DATAGRID_3D' in line"
in line #159 in ase/io/xsf.py
but xsf-file format doesn't require it.

I suggest to add some alternative section that allows for nothing after 
the atomic positions section.

Finally, If forces are included as 3 floating-point values directly 
after the atomic positions then running ag file.xsf results in error:

    File "/home/jakob/ase/ase/gui/ag.py", line 131, in main
     run(opt, args)
   File "/home/jakob/ase/ase/gui/ag.py", line 91, in run
     images.read(args, string2index(opt.image_number))
   File "/home/jakob/ase/ase/gui/images.py", line 164, in read
     self.initialize(images, names)
   File "/home/jakob/ase/ase/gui/images.py", line 71, in initialize
     self.F[i] = atoms.get_forces(apply_constraint=False)
ValueError: shape mismatch: objects cannot be broadcast to a single shape

which seem to come from problems with lines #152-154 in io/xsf.py
###
         if forces is not None:
             image.set_calculator(SinglePointCalculator(None, forces, None,
                                                        None, image))
         images.append(image)
###
As they disappear if I remove these.

/best

-- 
Jakob Blomquist
Associate Professor
Dep. of Material Science
IMP, School of Technology
Malmo University
SWEDEN
+46(0)40 6657751
jakob.blomqvist at mah.se

-------------- next part --------------
ANIMSTEPS 4
CRYSTAL
PRIMVEC 1
    -2.0695847882    0.0000000000    2.0695847882
     0.0000000000    2.0695847882    2.0695847882
    -2.0695847882    2.0695847882    0.0000000000
 PRIMCOORD 1
1 1
   Au       0.0000000000     0.0000000000     0.0000000000       0.0000000000     0.0000000000     0.0000000000
PRIMVEC 2
    -2.0707700228    0.0000000000    2.0707700228
    -0.0000000000    2.0707700228    2.0707700228
    -2.0707700228    2.0707700228    0.0000000000
 PRIMCOORD 2
1 1
   Au      -0.0000000000     0.0000000000     0.0000000000       0.0000000000     0.0000000000     0.0000000000
PRIMVEC 3
    -2.0710242051    0.0000000000    2.0710242051
    -0.0000000000    2.0710242051    2.0710242051
    -2.0710242051    2.0710242051    0.0000000000
 PRIMCOORD 3
1 1
   Au      -0.0000000000     0.0000000000     0.0000000000       0.0000000000     0.0000000000     0.0000000000
PRIMVEC 4
    -2.0710242051    0.0000000000    2.0710242051
    -0.0000000000    2.0710242051    2.0710242051
    -2.0710242051    2.0710242051    0.0000000000
 PRIMCOORD 4
1 1
   Au      -0.0000000000     0.0000000000     0.0000000000       0.0000000000     0.0000000000     0.0000000000


More information about the ase-users mailing list