The NanoLanguage Scripter

Table of Contents

The NanoLanguage Scripter and the Method Editor tool are the main components used in VNL for setting up calculations for the molecule, bulk, or two-probe systems that you have generated using the Molecular Builder, the Crystal Cupboard, and the Atomic Manipulator tools.

The basic work-flow when using the NanoLanguage Scripter typically involves the following steps:

  1. Import NanoLanguage scripts (molecule, bulk, or two-probe).

  2. Define the parameters that control the DFT and NEGF calculations for your configuration.

  3. Determine which physical quantities should be extracted from the converged results.

  4. Save all calculation settings as a script.

  5. Execute your scripts using the Job Manager.

In this chapter, we provide a set of tutorials, that will guide you through some of the typical steps that are required to master the usage of the NanoLanguage Scripter and the Method Editor. The complexity of the tutorials will increase as we progress, so if you are a relatively inexperienced VNL user, we recommend that you follow the tutorials in the order that they are presented.

Using the NanoLanguage Scripter

In this tutorial, we will use the organic molecule biphenyl (C12H10) as our system configuration. For this relatively simple molecular structure, we will demonstrate some of the most common and basic features of the NanoLanguage Scripter tool. In particular, we will cover:

  • Importing the biphenyl molecule to the NanoLanguage Scripter.

  • Setting up suitable parameters for the DFT calculation.

  • Choosing the physical quantities that should be calculated for the system. In this particular case, we have chosen the total energy and the electron density of the biphenyl molecule.

  • Saving and executing the calculation.

  • Accessing and visualizing the calculated physical quantities of the biphenyl system.

The organic molecule biphenyl (C12H10) used in the tutorial.

Figure 11: The organic molecule biphenyl (C12H10) used in the tutorial.


1. A short preliminary — building the biphenyl molecule

The first thing we need to do, is setting up the biphenyl molecule that we want to analyze. Please follow these steps in the VNL manual describing how to use the Molecular Builder tool for setting up a biphenyl molecule .

Once you have completed the steps, your file system should contain a file corresponding to the created biphenyl molecule.

Just for clarity, let us assign the biphenyl configuration with an appropriate file name: Rename the file to C12H10.py. We could also have used drag-and-drop to transfer the configuration from the Molecular Builder to the NanoLanguage scripter without saving it on the file system. However, since we are going to use it in more than one tutorial, we create the configuration on the disk.

2. Starting the NanoLanguage Scripter

To launch the NanoLanguage Scripter tool, double-click the NanoLanguage Scripter icon

As a result, the NanoLanguage Scripter window will appear:

3. Adding a configuration to the NanoLanguage Scripter

To add the biphenyl molecule to the NanoLanguage Scripter, drag-and-drop the file C12H10.py from your file browser to the open NanoLanguage Scripter window. The NanoLanguage Scripter window should now look as follows:

4. Previewing the configuration

If you left-click the Configuration tab in the NanoLanguage Scripter, the biphenyl molecule will be displayed. Use the mouse to rotate, zoom, and translate the displayed biphenyl molecule.

5. Setting method parameters

Our next task is to fine-tune some of the parameters that control the DFT calculation of the biphenyl molecule. In the NanoLanguage Scripter, we use the Method tab for that purpose. To do this, first left-click the Method tab. The NanoLanguage Scripter then changes back to:

The first thing we want to alter, is the basis set that will be used in the DFT calculation for the biphenyl molecule. You do that by using the Basis Set dialog: First, left-click and change the basis set Type from DoubleZetaPolarized to SingleZetaPolarized. This change implies that the SingleZetaPolarized basis set will used as the default basis set for all atoms of the biphenyl molecule.

Since hydrogen atoms have a relatively simple electronic structure, these particular atoms do not require the application of very complex basis sets. To set a specific basis set for hydrogen only, first check the option Specify basis set by element type . Navigate to H in the Element list and then left-click to check the element.

Finally, change the basis set type from SingleZetaPolarized to SingleZeta. As a result, the SingleZetaPolarized basis set is now applied to all carbon atoms whereas SingleZeta is selected for all the hydrogen atoms

[Note] Note

The same result could have been achieved by first selecting SingleZeta for all atoms followed by assigning SingleZetaPolarized explicitly for the carbon atoms.

6. Changing additional method parameters

The next thing we want to do, is to change the default size of the mesh cut-off from its default value of 150 to 100. First, select the item Electron Density from the drop-down list in the main Method tab . The following dialog window then appears inside the Method tab

Left-click in the field entitled Mesh Cut-off and change the default value from 150 to 100.

We have now modified the desired set of parameters. The next task is to select the list of physical properties that should be extracted from the DFT calculation that we just finished setting up.

7. Calculating the total energy

In this tutorial, we want to calculate the total energy Etot as well as the electron density of the biphenyl molecule. These quantities, as well as many other physical quantities that also can be extracted from the DFT calculation, are set via the Analysis tab.

Access the Analysis tab by left-clicking it from the NanoLanguage Scripter window. As a result, the NanoLanguage Scripter window changes to:

Now, left-click to select the item Total energy from the Available Quantities list and press the > button. The Total energy item now appears in the Selected Quantities list.

To enable the calculation of the electron density, repeat the above steps for the Electron density item.

8. Creating and running the NanoLanguage script

At this point, all method and analysis parameters are defined. The next step is to perform the corresponding computation. We do this by saving the state of the NanoLanguage Scripter as a NanoLanguage Script on the file system, which we then execute.

To create the file containing the script, press the Save/Save as button located on the main NanoLanguage Scripter window. As a result, the file C12H10_script.py will be created on your file system.

To execute the script, drag and drop the script icon from your file system browser into the Job Manager tool. The script is now executed resulting in the appearance of the following LogWindow

The LogWindow displays a summary of both the system configuration as well as the parameters used in setting up the method and analysis. As the actual DFT calculation is started a progress log from the calculation is appended to the contents of the LogWindow.

Once the script has finished, the LogWindow contains the following green lines indicating that the script has finished successfully:

Use the scroll bar of the LogWindow to investigate the log output from the script execution.

9. Examining the results

Once a script has finished execution, a VNLFile with the extension .vnl has been created on your file system. This VNLfile contains

  • a copy of the configuration originally used to set up the script

  • the calculated results (physical quantities) obtained from running the script

In this particular case, the file C12H10<1>.vnl has been added to your file system.

In order to examine the calculated data, do the following:

  • To determine the total energy, do the following: From your file browser, drop the newly created file on the Result Browser tool . As a result, a new sample icon appears. Then, right-click and choose LogbookNanoLanguage…. A LogBook window opens displaying the entire output generated when the script was executed. Use the scroll bar to locate the line starting with “# Total Energy”. Here you will find values for all energy components of the biphenyl system. In particular, we see that the total energy satisfies Etot = -2031.84 eV.

  • The electron density is stored in the sample as a 3D grid structure . This data set can be visualized by using the Nanoscope tool. To visualize and investigate the electron density, drag-and-drop the sample icon “C12H10<1>” on a Nanoscope tool and choose Insert plotContour plotReal Space Electron Density NanoLanguage…. A plot similar to the one shown below will appear

In this case, we have chosen to visualize the electron density using a 3D contour plot. Other visual representations of the grid data, such as isosurfaces and volume plots can also be generated via the context menu of the Nanoscope tool.

This finishes our first NanoLanguage Scripter tutorial . If you want to continue, we suggest you continue with the next tutorial, where we will use the NanoLanguage Scripter in combination with the Method Editor tool to investigate the twisting potential energy surface of biphenyl.

Using the Method Editor tool with the NanoLanguage Scripter

The Method Editor tool provides you with a fast and convenient way to set-up and store calculation parameters for the optimization of the electron density. Once you have set it up, it also provides a fast way to specify all these parameters in the NanoLanguage Scripter by a drag-and-drop action instead of going through all parameter dialogs and changing them by hand. In this section, you will learn how to

  • Use the Method Editor tool to define calculation parameters

  • Export the script directly to the file system

  • Execute the job from the command line.

This will be illustrated by calculating the potential energy surface when the dihedral angle between the two phenyl rings in biphenyl is changed. It is assumed that you have gone through the basic tutorial and are familiar with basic operations in VNL. We will also assume that your working folder contains the items that were used in the previous section. If this is not the case, you might need to go through some of those steps before you can continue.

1. Create configurations

Similar to the previous section, we first need to generate the biphenyl configuration that we want to study. In this case, however, we will study a series of configurations, and have chosen to calculate the energy of biphenyl for the dihedral angles 0°, 25°, 35°, 45°, 55°, and 90°. The corresponding molecular configurations will be generated with the Molecular Builder tool. To do this you need to

  1. Open the Molecular Builder by dropping the biphenyl configuration from the previous section onto the molecular builder icon.

  2. Select the four carbon atoms that defines the dihedral angle between the two rings (see Figure 12).

  3. Open the Geometry Manager by left-clicking on the Geometry Manager button.

  4. Change the dihedral angle by clicking in the input section for atom 4, change the value from 45° to 0°, and close the Geometry Manager.

  5. Clicking on the Save/Save As button, and save the configuration on your file system in a file with the name biphenyl_0.py.

Then create a number of biphenyl configurations with various dihedral angles with the Molecular Builder and save them.

Figure 12: Then create a number of biphenyl configurations with various dihedral angles with the Molecular Builder and save them.


After you have generated all the needed configurations, the following files will be present in your working directory: biphenyl_0.py biphenyl_25.py, biphenyl_35.py, biphenyl_45.py, biphenyl_55.py, biphenyl_90.py.

2. Create and set-up the method tool

Before starting to use the Method Editor tool, we need to set the calculation parameters to the values we want. In this case we are going to set up a comparatively crude but fast calculation so that running the calculations will not take too long time. In order to do this

  1. Open a molecule Method Editor tool by double-clicking on the associated icon in the VNL Toolbar

  2. Once the tool is open, we need to specify the calculation parameters we are going to use. The calculation parameters are divided into groups and can be accessed in separate dialogs. You can navigate through the dialogs by using the drop-down menu.

    1. Change the basis set Type in the Basis Set dialog from the default DoubleZetaPolarized to SingleZetaPolarized, (Figure 13).

    2. Make sure the Energy Shift in the Basis Set dialog is set to 0.01 Ry, (Figure 13).

    3. Change the Mesh cut-off in the Electron Density dialog to 100 Ry, (Figure 13).

    4. Change the Exchange Correlation Functional in the Exchange Correlation Functional dialog to GGA.PBE , (Figure 13).

    5. Make sure the Tolerance in the Iteration Control dialog is set to 0.0001, (Figure 13).

  3. Save the settings of the Method Editor tool by pressing the Save/Save As button. Name the corresponding file approximate.py.

Basis set parameters   Electron density parameters
The dialog windows for the calculation parameters that are changed in this tutorial.   The dialog windows for the calculation parameters that are changed in this tutorial.
     
Exchange correlation functional   Iteration control parameters
The dialog windows for the calculation parameters that are changed in this tutorial.   The dialog windows for the calculation parameters that are changed in this tutorial.

Figure 13: The dialog windows for the calculation parameters that are changed in this tutorial.


3. Create scripts with the NanoLanguage Scripter

After defining the configuration with the Molecular builder and the calculation parameters by setting up the “approximate” method, we combine these elements to create a script with the NanoLanguage scripter tool. To do this, you need to

  1. Open the NanoLanguage Scripter that you created in the previous tutorial by drag-and-dropping the first configuration (biphenyl_0.py) on the NanoLanguage Scripter. This action loads the NanoLanguage Scripter with a biphenyl configuration associated with a dihedral angle of 0°.

  2. Drag-and-drop the “approximate” method icon onto the open scripter window. This sets all the calculation parameters under the scripter Method tab to those defined in the method in step 2 “Create and set-up the Method Editor”.

  3. Instruct the NanoLanguage Scripter to calculate the total energy by selecting Total energy in the Available Quantities list in the Analysis tab in the same way as was done in the previous section.

  4. Save the script to the file system by pressing the Save/Save As button. A file dialog is presented where you can specify the name of the script and in which directory you want to create it. Save the script as biphenyl_0_nls.py, and close the scripter.

4. Run the scripts and extract the data

Now that your script is stored on disk, you can to execute it like any other script by typing

atk biphenyl_0_nls.py > biphenyl_0.log

from the command line. When the calculation has finished, open the file biphenyl_0.log and locate the line starting with “# Total potential energy” towards the end of the file.

[Note] Note

You could just as well have used the Job Manager tool to start a local execution of the script. This, however, could be inconvenient for jobs that require substantial computation time in order to finish.

Now, repeat the calculation for the remaining configurations with dihedral angles 25°, 35°, 45°, 55°, and 90° using the same set-up of calculation parameters (steps 3 and 4). The energies you obtain are collected in Table 1, and presented in Figure 14.

Table 1: Total energies for the biphenyl molecule with various dihedral angle between the two phenyl rings.

ϕ / ° Energy / eV
0 -2032.0591
25 -2032.1949
35 -2032.2309
45 -2032.2087
55 -2032.1591
90 -2032.0327

This is where the tutorial on the Method Editor tool ends. However, as an extra and informative exercise, you could also set up the Method Editor tool with higher accuracy, calculate the total energy using the same biphenyl configurations, and compare how different parameters affect the calculated result. A suggestion of parameters to change and values to choose is given in Table 2. Just keep in mind that more accurate calculations require longer time to run. In the next tutorial, we will use the NanoLanguage Scripter to calculate some of the properties of a silicon bulk crystal system .

Table 2: Suggested parameters and values for testing the accuracy of your calculation. The outcome of these calculations are plotted in Figure 14.

approximate intermediate accurate
Basis Set Type SingleZetaPolarized DoubleZetaPolarized DoubleZetaDoublePolarized
Energy Shift 0.01 Ry 0.001 Ry 0.0001 Ry
Mesh Cut-off 100 Ry 200 Ry 300 Ry
Exchange Correlation Functional GGA.PBE GGA.PBE GGA.PBE
Tolerance 0.0001 eV 0.0001 eV 0.00001 eV

The energy of biphenyl as a function of the twisting dihedral angle for the approximate (red), intermediate (green), and accurate (blue) set of calculation parameters defined in . Note that all curves have been shifted such that the value of the lowest point in each curve is zero.

Figure 14: The energy of biphenyl as a function of the twisting dihedral angle for the “approximate” (red), “intermediate” (green), and “accurate” (blue) set of calculation parameters defined in Table 2. Note that all curves have been shifted such that the value of the lowest point in each curve is zero.


[Note] Note

The accuracy of these parameters is very system-dependent, so “intermediate” parameters for one molecule can still be “good” parameters for another. You should always check how your result depends on your choice of parameters.

Optimizing the lattice parameter of a bulk system

In this tutorial, we will look at a silicon bulk system and use the NanoLanguage Scripter tool to find the optimal lattice constant for silicon.

We will do this by storing six configurations each with different lattice constants. Once the NanoLanguage scripts have been created, the NanoLanguage Scripter tool will be used to create the necessary scripts for calculating the total energy of the six systems. By plotting the total bulk energy against the six lattice constants, the lattice constant αmin associated with the minimum bulk energy can be deduced.

1. Creating the silicon configurations

The first step will be used to create the different silicon bulks. Do this by double-clicking the the Crystal Cupboard tool and enter the string “Si” in the Filter field. Then left-click to choose the structure Si (alpha) followed by pressing the Save/Save as. Then drag-and-drop the saved NanoLanguage script onto the Atomic Manipulator tool. Here we will be able to change the lattice parameters for the silicon crystal.

Under the Lattice tab change the Lattice parameter a to 5.0 Å and click Save/Save As to save the bulk in a NanoLanguage script called Si (alpha) 5.0.py

Now, repeat the above step until you have a total of six crystal configurations on disk with lattice parameters ranging from 5.0 Å to 6.0 Å separated by increments of 0.2 Å.

Once these steps are completed, the following files should be available: Si (alpha) 5.0.py, Si (alpha) 5.2.py, Si (alpha) 5.4.py, Si (alpha) 5.6.py, Si (alpha) 5.8.py, Si (alpha) 6.0.py.

2. Launching the NanoLanguage Scripter

We will create the scripts by importing the six different NanoLanguage script one at a time in the NanoLanguage Scripter tool. After this, we will change some appropriate parameters and choose the physical quantity (the total energy) that we wish to calculate.

First open the NanoLanguage Scripter tool, by double-clicking on its associated icon

As a result, the NanoLanguage Scripter window appears

[Note] Note

Observe that at this particular moment, it is not possible to change any of the parameters, since the NanoLanguage Scripter has not been informed about the system type that should be used for setting up the calculation. As a consequence, almost all tabs in the window are inactive (grayed out) .

3. Importing a bulk configuration

To activate the NanoLanguage Scripter functionality, import the first configuration Si (alpha) 5.0.py by drag-and-dropping it from your file browser to the NanoLanguage Scripter window (it does not matter where you drop on the window). Now that the NanoLanguage Scripter has been informed about the system type (a bulk system), the various tabs become active. Notice that the System type in the top right corner has changed from None to Bulk. In addition, the name of the NanoLanguage script file (Si (alpha) 5.0) has also appeared in the top left corner of the NanoLanguage Scripter window:

4. Defining parameters for the DFT calculation

The first task we will solve, is choosing some appropriate parameters for the DFT calculation; these are defined in the Method tab, which you activate by left-clicking the associated tab

To obtain more accurate results, we will change the basis set type that will be used in the DFT calculation. Click on the drop-down list and change the basis set type from DoubleZetaPolarized to DoubleZetaDoublePolarized . Many other DFT relevant settings can be changed and fine-tuned from the Method tab. You access these by choosing the relevant parameter groups from the top-level drop-down list on the Method tab. For this particular tutorial though, we leave the remaining default values.

5. Choosing the calculated physical properties

Our final step in setting up the NanoLanguage Scripter is to specify the physical quantities that should be calculated from the main DFT calculation. These are accessed via the Analysis tab: left-click on the tab to display all the quantities that the NanoLanguage Scripter offers.

When the Analysis tab has been activated, all the available quantities for the calculation are displayed on the left side in the Available Quantities list . On the right, the list Selected Quantities displays all the quantities that you have selected (at this moment the list is empty since no choices have been made so far).

In this tutorial, we are only interested in the total energy corresponding to the list term Total Energy. Therefore, left-click to select the item Total Energy in the Available Quantities list and add it to the Selected Quantities list by pressing the > button located in-between the two lists. The content of the Analysis has changed to

6. Generating the scripts

After setting up the DFT calculation using the Method tab and adding the desired physical quantity from the Analysis tab, we are ready to generate the scripts that will be used to perform the actual calculation:

Simply left-click the Save button and the script file will be saved in your working directory.

The generated script is named using the convention: configuration_name + _script. So in this case, the script will given then name Si (alpha) 5.0_script.py.

Since the NanoLanguage Scripter stores all Method and Analysis parameters internally, it is an easy matter to generate the five additional scripts for the remaining bulks: Just drag-and-drop each bulk configuration from your file browser onto the open NanoLanguage Scripter tool and press the Save/Save As button. Repeat this procedure for the last five bulks. Once you are done, you should have created the following files: Si (alpha) 5.0_script.py, Si (alpha) 5.2_script.py, Si (alpha) 5.4_script.py, Si (alpha) 5.6_script.py, Si (alpha) 5.8_script.py, Si (alpha) 6.0_script.py.

7. Executing the scripts

We are now ready to perform the calculation of the total energy for the six silicon bulk systems. To execute the scripts in one single batch , do as follows:

  1. Select all the bulk silicon script files on your file browser

  2. Drag-and-drop the selected group of files onto the Job Manager icon located in the Toolbar.

For each submitted script, a LogWindow will appear, displaying informative output about the status of the script execution. Notice also, that the title bar of the LogWindow informs you whether the script is NanoLanguageScript [Running] or NanoLanguageScript [Waiting] . In this case, the scripts are executed in successions with only one active script running at a time.

Once a script has successfully finished execution, the title bar of the LogWindow changes to NanoLanguageScript [Finished] . In addition, the log output in LogWindow also contains the following line (type set in green): Terminated Normally.

After all scripts have finished execution, we are ready to extract the total energy value from each of the runs.

8. Extracting and analyzing data

After each successful script execution, a new VNLFile will be added to your file system. So after execution of the six scripts, the contents of your working directory will be extended with the following files: Si (alpha) 5.0(1).vnl, Si (alpha) 5.2(1).vnl, Si (alpha) 5.4(1).vnl, Si (alpha) 5.6(1).vnl, Si (alpha) 5.8(1).vnl, Si (alpha) 6.0(1).vnl.

Each of the new VNLFiles files, Si (alpha) 5.0(1).vnl,…, Si (alpha) 6.0(1).vnl, contain the results (the total energy) that we specified in the Analysis tab of the NanoLanguage Scripter. You can access the results by dropping the file into the Result Browser tool. The result of examining the filer

Locate the line in the log text that reads “# Total Energy. Here you will find values for all the energy components of the silicon bulk in question. In particular, for the bulk system with a lattice constant equal to 5.0 Å, the total energy Etot should be equal to -357.0873 eV.

From all the new samples generated by the script executions, collect the values of the calculated total energies. Your result should be equal to the values displayed in the following table

Table 3: Total energies for a silicon bulk system calculated for six different values of the bulk lattice constant α .

α / Å Energy / eV
5.0 -357.0873
5.2 -357.6944
5.4 -357.8717
5.6 -357.7387
5.8 -357.3989
6.0 -356.9253

A plot of the data set together with a parabolic fit is shown in Figure 15. The data values already reveal that the minimum energy lattice constant αmin must be located somewhere between 5.2 and 5.6. Using the minimum of the parabolic fit, a more precise estimate of αmin becomes 5.41 Å.

The variation of the total energy Etot of a silicon bulk as a function of the lattice constant (blue circles). A parabolic fit to the points around the minimum is also shown (solid line).

Figure 15: The variation of the total energy Etot of a silicon bulk as a function of the lattice constant (blue circles). A parabolic fit to the points around the minimum is also shown (solid line).


Current versus geometrical changes of a molecule

In this tutorial, we will combine what we have learned in the previous tutorials to perform computations of the electron ballistic current through a molecule of experimental interest . We will do the following:

  1. Use the the Molecular Builder tool to create a set of diamino biphenyl (DABP) molecules with different dihedral angles ϕ.

  2. Create two-probe NanoLanguage scripts by using the Atomic Manipulator tool to place the DABP molecules in-between two gold electrodes.

  3. Use the NanoLanguage Scripter tool to create NanoLanguage scripts for computing the electronic current.

  4. Execute the generated scripts.

  5. Obtain and analyze the calculated results, which, for example, will enable us to predict how the ballistic electron current changes as a function of the dihedral angle ϕ.

1. Creating the molecules

The molecule diaminobiphenyl (DABP) has the molecular formula C12N2H12, and is very similar to the biphenyl (C12H10) molecule investigated in the tutorial “Using the NanoLanguage Scripter”. We will create several DABP molecules that only differ in their dihedral angles ϕ. To create the molecules, follow these steps:

  1. Open the Molecular Builder tool by double-clicking its icon in the Toolbar.

  2. Left-click on the Molecule Cupboard button and select “C6H6 (Benzene)” from the list displayed in the Molecule Cupboard window.

  3. Press the Insert key while the mouse cursor is placed in the 3D-View of the Molecular Builder window. A benzene ring will appear. Select one of its H atoms and press Insert again. Another ring appears, both rings are joined at the selected position. As a result, a biphenyl molecule has been created. Note that you might need to rotate or zoom out to get a clear view of the biphenyl molecule.

  4. Select one of the H atoms at the longitudinal extreme, press N. Select the opposite H atom, and press N again. This leads to the creation of the DABP molecule by inserting two amino groups in the biphenyl molecule. At this point your Molecular Builder window should look like this:

    One of the molecules diamino biphenyl (DABP) used in the tutorial.

    Figure 16: One of the molecules diamino biphenyl (DABP) used in the tutorial.


  5. To change the dihedral angle ϕ between the planes spanned by the two rings of the DABP molecule, select a sequence of four carbon atoms, as shown in Figure 17. Note, that the order of the selection matters and it is color coded; so make sure that yours follow the same color sequence as that displayed in Figure 17:

    The same molecule after the selection has been done aiming to change a dihedral angle.

    Figure 17: The same molecule after the selection has been done aiming to change a dihedral angle.


  6. Now, launch the Geometry Manager and change the value of the dihedral angle from 45 to 0. Left-click Save/Save As in the main Molecular Builder window to save the configuration in your working directory with the name dabp0.py (where 0 stands for its dihedral angle value).

  7. Using the Molecular Builder tool, change the dihedral angle to 22, save the configuration as a NanoLanguage script, and name this dabp22.py. Repeat this procedure and create NanoLanguage scripts for the dihedral angles 45, 67, and 90.

  8. Once you have completed these steps, your working directory should contain the following files: dabp0.py, dabp22.py, dabp45.py, dabp67.py, dabp90.py.

2. Placing the DABP molecules in between the gold electrodes

Our next task is to place the generated DABP molecules in between the electrodes. We will use gold electrodes since it is the material of choice in actual experiments. The outcome will be five two-probe systems, each one consisting of a DABP molecule positioned in between two gold electrodes. These systems will only differ from each other in the dihedral angle ϕ of the DABP molecules. Follow these steps:

  1. Open the Crystal Cupboard tool by double-clicking on its icon. Select “Au” from the displayed list of crystals and then left-click Save/Save As to create a NanoLanguage script called Au.py containing a gold bulk crystal.

  2. Open the Atomic Manipulator tool and drop the Au NanoLanguage script file on it. Right-click on the 3D-View and select Cleave from the context menu. In the left dialog, change

    • Surface Vector 1 (S1) from (1,0) to (2,0)

    • Surface Vector 2 (S2) from (0,1) to (0,2)

    • In the Two-Probe tab, change Left Surface Layers to 3.

    Your Atomic Manipulator tool now looks like this (you might need to press the Show button to update the window):

    The Atomic Manipulator after cleaving a gold bulk gold bulk and changing the values of the surface vectors.

    Figure 18: The Atomic Manipulator after cleaving a gold bulk and changing the values of the surface vectors.


  3. Drop the molecule dabp45.py in between the electrodes. Set its respective origin and orientation to (0,0,15.2) and (0,90,0) in the corresponding edit fields of the molecule dialog. Set the central region width in the Two-Probe tab to 14.15. Your Atomic Manipulator now looks similar to this:

    The appearance of Atomic Manipulator after placing a DABP molecule in between two gold electrode followed by setting the DABP origin, orientation, and the central region width correctly.

    Figure 19: The appearance of Atomic Manipulator after placing a DABP molecule in between two gold electrode followed by setting the DABP origin, orientation, and the central region width correctly.


  4. Click Save/Save As to save the configuration in NanoLanguage script called Au-dabp45-Au.py. Get back to the Atomic Manipulator tool again and delete the molecule: Right-click on molecule dialog and choose Delete... from the context menu. Check that the molecule has been removed and that the electrodes still remain.

  5. Drop another molecule, say dabp90.py in-between the electrodes. Set the same values as above and create the corresponding NanoLanguage script. Continue this procedure until you have produced two-probe configuration scripts for each of the five molecules. After this has been done, your working folder contains five additional NanoLanguage scripts: Au-dabp0-Au.py, Au-dabp22-Au.py, Au-dabp45-Au.py, Au-dabp67-Au.py and Au-dabp90-Au.py.

3. Creating the scripts.

We will now create a NanoLanguage script for each of the constructed two-probe scripts. The goal is to produce a minimal intensity-voltage curve composed of two points only. We will first do this for the relaxed configuration with a dihedral angle of 45°.

  1. Open the NanoLanguage Scripter tool and drop the file Au-dabp45-Au.py on it. In the Method tab, choose Basis Set from the drop-down list. Set Type to SingleZeta and check Specify Basis Set by Element Type. Choose the chemical element C (carbon) and set its basis set Type to DoubleZetaPolarized and Energy Shift to 0.005. Except for carbon, we have chosen simple parameters for all chemical elements. This permits for a relatively quick calculation that still preserves a correct description of π-conjugated bonds.

    The NanoLanguage Scripter while setting the chosen basis sets parameters.

    Figure 20: The NanoLanguage Scripter while setting the chosen basis sets parameters.


  2. The next step is to customize the names of some of the files that will be generated during the execution of the actual calculation:

    • In the Self Consistent Calculation tab, type audabp45au.nc in the Checkpoint Filename field.

    • In the Analysis tab, type audabp45au.vnl in the VNLFile Name field.

    Here are the contents of the NanoLanguage Scripter window, after completion of these steps

    The Self Consistent Calculation tab after setting the Checkpoint Filename to audabp45au.nc.

    Figure 21: The Self Consistent Calculation tab after setting the Checkpoint Filename to audabp45au.nc.


  3. From the Available Quantities list, select and add the following items to the Selected Quantities list:

    • Atomic forces

    • Current

    • Electron density

    • Mulliken population

    • Total energy

    • Transmission spectrum .

    Finally, left-click Save/Save As. This generates a script file containing all the necessary information for performing a computation with a zero-bias voltage.

    The Analysis tab after selecting the quantities.

    Figure 22: The Analysis tab after selecting the quantities.


  4. Select the Self-Consistent Calculation tab. In the Runtime Parameters dialog, change the value of Checkpoint Filename from audabp45au.nc to audabp45au01.nc. Then check Restore calculation from checkpoint file, and type audabp45au.nc in the Checkpoint Filename field. Check Only use initial density.

  5. In the Analysis tab, change VNLFile Name from audabp45au.vnl to audabp45au01.vnl. Then, select the Method tab. Finally, in the menu entry labeled Electrode Voltages, change the value of Right Electrode from 0 to 0.1. Click Save/Save As to produce a new script file. Close the NanoLanguage Scripter tool. On your file system, two new script files will now be available. Make sure that these are called: Au-dabp45-Au_script.py and Au-dabp45-Au_script(1).py.

  6. Repeat the steps IV this time using the dabp90.py. Make sure that all file names (check point and VNLFile names) have a “90” instead of a “45”. Carry out the same steps for the remaining samples: dabp0.py, dabp22.py and dabp67.py.

4. Running the computations

To run the computations, beware that the order in which the jobs are submitted matters. We will create a batch queue where the calculations are done in the order in which they have been submitted. In this case, we will simply use the local computer.

  1. Drop the script file labeled Au-dabp45-Au_script.py on the Job Manager tool. The execution of the script starts, and the associated log window appears. While the job is running, launch the script labeled Au-dabp45-Au_script(1).py. A log window also appears, but it will be in a waiting state until the previous job either finishes or is canceled. In this fashion, all committed jobs are placed in a simple job queue.

  2. Repeat these steps until all scripts have been committed to the execution queue.

    [Note] Note

    Remember to preserve the order in which the jobs are submitted: Since the script Au-dabp45-Au_script(1).py depends on the output generated by the script Au-dabp45-Au_script.py, Au-dabp45-Au_script.py must be submitted first.

    Furthermore, for computations at high bias voltage, it is recommended to use the following technique: First perform computations at zero bias and store the resulting density. Then use this density as the initial density for the computation with a higher bias. Then increase the bias voltage stepwise by reusing the previous computations as starting points. Often, this will give convergence for systems under high bias voltages, that otherwise would not converge.

  3. The required computation time for the jobs you just have committed depends on your computer power. Since it very well may take several hours, we suggest that you leave the computer overnight working on finishing the jobs. For very computational demanding tasks, we recommend that you execute the job(s) on a cluster and use the Atomistix ToolKit (ATK) directly for processing the scripts. For more information, please consult your system administrator or consult the ATK manual.

Inspection of the produced log and VNLFiles will allow you to predict changes in the current for a bias voltage of 0.1 V as a function of the dihedral angle. In addition, you will be able to predict changes in the zero bias conductance, the atomic forces, and atomic charges as a function of both the bias voltage and the dihedral angle ϕ.

The following figure shows the obtained current as a function of the dihedral angle. The dashed line is a function proportional to the square of the cosine of the dihedral angle. As can be seen, there is an approximate correspondence as observed in experimental studies for similar π-conjugated systems[1].

The computed current for the DABP molecules between gold leads (points). The bias voltage is 0.1 V, and the current is computed for different dihedral angles ϕ ranging from 0° to 90°. To highlight the approximate correspondence to a cosine-square function (dashed line), the results are displayed symmetric around ϕ = 90°. Note: we include here 4 extra points that are not computed in the present tutorial.

Figure 23: The computed current for the DABP molecules between gold leads (points). The bias voltage is 0.1 V, and the current is computed for different dihedral angles ϕ ranging from 0° to 90°. To highlight the approximate correspondence to a cosine-square function (dashed line), the results are displayed symmetric around ϕ = 90°. Note: we include here 4 extra points that are not computed in the present tutorial.


Zero bias conductance as a function of cos2ϕ, where ϕ is the dihedral angle. conductance as a function of the dihedral angle The zero bias conductance is proportional to the current at 0.1 V (as expected for the low bias regime), and is therefore also roughly proportional to cos2ϕ as highlighted here.

Figure 24: Zero bias conductance as a function of cos2ϕ, where ϕ is the dihedral angle. The zero bias conductance is proportional to the current at 0.1 V (as expected for the low bias regime), and is therefore also roughly proportional to cos2ϕ as highlighted here.




[1] L. Venkataraman, J. E. Klare, C. Nuckolls, M. S. Hybertsen, and M. L. Steigerwald, “Dependence of single-molecule junction conductance on molecular conformation”, Nature 442, 904-907