Tutorial 13: Reading from a xyz file

Warning: the version of NanoTCAD_ViDES.py available here solves some problems with the definition of defects in the material (to be released in the new version of the code).

In this tutorial, we will go through the definition of a
system by means of a molecular editor.
In particular, we will consider a nanoribbon, where a hole is defined in the middle.
We will exploit the molecule editor Avogadro, which can be found here.
Any other editor can work as well.

Let’s first define a nanoribbon with 5 atoms along the transversal direction and long 3 nm. Please pay attention that the number of slices have to be at least larger than 4, in order to correctly compute the transport with the Hamiltonian class.

In order to do that we can simply use the following script:



In order to generate the hole in nanoribbon (central part of the device), we can exploit Avogadro as in this movie, opening the ribbon.xyz file just created above.

Now we have to elaborate the generated file (ribbon5_test.xyz) so to be “understood” by NanoTCAD ViDES simulator, i.e. we have to create the Hamiltonian in the format described in the tutorial 9.

We will use the create_H_from_xyz command.

As usual, let’s import the NanoTCAD ViDES module

from NanoTCAD_ViDES import *

Let’s extract the x,y and z vectors of the atoms coordinated from the created file, through the get_xyz_from_file command


and let’s create the Hamiltonian (the hopping parameter has been set to -2.7 and the onsite energy to 0).

At this point, we can create the Hamiltonian class 

and compute transport 


Comments are closed.