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 - ipsecog

Pages: [1]
1
I installed the latest beta-version of ATK, but I wasn't able to launch it, it complained about the license. So I wanted to open the Control Panel to check the environment variables, but lo and behold - I got a very weird error message:

Windows cannot find '%windir%\system32\rundll32.exe'. Make sure you typed the name correctly, and then try again.

This is very odd - the file is actually there! I tried to Google about it but those results are all about viruses and corrupted files, I don't think that's the case for me at all.

Any ideas?

2
I have heard that some other transport software has implemented a special algorithm for treating an ill-conditioned self-energy/electrode Hamiltonian. How does ATK handle this case?

3
General Questions and Answers / Installation of GPAW fails
« on: August 23, 2010, 16:59 »
I'm trying to install GPAW in ATK 10.8 on a Linux system, but I get a lot of weird error messages. I separated stdout and stderr to see what's going on, I'm just showing the end, where it goes wrong:

STDOUT
Quote
Writing ../../lib/python2.6/site-packages/gpaw-0.6.5147-py2.6.egg-info
mpicc -DPARALLEL=1 -DGPAW_INTERPRETER=1 -Wall -std=c99 -I/home/anders/QuantumWise/atk-10.8.0/atkpython/lib/python2.6/site-packages/numpy/core/include -Ic/libxc -I/home/quantum/quantumnotes/qw-control/quantumconnect/trunk/external-libs/build/include/python2.6 -I/home/quantum/quantumnotes/qw-control/quantumconnect/trunk/external-libs/build/include/python2.6 -o build/temp.linux-i686-2.6/c/bc.o -c c/bc.c
mpicc -o build/bin.linux-i686-2.6//gpaw-python build/temp.linux-i686-2.6/c/xc.o build/temp.linux-i686-2.6/c/libxc.o build/temp.linux-i686-2.6/c/pbe.o build/temp.linux-i686-2.6/c/point_charges.o build/temp.linux-i686-2.6/c/spline.o build/temp.linux-i686-2.6/c/vasiliev02prb.o build/temp.linux-i686-2.6/c/pw91.o build/temp.linux-i686-2.6/c/wigner_seitz.o build/temp.linux-i686-2.6/c/compiled_WITH_SL.o build/temp.linux-i686-2.6/c/blas.o build/temp.linux-i686-2.6/c/d2Excdn2.o build/temp.linux-i686-2.6/c/rpbe.o build/temp.linux-i686-2.6/c/ensemble_gga.o build/temp.linux-i686-2.6/c/tpss.o build/temp.linux-i686-2.6/c/_gpaw.o build/temp.linux-i686-2.6/c/utilities.o build/temp.linux-i686-2.6/c/tpss_ec.o build/temp.linux-i686-2.6/c/mpi.o build/temp.linux-i686-2.6/c/localized_functions.o build/temp.linux-i686-2.6/c/lb94.o build/temp.linux-i686-2.6/c/tpss_ex.o build/temp.linux-i686-2.6/c/bc.o build/temp.linux-i686-2.6/c/plt.o build/temp.linux-i686-2.6/c/transformers.o build/temp.linux-i686-2.6/c/mgga.o build/temp.linux-i686-2.6/c/lcao.o build/temp.linux-i686-2.6/c/lfc.o build/temp.linux-i686-2.6/c/operators.o build/temp.linux-i686-2.6/c/blacs.o build/temp.linux-i686-2.6/c/lapack.o build/temp.linux-i686-2.6/c/vdw.o build/temp.linux-i686-2.6/c/mlsqr.o build/temp.linux-i686-2.6/c/bmgs/bmgs.o build/temp.linux-i686-2.6/c/libxc/src/gga_c_lyp.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_rpbe.o build/temp.linux-i686-2.6/c/libxc/src/lda.o build/temp.linux-i686-2.6/c/libxc/src/lca_omc.o build/temp.linux-i686-2.6/c/libxc/src/gga.o build/temp.linux-i686-2.6/c/libxc/src/gga_c_p86.o build/temp.linux-i686-2.6/c/libxc/src/lda_x.o build/temp.linux-i686-2.6/c/libxc/src/gga_xc_xlyp.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_am05.o build/temp.linux-i686-2.6/c/libxc/src/lda_xc_teter93.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_optx.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_hl.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_o3lyp.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_pbeh.o build/temp.linux-i686-2.6/c/libxc/src/mgga_c_m06l.o build/temp.linux-i686-2.6/c/libxc/src/functionals.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_b1wc.o build/temp.linux-i686-2.6/c/libxc/src/lca_lch.o build/temp.linux-i686-2.6/c/libxc/src/gga_xc_edf1.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_pw86.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_ft97.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_amgb.o build/temp.linux-i686-2.6/c/libxc/src/util.o build/temp.linux-i686-2.6/c/libxc/src/gga_c_pw91.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_g96.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_b3p86.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_pw91.o build/temp.linux-i686-2.6/c/libxc/src/gga_xc_lb.o build/temp.linux-i686-2.6/c/libxc/src/gga_c_pbe.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_mpbe.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_rpa.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_b3lyp.o build/temp.linux-i686-2.6/c/libxc/src/gga_xc_hcth.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_wc.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_wigner.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_b88.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_lg93.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_pbe.o build/temp.linux-i686-2.6/c/libxc/src/mgga_x_m06l.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_pbea.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_x3lyp.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_dk87.o build/temp.linux-i686-2.6/c/libxc/src/special_functions.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_pw.o build/temp.linux-i686-2.6/c/libxc/src/mgga.o build/temp.linux-i686-2.6/c/libxc/src/mgga_c_tpss.o build/temp.linux-i686-2.6/c/libxc/src/gga_c_am05.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_b86.o build/temp.linux-i686-2.6/c/libxc/src/mgga_x_tpss.o build/temp.linux-i686-2.6/c/libxc/src/gga_perdew.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_xalpha.o build/temp.linux-i686-2.6/c/libxc/src/hyb_gga_xc_b3pw91.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_vwn.o build/temp.linux-i686-2.6/c/libxc/src/lca.o build/temp.linux-i686-2.6/c/libxc/src/gga_x_b86_mgc.o build/temp.linux-i686-2.6/c/libxc/src/lda_c_pz.o  -L. -L/home/quantum/quantumnotes/qw-control/quantumconnect/trunk/external-libs/build/lib/python2.6/config -lmkl_intel -lmkl_intel_thread -lmkl_lapack -lmkl_def -lmkl_core -liomp5 -lpython2.6 -lpthread -ldl  -lutil -lm  -Xlinker -export-dynamic

STDERR
Quote
/opt/QuantumWise/atk-10.8.0/atkpython/lib/python2.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:871: error: expected specifier-qualifier-list before 'PyObject_HEAD'
/opt/QuantumWise/atk-10.8.0/atkpython/lib/python2.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:1084: error: expected specifier-qualifier-list before 'npy_intp'
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status

Puzzled...

4
I installed ATK 2010.01 and I can run VNL fine (it starts). But as soon as I click on the Viewer, or Database, or most other icons, the program just shuts down :(

Any ideas???

I can actually open the Editor, the Job Manager, and the Custom Analyzer, but none of the other tools.

I checked my OpenGL/3d graphics config, all looks fine there...

5
Links to Resources and Publications / Resource on spintronics
« on: February 6, 2009, 15:14 »
I found some useful information on spintronics here: http://www.spintronics-info.com/

6
There is a multitude of Python tutorials and resources on the net, as well as text books, which makes it hard to choose sometimes, especially for beginners. I figured we could start a small link collection in this thread, and people can post their favorite book titles or web resources for Python.

To kick it off, here are some!

  • Docs at Python.org - the official Python site. We have to mention this of course; the most useful resource (I think) are the Language Reference and Library Reference, while the tutorials leave some to be desired (in particular, too much clicking for my liking, I'd rather have a straight Powerpoint or PDF...
  • ... like this one! A nice, simple Python tutorial!. Has some basic stuff but also advanced discussions. This is some university course work, so you never know if the file is removed, so get it while you can!
  • Python Recipes. If you need a piece of Python code to do something relatively standard, chances are someone else has written it already, so look around first, before coding :)
  • The Vaults of Parnassus. Another collection of Python scripts and resources
  • Stack OverFlow. A really nice forum, in general.
  • Google. I'm not kidding - searching Google is, as we all know, one of the most powerful ways to find what you're looking for. You could also try Google Code although it seems it hasn't really gained momentum yet, at least not for Python.
  • Numpy home page. There is a saddening lack of up-to-date reference material for Numpy. The two main documents linked to from the Numpy home page are "Guide to Numpy" from 2006 and the reference for Numerical Python from 2001... Fortunately the basics are the same, still, but there are some changes that can cause some confusion.
  • Quick reference cards for Python and more...
  • 10 Python pitfalls. A bit old, but very useful reading.
  • Free Python programming resources. There are plenty of link collections out there, so why make your own? Well, none of them is complete...
  • Matplotlib / Pylab / pyplot home page

Please add your own favorite links!

7
Scripts, Tutorials and Applications / Bulk density of states
« on: January 9, 2009, 13:06 »
Does anyone have a script that can compute the bulk density of states (DOS) with ATK? The basic functionality is already available in ATK, in some sense; it's really just a matter of k-point sampling, compute E(k), then do some statistics... Ideally, one would want to use the tetrahedron method ;)

But of course it's not trivial...

8
General Questions and Answers / Question on temperature
« on: December 14, 2008, 23:11 »
I noticed that the default electron temperature is 300 K. In the example on optimizing a two-probe (manual chapter "Optimizing a two-probe system") the temperature is set to 1300 K, however I didn't see any comment on that choice. Is that a reasonable choice (1300 K)? Would a lower temperature hinder the optimization, and are there any drawbacks to choosing a higher temperature such as 1300 K? I was just trying to get a feel for that parameter, I'm using 1300 K at the moment since I'm not sure what else to use.

9
Putting data into VNL files is simple in NanoLanguage, using the addToSample() function, and appears to be a convenient way of storing data calculated by ATK. However, getting it out again can be a challenge (which kind of makes the idea of using it for storing data a bit less useful).

Of course, Virtual NanoLab can read the data and plot it, but what if you want the actual data, the raw numbers? That is, the data you had access to before you put it into the VNL file (typically via the toArray() method on the data object, e.g. the transmission spectrum).

Well, it turns out that the vnl files have a rather simple but undocumented structure; they are actually just Python zipfiles, and the data is stored in nested dicts with quite obvious labels! Therefore, it's relatively simple to extract the data, as long as you know what you are doing.

Disclaimer: The scripts below use undocumented features, and may not work in future (and/or some old) releases of ATK.

It's best to do some of these operations in interactive mode, but there is an initial part, which is in the attached script. Download it and run it as

Code
atk -i extract_from_vnl_file.py

Note the "-i" option; this will cause ATK to execute the script and then remain in interactive mode. The script will ask for the filename (because it cannot be given as a script parameter when you want to run in interactive mode); be sure to specify it with full path if it's not in the current directory. (On most platforms you can use the Tab key to complete the file name!)

At this point the script has created a variable (a dictionary) called samples which contains all the data. In this top-level dict, the keys correspond to the sample names. You can list the sample names:

Code
print samples.keys()

Let us assume that the sample we are interested in is called "mySample". To drill down to the data, give the command

Code
data = samples['mySample']['NanoLanguage']

Now, you can see which data has been stored on this sample:

Code
print data.keys()

Let us assume that we are looking to extract a transmission spectrum. In that case, you will hopefully see (perhaps among many other things) a key called "Transmission Spectrum Transmission Spectrum" in the printed list. However, it depends a bit on the version of ATK you used to create the VNL file. In some older versions it's just "Transmission Spectrum" and in some really old ones it might even be "TransmissionSpectrum". So, it's best to inspect the data to be sure!

Now we can extract the data:

Code
trans = data["Transmission Spectrum Transmission Spectrum"]

By typing "trans" and hitting the Tab key, we now find that the so-created "trans" data object has several methods and properties. (You can also give the command

Code
dir(trans)

to see the list.

What we are interested in here are the energies E and the values of the transmission at these energies, T(E). Here's how to access it:

Code
E = t.energy()._dataarray_
T = t.average_transmission()

And now we can just print the transmission spectrum (or do whatever you want with it):

Code
for i in range(len(E)):
    print E[i],T[i]

Note that if the calculation was spin-polarized, the transmission has a bit different shape.

Using the general method outlined above it should be possible to extract any kind of data stored in a VNL file. Do note, however, that each specific data type is stored in different ways, and you have to figure out the (undocumented) methods and properties for each one by using the "dir()" command quite a lot...

To summarize, here is a complete script that extracts and prints the transmission spectrum from a VNL file, by asking the user for the file and sample name (this script is also attached to this post as extract_transmission_from_vnl_file.py):

Code
import zipfile, cPickle, sys

filename = raw_input('Please enter VNL file name: ')
try:
    f = zipfile.ZipFile(filename,'r')
except:
    print 'Unable to locate VNL file "%s"' % filename
    sys.exit(1)

# Restore the samples from the VNL file into a dict
samples = {}
for zinfo in f.infolist():
    s = f.read(zinfo.filename)
    try:
        obj = cPickle.loads(s)
        samples[obj.name()] = {}
        for h in obj.history():
            samples[obj.name()][h.name] = h.resultsample.properties()
    except:
        pass

print 'The following samples are present in this VNL file:'
print samples.keys()

sname = raw_input('Please enter sample name to extract (default=first sample): ')
if sname.strip()=="":
    data = samples[samples.keys()[0]]['NanoLanguage']
else:
    data = samples[sname]['NanoLanguage']

# Some older versions used "Transmission Spectrum" or "TransmissionSpectrum"
trans = data['Transmission Spectrum Transmission Spectrum']
print 'Energy (eV)\tTotal transmission'
print '----------------------------------'
energies = trans.energy()._dataarray_
# Check for energy unit, if you want to be sure
# e_unit = t.energy().units()
T = trans.average_transmission()
for i in range(len(energies)):
    print '%g\t%g' % (energies[i],T[i])

10
Scripts, Tutorials and Applications / Density difference
« on: December 3, 2008, 15:06 »
NanoLanguage doesn't allow you to subtract two ElectronDensity objects from each other (it does allow you to add them, however), which means it's not immediately obvious how to calculate e.g. the spin polarization density.

By using some undocumented tricks, it is however possible to do it relatively easily anyway.

Disclaimer: The scripts below use undocumented features, and may not work in future (and/or some old) releases of ATK.

The steps involved are:

1) Extract the actual array data from the ElectronDensity objects. This is easy, just use the toArray() method on the object.
2) Calculate the difference. This is also easy, because the arrays (not the objects!) support the minus operation.
3) Store the difference. This is the tricky bit, but all we need to know is that the density data is stored in a private property called _ElectronDensity__electron_density_data.

The second part of the trick is to use the Python module copy to create a new ElectronDensity object (since this class has no constructor exposed in NanoLanguage).

Putting this together in a utility function, we obtain

Code
def calculateDensityDifference (d1,d2):

    import copy
   
    n1 = d1.toArray()
    n2 = d2.toArray()
    density = copy.copy(d1)
    density._ElectronDensity__electron_density_data = (n1-n2)
    return density

Calling this with two densities (d1 and d2), the function returns their difference in an ElectronDensity object, which you can put into a VNL file just as normal, and plot in Virtual NanoLab.

Pages: [1]