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 ... 337 338 [339] 340 341 ... 363
5071
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.

5072
Here's how you would do it for a spin-polarized system:

Code
from ATK.KohnSham import *

# Restore the self-consistent calculation
# --- Change filename to match your case! ---
scf = restoreSelfConsistentCalculation("c:/vnl/fe.nc")

# Calculate the band structure in just one single point
# --- Change the k-point value to the one relevant for you! ---
k = (0,0,0)

bands_up = calculateEnergyBands(scf,[k],Spin.Up)
bands_dn = calculateEnergyBands(scf,[k],Spin.Down)
print "Index\t\tEnergy (eV)"
print "\tSpin.Up\t\tSpin.Down"
print "------------------------------------"
for i in range(bands_up.numberOfBands()):
    print i,'\t',bands_up.band(i)[0].inUnitsOf(eV),
    print '\t',bands_dn.band(i)[0].inUnitsOf(eV)

Output looks like:

Quote
Index           Energy (eV)
        Spin.Up         Spin.Down
------------------------------------
0       -8.57804275842  -8.00798815437
1       -2.31747667937  -0.580211098406
2       -2.31747667888  -0.580211097992
3       -2.31747638121  -0.580210882288
4       -1.0434911475   1.33719151525
5       -1.04349114563  1.33719151738
6       29.3066311312   30.3959460736
7       29.3066311709   30.3959461524
8       29.3066311719   30.3959461533

5073
There is no energy spectrum in the analysis for a bulk, because what you do for bulk is compute the band structure. But I think you figured that out already? :)

So, why do you need the index? I assume it is because you want to compute the Bloch function for a particular eigenstate, for which you need the quantum numbers "band index" and k-point. The k-point is obvious, but how to get the band index?

If you look at the band structure plot in VNL (in the Result Browser), there is a band index shown in the "Tool Tip" which appears if you let the mouse rest over a particular point on the curves. Sadly, this index is wrong!

Therefore, unfortunately it's not extremely easy to find the index (as it should be)...

Here's what you could do.

  • Assume we have converged a calculation for a bulk material, computed the band structure, and looked at it, and determined that at a particular k-point (let's say [0,0,0] for simplicity), it would be interesting to see the Bloch function for the band with an energy which is about -0.93 eV.
  • We have stored the calculation in a checkpoint file, "c:/vnl/bulk.nc" (assuming Windows, modify for Linux or if your file is elsewhere; note forward-slashes "/", backslash "\" means something else in Python strings!).
  • Now, we write a small script that shows us the band indices at this k-point:

Code
from ATK.KohnSham import *

# Restore the self-consistent calculation
# --- Change filename to match your case! ---
scf = restoreSelfConsistentCalculation("c:/vnl/bulk.nc")

# Calculate the band structure in just one single point
# --- Change the k-point value to the one relevant for you! ---
k = (0,0,0)
bands = calculateEnergyBands(scf,[k])

print "Index\tEnergy (eV)"
print "---------------------------"
for i in range(bands.numberOfBands()):
    print i,'\t',bands.band(i)[0].inUnitsOf(eV)

  • Either run this in ATK, from the command line, or drop it on the "Job Manager" in VNL. In the latter case you need to take care to use the full path to the NetCDF file; if you run from the command line you can just write the file name, if the file is in the same directory as you execute ATK in.

The output will look like
Quote
Index   Energy (eV)
---------------------------
0       -7.88580879754
1       -2.46911803845
2       -2.46911803746
3       -2.46911803684
4       -0.93553745241
5       -0.935537451013
6       24.7557039501
7       24.7557039577
8       24.7557039583
9       26.3855165124
10      41.5600392667
11      41.560039267
12      41.5600392725
13      53.5208120456
14      53.5208120462

Notes:

  • If you have a spin-polarized calculation, some modifications are needed!
  • The bands are usually degenerate! Take care to get the right index, if there are two with the same energy (most likely you will want both, simply).

Hope you figure it out!

I will also take the opportunity to make some advertising for the new tutorial on band structure calculations (and DOS); actually this little script might make for a useful appendix to that tutorial...
 

5074
Setting up the gated voltage sweep requires some careful considerations about defining the surface atoms. See the manual for more details.

Once that is done, you can wrap the self-consistent calculation in a loop over voltages:

Code
surface_atoms = (0,0)
current_k_point_sampling = (4,4)
current_number_of_points = 200

print 'Gate voltage (V)\tCurrent (A)'
print '---------------------'
for voltage in [0.0,0.2,0.4]:
    gated_method = GatedTwoProbeMethod(
        two_probe_method = two_probe_method,
        gate_voltage = voltage*Volt,
        surface_atoms = surface_atoms
    )
    scf = executeSelfConsistentCalculation(
        twoprobe_configuration,
        method = gated_method
    )
    current = calculateCurrent(
        scf,
        brillouin_zone_integration_parameters = brillouinZoneIntegrationParameters(current_k_point_sampling),
        number_of_points = current_number_of_points
    )
    print voltage,'\t\t',current.inUnitsOf(Ampere)

The two_probe_method and twoprobe_configuration should be defined earlier in the script (append the code above to your VNL-generated script and it should be fine; just remove the executeSelfConsistentCalculation() part).

Don't forget to change the variables current_k_point_sampling and current_number_of_points to fit your system!

5075
Ok, I modifed the ivcurve.py script ever so slightly to add the functionality to initialize the first calculation from an existing checkpoint file. The script is attached.

The only change is a new keyword to runIVcurve called initialize_from, which should be an scf object that the first calculation will be initialized from. So, if I have an existing converged zero bias calculation in a file called "zerobias.nc", I would use the NEW ivcurve.py this way:

Code
import ivcurve
   
voltages=[0.1,0.2,0.3]*Volt
zerobias_scf = restoreSelfConsistentCalculation("zerobias.nc")

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,
    initialize_from = zerobias_scf
  )

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

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

Note that this is not a complete script; you should add it to whatever script defines the two_probe_method and twoprobe_configuration (just noticed the asymmetry of those variable names! but that's how VNL does it...).

Actually, this version of the script allows for perhaps an even nicer way to take advantage of the VNL generated scripts...!

Instead of the above, where you should remove the executeSelfConsistentCalculation() statement from the VNL-generated script, we can let VNL set up the zero bias calculation, and use that. So, we would keep the VNL-generated script intact (don't add any analysis options to it!), and just append these lines to the end:

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

# Insert zero-bias current into VNL file
vnl_filename='myfile.vnl'
sample_name='mysample'
if processIsMaster():
    f = VNLFile(vnl_filename)
    f.addToSample(0.*Ampere,sample_name,'Current at 0.0 V bias')

ivcurve.runIVcurve (
    twoprobe_configuration,
    two_probe_method,
    runtime_parameters,
    voltages,
    vnl_filename=vnl_filename, sample_name=sample_name,
    current_k_point_sampling = (1,1),
    current_number_of_points = 100,
    initialize_from = scf
  )

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

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

Don't forget to change the filenames, k-points, etc to fit your specific system.

Note the insertion of the zero-bias current into the VNL file, otherwise we don't get a current calculation for zero bias!

There are end-less variations to scripts like this, which is the power of NanoLanguage, although it does require a bit of programming knowledge to take advantage of it.

5076
About the bias voltage sweep, it's really simple: just change the line

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

to include the voltages you want, e.g.

Code
voltages=[0.0,0.1,0.2,0.3,0.4,0.5,0.6]*Volt

or whatever! :)

The functionality delivered with the script ivcurve.py is not really intended as a full fledged one-stop solution, but rather as a template, to show how it can be done. So, for instance, if you have already converged zero bias calculations, and you want to avoid re-running the 0.0 V case and restart at 0.1 V, you should modify that script (slightly).

I'm sorry, I didn't actually understand the second question in that post...

5077
In the future, I recommend you attach pictures as pictures, ideally in the PNG format (use MSPaint to convert to PNG). The file size will be smaller, and we don't have to open each file in Word just to see the picture. Moreover, Word files are potentially dangerous since they can contain macros etc, so in general I would be very suspicious against someone sending me pictures in Word format...

Although the whole error message cannot be seen, my guess (tell me if I'm wrong, and if so let me know all the steps you do, leading up to the error message!) is that you have imported an XYZ file from the directory "F:\diamond nanostructures...". Either this XYZ file does not have any "name" inside it (second row in the file), or the name is "F:\diamond nanostructures...".

This name contains illegal file name characters (":") and will not work. I agree it's a bug, of sorts; VNL should probably filter out such characters, but to overcome it I suggest you either fix the name in the XYZ file (either change it or add it, if it's missing), or copy the Python code from the "Result Browser" to the "Script Editor" and drop the molecule from there, in order to "lose" the file name.

5078
General Questions and Answers / Re: Wave functions of MPSH
« on: June 10, 2009, 09:24 »
In NanoLanguage, use the function calculateProjectedHamiltonianEigenstates().

From VNL, add "Eigenstates" to the analysis options.

In both cases you must specify the eigenstate index, which is 0 for the lowest MPSH eigenstate, 1 for the next, and so on.

Save the results to a VNL file and use the Nanoscope to plot the result.

5079
That depends a bit on what you mean :) ATK can handle a finite bias across the transport direction, this is the special feature of the software, and this of course constitutes an electric field.

General electrostatic fields in arbitrary directions are however much trickier to handle, as they must be incorporated in the boundary conditions in a proper way. Not only do they break the periodicity, which is used in the XY directions to simplify the calculations in ATK, but actually a constant electric field becomes an infinite potential if it extends to infinite, so unless you have something to screen the field (or you terminate it at some point, like a gate electrode), such calculations generally break down.

We are currently working on a new multi-gate model for ATK. It will soon be released in the upcoming new product from QuantumWise, ATK-SemiEmpirical which is based on the extended Huckel model instead of DFT, and will allow for an arbitrary collection of metallic or dielectric gates to be included in a two-probe system. The gates and their influence on the transport properties will be described fully self-consistently electrostatically, thus enabling a realistic description of transistor-like structures (and other devices).

This model willl then be included in the DFT code too later, by winter or so.

5080
I'm jumping in here with a few comments, if you don't mind :)

1) Applying a 6 V bias is not really realistic. You'd have a hard time doing it in an experiment, and ATK rarely converges at such high bias. Even if it does, the bias is so large compared to typical band width of the valence band that you are outside the range where the calculations make sense anyway. The valence band of Li is only 4 eV deep!

2) The choice of electrodes is a subtle question, but wouldn't have anything to do with mass. Rather, what matters primarily is what experiments you may be comparing (or which experiment one could do to compare to the calculation), what is physically feasible and realistic, and what effect you are looking for. Li is certainly not a feasible or realistic material to use in any experiment, but it has a simple band structure and works a bit like a "simple transparent metal". So, if the details in the transmission are primarily due to the molecule etc in the central region, and not the electrode material (this is certainly not always the case!), Li can be used as a testing material since it is also fast to compute. But one should be very careful to draw any serious conclusions from such calculations!

5081
Noted!

The functionality to change the electrode element is not really needed, as such. You can (and should!) always prepare the electrode before, in the Bulk Builder, and then bring it into the Atomic Manipulator for cleaving. So, in the AM, the only operations needed are those of relative alignment plus adding surface layers, etc. Same for the central region, you don't really build it in the AM (unless it's very simple), you bring it in as a ready molecule or slab material.

Thanks for the feedback, it's much appreciated to learn what users think of the specific features etc! More, please!

5082
Magnetic fields are not included in ATK, sorry.

5083
General Questions and Answers / Re: why?
« on: June 5, 2009, 12:33 »
When you add spin to a graphene ribbon like this, a band gap opens up around the Fermi level. Therefore, your LDOS for E=0 shows a non-conducting state, which does not extend across the structure. In the case without spin, the transmission is finite at the Fermi level, and so you get a conducting state, as your first figure shows.

5084
General Questions and Answers / Re: why?
« on: June 4, 2009, 11:30 »
It's worth noticing that there is no periodicity in a two-probe system in the Z direction, even at zero bias. This is embedded in the scattering boundary conditions, used for the Green's function.

Thus, if the transmission is zero, it means electrons from the left electrode cannot reach the right electrode. Hence, the LDOS will not extend from the left to the right.

5085
General Questions and Answers / Re: why?
« on: June 3, 2009, 17:13 »
At which energy is this taken? What is the transmission at this energy?

If you did an optimization, the system is no longer perfect, I guess ;)

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