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.


Topics - Anders Blom

Pages: 1 2 3 [4] 5
46
The Atomic Manipulator contains a very handy functionality to cleave any crystal along an arbitrary direction, specified via the Miller indices. This makes it powerful to use VNL to set up structures for e.g. slab calculations, in addition to making it easy to construct two-probe systems from surfaces.

The Atomic Manipulator always creates "minimal electrodes", and then uses the "repetitions" keywords for the TwoProbeConfiguration() construction to expand the electrodes to their full configuration. This saves calculation time for the electrode part by converting a lot of atoms into a lot of k-points, but sometimes it is desirable to obtain the full, explicitly repeated configuration of the electrode cell instead.

For slab calculations, the best way to do this is to save the "Equivalent BulK" system (there is a ready button for this in the Atomic Manipulator), but if you want to keep the system as a two-probe system, then you can use the attached script instead. It converts a two-probe system with repetitions to one without. Up-front this may seem a bit useless, since it generates an identical configuration which just takes more time to calculation. It can however be used as a first step towards a more complex two-probe geometry, e.g. one where the electrodes are shifted in X or Y with respect to each other (after the electrode cell has been expanded accordingly).

Anyway, the script is attached, and hopefully someone will find it useful! To use it as-is, just type

Code
atk expand_numrep.py file.vnl

to expand the first two-probe configuration in file.vnl. The expanded two-probe configuration will be put back in the VNL file with "_expanded_reps" appended to the sample name. (The name "numrep" comes from the original name for this keyword in ATK 2.0 and TranSIESTA-C.)

47
Gallery / Periodic table of VNL colors
« on: April 29, 2009, 21:23 »
VNL uses the JMol color map to assign a unique color to each element. There is a reference in the manual too, but I find the attached pictures to be quite useful.

In addition to the color, they also indicate the van der Waals and covalent radii in a nice way.

I have also attached the input file I created to generate the figures. It's a simple XYZ file of the periodic table; just import it in VNL and drop it on the Nanoscope!

48
News and Announcements / LaTeX on the Forum!
« on: April 23, 2009, 09:21 »
You can now use [tex]\LaTeX[/tex] equations on this Forum! The syntax is simple, just enclose the LaTeX formula in

Code
[ tex ]...[ /tex ]

(without the spaces, they are inserted to prevent the tags from actually rendering TeX code!)

Some examples:

[tex]\blue\Large      e^x=\sum_{n=0}^\infty\frac{x^n}{n!}[/tex]

There is even an interactive editor for equations! Click the last icon in the second button row (the blue one, to the right of the "list" icon)!

More examples to come (for now, see http://www.yourmathstutor.info/forum/index.php?topic=4.0, which uses the same technique as we do)!

49
Future Releases / NanoLanguage editor
« on: April 6, 2009, 23:01 »
Which editor do you primarily use to develop NanoLanguage (or general Python) code? There are many, many editors out there, so if yours is not listed in the poll, please post it in a comment!

We could try to develop some syntax highlighting and/or completion files for the most popular ones, if possible!

50
Thanks to its ability to treat large-scale systems without demanding a huge premium in calculation time, ATK is an ideal tool to study the work function of surfaces. To demonstrate this ability, Cybernet Systems Co., our highly valued distributor in Japan, have authored a very detailed and instructive tutorial on this topic.

The systems used for the demonstration are various metal surfaces, and as the tutorial will show, ATK provides accurate values for the work function for a wide range of metals.

51
Did you know that you can visualize Bloch states with ATK/VNL?! :)

We have used this functionality in a new tutorial to demonstrate how spin creates a band gap in a zigzag graphene nanowire, which is gapless/metallic without spin included. By plotting the Bloch states we see that the two spin components localize on opposite edges of the ribbon.

An example of a Bloch state plot is attached.

52
Links to Resources and Publications / Papers from 2009
« on: March 2, 2009, 13:08 »
Some publications with ATK have already appeared in 2009! Very interesting reading, on

  • Tunnel currents across silane diamines/dithiols and alkane diamines/dithiols
  • CrAs(001)/AlAs(001) heterogeneous junction as a spin current diode
  • Half-metallic Au-V(Cr) quantum wires as spin filters
  • Transport properties of T-shaped and crossed junctions based on graphene nanoribbons
  • Switching characteristics of the phenoxynaphthacenequinone-based optical molecular switch with carbon nanotube electrodes

For more details and links to full text, see http://quantumwise.com/documents/ATK_Publication_List.html.

53
As useful as it may seem, numpy.arange() is not a reliable function. I recommend everyone to consider using numpy.linspace() instead, when possible.

From the documentation, it is pretty clear what arange() should deliver:

Code
arange(start,stop,step)

should give an array with values [start,start+step,start+2*step,...] until start+N*step > stop. "stop" is not part of the interval, the manual says.

So, let's try:

Code
arange(0.4, 1.1, 0.1)

Ok, this is what you expect: you get [0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], and as the documentation says the endpoint, 1.1, is not included.

But, now try

Code
arange(0.4, 1.1, 0.1)

This time you get [0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1] - the end-point is suddenly included!!!  :o

The problem lies deeply buried in the bit representation of floating numbers. Due to the rule used to determine the number of points in the array, the last element in the output array may be larger than "stop". Actually, the manual is honest enough to mention this, but it makes it a bit hard to trust the output from this function!

It should be said, that the implementation of arange() has been under a lot of debate, regarding this point; see e.g. http://osdir.com/ml/python.numeric.general/2006-02/threads.html, and search for "arange" on that page. However, no result has come of this, and as a result I recommend that arange() not be used if it can be avoided.

Fortunately, there is an alternative, which actually is even better (ok, it depends a bit on what you are trying to achieve). The function numpy.linspace() is a bit unknown but very useful, and above all more predictable!

The syntax is very simple (I just paste the result of "help linspace" here, for convenience):

Quote
linspace(start, stop, num=50, endpoint=True, retstep=False)
    Return evenly spaced numbers over a specified interval.

    Returns `num` evenly spaced samples, calculated over the
    interval [`start`, `stop` ].

    The endpoint of the interval can optionally be excluded.

    Parameters
    ----------
    start : {float, int}
        The starting value of the sequence.
    stop : {float, int}
        The end value of the sequence, unless `endpoint` is set to False.
        In that case, the sequence consists of all but the last of ``num + 1``
        evenly spaced samples, so that `stop` is excluded.  Note that the step
        size changes when `endpoint` is False.
    num : int, optional
        Number of samples to generate. Default is 50.
    endpoint : bool, optional
        If True, `stop` is the last sample. Otherwise, it is not included.
        Default is True.
    retstep : bool, optional
        If True, return (`samples`, `step`), where `step` is the spacing
        between samples.

    Returns
    -------
    samples : ndarray
        There are `num` equally spaced samples in the closed interval
        ``[start, stop]`` or the half-open interval ``[start, stop)``
        (depending on whether `endpoint` is True or False).
    step : float (only if `retstep` is True)
        Size of spacing between samples.

Use this function whenever you want to create a sequence of real numbers between a start and an end point, with a specified number of points. This is often more handy than specifying the point spacing, as you must do for arange() anyway.

54
A question popped up on CCL (mailing list for computational chemistry), which has a strong relevance for ATK. The question was (rephrased a bit):

Quote
For a calculation of a systems like [metalic electrode]-[molecule]-[metalic electrode] with molecule along the z axis, some literature references mention k-point parameters like 1x1x100 or 3x3x100 for the Brillouin zone integration. It is surprising, because in interface system like SAM in periodic condition, reasonable k-point parameters are like 8x8x1. Can you explain this difference?

The key point of Atomistix ToolKit (or the TranSIESTA method, which ATK is based on) is that the boundary conditions are not periodic in the z direction. Instead, open boundary conditions are used, in order to apply a voltage across the structure, so that one can compute the electron current under finite bias.

To understand why one needs many Kz-points in this case, assume that you have an ideal system, i.e. the electrodes are identical to the central region. Let HL, HC, HR be the Hamiltonians of the left electrode, central region, and right electrode, respectively. HL, HR are calculated under periodic boundary conditions, while HC is evaluated with open boundary conditions using self-energies obtained from HL and HR.

Now, clearly you will only get integer transmission in this system if HL=HR=HC. To obtain this, the same k-point sampling should be used in
the Kx and Ky directions for the electrode and two-probe calculation. This point is quite trivial.

In the z-direction, however, the two-probe calculation corresponds to an infinite number of Kz points, thus you need a lot of k-points in the
z-direction for the electrode calculation to ensure the same level of accuracy.

Generally, the literature values for Kz (and the VNL default) may be a little conservative, but it is relatively inexpensive since these k-points are only required for the electrode calculation which is the smaller and faster part of the whole computation.

55
A junction between metallic and semiconducting graphene nanoribbons is often proposed as a potential novel transistor structure (see e.g. Ren et al., Chinese Journal of Chemical Physics 20, 489 (2007)). We also used this structure in the ATK tutorial on graphene, where the structure was built by piecing together two armchair segments (electrodes) and the zigzag central region by hand. This involved quite a few complex steps, so I decided to make a simple script that constructs the complete geometry in one shot!

So, here it is - I hope it will be useful!

To use it, just load it into any editor, set the relevant parameters in the top of the script. The following aspects of the geometry can be easily controlled this way:

  • Width across (number of atomic layers) of the armchair segments
  • Number of armchair unit cell repetitions in both electrodes, as well as in the central region (screening surface layers)
  • Number of zigzag unit cell repetitions in the central region
  • C-H and C-C bond length
  • XY unit cell padding

Then just drop the script on the Nanoscope in VNL to visualized the geometry, and then, if you are happy with it, on the NanoLanguage scripter to set up the calculation. An example is included as a picture.

56
This topic has been moved to Installation Questions since it deals with installation issues.

http://quantumwise.com/forum/index.php?topic=67.0

57
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.

58
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 ;)

59
Scripts, Tutorials and Applications / Voltage sweep (I-V curve)
« on: December 12, 2008, 22:20 »
One of the fundamentally important applications of ATK is to produce an I-V curve for a two-probe system. There is, however, no simple way to do it without quite a bit of scripting, as noted in another post on this Forum.

Here is a script/module ivcurve.py (attached) that takes care of that, at least in a quick-and-dirty way. The script is not a masterpiece of software design, and does no error checking etc, but ... it works :-)

The idea is to minimize the code the user has to write in his own script. The only required code to add is something along the lines of

Code
import ivcurve
   
voltages=[0.0,0.1,0.2,0.3]*Volt

ivcurve.runIVcurve (
    twoprobe_configuration,
    two_probe_method,
    runtime_parameters,
    voltages,
    vnl_filename='myfile.vnl', sample_name='mysample',
    current_k_point_sampling = (1,1),
    current_number_of_points = 100
  )

iv = ivcurve.extractIVcurveFromVNLFile('myfile.vnl','mysample')

ivcurve.plotIVCurve(iv,'iv.png')

Hopefully the above is relatively self-explanatory, but we'll review some details below. Note how the variable names above are chosen to match those used by Virtual NanoLab when it produces NanoLanguage code for a two-probe system. Therefore it is very easy to just include the code above at the end of a script produced by Virtual NanoLab to obtain an I-V curve.

For a more complete example, see the attached script lih2li_iv.py. It is based on the Li-H2-Li system from the manual, just because it's relatively quick to compute, so it's easy to test the I-V curve script using this system. To run the example you should have the geometry file lih2li.vnl too; for simplicity it is also attached.

The code above should be inserted into a script, after the usual part which defines the TwoProbeConfiguration and the TwoProbeMethod, and also the run-time parameters. Then, insert the code snipped above at the bottom of the script, replacing the execution statement (executeSelfConsistentCalculation()) if present. If you used your own variable names for the configuration, method and run-time parameters, adjust accordingly.

The code snippet above
  • defines the voltages for which to compute the current
  • runs a sweep with one calculation for each voltage bias
  • produces a plot, stored in "iv.png" of the I-V curve

Important notes:
  • The bias values should come in sequence and start with 0 V, since for each bias, the previous converged calculation is used to initialize the calculation.
  • An alternative way to set up the bias is to use numpy; to sweep from 0.0 to 1.0 V in steps of 0.1 V, use
Code
import numpy
voltages = numpy.arange(0.,1.01,0.1)*Volt
  • If the runtime parameters contain a checkpoint filename, the value of the bias will be added before the extension to create a unique NetCDF file for each bias. Thus, if you specified file.nc for a run with bias 0.0, 0.1 and 0.2 V, you will get three nc files file-0.0.nc, file-0.1.nc, and file-0.2.nc.
  • The runtime parameters argument is required, but you can give None if you don't want any NetCDF files.
  • All the computed values of the current will be stored in the VNL file specified, under the given sample name. You can inspect these values in Virtual NanoLab afterwards too.
  • Remember to provide the correct integration parameters for the current (k-point sampling, in particular!).
  • The plot can be customized to your liking. ATK actually has a built-in plotting engine (matplotlib), and you can produce very beautiful plots directly in NanoLanguage by using it. I'll make a separate post on that below!
  • You can change the extension of the image file from "png" to any other supported file format (such as "eps").
  • To print the I-V values, add this code to the end of the script:
Code
print 'Bias (V)\tCurrent (A)\n' + '-'*40
for i in iv:
    print i[0],'\t\t',i[1]

It's not unlikely that I overlooked some detail in this script, which causes it not to work in a particular situation... But please try it out, and together we can update it to make it a powerful NanoLanguage tool!

Edit: Updated version of script, which is safe for running in parallel.

60
The libstdc++.so.5/6 is installed on most systems, but not all.

To install a missing libstdc++ library, visit http://rpm.pbone.net/ and search for libstdc++ for your relevant distribution. Download and rpm --install it (as root).

Link the installed library from the VNL lib directory, like so:
Code
ln -s /usr/lib/libstdc++.so.6 libstdc++.so.6

Modify as needed for the location of the installed library, as found by (as root, in /)
Code
find -iname libstdc++*

Pages: 1 2 3 [4] 5