QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: jjhskang on March 17, 2010, 10:04

Title: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on March 17, 2010, 10:04
Hi!

I have calculated the transmittance of (5,5) carbon nanotube at zero bias. The ATK version I used for that calculation is 2008.10.  See the file attached. There you can find that the transmiitance is zero at E = 0 (Fermi energy), which is certainly incorrect! It should be 2, since there are two conducting channels at the Fermi level. I addition, you will also find many dips at other energies in the plot. This is a problem.

I used 4-4-4 primitive cells in the left electrode, scattering region, and the right electrode. Since the lattice constant for a primitive cell along the tube axis is 2.45A, each region is 2.45*4 = 9.8A, which seems to be large enough to exclude any appreciable overlap between nonadjacent units. I used DZP basis set, and 80 k-points.

Please answer the following questions:

(1) Is  this problem fixed in the newer version, i.e., in version "2010.02 bug fixed release (= 2010_fixed)" ?
(2) In the quantumwise home page, you mentioned that

  As before noted for the 2009.11 release, ATK-DFT 2010.02 is not a complete replacement of ATK 2008.10, as it is still missing a few key features. Therefore it is considered an alpha-version, while VNL hereby is released in another beta-version.

Does this mean that you do not recommend to use 2010_fixed instead of 2008.10?

(3) Do you have any other suggestion to solve this probelm?

Thanks!
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on March 17, 2010, 16:02
1) There is a bug in the FFT algorithm in the first 2010.02 (and possibly 2010.01) release which at least would almost certainly be the cause of the dips (and most likely the E=0 issue too). It is fixed in 2010.02 build 4038.

A too short electrode could also give these kinds of artifacts, but you can check that with the new release.

2) There are definitely things in 2010.xx which are not optimal yet, so caution is advised. I'd recommend using both, for a few months still. The old one as the "work horse", but checking with the new one to see if the results are the same, thereby learning the new interface, and the slightly modified scripting language.

By summer there will be a complete replacement of 2008.10 available.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on March 18, 2010, 01:43
Thanks!

One more question.

Do I need a separate lisence for the version 2010.02 4038 ? Or, can I use it just with the lisence for 2008.10 ?

Thanks!
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on March 18, 2010, 03:10
I apologize, I didn't read your post very carefully.

First, yes, you need a separate license for 2010.xx, but the upgrade is for free if you have an active maintenance contract. Please contact Marcus Yee about this.

Now, if these dips appear for the older 2008.10 code, most likely the explanation is that the electrodes are too short OR you have electrostatic interactions. A good way to test the box size (unit cell in XY) is to see if the band structure of the single unit cell has proper degeneracies at Gamma and (0,0,1/2), with this cell.

Also, do I understand you correctly that the left/right electrodes AND the central region are all 4 repetitions of the unit cell? Probably that's ok for the electrodes, but it might be too short for the central region; I would double it.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on March 18, 2010, 09:04
Le me make thing more clear.

(1) Do you believe that there is no bug in 2008.10 which can cause dips in the transmission?
(2) If (1) is true, are you saying that the supercell-supercell interaction along XY directions (not along Z direction) can cause the probelm?
(3) You are also saying that the size (Lz) of the scattering region may be too short along Z direction (= transport direction). What is the physical reason why you think that way? Is there any reason why the scattering region should be much large along Z axis than that of the electrode, when I calculate the transmittance of a pristine CNT?

Please note that I used a much larger value of Lz for my another calculation of the transmittance in which a molecule is adsorbed on the surface of (5,5) CNT. For this, please read another question which   I posted under the title "How can I get rid of noisy dips in the tranmission curve?" more carefully. There I also find the dip at E=0, although I used much large Lz.

Thanks!
 
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on March 18, 2010, 09:16
1,2 are both correct. The main cause for the dips is most likely either the supercell interaction or the electrode length.

For 3, it must be noted that ATK is not really designed to compute a perfect metallic system, for which we know the solution based on the band structure. So since your end goal is to simulate the modified system, it's best to calculate the pristine system under the same circumstances, i.e. using the same length of the central region as when the molecule is present. For the case with the molecule, there must be enough CNT in the central region to screen the influence of the molecule such that the area close to the electrodes is bulk-like.

Generally speaking, the longer the central region is, the closer one is to modeling the realistic system, and thus avoids the risk of artifacts. The pristine system is a special case, one might argue, but even so, electrostatic interactions between the electrodes cannot be ruled out if the central region is very short.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on March 18, 2010, 10:02
Some more questions:

(1) Does the size of the system along X and Y axes affect the computational time ? If I increase them, does the calcultion require much more CPU time? The CNT systems, i.e., both of pristine and CNT+molecule,  I have considere are alreay too big, which required more than three days for the calculation of zero-bias tranmittance only.

(2) That makes me hesitate to use larger supercell sizes of X and Y axes as well as using more atoms in the scattering region so that the perfect screening is guaranteed. Can you suggest me any possible solution for this kind of timing problem? How many cores of Zeon CPU would you recommend to use for the calculation of the zero-bias transmittance ?

(3)  Since dips at E=0 appears for both of pristine (5,5) CNT [which uses 4 prim cells for the scattering region] and CNT+molecule [which uses much longer tube for the scattering region], I doubt that the problem is originated from the short size of Lz for the scattering region. This is puzzling to me, unless this is due to the supercell-supercell interaction along X and Y axes.

Thanks!

Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on March 18, 2010, 16:13
Without seeing the exact current setup, it's hard to advise... Perhaps you can post the script?

Some more questions:

(1) Does the size of the system along X and Y axes affect the computational time ? If I increase them, does the calcultion require much more CPU time? The CNT systems, i.e., both of pristine and CNT+molecule,  I have considere are alreay too big, which required more than three days for the calculation of zero-bias tranmittance only.

A little bit, plus it increases the memory usage.

Increasing the electrode length will not add too much time. And, after all, if the results are wrong, one doesn't have much of a choice...

Quote
(2) That makes me hesitate to use larger supercell sizes of X and Y axes as well as using more atoms in the scattering region so that the perfect screening is guaranteed. Can you suggest me any possible solution for this kind of timing problem? How many cores of Zeon CPU would you recommend to use for the calculation of the zero-bias transmittance

This is a bigger question... If you have a parallel license, but only a single computer, it's not always the best idea to use MPI parallelization, esp. if that single machine only has one socket. Put generally, the top performance of ATK is achieved by MPI parallelization over several nodes (physically separate machines with individual RAM), while at the same time letting the code thread over the cores.

The problem if you run multiple MPI processes on a single node is that the processes will fight both for RAM and CPU. So unless the system is small, it might actually end up running slower than in serial...

Threading is controlled by the environment variables MKL_NUM_THREADS (set to the number of cores) and MKL_DYNAMIC (set to false). On Linux you will probably need to set these variables by hand, while on Windows the correct number of cores is typically automatically detected.

Also, as a general rule, Linux is faster than Windows and 64-bit is much faster than 32-bit.

Quote
(3)  Since dips at E=0 appears for both of pristine (5,5) CNT [which uses 4 prim cells for the scattering region] and CNT+molecule [which uses much longer tube for the scattering region], I doubt that the problem is originated from the short size of Lz for the scattering region. This is puzzling to me, unless this is due to the supercell-supercell interaction along X and Y axes.

Agree, it's not necessarily the first thing to try. First increase the electrode length (unless the XY cell is way too small, but again, since I don't see the setup I cannot know), then the cell (after checking with a simple band structure, using the same cell), and finally Lz of the central region.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on March 29, 2010, 08:14
Hi

I have made extensive calculations for pristine (5,5) CNT by changing the electrode length,  Lx, and the length of the scattering region. Lz = 2.45A for a primitive cell.

(a) 4-4-4 cells in the left electrode, scattering region, and the right electrode. Lx-Ly = 25A, Lz = 2.45*4
(b) 4-4-4 cells, Lx = Ly = 32A (much larger than that for (a)), Lz = 2.45*4
(c) 5-5-5 cells, Lx=Ly = 25A. Lz = 2.45*5

For all of the runs above, I still get a very sharp dip (Transmission = 0) in the transmission at E=0.

Also note that I find that T = 2.0 (correct answer) at E = 0.005 eV !!!

I guess I have tried all your suggestions in your previous reply,and I still get a wrong answer!

What can you suggest me next to get the right answer? Does't this mean that there's a bug in the code?
I hope that I would have your reply very soon.

Thanks!
 

Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on March 29, 2010, 13:30
You will need to determine if this is a singularity or not.

Using one of the previous calculation, calculate the transmission spectrum around 0.0 eV ( from - 0.01 eV to 0.01 eV ).
Remember to use many energy points so we get a really good resolution.

After doing this try to redo the calculation of the transmission spectrum with a smaller infinitesimal than the default.

Looking forward to hear the continuation.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on April 1, 2010, 07:31
Hi

Following your suggestions in your previous reply to this question, I have calculated the transmission at zero bias using real_axis_infinitesial = 0.004eV (default = 0.01) at every 0.001eV (very cvompact !), again finding dips around E= 0!

Below you will find nunerical values for the trasnmissiona round E = 0.

--------------------------------------
           E(eV)            Transmittance
--------------------------------------
           -0.010          1.999754
           -0.009          1.999750
           -0.008          1.999745
           -0.007          1.999736
           -0.006          1.999719
           -0.005          1.999681
           -0.004          1.999502
           -0.003          0.000542
           -0.002          0.000044
           -0.001          0.000022
            0.000          0.000019
            0.001          0.000024
            0.002          0.000056
            0.003          0.003167
            0.004          1.999573
            0.005          1.999692
            0.006          1.999724
            0.007          1.999738
            0.008          1.999746
            0.009          1.999751
            0.010          1.999755
            0.011          1.999757
            0.012          1.999759
-----------------------------------------

Obviously something is wrong!
I hope that you could consider this problem serioulsy, checking possible bugs in the code.

I hope to hear from you very soon.

Thanks!
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 1, 2010, 16:34
How many k-points do you have in the z-axis of the electrode calculation ?
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 1, 2010, 20:54
I tried to perform a standard calculation of the electrode to calculate the energy bands, since there must be a 1-to-1 agreement between these and the transmission spectrum in the ideal zero bias case.

I have found out that using your parameters there is an avoided crossing in the point where a simple nearest neighbor model would make the nanotube metallic. But this is not the case in this simulation. Hence the transmission spectrum also shows that this is the case.

If you want the system to behave metallic in this point, you will need to make some adjustments to your calculation.

For your convenience, I have attached a plot of the avoided crossing.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 1, 2010, 22:11
Maybe this is not a avoided crossing. But the 3-nearest neighbor model also gives this "avoided crossing".
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on April 1, 2010, 23:42
I don't think this is an anti-crossing, it's just the way the plotting is done. If you remove the lines, you can (and should, I guess) connect the dots in the opposite way around the Fermi level. With more k-points on the x-axis you could get arbitrarily close to E=0.

@jjhskang: Please post your script used for the calculation. I agree with Nordland it might be the Z k-points. The presence of so many minor dips at several energies (not just E=0) indicates artificial scattering from somewhere.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: nori on April 2, 2010, 02:12
I did transmission calculation of (5,5) CNT with "55cnt_l14_2_dzp_rsd.py" and there is no dip in my transmission spectrum.
So I guess ATK 2008.10 is able to treat (5,5) CNT properly and your calculation is something wrong.
(I'm not sure the exact reason why such dips appear in your calculation though...)

If you get the correct answer about this issue, you should give us the NanoLanguage script used for the calculation.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on April 2, 2010, 04:13
Hi!

It's possible that it is due to the number of k-points along the Z axis. I used 80 points, which might not be large enough to describe the band crossing at the Fermi level. I am currently running with more k-points.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 2, 2010, 08:36
I don't think this is an anti-crossing, it's just the way the plotting is done. If you remove the lines, you can (and should, I guess) connect the dots in the opposite way around the Fermi level. With more k-points on the x-axis you could get arbitrarily close to E=0.

Agreed that is not a avoided crossing, however other models suggest there is one. However this could only explain the dip at the E=0, other at the other energies

I did transmission calculation of (5,5) CNT with "55cnt_l14_2_dzp_rsd.py" and there is no dip in my transmission spectrum.
So I guess ATK 2008.10 is able to treat (5,5) CNT properly and your calculation is something wrong.
(I'm not sure the exact reason why such dips appear in your calculation though...

Nori beat me to it, but I did the same calculation and got perfect transmission and density of states as well. My calculation used fewer k-points than 80.

However I think that I know what the problem is. This is artificial scattering due to a small error in the central region. Normally when we see this artificial scattering it is much stronger, but in this system is a quite weak effect here, which lead me to think it was something else.

If you build the system in VNL, selecting a 5,5 CNT nanotube from the Nanotube Grower, and drop it onto the atomic manipulator, selects cleave, and repeat the system a number of times to make your two-probe. Then you have to enter a central region width. If you enter a distance of 1.23149 Ang, you will see no artifial scattering, however do you enter a less precises value of 1.23 Ang you will see tiny artificial scattering in your transmission spectrum, and will see dips in the transmission spectrum.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on April 4, 2010, 07:51
Hi

I used 80 and 200 k-points along the Z-axis, both of which give zero tranmittance at E = 0.
For your convenience, I attach three python scripts for that using 200 k-poinhts.

Youc an run

set_up.py -> scf_dm.py -> tspec_bias_0p0.py ins equence.

I hope to hear from you very soon.

Thanks!
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on April 4, 2010, 08:02
Hi!

If I look at Nori's python script, I find that he supplied very accurae atomic corrdinates. However, I usually do not use Nanoscript to build my python script, but rely on my own way of converting a pdb file(which is accurate up to 3 decial digits) whose coordinate are optimized using some other method to a pyton script.

One of the possible source of the problem could be the limited  number of digits in atomic coordinates. Do you agree with this? If then, I might have to device some other of writing the script which includes more than 3 decimal digits in the atmic coordinates.

Thanks!
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 4, 2010, 09:37
The number of digits do not matter in principal as long as the match is exactly, but if your converting script introduces an error on the last digit it will be enough for giving this errors, as I wrote two post earlier.  If you want perfect transmission, you will need perfect repetition of the electrode inside the central region.

PDB files do not have two-probe geometry, how do you setup the two-probe geometry?
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on April 4, 2010, 09:59
It's worth pointing out that the crucial dependence on the accuracy of the setup is only really noticeable for perfect systems, for which we in principle do not need ATK since the transmission is known (otherwise we wouldn't know it's "wrong").

For a real system, which has some complicated transmission spectrum because of scattering in the central region, it's probably enough with a few decimals. If the device function and design depends on higher accuracy it will not work anyway ;)
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Nordland on April 4, 2010, 10:05
For a real system, which has some complicated transmission spectrum because of scattering in the central region, it's probably enough with a few decimals. If the device function and design depends on higher accuracy it will not work anyway ;)

True.

If we want analytical results, we will need analytical precision.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: jjhskang on April 10, 2010, 08:49
Hi

I found that (5,5) CNT has  10 atoms with the same z coordinates. In my old runs, some of their z coordinates are different by 0.001 or 0.002A. [In this case, note that coordinates for 4 cells which constitute the eelctrode  still have exact replication of those for the primitive cell.] Therefore, I reoptimized the structure with those z coordinates the same, which resulted in changes in only X and Y coordinates, leaving the Z coordinates the same one another. I guess that this is a well-known problem of the mimimizer when the number of atoms is large. Now, the zero transmittance at E = 0 is solved. However, there are still dips in other energies.

It seems that the transmittance is quite senstive to small errors in the coordinates.
Title: Re: Possible Bug in the code: dips in the transmittance
Post by: Anders Blom on April 10, 2010, 22:44
Yes and no, I guess we can say.

As noted in a couple of posts above, the strong difference observed (T(E)=0 instead of 1 at the Fermi level) is a special case, where the expected results is a result of a particular symmetry (perfect periodicity) which is broken by the real system.

In other cases, where no particular symmetry is present to give a special value of the transmission, small changes in the coordinates, like those arising from fluctuations during a geometry relaxation, have a negligible effect. (This is not to say the relaxation itself has no influence, since it might move the atoms by a substantial amount from the original geometry to the equilibrium position.)

Also note that a change of T(E) in a narrow range of energies dE only has a small influence (roughly dE/V, where V is the bias) on the integrated transmission, i.e. the current - the physical observable.