QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: BandTheory on February 27, 2009, 20:20

Title: Convenient ways to generate nanotube segments ?
Post by: BandTheory on February 27, 2009, 20:20
Howdy folks,

My question is this:

Suppose I make a (4,4) nanotube in the Nanotube Grower.  It is in the bulk configuration.  Is there anyway I can, say, make six unit cells out of it and make it a molecule configuration ?

My real goal here is just to be able to generate coordinates for any given length I might be interested in, that I can then drop in the script editor where all the magic happens.

Thanks in advance,

BT
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Nordland on February 28, 2009, 00:15
My first question is why do you want to make it into a molecule?

If you real goal is to make be able to perform a calculation on a long nanotube, then you can generate the (4,4) in the Nanotube Grower.
Drop the script on the Bulk Builder and select repetitions button. Set n(C) to f.x 5 and wolla, drop this on the scripter. :)
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Anders Blom on February 28, 2009, 22:01
I suggest you have a look at this post (http://quantumwise.com/forum/index.php?topic=64.0)
It should give you want you want, and more :)
Title: Re: Convenient ways to generate nanotube segments ?
Post by: BandTheory on March 2, 2009, 20:29
To answer your question, I am interested not in long nanotubes, but in relatively small chunks of them.  Say five or six unit cells.

I have yet to fully delve into Mr. Blom's code.  Am I correct in thinking that by using the following snippit, I could create a 4,4 CNT of 5 unit cells.

def createNanotubeForCentralRegion(n,m,reps=1,elements=(Carbon,Carbon),bondlength=1.422*Ang)

Then would I call this in some way?

Say like CNTmetallic = createNanotubeForCentralRegion(4,4,reps=4,elements=(Carbon,Carbon,)...)

Like this ?  You'll forgive me if my Python knowledge is weak. 

If this is the case, how can I now use my "CNTmetallic" object ?

I much appreciate the help,

BT
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Anders Blom on March 3, 2009, 00:10
Fortunately, by coupling the script to VNL you don't need to know so much about Python :)

The simplest way possible is this:

Code
CNTmetallic = createNanotubeForCentralRegion(4,4,reps=5,elements=(Carbon,Carbon))

Now you will have your nanotube segment there, and you can manipulate it, save it as a VNL file for later use, etc.

If you wanted to insert it between metal electrodes, for instance, then cleave the electrodes etc before you perform the steps above, and the nanotube will be inserted as central region.
Title: Re: Convenient ways to generate nanotube segments ?
Post by: BandTheory on March 27, 2009, 21:08
Hello again,

I've been preparing presentations and such and so I have been unable to follow-up on this line of work.  Here's my problem and I think you may have addressed it in you "Script for creating nanotubes" but I have not been able to follow exactly what it means.  I tried to use the above script to generate the CNT segment as directed by dragging the little blue icon to the atomic manipulator, but VNL does not respond to this.

I also tried to use it to create a vnl file that I could then manipulate, but I received and error to the effect that ATK did not recognize "Nanotube"  when I tried to import it. 

I'm know I'm missing something, just not sure what.

Thanks again,

BT
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Nordland on March 27, 2009, 21:26
I think the best way to do it, is to create the tube in the tube builder, drag and drop it to the bulk builder, here will you can repeat it 6 times, then drag it to the scripter, and here you delete the unitcell, and make the BulkConfiguration into a MoleculeConfiguration.
Title: Re: Convenient ways to generate nanotube segments ?
Post by: BandTheory on March 27, 2009, 22:02
I've tried that before Nordland and I end up with a sort of carbon-wad.  All the carbons are balled up on top of each other which makes me think there is some kind of issue with the coordinates going from bulk to molecule.

BT
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Nordland on March 28, 2009, 00:04
It took me 20 seconds and here is the results:

Quote
from ATK.KohnSham import *

# Define elements and unit cell coordinates
elements = [Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon,
            Carbon, Carbon, Carbon, Carbon]
coordinates = [[ 10.32234097,   7.60652113,   0.        ],
               [ 10.32234097,   7.60652113,   2.46297622],
               [ 10.32234097,   7.60652113,   4.92595243],
               [ 10.32234097,   7.60652113,   7.38892889],
               [ 10.32234097,   7.60652113,   9.85190487],
               [ 10.32234097,   7.60652113,  12.31488132],
               [  9.52689552,   9.52689552,   1.23148811],
               [  9.52689552,   9.52689552,   3.69446445],
               [  9.52689552,   9.52689552,   6.15744066],
               [  9.52689552,   9.52689552,   8.62041664],
               [  9.52689552,   9.52689552,  11.0833931 ],
               [  9.52689552,   9.52689552,  13.54636955],
               [  7.60652113,  10.32234097,   0.        ],
               [  7.60652113,  10.32234097,   2.46297622],
               [  7.60652113,  10.32234097,   4.92595243],
               [  7.60652113,  10.32234097,   7.38892889],
               [  7.60652113,  10.32234097,   9.85190487],
               [  7.60652113,  10.32234097,  12.31488132],
               [  5.68614626,   9.52689552,   1.23148811],
               [  5.68614626,   9.52689552,   3.69446445],
               [  5.68614626,   9.52689552,   6.15744066],
               [  5.68614626,   9.52689552,   8.62041664],
               [  5.68614626,   9.52689552,  11.0833931 ],
               [  5.68614626,   9.52689552,  13.54636955],
               [  4.89070082,   7.60652113,   0.        ],
               [  4.89070082,   7.60652113,   2.46297622],
               [  4.89070082,   7.60652113,   4.92595243],
               [  4.89070082,   7.60652113,   7.38892889],
               [  4.89070082,   7.60652113,   9.85190487],
               [  4.89070082,   7.60652113,  12.31488132],
               [  5.68614626,   5.68614626,   1.23148811],
               [  5.68614626,   5.68614626,   3.69446445],
               [  5.68614626,   5.68614626,   6.15744066],
               [  5.68614626,   5.68614626,   8.62041664],
               [  5.68614626,   5.68614626,  11.0833931 ],
               [  5.68614626,   5.68614626,  13.54636955],
               [  7.60652113,   4.89070082,   0.        ],
               [  7.60652113,   4.89070082,   2.46297622],
               [  7.60652113,   4.89070082,   4.92595243],
               [  7.60652113,   4.89070082,   7.38892889],
               [  7.60652113,   4.89070082,   9.85190487],
               [  7.60652113,   4.89070082,  12.31488132],
               [  9.52689552,   5.68614626,   1.23148811],
               [  9.52689552,   5.68614626,   3.69446445],
               [  9.52689552,   5.68614626,   6.15744066],
               [  9.52689552,   5.68614626,   8.62041664],
               [  9.52689552,   5.68614626,  11.0833931 ],
               [  9.52689552,   5.68614626,  13.54636955],
               [  9.95849037,   8.96443081,   0.        ],
               [  9.95849037,   8.96443081,   2.46297622],
               [  9.95849037,   8.96443081,   4.92595243],
               [  9.95849037,   8.96443081,   7.38892889],
               [  9.95849037,   8.96443081,   9.85190487],
               [  9.95849037,   8.96443081,  12.31488132],
               [  8.30942726,  10.22980118,   1.23148811],
               [  8.30942726,  10.22980118,   3.69446445],
               [  8.30942726,  10.22980118,   6.15744066],
               [  8.30942726,  10.22980118,   8.62041664],
               [  8.30942726,  10.22980118,  11.0833931 ],
               [  8.30942726,  10.22980118,  13.54636955],
               [  6.24861097,   9.95849037,   0.        ],
               [  6.24861097,   9.95849037,   2.46297622],
               [  6.24861097,   9.95849037,   4.92595243],
               [  6.24861097,   9.95849037,   7.38892889],
               [  6.24861097,   9.95849037,   9.85190487],
               [  6.24861097,   9.95849037,  12.31488132],
               [  4.98324013,   8.30942726,   1.23148811],
               [  4.98324013,   8.30942726,   3.69446445],
               [  4.98324013,   8.30942726,   6.15744066],
               [  4.98324013,   8.30942726,   8.62041664],
               [  4.98324013,   8.30942726,  11.0833931 ],
               [  4.98324013,   8.30942726,  13.54636955],
               [  5.25455189,   6.24861097,   0.        ],
               [  5.25455189,   6.24861097,   2.46297622],
               [  5.25455189,   6.24861097,   4.92595243],
               [  5.25455189,   6.24861097,   7.38892889],
               [  5.25455189,   6.24861097,   9.85190487],
               [  5.25455189,   6.24861097,  12.31488132],
               [  6.903615  ,   4.98324013,   1.23148811],
               [  6.903615  ,   4.98324013,   3.69446445],
               [  6.903615  ,   4.98324013,   6.15744066],
               [  6.903615  ,   4.98324013,   8.62041664],
               [  6.903615  ,   4.98324013,  11.0833931 ],
               [  6.903615  ,   4.98324013,  13.54636955],
               [  8.96443081,   5.25455189,   0.        ],
               [  8.96443081,   5.25455189,   2.46297622],
               [  8.96443081,   5.25455189,   4.92595243],
               [  8.96443081,   5.25455189,   7.38892889],
               [  8.96443081,   5.25455189,   9.85190487],
               [  8.96443081,   5.25455189,  12.31488132],
               [ 10.22980118,   6.903615  ,   1.23148811],
               [ 10.22980118,   6.903615  ,   3.69446445],
               [ 10.22980118,   6.903615  ,   6.15744066],
               [ 10.22980118,   6.903615  ,   8.62041664],
               [ 10.22980118,   6.903615  ,  11.0833931 ],
               [ 10.22980118,   6.903615  ,  13.54636955]]*Angstrom

# Set up periodic atom configuration
periodic_atom_configuration = MoleculeConfiguration(
    elements,
    cartesian_coordinates=coordinates
    )

But remember to change to cartesian coordinates in the bulk builder prior to dropping it on the scripter.
Title: Re: Convenient ways to generate nanotube segments ?
Post by: Anders Blom on March 30, 2009, 09:48
Going back to using the script, which should work, there might be some typing mistake, plus that I recently updated the Nanotube.py script, so unless you have the latest version, it may not work. To check what is wrong you can always drop the script on the Job Manager instead; this will print all the Python error messages, if any, to the Log Window that appears.