[gpaw-users] ValueError: Array has wrong length: 2 != 10.

Jens Jørgen Mortensen jjmo at dtu.dk
Wed Sep 27 07:54:22 CEST 2017


On 09/26/2017 04:27 PM, Punit Kumar via gpaw-users wrote:
> Hello GPAW Users
>
> I am trying to calculate the lattice constant for La2O3 crystal after 
> reading the tutorial given in ase tutorial page
> https://wiki.fysik.dtu.dk/ase/tutorials/lattice_constant.html.
>
> I have modify it accordingly and attached my script file below. When I 
> run my script I got the following error
>
> Traceback (most recent call last):
>   File "la2o3_lattice_parameter_2.py", line 11, in <module>
>     la2o3 = bulk('La2O3', 'hcp', a=a0, covera=np.sqrt(8/3))
>   File 
> "/home/punit/.local/lib/python2.7/site-packages/ase/build/bulk.py", 
> line 94, in bulk
>     pbc=True)
>   File "/home/punit/.local/lib/python2.7/site-packages/ase/atoms.py", 
> line 220, in __init__
>     self.new_array('positions', positions, float, (3,))
>   File "/home/punit/.local/lib/python2.7/site-packages/ase/atoms.py", 
> line 403, in new_array
>     (len(a), len(b)))
> ValueError: Array has wrong length: 2 != 10.
>
> Can someone help me in figuring out this error. It will be a great 
> help for me.

The bulk() function is not that clever.  You must build your La2O3 
crystal in some other way.

     Atoms('La2O3', positions=..., cell=..., pbc=True)

I've improved the error message so that you now get:

     ValueError: Please specify 1 atom for hcp and not 5

Jens Jørgen

> Thank You
>
> Punit
>
>
>
> _______________________________________________
> 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