In this mini-tutorial we will present a work flow that enables the computation of an I-V curve - the current as a function of the bias - for a two-probe system.´The I-V curve is in many cases the main results of a study in ATK, although there are several steps towards it, and there are many supporting quantities that provide valuable information about the transport mechanisms. One of these quantities, which has a strong physical relevance, is the voltage drop, computed as the difference in the electrostatic potential between the finite-bias calculation and the corresponding zero-bias calculation. This essentially tells you where the resistance is in the device, for a given apvoltagesplied bias.
The calculations will be performed in two steps. First, we will loop over the bias voltages and perform all self-consistent calculations. Then, in a subsequent step, we will compute all the transmission spetra and electrostatic potentials. This work flow is to some extent already presented in the tutorial on basic transport calculations, but we will here extend the analysis a bit and the work flow will be more readily adaptable for any given two-probe system.
This tutorial is somewhat more advanced than others, and it will be assumed that you already have some basic experience of setting up and running calculations with ATK. The basic transport tutorial mentioned just above is an excellent starting point for that.
Setting up the calculation
- We will not concern ourselves here with how to define the geometry of the two-probe system. Instead, we provide a ready script (details on how to build it are available elsewhere) that you can just download and save. Drop the script on the Viewer to make sure the geometry looks correct.
- Next, drop the downloaded script on the Scripter and insert a "New Calculator". We will use all default parameters, meaning we will run the calculation with DFT, as opposed to the basic transport tutorial which used the extended Hückel method.
- Define a suitable name and location for the resulting NetCDF file under "Default output file".
- Save the script.
Making a loop over bias voltages (self-consistent part)
- Transfer the script to the Editor, using the "Send to" button in the lower right-hand corner of the Script Generator.
- Scroll down to the end of the script. The 4 last lines are the ones which actually carry out the calculation, and these are the ones that need to be repeated for each bias.
- First, to define the bias voltages, insert a new line in the script, before the last 4 lines (above device_configuration.setCalculator(calculator)):
Don't forget the trailing colon! (See the appendix below for other way to define the voltage more generally.)
- Then, mark the four last lines in the script and press the TAB button on the keyboard. This will indent the lines, such that they will be executed for each step in the bias loop.
- The first indented line attaches the calculator to the configuration. This needs to be modified to take into account the bias. In addition, to speed the calculation up, the converged state of the previous bias will be used as the initial guess for the next one. Therefore, change the line
to (remember the retain the indentation)
- Note how the device_configuration is used as initial state for the calculation (for the first step, ATK will discover that no previous calculation was performed, and it will just ignore this specification).
- The bias is applied in such a way that we obtain a positive current, meaning a current flow from left to right (i.e. electron flow from right to left!); this is the case when the specified voltage for the left electrode is higher than for the right one.
- The following lines can be left as they are, although you may want to move the line which uses "nlprint" to print out the whole device configuration before the "for" loop over voltages, so that the lists of atomic coordinates are printed once only, and not for each bias. In that case, the line must be unindented again.
The script is now ready to be run. Save it as lih2li_iv.py, and send it to the Job Manager.
You can download the complete finished script to compare with your own. Also, if you prefer not to run all the self-consistent calculations yourself, you can save time by downloading the resulting NetCDF file, and use that for the following step: the calculation of the current and voltage drop.
NOTE: If you apply the methodology in this tutorial to your own device configuration, and if the calculations are rather large, it is a good idea to save the configurations in separate files:
In this case you need to modify some of the analysis below, to read the configurations back from the individual files; see the Notes below for more information.
Calculating the I-V curve and voltage drop
We now have a converged calculation for each bias, all stored in the NetCDF file. Next, we need to compute the transmission and voltage drop for each case. For this purpose, we will use the script below; download it and save it in the same folder as your NetCDF file.
The script should hopefully be more or less self-explanatory (click above to expand the source code).
- All the results are stored in a new NetCDF file, and we also copy the device geometry to this file, for plotting convenience.
- Note how we use the bias as a label for each quantity we store in the NetCDF file, via the object_id keyword.
- There is no need to compute the current in the script, this will be done later, see below.
- If you intend to use this script for your own device configuration, make sure to adjust the energy range of the transmission spectrum, as well as the k-point sampling!
- As mentioned above, for larger calculations it's a good idea to save the different bias points in separate files. In that situation, replace the first 6 lines in the analysis script with these (i.e. keep the original lines starting from line 7, "biases = ..."):
Also, the second last line in the script should be modified to read
Note how in case it is also necessary to manually copy the list of biases into the analysis script.
Important: Before running the script, you should open it in an editor and check that the file names on the first two lines reflect your existing NetCDF file with the self-consistent calculations, and the new result file. If you want to run from the Job Manager, both should be specified with full absolute paths (on Windows, make sure to use "/" instead of "\" in file names).
Run the script, either by dropping it on the Job Manager or from the command line. It should take less than a minute to complete.
Plotting the results
- In the VNL main window, click the Analyzer icon and choose from the menu "Analyzers > IV Curve".
- Drop the analysis NetCDF file on the drop-zone labeled "Drop file here".
- As we see, VNL will plot the I-V curve, and also print out the values of the current in the log window at the bottom. Also the transmission spectra for each bias are shown, shifted vertically by essentially the bias.
- Finally, to visualize the voltage drop, select one of the quantities labeled "Voltage drop" in the NetCDF file, and click "Show" next to "Contour".
- In addition, drag and drop the device configuration in the NetCDF file to the Viewer window that opens to visualize the geometry overlaid on the data.
Finally, let us average the voltage drop over the X/Y plane, to get the profile as function of Z. For this, we will again use the Analyzer tool, but this time with a custom-made script.
Download the analyzer script, and drop it on the Analyzer icon in the main VNL window (you can inspect the source code just below, if you are interested in learning more about writing your own plug-ins to VNL).
- Drop the NetCDF file with the analysis results on the drop-zone labeled "Voltage drop NetCDF file"
- If the file contains more than one voltage drop, you can choose which one to plot by changing the "Data index". The data for the curve is printed in the log panel, from where it can be copied and pasted into another plotting program.
- In principle all the calculations above could be carried out in a single script. Our approach will be a bit more transparent, and it is easier adapt the scripts produced by the Script Generator by hand for this work flow.
- We apply the electrode voltages symmetrically, but it doesn't actually matter, since only the difference in the voltages is used for the calculation, at least as long as we do not introduce additional gate electrodes in the system.
- Using the converged state of a lower bias to boot-strap the calculation for a higher bias, is generally the best way to achieve stable convergence for finite-bias calculations.
- One should not put too much emphasis on the results of this calculation. For example, the voltage drop does not level off towards the electrodes, but this is purely an effect of the extremely poor screening in this system. By using a larger X/Y unit cell, and by also increasing the total number of Li atoms in the central region, the effect can be made smaller, but it is hard to avoid completely in this rather artificial system.
There are many different ways to set up the voltages. Above we used a simple list, but we could also do a more advanced construction like
to get 10 equally spaced points between 0 and 1.