Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Anders Blom

Pages: 1 ... 358 359 [360] 361 362 363
5386
There is none thing one should (always) observe with these 1D systems, and that is of course the transverse unit cell. The script tries to make the unit cell large enough to avoid electrostatic interactions with neighboring cells in the XY plane, but for serious work this should be checked carefully.

Fortunately it is nowadays easy to open a bulk sample in the instrument Bulk Builder in VNL and quickly adjust the unit cell vectors.

There is a relatively simple way to check if the unit cell is large enough in the XY directions. If it is too small, the residual electrostatic interactions will split the band structure in the degeneracy points at Gamma and Z = (0,0,0.5). Other parameters, like mesh cut-off or basis set size etc do not break degeneracies in this way.

5387
Dear all, I wanted to share with you a script that pretty much does the same thing as the Nanotube Grower in VNL, but in a much more versatile way.

Specifically, it contains easy-to-use functions to generate
  • Perfect nanotubes, as bulk
  • Carbon or boron-nitride tubes (or any A-B tube)
  • Ideal two-probe representations of nanotubes
  • Molecular nanotube segments for editing and insertion as central region in two-probes

I will make a more proper tutorial around it later, but I just wanted to let everyone get a chance to try to script.

Essentially, it's built up around a class called Nanotube which has a lot of useful methods like chiralVector(), radius(), etc. These will be documented separately later on.

Then, there are 4 high-level functions that use this class:

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

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

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

def createPerfectNanotubeAsTwoProbe (n,m,elec_reps,sr_reps,elements=(Carbon,Carbon),bondlength=1.422*Ang)

The parameters are almost the same for all functions.

  • n and m are of course the nanotube indices, as in a (n,m)=(4,1) nanotube
  • reps is a repetition factor (along the tube), by default always 1
  • elements should be a tuple (or list) with 2 elements, like (Carbon,Carbon) or (Boron,Nitrogen)
  • bondlength is the carbon-carbon (or whatever) distance; must be given with unit

For the two-probe function, there are 2 repetition parameters instead of one: one for the electrodes (elec_reps) and one for the scattering region (sr_reps).

The functions all return a configuration. You can use it as it is, in the script, or store it in a VNL file for manipulations in VNL or later use. For instance, running

Code
from ATK.KohnSham import *
from Nanotube import *

# -----------------------------
# Tube parameters
# -----------------------------
aCC = 1.422*Ang
n = 12
m = 1
element1 = Boron
element2 = Nitrogen
# -----------------------------

nanotube = createNanotubeAsBulk (n,m,1,(element1,element2),aCC)

vnl_file=VNLFile("BN_nanotube.vnl")
vnl_file.addToSample(nanotube,"Boron-nitride (12,1) nanotube")

produces a file that we can visualize in VNL (attached as image) with a (12,1) B-N nanotube.

Dropping the VNL file on the NanoLanguage scripter, we can now immediately proceed to calculate its band structure, for instance, etc.

5388
General Questions and Answers / Re: some question about the DOS
« on: January 12, 2009, 11:10 »
Getting the PDOS is, in principle, not very difficult, however ATK is not prepared for it, and to do it in a script would therefore require quite a lot of tweaking, indeed... It is something that can be looked into however.

One thing to clarify is what is meant by the PDOS. Some people refer to it as the density matrix projected on specific atoms and orbitals, others prefer it to mean the real-space density (projected in the same way).

As for what the DOS "is", it is the total surface density of states for the complete two-probe system. Thus it is a composite DOS of the band structure of the electrodes and the localized levels of the molecule (broadened by the coupling to the electrodes).

Technically it's computed from the Green's function, and thus it is accurate and trustworthy on the same level as the transmission spectrum and current.

5389
I mentioned in the original post that you can do nice plotting with ATK + matplotlib. A specific example of this is how the I-V script plots the results, and we can present that in a bit more detail, for those interested.

Remember from the actual I-V calculation that we have stored the values of bias and current in an array called "iv".

The simplest version of a plotting code would look like this:

Code
import matplotlib
matplotlib.use('Agg')
import pylab as P
from numpy import array

X = array(iv)[:,0]
Y = array(iv)[:,1]
P.plot(X,Y)
 
P.xlabel('Bias (Volt)')
P.ylabel('Current (Ampere)')
P.title('I-V curve for Li-H2-Li')

P.savefig('lih2li_iv.png')

This looks very much like Matlab, and should be trivial to understand. The plot is attached as "lih2li_iv.png", and we can see that there are some things we would like to improve one (no plot points, scaling of the y-axis values).

Now, in the actual I-V script we go a step beyond this, since we wish to give the user control over things like the output file name, plot title, axis labels, etc, but also
  • scaling (currents are in microamperes)
  • plot symbols and colors
  • axis min/max
  • ... and perhaps something more

There are many ways to solve that, but one simple way is to use a dictionary. The script contains an internal dict(ionary) the defines the default values, and we then allow the user to pass another dict to the plot function, and use it to overwrite the defaults with any user-defined parameters.

A simple example of this technique is

Code
# Default values
parameters = { 'a' : 5, 'b' : 3 }
# User-defined parameters
my_parameters = { 'b' : 8 }
# Apply user parameters
parameters.update(my_parameters)

After that, the dict "parameters" will have a=5 (default) and b=8 (user-defined).

We use this in the plot function of the I-V script as follows. The default values are:

Code
plot_params = {
        # Blue circles with a line is default plot style
        'plot_color' : 'b',   
        'plot_symbol' : 'o-',
        'ylabel' : 'Current (micro-Ampere)',
        'xlabel' : 'Bias (V)',
        'grid' : False,
        'title' : 'I-V curve',
        'ymin' : None,
        'ymax' : None,
        # Scaling factor for the y-axis
        'yscale' : 1.e6
    }

To result of using these default can be seen in the original post (updated!).

The user can then make his own preferences, like

Code
    my_plot_params = {
        # I want a green line with X plot symbols
        'plot_color' : 'g',
        'plot_symbol' : 'x-',
        # No scaling, please
        'yscale' : 1
        'ylabel' : 'Current (Ampere)',
        # I want a grid
        'grid' : False,
        'title' : 'I-V curve',
    }

He then passes this to the plot script:

Code
ivcurve.plotIVCurve(iv,'lih2li_iv_green.png',my_plot_params)

The result is also attached, as "lih2li_iv_green.png".

As mentioned above already, more details on matplotlib is available on their webpage.

Hopefully this demonstrates some of the powerful stuff you can do with plotting inside ATK!

5390
There is a new tutorial on the web site (http://quantumwise.com/publications/tutorials) on the topic of graphene nanoribbons that might be useful to some people ;)

5391
General Questions and Answers / Re: a spin problem
« on: January 8, 2009, 16:24 »
There is a tutorial on the web site (http://quantumwise.com/publications/tutorials) on the topic of graphene nanoribbons that you might find useful.

Regarding the original question, when you refer to the "spin value of every atom in my system", do you mean the resulting spin polarization of each atom produced by the self-consistent calculation, or is this still a matter of input?

For output, you should look at the Mulliken populations. For input, I recommend looking in the manual under electronDensityParameters()

5392
Installation and License Questions / Re: lmgrd error
« on: January 8, 2009, 15:56 »
You cannot use lmgrd with a node-locked license (as you have), so there is no point in trying ;)

5393
Unfortunately, it's complicated. First of all you need access to internal quantities, and second it involves some relatively complex surface integrals. I suppose by the time implement it, we will take a lot of inspiration from SIESTA (see http://www.uam.es/departamentos/ciencias/fismateriac/siesta/manual-2.0/node18.html, scroll down to "PolarizationGrids").

5394
In principle, this is possible, meaning that the formalism allows it, and all quantities required are present in the code. It is, however, not implemented in ATK yet.

5395
A two-probe system is periodic in the two directions perpendicular to the transport direction (which we always take as Z for simplicity). Therefore, it's easy to set up a bulk electrode cell to represent a whole metal surface, for instance. You just have to remember to make the surface unit cell large enough that the molecule in the central region does not interact with it's repeated copies.

If, on the other hand, you wish to have a 1D-type of electrode, like a nanotube, you have the opposite "problem"; you must include enough vacuum in the XY unit cell that the electrodes have no interactions with their repeated copies.

Compare the two attached figures, one for a bulk electrode ([111] 3x3 fcc Au) and one for a nanotube. Both two-probe systems are repeated 3x2 times in the transverse directions; note the unit cells!

I'm not sure I understood the question on hardware, but regarding the vacuum, obviously this adds to both the CPU and memory usage, since the real-space 3D grids can be quite large, and the Poisson equation will be heavier to solve. Usually this is, however, not a problematic constraint that limits the size of the calculation.

1D systems typically exhibit a slightly worse performance gain in parallel due to the 1x1 k-point sampling in the XY plane. On the other hand, the way ATK handles memory partitions along the transport axis, and the reduced number of neighbor atoms, typically means that you can handle a larger number of atoms in such an "elongated" configuration compared to a compact system.

5396
I split this topic. The original question was on a specific MPI issue, and follow-up posts should only address that point. Let's try not to mix different discussions in the same thread :)

MPICH1 (like 1.2.5) works fine - if you are running a ATK version pre-dating 2008.02. As far as I know, it does not work with the latest releases (2008.02 and later, which use MPICH2), and even if it does it's "by accident" and not recommended (i.e. it might not be stable, and error might be hard to detect).

In MPICH2, the corresponding command is

Code
mpiexec -n 3

5397
Installation and License Questions / Re: lmgrd error
« on: January 7, 2009, 22:55 »
On a quad-core, you might be better off using MKL over MPI, but it depends.

For the transmission calculation, for instance, you get a linear speedup using MPI (so, 4 times faster for you), but certainly not as much using MKL (OpenMPI). On the other hand, when you MPI-parallelize (esp the SCF loop) on a single node all processes will need X Mb of RAM = total 4X Gb, so it limits the size of the calculation you can perform, plus the processes will fight for the L2 cache a bit...

But the only way to really find out is to try it, because it differs a lot between different system sizes, geometries, and parameters like k-point sampling etc :)

5398
General Questions and Answers / Re: Some errors
« on: January 7, 2009, 22:48 »
It certainly seems confusing, but perhaps a simple explanation can be found. To proceed, however, I think we need to see the script you are using, and the exact command line arguments, in sequence, and at what point and how the error occurs. Also, is a VNL file produced? (Start by removing it, before running any script.) What does it contain? (Use the Result Browser in VNL to inspect its contents.)

You can remove the configuration from the script if you wish, it probably makes no difference for this issue anyway.

5399
Installation and License Questions / Re: lmgrd error
« on: January 7, 2009, 17:02 »
The lmgrd is not huge (800 kb) but still larger than the allowed post max size on the forum. The 64-bit lmgrd that works, to my best knowledge, is included in the 64-bit ATK package, in the "bin" directory. If this doesn't work, please post the error messages, how to reproduce the error, etc, so we can follow up on it.

If there are specific issues for Mandriva (which is not an officially supported platform), you could try to use an lmgrd from http://www.globes.com/support/fnp_utilities_download.htm instead.

Also note the post above regarding the 32/64-bit vendor daemon.

5400
Actually, the number are not really different on the colorbar... The data set contains values between -11.1 and 12.2.

  • Using "sign" shows this full range on the colorbar, but uses blue (cyan) for all negative values and red for all positive. (The "third color" in the middle is a VTK artifact but has no real influence on the plot.)
  • Using "magnitude" is probably not proper for this plot. What you get in that case is that first all negative values are converted to positive ones; then we have only have values from 0.0 to 12.2, and these are then according to the colorbar.
  • Using "value" would be the correct alternative to "magnitude", and would color all data values differently, from -11.1 to 12.2. Try it :)

In general, there is no "correct" (and hence no "wrong") choice, it's a matter of how you want to present your results.

Pages: 1 ... 358 359 [360] 361 362 363