Coupling ATK with Synopsys tools¶
In this tutorial you will learn how to extract band structure data from a first-principles (DFT) calculation in a file format that can be directly imported in Synopsys tools for TCAD simulations. We will use a simple silicon crystal as the example, but the methodology is general and can in principle be applied to any semiconductor material, subjected to for instance strain, or even a nanowire or 2D thin film.
This tutorial is aimed both at experienced users and those with more limited experience, who are trying this functionality for the first time. In order to keep the tutorial short and succinct, we will not explain so much, but just present the steps you need to follow. It is however a good idea to go through the Basic VNL and ATK Tutorial to learn the basics of Atomistix ToolKit (ATK) and its graphical user interface Virtual NanoLab (VNL).
If you are familiar with VNL, you may skip the following section - just start VNL (in any project) and proceed to the next section to install the addon needed for this tutorial.
You will of course first need to download and install the software (there is both a Linux and Windows version).
Start VNL, typically by double-clicking the desktop icon. If this is the first time you try VNL and you don’t have a license, the software will automatically attempt to download a demo license over the internet - naturally you need to be online for this to work. For alternative methods to obtain a license, see the Trial license to apply for an extended trial license.
Spend just a few minutes to familiarize yourself with the program.
First, a project selection dialog will appear. If this is your first encounter with VNL, it is recommended to first open the Example Project, to have some data to play around with.
- In the left panel you see a list of files in the project. By checking the little box next to a file name, the contents of the file will be displayed on the LabFloor, the middle panel, provided that the file type is understood by VNL (additional file types can be supported via plugins).
- By selecting an object icon on the LabFloor, a set of tools on the right-hand toolbar panel will become active, indicating possible ways you can interact with this object by clicking the corresponding panel button. For instance, a band structure can be opened in the Bandstructure Analyzer.
- Some objects - in particular atomic configurations - can also be dragged with the mouse to e.g. the Viewer to show them in 3D, or the Builder for manipulations of the geometry.
Installing the addon¶
To export band structures to the Synopsys SAI format, you need to install the SynopsysTools addon in VNL.
Open the AddOn Manager from the Help menu. Scroll down to “SynopsysTools” (or type “syn” in the search box) - as you will see, this addon is not installed, but is available on the server (the version number may vary).
Select the SynopsysTools package and click Install (alternatively, just click Update all) to download and install it.
You now need to restart VNL for the plugin to become active.
When VNL starts again, make a new project for this tutorial.
- Create a new project by clicking Create new in the dialog shown on startup.
- Choose a suitable directory (that does not contain any non-Latin characters in the path).
- Then click Open to start the main interface.
- Click the button Add to the left of the Stash area and choose From Database... from the popup menu.
- Locate the “Silicon (alpha)” structure - for instance by using the search filter - and select it.
- Click the plus button to add the silicon crystal to the Stash. The database window will automatically close.
- Now click the icon in the lower right-hand corner of the Builder, and choose Script Generator from the popup menu. This will transfer the geometry to the tool used for setting up the calculation model.
DFT model setup¶
- double-click New calculator in the “Blocks” panel;
- double-click Analysis and choose Bandstructure from the popup menu;
- simplify the name of the default output file to
silicon.nc. This is where all results of the calculation will be stored.
- Set the k-point sampling as the 2 Å density or the number of k-points to 5 in all three directions (A, B, C)
- Choose the MGGA exchange correlation
Click OK to close the window.
Parameters like the k-point sampling and a few other ones should always be systematically checked for convergence, to obtain accurate results.
Next, double-click the Bandstructure block and set the route in the Brillouin zone to L,G,X, and the number of points to 50, to get a detailed picture of the most important part of the band structure.
Click OK to close the window.
A file dialog will pop up, prompting you to save the input file. Choose a suitable filename, such as
silicon.py (the file is a python script, so always use the .py extension). Make sure the file is saved in the current project directory.
Running the calculation¶
Visualizing the band structure¶
The job should take less than a minute or so to complete. When it’s done, you will note that a new file (
silicon.nc) has appeared in the project (along with a log file for the calculation), and its contents are already visible on the LabFloor in the main VNL window: a band structure and a bulk configuration.
- Select the band structure object;
- Click Bandstructure Analyzer on the right-hand side panel of analysis tools.
The band structure plot will appear, and you can verify the band gap to be 1.2 eV.
To measure the band gap,
- Click the zoom buttom, and draw a rectangle with the mouse to zoom in around the Fermi level. Then click the zoom button again, to exit zoom mode.
- Click a point in the band structure and hold down the mouse button, while moving the mouse to another point, and the difference in energy will be displayed in the toolbar.
It is well-known that “standard” DFT fails to give good band gaps. In this tutorial you have, however, found that by using a Meta-GGA (MGGA) exchange-correlation functional, the gap comes out close to the experimental value for silicon (and the same is true for many other semiconductors). In fact, the Tran-Blaha MGGA functional you used actually contains a tunable parameter which can be used to fit the gap very precisely.
Exporting the band structure to SAI format¶
The ultimate goal of this tutorial is to export the band structure in a format that can be imported in Synopsys tools. To do this, ensure that the band structure object is still selected, then locate the Synopsys SAI Export... button on the right-hand side toolbar.
Click it - then provide a filename and click Save. You have now exported an
.sai file which can be imported in Synopsys tools, for further use in TCAD simulations.
It is also possible to select multiple band structure objects on the LabFloor and export them all with a single click on the Synopsys SAI Export... button. In this case, the filename of the .sai file will be automatically determined by the lab floor item title.
Specifically, each SAI file will be saved in the same directory as the NetCDF file containing the corresponding band structure, with the extension switched from “nc” to “sai” and with the unique object ID (seen in the label for each lab floor item - it is gID001 for the band structure created in this tutorial) appended to the filename to handle the case where there are several band structures in the same NetCDF file.
Batch processing and command line usage¶
A major advantage of ATK is that in addition to the graphical user interface, you can also perform tasks via Python scripting.
First of all, to convert a single bandstructure, saved in an NetCDF file, to the SAI format, you just need 3 lines of Python code (assuming the addon has been installed, of course):
from AddOns.SynopsysTools.saiExporter import saiExporter import sys saiExporter(sys.argv, sys.argv)
Download this script
atd_input_qw.py and save it in the folder containing the NetCDF file. Then run, as also described in the Synopsys Ab-Initio to Device User Guide:
$NC_FILE denotes the NetCDF (.nc) output file containing the BandStructure object, and
$SAI denotes the desired output
However, the scripting interface also makes it possible to do batch processing. For instance, assume you have a set of NetCDF files in a particular directory, and each one contains only one band structure. Then, open the Editor in VNL and insert the following code:
from AddOns.SynopsysTools.saiExporter import saiExporter import glob, sys for nc_file in glob.glob("*.nc"): bs = nlread(nc_file, Bandstructure) sai_file = nc_file.replace(".nc",".sai") print nc_file, ">", sai_file saiExporter(bs, sai_file)
Save the script in the same folder where the NetCDF files are (for instance with a name like
many_to_sai.py), and run it from the command line (in the directory where the files are) as
This will produce
silicon.nc, and so on. Of course, if you want to select only a subset of NetCDF files, you just need to modify
glob.glob (“*.nc”) to reflect your desired selection.
If you have NetCDF files with several band structures, use a modified script:
from AddOns.SynopsysTools.saiExporter import saiExporter import glob, sys for nc_file in glob.glob("*.nc"): all_bs = nlread(nc_file, Bandstructure) for i, bs in enumerate(all_bs): sai_file = nc_file.replace(".nc","_%i.sai" % i) print nc_file, i, ">", sai_file saiExporter(bs, sai_file)
This will make one SAI file for each band structure, and the files will be named after the NetCDF file (just like before) but with _1, _2, etc added.
As an alternative to specifying the NetCDF files inside the script, replace the line
for nc_file in glob.glob("*.nc"):
for nc_file in sys.argv[1:]:
and run it as
atkpython many_to_sai_2.py silicon*.nc
The possibilities to customize tasks like this with scripts in ATK are endless.