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 ... 336 337 [338] 339 340 ... 363
5056
General Questions and Answers / Re: how to get the table?
« on: June 22, 2009, 16:08 »
You have built a very beautiful and interesting system, but the central region is not a molecule, so it makes no sense to talk about a "molecular" projected Hamiltonian or HOMO/LUMO; these are all concepts related to finite system, not nanowires.

Your nanowire is probably semiconducting, which would explain the small transmission. But at any rate, the relevant concepts are the band structure of the nanowire, and other bulk concepts.

5057
General Questions and Answers / Re: how to get the table?
« on: June 22, 2009, 15:40 »
The MPSH concept as such does not really apply to the kind of system you have, since there is no well-defined "molecule" for which you can compute the spectrum in the absence of the electrodes, to compare to the MPSH spectrum (molecule with electrodes).

5058
General Questions and Answers / Re: how to get the table?
« on: June 22, 2009, 10:16 »
Yes, the marks in Figs. 3 and 5 are the MPSH eigenvalues. However, to get the correct spectrum you must project the Hamiltonian onto the molecule atoms only; from the number of eigenvalues, I believe in your case you have not selected any projection atoms.

Also, I wouldn't expect to get the same results as in that paper, since your electrodes are Li, while the paper used Au.

5059
Future Releases / Re: Voltage sweep command would be useful
« on: June 22, 2009, 09:23 »
There isn't really anything magical about sweeping the voltage. The script showed in the post you refer to can by tweaked extremely easily to support a different kind of sweeping. All you need to do, basically, is modify the "voltages" list. For instance, to run from 0 V to -3 V in steps of 0.5 V, use

Code
voltages = [0.,-0.5,-1.,-1.5,-2.,-2.5,-3.]*Volt

or for more flexibility, use NumPy:

Code
import numpy
voltages = numpy.linspace(0.,-3.,7)*Volt

and so on. You can just as well sweep backwards,

Code
voltages = [3,2,1,0]*Volt

but note that it can be hard to converge the high-bias calculation without initializing it from a lower-bias self-consistent density.

The updated version of the ivcurve script in this post should also be of relevance, esp. for the case of starting from a high bias, which perhaps is converged by climbing up from zero bias.

5060
General Questions and Answers / Re: how to get the table?
« on: June 22, 2009, 09:11 »
You have mixed up completely different concepts here, I'm afraid :)

THE MPSH eigenvalues, as used in the reference you mention, show how the molecular levels are affected by the coupling to the electrodes. MPSH = molecular projected self-consistent Hamiltonian. By diagonalizing this projected Hamiltonian, and comparing the eigenvalues to the isolated molecule, you can see how the levels are shifted due to the influence of the electrodes. Often, it's the change of the HOMO-LUMO gap which is of interest.

The transmission eigenvalues show how the transmission spectrum is broken down into components. For a particular energy E, there may be several channels contributing to the transmission, and by computing the transmission eigenvalues you see how many. Each transmission eigenvalue must be <=1 but the total transmission T(E) can be > 1 if you add up the channels.

In your case, the transmission eigenvalues are all zero, meaning the transmission itself at this energy is also zero.

5061
Please note that the symmetry points for tIn (body-centered tetragonal) and the orthorhombic ones are under evaluation. I just found some mistakes in them. I will post an update as soon as possible.

5062
The best thing is always to install and run VNL on your local computer, not on the server. It's only the license that must reside on the license server, since it's locked to that host.

5063
Some caution is required. The 111 direction is not necessarily the same as (1,1,1) in units of the primitive reciprocal lattice vectors. The "111" direction refers to the corresponding conventional system, thus in each case one needs to consider which combination of the primitive vectors that make up this "Cartesian" direction. For fcc, it is towards the X-point at (1,1,1)/2, i.e. the relevant point to use in this script would rather be (1e-6,0,1e-6).

5064
This is a bug, sorry about that.

The solution is to include these two lines in the script, after the definition of the gated two-probe method (i.e. insert this after line 243 in your script):

Code
import NL
gated_two_probe_method._TwoProbeMethod__algorithm_parameters['initial_density_type'] = NL.DensityFunctionalTheory.ATKParameters.TwoProbeAlgorithmParameters.NeutralAtom

Hope that solves all your issues!

5065
The short story

Some users may still have a lot of .atk input files for ATK 2.0 and earlier. The script attached in this post makes it extremely simple to upgrade such files to NanoLanguage files. The script converts all kinds of ATK 2.0 input files, including two-probe systems, into NanoLanguage scripts, ready to be run!

Quote
Compatibility note
To run the conversion script requires ATK 2.3 or higher. The generated scripts are compatible with ATK 2.2 and later (and also ATK 2.1 and 2.2 with relatively small modifications). However, we recommend you to use the latest ATK for several reasons (calculation speed, bug fixes, etc, etc)!

Introduction

It is our hope and intention, that these generated scripts will make it easier to learn NanoLanguage, and to lower the barrier in learning the new input format. Once you can see how the old keywords translate into NanoLanguage, it will be a simple matter to use the converted scripts as templates for new calculations, with different geometries and/or different parameters.

The script is very simple to use: download it into the directory where you keep you keep your atk files. Then, download and install the latest ATK, and run

Code
atk convert_atk_to_nl.py input.atk > script.py

for each input file (here symbolically called input.atk) you wish to convert. Batch processing is also possible, along the lines of (in bash)

Code
for i in *.atk ; do
    atk convert_atk_to_nl.py $i > $i.py
done

Two-probe systems

To convert two-probe systems, the input file should be the two-probe file (containing the definition of the central region). The script will automatically attempt to locate, and convert, the electrode files, based on the keywords TwoProbe::LeftElectrode::ATKFile or TwoProbe::LeftElectrode::NetCDFFile (and correspondingly for the right electrode). If the NetCDF keyword is used, the script will look for an ATK input file by the same name, but with the extension .atk. If this file is not found, the conversion will fail. In this case, please edit the two-probe script to match the names of the electrode input files.

Two-probe systems will be considered as heterogeneous if the name of the input files for left and right electrode are different. In this case, separate configurations and parameters will be defined for the left and right electrode, respectively, and the multigrid method will be employed in the two-probe calculation.

Output control

The generated script will, when you run it in ATK, produce verbose output (if you prefer less output, you can modify the verbosity_level defined in the head of the conversion script) a VNL file containing the structure, and a NetCDF checkpoint file.

All these files are named after the original input file, but with an additional label "converted" in the name. At the top of the conversion script are a few parameters that furthermore effect the output script:

  • include_defaults. If this variable is set to True, the NanoLanguage file will be very explicit, with all parameters specified. If it is False, only parameters which are different from default will be shown, giving simpler and more readable code. Keywords specified in the list explicit_defaults will however always be explicitly printed out in the NanoLanguage code, even if they are assigned default values.
  • remove_default_factories. If this parameter is True, empty constructions like basisSetParameters() will be removed, giving much simpler code.
  • round_dec. If this is zero, all atom positions are printed "as is", which can give some ugly things like 0.9999999991 instead of 1.0. Setting this parameter to a non-zero (positive) value introduces rounding to the specific number of decimals. 5 seems to work nicely, unless it is of importance that the coordinates are very exact, in which case 8 could be a good value to still avoid values like 4.800000000004. Note that Python is rather clever and does not print trailing zeros (unless specifically asked to). Thus, even if the rounding is set to 5 decimals, a value like 4.800000000004 will be printed simply as 4.8.
  • lattice_tolerance. See below.

Specific details

The following additional things should be noted about the conversion:

  • The script can handle input files for molecules, bulk, and two-probe systems. Electrode files are not converted on their own, but only as part of the two-probe.
  • Very limited error checking is performed. The input file is assumed to run properly in ATK 2.0. If it does, the script should be able to convert it.
  • Default values are assigned to unspecified parameters using the NanoLanguage standard. Thus, the ATK 2.0 default file is not read and not used.
  • K-point keywords are assigned default values corresponding to ATK 2.0 if they are not specified in the input file.
  • Note that spin is handled a bit differently in NanoLanguage, so take extra care when converting spin-dependent calculations. The converted script may not exactly correspond to the calculation as defined in ATK 2.0.
  • The script fully supports element-specific basis set parameters.
  • Relaxation/geometry optimization is supported. In this case, the final configuration will also be stored in the VNL file, with the additional "optimized_geometry" in the sample name.
  • All comments in the input files are conserved, and collected at the end of the output script.
  • All un-converted keywords are also included in the output script for reference.

In NanoLanguage, it is necessary to specify explicitly the Bravais lattice for bulk systems, while in ATK 2.0 the unit cell was given as just three vectors. The conversion script will attempt to recognize the simplest lattice types:

Code
simple cubic
fcc
bcc
simple tetragonal
simple orthorhombic
rhombohedral
hexagonal

All other lattice types will be represented as Triclinic. This actually has no effect on the calculations, as the lattice type is never used explicitly in NanoLanguage.

Note that a tolerance factor is employed in the recognition of the lattice type. This tolerance is used for comparison of angles and lattice constants to each other and known values. The default is 1e-5, which seems to work fine for orthogonal lattices. It might, however, be too low for hexagonal if the lattice vectors are given with
few decimals. In that case, it is safe to increase the value to, say, 1e-3. The parameter is easily accessible at the top of the script.

Unsupported keywords

  • The use of fractional spin is not supported in NanoLanguage. If such keywords are discovered in the input file, the conversion will fail.
  • Basis set keywords from the electrode files will be ignored; the same basis set size should anyway always be used for all element in the entire structure, also in ATK 2.0.
  • The script cannot yet convert pure analysis scripts; more specifically, the script must contain an atom list (and a unit cell, if it's a bulk system), and so on.
  • In fact, no analysis options are, so far, converted. This may be supported in an updated version later on.
  • All keywords related to pseudopotentials and ion files are ignored.
  • The keywords UnitCell::X0/Y0/Z0 are not supported (they are not used in ATK 2.1 and higher anyway).
  • The keyword Relaxation::MaxDisplacement is not supported (it is not used in ATK 2.3 and higher anyway). If you specifically want to use it with ATK 2.2, you can insert it back manually in the generated script. Please refer to the ATK documentation for details.
  • Constraints in relaxations are not supported, you need to manually add them by hand afterwards, see the manual.
  • The keyword TwoProbe::UseMultigridForElectrostatics is not supported (or rather, it is ignored). In NanoLanguage, the choice between homogeneous and heterogeneous systems is implicit (also see above about multigrid).
  • Gate voltage is not supported yet. The corresponding NanoLanguage construction is quite different in nature (see the manual page on gate voltage).

Compatibility notes

To make the converted scripts compatible with ATK 2.1 and 2.2 is generally very simple. In fact, most converted scripts will work fine with these versions, and require no changes, except this one: Remove the nlPrint() statements.

After that, the first step, if you have an older version of ATK that you wish to use, is to simply test the script! If it fails, try these things to make the script compatible:

  • Remove all references to algorithm_parameters. These parameters were introduced in ATK 2.3.
  • Change two_center_integral_parameters to two_center_integrals_parameters (an extra "s"). The name of this parameter was changed in ATK 2.3.
  • Remove the named parameters optimizer and trust_radius for geometricOptimizationParameters(). The construction was modified in ATK 2.3.

In all cases, these changes should only be necessary if include_defaults was set to True.

Final notes

You should always inspect the converted file carefully to verify that the conversion was successful, before attempting any calculations.

The script has been tested on a large amount of input files, but there may be special situations that have not yet been considered. If the script fails to convert an input file, or the converted script does not correspond to the input, please report the problem in this thread so that we can fix the problem!

We hope you will enjoy working with NanoLanguage, and explore and discover the much enhanced flexibility and control that the new input format offers over the old keyword-based input files. This script should hopefully make the transition easier!

5066
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.)

5067
Run the job under "nohup" (no hang-up).

For instance,

Code
nohup mpiexec -n 4 /opt/atk/bin/atk script.py > log.py &

Note that some instances of mpd produces a huge amount of error messages in the log when you run in the background unless you pipe stdin also. In that case, use

Code
nohup mpiexec -n 4 /opt/atk/bin/atk script.py > log.py < /dev/null &

5068
2,when I see the export log files ,in the energy band ,It have one line "Energy Band: number" , what's meaning of this number between that band index?
 and i also see four column under that line (the first three is k points ,and the last is energy), are they belong to one list? or from (i)[0] that you write
 I guess they belong to two different list(one is the kpoint list and the energy is another)?  any way  I want to know how to use member of a list and
 how can we know the constitutes of a list?

The index shown in the log appears to be shifted by 1. So, what is called "Energy Band: 1" would be index=0.

The columns are indeed kA, kB, kC, and the energy, in eV, and would belong to the list energy_bands.band(0). To extract elements (not members :) ) from this list, use square brackets. Thus, to print the energy of the 22nd k-point of the 13th band, I would add this line at the end of the VNL-generated script for the band structure calculation:

Code
print energy_bands.band(12)[21]

Note the shift by 1! If I wanted the 1st k-point of the 1st band, I would use

Code
print energy_bands.band(0)[0]

5069
1,My python knowledge is poor, I don't know what's mean of (i)[0] of bands_dn.band(i)[0] in your post ? And waht is the difference between (i)[0] and
  [band][ i ]  ? i.e.  the difference one parenthesis one square brackets and two square brackets?
 by the way:the [band][ i ] is a segment in the manu of ATk -2008-manual CHAPTER 3. BULK MATERIALS (67page)
    ([band][ i ] have no blank in the last square brackets is not correct display)

band() is a function (a method, if you wish) of the object returned by the function calculateEnergyBands(). It takes one parameter, an integer, corresponding to the band index (the loop variable "i" in our case). The band() function in turn returns a list which has the same length as the k-point list. In our case there is just one k-point, so the energy we are looking for is the first element, [ 0 ].

Blanks are often irrelevant in Python. [ j ] and [j] is the same; I use [ 0 ] above because without spaces the Forum thinks I'm trying to make a list :)

5070
The original script works fine, it just assumes that you will also run the first bias point instead of restoring from an existing calculation. However, the new script is more general, and also allows for this case by just excluding the parameter "initialize_from" when you call runIVcurve. So, you might as well just stick to the new version.

However, you will probably not want to scan the two voltages at the same time. Better stick to a particular bias, and scan the gate, or opposite.

Pages: 1 ... 336 337 [338] 339 340 ... 363