CyRhmU.jpeg
查看: 1938  |  回复: 7
【奖励】 本帖被评价6次,作者zhangguangping增加金币 4.6
本帖产生 1 个 1ST强帖 ,点击这里进行查看

[资源] 利用VNL-2008.10构建体系,并导出为xyz格式的方法

很多做输运的同行们对构建双电极体系的繁琐很烦恼。我之前是用Giew+自己写的一些脚本来构建体系,发现比较繁琐。ATK的界面VNL可以较方便的构建体系,但是如果做输运计算不使用atk而使用TranSIESTA或者Smeagol的话,怎么利用VNL来方便的构建体系呢?下面咱们就开始讨论这个问题。(可能也还有其他的更简便的方法来构建体系,希望那些有其他更方便方法来构建体系的同学们将自己的方法分享一下。)
首先声明:这个方法以及下面提到的脚本不是我本人原创的。我只是负责把它翻译成中文并且总结了一下而已。详细的原帖请参看:http://quantumwise.com/forum/index.php?topic=5.0
下面的实践都是在window版本的2008.10版本的VNL上面操作的。对于别的版本,可能会有些许变化,或者不可行,需要自己尝试一下。
*************************************************
①首先在window安装的QuantumWise\Virtual NanoLab 2008.10.0\atk\lib目录下添加一个目录site-packages

②将下面的内容存为文件名为xyzexport.py的文件,放到上述目录下。

##########################

from ATK.KohnSham import *

def printXYZFile (configuration):
    elements = configuration.elements()
    coordinates = configuration.cartesianCoordinates()
    print len(elements)
    print 'From VNL'
    for elem,coords in zip(elements,coordinates):
        print elem.symbol(),
        for i in coords:
            print i.inUnitsOf(Angstrom),
        print


############################

③在VNL中利用Atomic Manipulator工具构建一个双电极体系。

④利用拖动图标将体系拖到Script Editor中,假设形成的脚本为:

################################

from ATK.TwoProbe import *
# Scattering elements
left_surface_elements  = [Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold]
central_atom_elements  = [Carbon,   Carbon,   Carbon,   Carbon,   
                          Carbon,   Carbon,   Sulfur,   Hydrogen,
                          Hydrogen, Sulfur,   Hydrogen, Hydrogen]
right_surface_elements = [Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold, Gold, Gold,
                          Gold, Gold]
scattering_elements = left_surface_elements + central_atom_elements + right_surface_elements

# Scattering coordinates
left_surface_coordinates  = [[  0.00000000e+00,   0.00000000e+00,   7.06330299e+00],
                             [ -1.44179070e+00,   2.49725485e+00,   7.06330299e+00],
                             [ -2.88358140e+00,   4.99450970e+00,   7.06330299e+00],
                             [  2.88358140e+00,   0.00000000e+00,   7.06330299e+00],
                             [  1.44179070e+00,   2.49725485e+00,   7.06330299e+00],
                             [  0.00000000e+00,   4.99450970e+00,   7.06330299e+00],
                             [  5.76716280e+00,   0.00000000e+00,   7.06330299e+00],
                             [  4.32537222e+00,   2.49725485e+00,   7.06330299e+00],
                             [  2.88358140e+00,   4.99450970e+00,   7.06330299e+00],
                             [ -2.88358140e+00,   6.65934610e+00,   9.41773796e+00],
                             [  0.00000000e+00,   1.66483653e+00,   9.41773796e+00],
                             [ -1.44179070e+00,   4.16209126e+00,   9.41773796e+00],
                             [  1.33226763e-15,   6.65934610e+00,   9.41773796e+00],
                             [  2.88358140e+00,   1.66483653e+00,   9.41773796e+00],
                             [  1.44179070e+00,   4.16209126e+00,   9.41773796e+00],
                             [  2.88358140e+00,   6.65934610e+00,   9.41773796e+00],
                             [  5.76716280e+00,   1.66483653e+00,   9.41773796e+00],
                             [  4.32537222e+00,   4.16209126e+00,   9.41773796e+00]]*Angstrom
central_atom_coordinates  = [[  1.44      ,   2.5       ,  15.68600003],
                             [  1.44      ,   1.29100001,  14.98800001],
                             [  1.44      ,   1.29100001,  13.59199999],
                             [  1.44      ,   2.5       ,  12.89399997],
                             [  1.44      ,   3.70899999,  13.59199999],
                             [  1.44      ,   3.70899999,  14.98800001],
                             [  1.44      ,   2.5       ,  17.4400001 ],
                             [  1.44      ,   0.35299993,  15.53000001],
                             [  1.44      ,   0.35299993,  13.04999999],
                             [  1.44      ,   2.5       ,  11.1399999 ],
                             [  1.44      ,   4.64700007,  13.04999999],
                             [  1.44      ,   4.64700007,  15.53000001]]*Angstrom
right_surface_coordinates = [[ -2.88358140e+00,   6.65934610e+00,   1.91477375e+01],
                             [  0.00000000e+00,   1.66483653e+00,   1.91477375e+01],
                             [ -1.44179070e+00,   4.16209126e+00,   1.91477375e+01],
                             [  1.33226763e-15,   6.65934610e+00,   1.91477375e+01],
                             [  2.88358140e+00,   1.66483653e+00,   1.91477375e+01],
                             [  1.44179070e+00,   4.16209126e+00,   1.91477375e+01],
                             [  2.88358140e+00,   6.65934610e+00,   1.91477375e+01],
                             [  5.76716280e+00,   1.66483653e+00,   1.91477375e+01],
                             [  4.32537222e+00,   4.16209126e+00,   1.91477375e+01],
                             [ -1.44179070e+00,   5.82692766e+00,   2.15021718e+01],
                             [  1.44179070e+00,   8.32418263e-01,   2.15021718e+01],
                             [  0.00000000e+00,   3.32967305e+00,   2.15021718e+01],
                             [  1.44179070e+00,   5.82692766e+00,   2.15021718e+01],
                             [  4.32537222e+00,   8.32418263e-01,   2.15021718e+01],
                             [  2.88358140e+00,   3.32967305e+00,   2.15021718e+01],
                             [  4.32537222e+00,   5.82692766e+00,   2.15021718e+01],
                             [  7.20895386e+00,   8.32418263e-01,   2.15021718e+01],
                             [  5.76716280e+00,   3.32967305e+00,   2.15021718e+01]]*Angstrom
scattering_coordinates = left_surface_coordinates + central_atom_coordinates + right_surface_coordinates

electrode_elements = [Gold, Gold, Gold]
electrode_coordinates = [[  0.00000000e+00,   0.00000000e+00,   0.00000000e+00],
                         [  1.11022302e-16,   1.66483653e+00,   2.35443440e+00],
                         [  1.44179073e+00,   8.32418264e-01,   4.70886880e+00]]*Angstrom

electrode_cell = [[ 2.88358145,  0.        ,  0.        ],
                  [-1.44179073,  2.49725479,  0.        ],
                  [ 0.        ,  0.        ,  7.06330319]]*Angstrom

# Set up electrodes
electrode_configuration = PeriodicAtomConfiguration(
    electrode_cell,
    electrode_elements,
    electrode_coordinates
    )

# Set up two-probe configuration
twoprobe_configuration = TwoProbeConfiguration(
    (electrode_configuration,electrode_configuration),
    scattering_elements,
    scattering_coordinates,
    electrode_repetitions=[[3,3],[3,3]],
    equivalent_atoms=([0,0],[-1,-1])
    )

####################################

在窗口中,在脚本最后添加两行:

from xyzexport import printXYZFile

printXYZFile(twoprobe_configuration.equivalentBulkSystem())
⑤然后拖入Job Manager工具中,在logWindow中会出现xyz格式的结构。
如果仅仅想得到扩展分子结构而不想得到带左右电极的双电极体系,那么将④中的第二行换成:
printXYZFile(twoprobe_configuration)
即可。
如果你想转换的体系不是双电极体系而是别的体系,那么
printXYZFile(twoprobe_configuration)
中的对象换成你脚本中相应的对象名称。

注:如果用上面的方法可能得到的双电极体系不是很美观,发现左右两个电极参差不齐,这个时候,
可以在③建立好双电极体系之后,利用"Save Equivalent bulk configuration to file"选项,将体系存为bulk体系,
然后进行④
以后再使用的时候就可以省略①②步了。
*************************************************


希望上述方法能够帮助那些平时利用Smeagol和TranSIESTA做计算的那些同志们构建体系。

[ Last edited by zhangguangping on 2011-7-31 at 12:05 ]
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

yongma2008

木虫 (著名写手)


★★★★★ 五星级,优秀推荐

支持一下
2楼2011-07-31 23:35:40
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

★★★★★ 五星级,优秀推荐

★★★★★
5楼2011-08-30 12:19:51
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

mengfc

金虫 (正式写手)


★★★★★ 五星级,优秀推荐

请问这个VNL在哪里下载呢?
6楼2012-11-26 09:05:26
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

@@@@0000

新虫 (小有名气)


★★★★★ 五星级,优秀推荐

谢谢
7楼2012-12-03 21:22:13
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
简单回复
2011-08-01 08:06   回复  
2011-08-25 21:52   回复  
五星好评  顶
wekow8楼
2013-06-27 12:58   回复  
三星好评  
相关版块跳转 我要订阅楼主 zhangguangping 的主题更新
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复(可上传附件)
信息提示
请填处理意见