[ase-users] ASE-3.13 release candidate

Tom Daff tdd20 at cam.ac.uk
Thu Jan 19 15:56:20 CET 2017


Thanks @jensj for making the changes!

To answer Ask, I was using the vacuum=None configuration to be the zero for a surface energy calculation, i.e. (E_surface(...vacuum=10.0) - E_surface(...vacuum=None)). Since I exclusively use 3D periodic calculators it was the easiest way. I've just changed my script to modify the cell after creating a surface with 0.0 vacuum. Hopefully the scripts below will demonstrate and help anyone who gets bitten by the changes :)

In old ase you get a box with the 'layer' between the top and bottom:

>>> import ase
>>> from ase.build import surface, bulk
>>> ase.__version__
'3.12.0'
>>> n_layers = 6
>>> b = bulk('Fe')
>>> surface(b, indices=(1, 1, 0), layers=n_layers, vacuum=None).cell
array([[ 4.05879292,  0.        ,  0.        ],
       [ 0.        ,  2.48549291,  0.        ],
       [ 0.        ,  0.        ,  7.03003556]])
>>> surface(b, indices=(1, 1, 0), layers=n_layers, vacuum=0.0).cell
array([[ 4.05879292,  0.        ,  0.        ],
       [ 0.        ,  2.48549291,  0.        ],
       [ 0.        ,  0.        ,  5.85836297]])


Now the box can be manually adjusted according to the number of layers to add the extra layer between the top and bottom without needing to calculate the spacing directly:

>> import ase
>>> from ase.build import surface, bulk
>>> ase.__version__
'3.13.0b1'
>>> n_layers = 6
>>> b = bulk('Fe')
>>> surface(b, indices=(1, 1, 0), layers=n_layers, vacuum=None).cell
array([[  4.05879292e+00,   0.00000000e+00,   0.00000000e+00],
       [ -3.43997957e-17,   2.48549291e+00,   0.00000000e+00],
       [  0.00000000e+00,   0.00000000e+00,   0.00000000e+00]])
>>> surface(b, indices=(1, 1, 0), layers=n_layers, vacuum=0.0).cell
array([[  4.05879292e+00,   0.00000000e+00,   0.00000000e+00],
       [ -3.43997957e-17,   2.48549291e+00,   0.00000000e+00],
       [  0.00000000e+00,  -0.00000000e+00,   5.85836297e+00]])
>>> s = surface(b, indices=(1, 1, 0), layers=n_layers, vacuum=0.0)
>>> s.cell *= [1, 1, (n_layers/(n_layers-1.0))]
>>> s.cell
array([[  4.05879292e+00,   0.00000000e+00,   0.00000000e+00],
       [ -3.43997957e-17,   2.48549291e+00,   0.00000000e+00],
       [  0.00000000e+00,  -0.00000000e+00,   7.03003556e+00]])


Tom





On 19/01/17 11:46, Ask Hjorth Larsen wrote:
> Hi
> 
> 2017-01-19 12:08 GMT+01:00 Tom Daff via ase-users
> <ase-users at listserv.fysik.dtu.dk>:
>> Hi!
>>
>> With regards to the removal of the 'dummy' lattice vectors that used to
>> be added for surfaces, I actually found that they were sometimes useful
>> as vacuum=None and vacuum=0 didn't mean the same thing. Setting
>> vacuum=None was an easy way of getting an oriented bulk cell identical
>> to the surface, whereas vacuum=0 gives you the same atoms but with no
>> separation between the top and bottom layers. Of course it is possible
>> to work out the interlayer spacing and add that as 'vacuum' to achieve
>> the same thing, but I thing the documentation for build.surface also
>> needs to be updated to reflect the changes.
>>
>> Tom
> 
> Could you provide a specific example as a script?
> 
> Best regards
> Ask
> 
>>
>>
>>
>>
>> On 17/01/17 10:22, Jens Jørgen Mortensen via ase-users wrote:
>>> Hi!
>>>
>>> I've just uploaded ase-3.13.0rc1 to PyPI.  I would love as many of you
>>> to install it and try it out on some of the things you use ASE for:
>>>
>>>     $ pip install ase --pre --user
>>>
>>> or
>>>
>>>     $ pip3 install ase --pre --user
>>>
>>> See (incomplete) list of changes since 3.12 here:
>>>
>>> https://wiki.fysik.dtu.dk/ase/releasenotes.html#git-master-branch
>>>
>>> Jens Jørgen
>>>
>>>
>>> _______________________________________________
>>> ase-users mailing list
>>> ase-users at listserv.fysik.dtu.dk
>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>> _______________________________________________
>> ase-users mailing list
>> ase-users at listserv.fysik.dtu.dk
>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users


More information about the ase-users mailing list