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
31
I have written a small utility that allows you to import VASP geometries to use, or just visualize, in VNL 2010.02.

To use it, drop the attached script on the Custom builder icon in VNL 2010.02. Then, drop your POSCAR/CONTCAR file on the drop zone that says "Drop file here". That's it, really - you should see the structure in the 3D window!

You can then transfer the structure further to the Bulk Builder to modify it, or the Scripter to perform a calculation on it, all using the blue "Send To" arrow in the lower right-hand corner.

Notes:
  • The importer will not attempt to read any comments in POSCAR to figure out the elements. Instead, it relies on a valid POTCAR or OUTCAR file residing in the same directory as the file you dropped.
  • It works fine even if your POTCAR/OUTCAR file is zipped (bz2, gzip, zip).
  • The script is written for VASP 5.x, I'm not sure if it will work with older versions.
  • It will not attempt to read any information about constraints, and if you use Selective Dynamics mode, it will only read the first structure.

If you have a POSCAR file that doesn't work, let us know. We plan to support proper import of VASP input files in VNL soon, so it will be good to test the code.

32
Scripts, Tutorials and Applications / Basis set range
« on: March 26, 2010, 09:12 »
One of the distinct features of ATK (or, more correctly, the SIESTA method) is the use of localized numerical orbitals basis sets.

Each basis set orbital has a finite range, beyond which it is identically zero. This gives sparse matrices which saves a lot of memory, esp. for large two-probe calculations, and makes ATK efficient in describing systems with abrupt interfaces, defects, and vacuum.

Knowing the basis set range can be important in many situations, e.g. if you are trying to figure out how long the electrodes need to be. And sometimes you want to increase the basis set range, if there e.g. is a vacuum gap in the system that needs to be bridged.

Now, in 2010.xx, the basis set range is specified explicitly. So, you just set the range to whatever you want. Of course, one should be careful and not make it deviate wildly from the default, atomic-like value, since that compromises the quality of the basis set.

In 2008.10 and earlier versions, on the other hand, the basis set range was implicitly defined via the energy shift, which is the difference in energy between the basis orbital and the true atomic orbital from which the basis orbital is derived. The atomic orbital has infinite range with an exponential tail, so the energy difference arises from imposing a hard cut-off radius.

The attached scripts provide some utilities that allows you to compute the basis set radius for given basis set parameters.

As an example of how to use these functions, attached is also a plot showing the radius of the carbon SingleZeta (LDA.PZ) basis set, as a function of the energy shift. Note the logscale on the horizontal axis; the shift goes exponentially with the radius (and not opposite!).

33
What to do if you have installed ATK 2010.02 (or 2010.01) on Windows, and double-click then desktop icon, but absolutely nothing happen?

The cause of this problem is that there is another installed program which also provides Qt 4.x libraries, but this program appears before ATK in the path. The most typical example is MIKTeX, which additionally has a slightly nasty habit of inserting itself at the beginning of the path. This means that if you install MIKTeX after ATK, the ATK desktop icon will stop working, and if it already is installed when you install ATK, the desktop icon will not function either.

To solve this, simply move the MIKTeX part of the path to after ATK's vnl/bin directory.

To change system environment variables, follow these steps.

1. From the desktop, right-click My Computer (or just Computer, in Windows Vista/7) and click Properties.
2. In the window that appears, click on the Advanced tab (or the Advanced system settings link, in Windows Vista/7)
3. Click the Environment Variables button.
4. In the Environment Variables window (see attached picture), select the PATH variable under "Systems Variables" and click Edit. Each different directory is separated with a semicolon; what you need to do is move MIKTeX to the end.

Tip: You may want to copy the whole path definition and paste it into Notepad and edit it there, as it's very hard to see what goes on in the small edit field.

NOTE: I cannot guarantee that this will not render some part of MiKTeX non-functional. However, I have MiKTeX installed in nice coexistence with ATK, after having followed the steps above.

An alternative (which e.g. can be used if for some reason you discover that MiKTEX stops working) is to set the "Start in" folder of ATK to the vnl/bin directory instead. To do this, right-click the ATK desktop icon and choose Properties. Copy the specification of "Target" to "Start in" and just remove "vnl.exe" from the end (see second attached picture).

34
The attached files implement support for importing and exporting CAR files in NanoLanguage for ATK 2008.10.

There are two versions of CAR files, as seen from the header (first line), which will say "!BIOSYM archive 3" for version 3 and archive 1 for version 1. The script handles both. I'm not sure if there's a version 2, let me know if you come across it.

A simple usage example would be:

Code
from ATK.KohnSham import *
from car import *

imported_configuration = importCARfile('testfile.car')

There is also an export function, which takes 4 parameters:

Code
exportCARfile(filename, configuration, CARversion, configname)

where CARversion and configname are optional (default version is 3).

I wish to point out that this is a rather experimental first effort. I didn't have too many CAR files to test with... In particular, I don't know if the conversion of the unit cell shape works in all cases. Therefore, please do let me know of any problems you have using this tool (and naturally attach any CAR files that fail to import properly).

There is an explicit assumption that the first unit cell vector A lies along X, that A and B span the X/Y plane and that the angle between them is [tex]\gamma[/tex]. The third vector C follows from the definition of [tex]\alpha[/tex] and [tex]\beta[/tex] as the angles between  B and C, and A and C, respectively.

35
We have discovered a problem with the Windows release of ATK 2009.12.0.3643. Fortunately we were quickly able to determine the reason for it, and we also have a temporary work-around. Since we are in the middle of an active development period, we are however not able to release a new package immediately.

It will take 1-2 weeks before an updated version will be made available.

Problem description

  • The symptom of the issue is that calculations don't converge, or converge to the wrong result, because of incorrectly computed eigenvectors
  • The problem only occurs when running threaded on multi-cores, on Windows. If you run ATK on a single core, all is fine.
  • On Linux, there seems to be no problem even with threading turned on, but we cannot be sure

Solution

The solution is to disable threading, which automatically is turned ON in Windows, but (usually, unfortunately!!!) turned OFF in Linux (this is outside of our control).

Therefore, users of 2009.12.0.3643 should set the following environment variables in Contol Panel>System

Code
MKL_NUM_THREADS   =   1
MKL_DYNAMIC       =   FALSE

Don't forget to remove these when installing the updated version later on!

As noted above, the code seems to run fine on Linux even with threading turned on (which usually has to be activated manually), but for now we recommend everyone to leave it turned off, for safety.

For reference, the problem is not in the ATK code, but it's a bug in Intel's MKL library. The bug was discovered in November and fixed December 21st, and we have now updated to the latest library version which should solve the problem.

36
After upgrading to Ubuntu 9.10, VNL 2008.10 will not start, because libg2c is missing. In earlier versions this library could just be installed from the Package Manager, but from 9.10 this is no longer possible.

The solution is to download the attached tar-file and manually install the required files in /usr/lib.

Installation instructions

1. Download and save the attachment in your home directory

2. Extract the tar-file:

Code
cd $HOME
tar xzvf libg2c_32bit.tgz

The next step differs between 32/64-bit distros.

3: On 32-bit Ubuntu:
Code
sudo mv libg2c.* /usr/lib

3: On 64-bit Ubuntu:
Code
sudo mv libg2c.* /usr/lib32

After this, VNL 2008.10 should start.

37
Future Releases / What is your Linux distribution?
« on: October 26, 2009, 18:05 »
In order for us to determine which Linux distributions that are most important to test ATK/VNL on, it would help a lot to know which distributions people out there are using. This will also help us decide which distros to support, in the case we discover some where the programs do not run properly.

Since there are many versions of each distribution, it would be great if you post the more precise distro/version in a comment too.

Thank you for your assistance!

PS: To all the Windows users - we'll make a Windows version poll too, but let's not mix that in with the Linux stuff, ok? :)

PS2: For a list of popular distributions, in general, see DistroWatch


38
It has been brought to our attention that if you run ATK using Sun Grid Engine, you need to take care not to over-allocate licenses.

If you use the default settings, and run a job over, say, 4 nodes, you will actually consume 4 master licenses, which is not what you want. To avoid this, you should use the setting

Code
#$ -l atk=0.25

or 4 nodes, 0.125 for 8 nodes, etc (that is, in general 1/N where N is the number of nodes).

The keyword "atk" here is linked to the "-N" option, i.e. the name of the job. So, a more complete way to start a job on 4 nodes would be

Code
#!/bin/bash
#$ -N atk
#$ -l virtual_free=1G
#$ -l h_cpu=40:00:00
#$ -l atk=0.25
#$ -pe atk=4
module load atk
atk script.py

39
Dear all,

there have been several questions on the Forum about the electrode constraints, in particular how they are related to the voltage drop.

To explain, finally, all the deeper aspects of the three available constraints, we have published a small presentation, that should explain why you should always use the undocumented DensityMatrix constraint if you want to compute the voltage drop, plus it sheds light on various other things related to the constraints.

40
News and Announcements / ATK SE 2009.06 released
« on: September 9, 2009, 09:50 »
New release: Atomistix ToolKit Semi-Empirical (ATK-SE) 2009.06
QuantumWise is proud to announce the release of its new software package for simulations of electronic structure and transport properties of nanostructures, Atomistix ToolKit Semi-Empirical (ATK-SE). ATK-SE offers basically the same functionality as ATK-DFT, while at the same time introducing several new features that allow for even more realistic modeling of nanoscale electronic devices.

ATK-SE sets a new standard for nanoscale device simulations! Faster than DFT, allowing for larger systems, and featuring a unique capability to calculate how electrostatic (metallic and dielectric) gates influence the electron transport. And that's just the beginning...!

For detailed information, see http://quantumwise.com/products/12-products/28-atk-se-200906.

41
To run VNL on a 64-bit Ubuntu, you must install the "lib32g2c0" package. This can be done either via the Synaptic Package Manager (menu System>Administration) or by using the command

Code
sudo apt-get install lib32g2c0

In addition, if you want to run a license server on Ubuntu 64-bit, see this thread.

42
As reported in a different thread, there is a problem running the license daemon lmgrd on Ubuntu 64-bit (e.g. version 9.04).

We never got to the bottom of it there, but the user didn't have a floating license anyway. However, there is still a real problem.

The symptom of the error is, that when lmgrd is started it reports

Quote
license daemon: system error code: No such file or directory

It's related to permissions; lmgrd is trying to create a file which it's not allowed to. Fortunately, there is a simple work-around.

1) First of all, use the lmgrd (32-bit) provided in the ATK package. I'm not sure if the 64-bit lmgrd will work with a 32-bit "atomist" vendor
daemon.

2) Next, as always, decide which user will run the license daemon. Root is not allowed, so it must be a simple user. I will call him "user"; this can
be a new dedicated account, "guest", "nobody" (these are usually pre-defined), or just the local ATK user.

3) Run

Code
sudo mkdir /usr/tmp/.flexlm

4) Run     

Code
sudo chown user /usr/tmp/.flexlm"
(change "user" as needed)

5) Start lmgrd as normal, as user "user"; to test it, use

Code
./lmgrd -z -c licensefile.lic
to run properly (as a daemon) remove the "-z".

This should allow you to run the license server and then ATK on Ubuntu 64-bit.

There may however be other problems with running VNL, we'll get back to that separately.

43
Installation and License Questions / FAQ: Opening ports
« on: August 10, 2009, 16:22 »
On various Linux distributions, and most notably RedHat Enterprise Linux 5 and similar, the default iptables rules mean that all ports are closed. Therefore, lmgrd will not be able to start (or be seen to outside computers).

To fix this, i.e. to run a license server on a RHEL 5 machine or any similar distro with iptables, you must open the relevant ports. Detailed instructions can be found here: http://www.cyberciti.biz/faq/howto-rhel-linux-open-port-using-iptables/

For lmgrd, you need to open first 27000 (or 27001 or whatever you choose as the lmgrd port; you need to enter this number in the license file, and use the same port number from the client computer), plus a port for the vendor daemon. Now, this port is random, unless you specify it explicitly. To do this, add a port specification to the VENDOR line in the license file, like so:

Code
VENDOR atomist port=34564

Then, open this port too. The port number is quite arbitrary, just make sure it is not used by some standard services. Choosing it quite large, in the 30000 range, is quite safe, most services work in the 2000-7000 range.

44
Scripts, Tutorials and Applications / Relaxation under bias
« on: July 30, 2009, 13:13 »
As many have noticed, the latest version of ATK do not support geometry optimization of a two-probe system under bias. Here is a solution that enables this feature!

First of all, let us point out one thing. The reason the functionality to relax under bias was removed in the first place (or more specifically, the reason why two-probes are relaxed as equivalent bulk systems; that's why you cannot use bias, since a bulk system cannot be biased), was that we found out that there was an ambiguity regarding the configuration that minimized the forces vs. the configuration that minimized the total energy. That is, the force minimum and the energy minimum did not coincide.

Now, some experts maintain that this is to be expected. Since the two-probe boundary conditions are open, the total energy is not a well-defined quantity, one should rather probably use the free energy.

However, the forces as computed by ATK should still be correct. Therefore, it should be possible to use the force-based Steepest Descent method to relax a two-probe system, even under bias. Now, all we need to do to enable this feature, is to tweak ATK a little bit, and this is what the attached script does.

An example is provided to show you how to use it. It's just a simple Li-H2-Li system, with constraints applied so that only the hydrogen atoms can move. It should converge in 9 steps or so.

The following things need to be observed:

1) Only the Steepest Descent method is supported, for the reason mentioned above. The default in ATK is actually QuasiNewton, however if you forget to specify Steepest Descent the script will not complain, it will just silently use it anyway (and use the default "time_step").

For details on the relaxation method itself, and how to specify parameters to it, see http://quantumwise.com/documents/manuals/ATK-2008.10/ref.geometricoptimizationparameters.html and the example provided there.

2) Unlike the built-in method for relaxation, the new function calculateOptimizedTwoProbeGeometry() (note that the function has a different name, to separate it from the native one) returns BOTH the optimized geometry AND the final self-consistent object. This saves you the hassle of re-calculating the last step, as is otherwise necessary if you wish to follow up with some analysis in the same script.

3) A bug regarding verbosity level was fixed, so now the same verbosity level applies to the whole run (the native version reverts to zero after the first step).

4) This is not an officially released version of this functionality, so please use it a bit carefully, and at your own risk :)

5) There is also support for initializing the relaxation from an already converged density matrix (in the form of an SCF object). This can be used to boot-strap a finite bias relaxation from a converged calculation, e.g. for the same bias or a lower one.

6) Finally, I would recommend you place the module script CalculateOptimizedTwoProbeGeometry.py centrally in your ATK installation, i.e. in lib/python2.4/site-packages (on Linux, use lib/site-packages on Windows). That way it will work in parallel just as well as in serial, and you don't have to worry about setting the Python path etc.

Attached files are:
  • The module script
  • An example NanoLanguage script
  • The VNL file needed by the example

Comments, feedback etc is always welcome!

Update, after the original post: Added support for "initial_calculation".

45
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!

Pages: 1 2 [3] 4 5