Table of Contents
In the previous part of the tutorial an important part of a solid-state calculation was tacitly ignored - calculating the positions of the atoms corresponding to the lowest total energy. In this chapter you will learn how to set up an initial guess for the structure using VNL and subsequently finding the structure where the atoms experience no forces or stress - the optimized geometry. Potentially, the optimized geometry can have completely different properties than the initial guess, thus the optimization procedure (or relaxation, as it is sometimes referred to as) is always an important step in the setup of any system.
Constructing an optimized device structure is somewhat more complicated than the more conventional case of relaxing a molecule or a periodic structure, not least because a device configuration actually consists of three separate configurations (the two electrodes and the central region), which are combined to form the device. Also, the rule discussed in ... that the first/last atoms in the central region must perfectly match the electrodes means special care has to be taken to constrain these atoms from moving during an optimization.
This tutorial will introduce a straightforward strategy which works well in most cases:
Make a reasonable starting guess for the electrodes. This is often simple, as the electrodes are typically made of some known periodic structure like a cleaved metal surface, a nanotube, or as in our case a chain of atoms.
Optimize the electrodes, both the positions of the atoms and the size of the cell, in all directions. For this step it is possible to use the minimal electrode configuration, to save time.
Determine the required electrode lengths by ensuring that the electrodes are long enough that there are no (or negligible) interactions with the second-nearest neighbor cell in the transport direction.
Use this information to construct a starting guess for the central cell. A convenient approach is:
Start with a system corresponding to two repetitions of each electrode (with the proper length).
Place the desired central configuration between these extended electrodes. Here, the big unknown is the distance between the surfaces and the central material, which affects not only the positions but also the size of the central cell, i.e. the distance between the electrodes. This is why it is so important to optimize the central region!
|
|
Note |
|---|---|
|
These first two steps should be considered conceptually rather than literally. In many cases you would rather first add the central region to the extended left electrode, and then add the extended right electrode to that. Or, you would somehow modify a longer repetition of the electrode structure to form the central region, e.g. by removing or adding some atoms. |
Then, use the function in VNL to extract the electrodes from the central region to form the device configuration.
Remove or add more surface layers as needed for proper screening and to allow surface reconstruction during the optimization. There is a convenient function in VNL for this as well.
Optimize the atomic positions and length in Z of the central region, using the following trick: by running a device calculation non-self-consistently in ATK, the central region is still run self-consistently, and can hence be optimized, under periodic boundary conditions.
|
|
Note |
|---|---|
|
The reason it is convenient to do it this way, rather than just optimize the central region, is that the electrode extensions are automatically constrained in a device configuration. |
This step can be skipped, but without it, the next step, the final optimization, can be hard to converge.
Use the result of the previous step as a good starting guess for the final optimization of the central region under open boundary conditions (at zero bias).
One can, in principle, furthermore optimize the device for each value of the electrode voltages, before computing the transmission spectrum for each bias.
Notes
It may be sufficient to just use the central region, optimized under periodic boundary conditions, for the transport calculations, but this should be checked from case to case. One way to do this is to compute the forces on the atoms, computed under open boundary conditions for the configuration obtained from the optimization with periodic boundary conditions, are still smaller than the force criterion (or at least small enough).
The impact of the bias on the atomic positions can often be neglected, and the small changes in positions induced by the bias typically have a much smaller effect on quantities like the current or populations, compared to the electrostatic effect of the bias itself. Thus re-optimizing the structure for each bias is typically only needed if one is specifically interested in this effect.
You will now apply this methodology to build and optimize the system used in this tutorial - a hydrogen molecule embedded in a linear chain of lithium atoms.
The first task is to determine the electrode geometry, by constructing a starting guess and optimizing it.
You will now construct an infinite one-dimensional lithium wire using the Builder in VNL. Start the Builder by clicking the icon
on the Toolbar in the main VNL window.
To create a new structure, click the button Add in the menu
to the left of the stash and select New configuration
from the menu that pops up. This will insert a new, trivial configuration: a hydrogen
atom in empty space.
The first thing to do is inscribe this atom in a unit cell, since you need a periodic structure. Expand the plugin group "Edit Directly" and open the "Edit Lattice" plugin. As you see, there is currently no cell for this structure, but if you choose "Unit cell" at the end of the drop-down list, you can edit the size of the cell.
Set the length of the A and B vectors to 9 Å (pointing in the X and Y directions, as they are already) to make a large enough cell in the transverse direction to eliminiate interactions with the repeated copies of the chain. Then, set the length of the C vector (along Z) to 2.2 Å. This is just a guess; you will optimize the value in a short moment.
Close the "Edit Lattice" plugin.
|
|
Tip |
|---|---|
|
You can reset the configuration view in the Builder by pressing Ctrl+R to bring the entire configuration into easy view. |
To change the atom to lithium, select the hydrogen atom, click the "Change Element" button in the left-hand side toolbar, and choose Li in the periodic table that appears.
Finally, center the structure in the cell in all directions by using the plugin "Center", available in the plugin group "Tranform Coordinates" (click Apply).
|
|
Note |
|---|---|
|
To remove all interactions in X and Y the box should be larger than the basis set interaction range, which is about 8 Ångström. There is, in principle, also electrostatic interactions which can have quite a long range, and so it is necessary to check that the transverse unit cell size is large enough in each case. One way is to look for broken degeneracies in the band structure of the electrode, as such can only occur as a result of a violation of the translational invariance, not from insufficient k-point sampling or a too small basis set; another is to compute the band structure and check that the bands are completely flat in the XY plane. |
You now have an infinite, periodic lithium chain with an interatomic distance of 2.2 Ångstrom. Since the cell is also periodic in the X and Y directions, in reality it is actually an infinite array of chains, separated by a distance of 9 Ångström.
You will now use ATK-DFT to optimize the electrode geometry. Press the "Send To" button
in the lower right corner of the Builder and select
Script Generator.
In the Script Generator, add a New Calculator and a Optimize Geometry block by double-clicking them in the left panel.
Change the output file name to li.nc.
Double-click the New Calculator item in the Script panel to open it, and
reduce the mesh cut-off to 50 Hartree to save some time;
set the number of k-points in the C direction to 50 - a high value, but the calculation will be fast, and this is the most important parameter for good accuracy for this calculation.
Press the OK button to return to the Script Generator.
Open the Optimize Geometry block in the Script panel and
remove the tick from the cell constraint in the Z direction (the cell does not need to be optimized in the X and Y directions)
Set the stress tolerance to 0.001 eV/Å
.
Press the OK button to return to the Script Generator.
Send the script to the Job Manager and run it; it should only take about a minute.
When the optimization has finished, select the file
li.nc in the main VNL window. In the Result Browser
you can see that the file contains two bulk configurations - the
original geometry (gID000) and the optimized one (gID001).
Drag and drop the optimized configuration on the Builder icon on the VNL toolbar. In the Builder, change the title of the optimized configuration by selecting it in the stash, then press F2 and set the name to for instance "Optimized Li chain", so we can easily disinguish it from the initial guess.
If you open the "Edit Lattice" plugin again, you will notice that the chain lattice constant has increased to 3.03 Å. (You could also see this in the log file at the end of the optimization.) Thus our initial guess was not a very good one, but at least for this simple system it was easy enough to find the optimal value quickly anyway.
The next step is to find the geometry of the central region. The steps are the same as for the electrode, i.e. first you set up an initial guess in the the Builder and then the cell length in the Z direction will be optimized with ATK-DFT.
Start by repeating the optimized lithium chain 14 times in the C direction, using the "Repeat" plugin in the "Change Size" plugin group (press Ctrl+R to bring the system into comfortable view).
Select the two middle atoms (hold down Ctrl while left-clicking to select multiple atoms, or use e.g. the rectangle select tool from the toolbar to draw a box around the two atoms), and change them to hydrogen, using the "Change Element" button in the left-hand side toolbar.
The H-H and Li-H bond lengths are not expected to be as large as the Li-Li distance of 3.03 Å. between the hydrogen atoms, and between Ha nd Li,the hydrogen atoms and the litNext step is to manipulate the z-matrix of the wire atoms. left-click the Lattice -button and the Basis-button to remove these widgets, and left-click the Z-Matrix button to be able to change the z-matrix of selected atoms.
Next select all atoms using Select → All
Change bond distance of atom 5 to 2 Å
Change bond distance of atom 6 to 0.8 Å
Change bond distance of atom 7 to 2 Å
In the left panel switch to device mode by
left-clicking the device icon
.
The builder automatically detects the repetitions in the central region and sets up the device configuration.
The optimization of the central region geometry can be very time consuming. You will in this section learn two different approaches, an approximate method treating the device system as a bulk system, and a full open boundary condition optimization.
In this section you will learn how to optimize the central region geometry as a bulk system.
First send the device geometry to
the Script Generator
using the send to button
.
In the script generator
Add a New Calculator object.
Add an Optimize Geometry object.
Change the output file name to li-h2-opt.nc.
Open the New Calculator object and
Set the mesh cut off to 50 Ry.
Select the iteration control parameters widget and tick the No SCF iteration box.
For a Device Configuration No SCF iteration, means no NEGF open boundary SCF loop. However, there still is an equivalent bulk SCF loop in order to make an initial guess for the electronic structure, and it is this SCF state that is used for the optimization.
The equivalent electrode atoms in the central region are automatically fixed during a device optimization. In the following you will fix a few additional atoms, since the non self-consistent method is approximate and may give wrong forces for atoms close to the electrodes.
Open the Optimization object. Select atom 2 and 9 by
left-click on the third atom from the left in the central region.
Hold down the Ctrl key and left-click on the third atom from the right in the central region.
The widget should now have the following settings (check that you have constrained atom 2,9).
|
|
Note |
|---|---|
|
The cell vectors are not optimized, since usually the non self-consistent method is not sufficient accurate for such optimizations. |
Next execute the job - this will take some time, typically 5-10 minutes.
When the optimization has finished left-click the
li-h2-opt.nc in the result browser. The file has 2 device
configurations.
Drag and drop the second device configuration to the builder
,
switch to bulk mode
.
Activate the Z-Matrix widget, and hide the Basis and Lattice widgets.
Select all atoms.
You should now see the following
In this section you will learn how to perform a full device configuration optimization of the central region. As initial geometry, you will use the configuration from the previous section which was optimized using equivalent bulk.
In the Builder switch back to device mode
and send the optimized device geometry to
the Script Generator
using the send to button
.
In the script generator
Add a New Calculator object.
Add an Optimize Geometry object.
Change the output file name to li-h2-opt.nc.
Open the New Calculator object and
Set the mesh cut off to 50 Ry.
Remove the tick from the IO save check box, to avoid saving the non-optimized configuration.
The optimize geometry will optimize the position of all non-equivalent electrode atoms in the central cell. In order to optimize the cell size in the z-direction
Open the Optimization object and
Remove the tick from constraining the cell in the z-direction.
Set the force tolerance to 0.01 eV/Å
.
Set the stress tolerance to 0.001 eV/Å
.
|
|
Note |
|---|---|
|
The cell size in the x and y directions cannot be optimized, since they are fixed by the electrode cell size. |
Now execute the job - this will take approximately four times the previous optimization.
When the optimization has finished left-click the
li-h2-opt.nc in the result browser. The file should now have 3 device
configurations.
Drag and drop the third device configuration to the builder
,
switch to bulk mode
.
Select all atoms and only activate the z-matrix widget and you should see the following
Applying a finite bias will cause the position of atoms to shift slightly, so the geometry should in principle also be optimized under bias. However, the optimization under bias can be very time consuming and usually only has little effect on the transmission and is thus often omitted.
You will now use the zero bias optimized geometry as initial guess for a finite
bias geometry optimization. Drag the last device configuration in the file
li-h2-opt.nc onto the Script
Generator icon
This will open the script generator with a New
Calculator with the settings of the calculator on the dropped configuration. Add an Optimization object and
change the Default output file to
li-h2-opt-1V.nc.
Open the New Calculator object and
Set the Right electrode voltage to 1 Volt.
Remove the tick from the IO save check box, to avoid saving the non-optimized configuration.
Open the Optimization object and make the following changes (the same as previously for the zero bias optimization)
Remove the tick from constraining the cell in the z-direction.
Set the force tolerance to 0.01 eV/Å
.
Set the stress tolerance to 0.001 eV/Å
.
Now execute the script by sending it to the Job Manager, it will take approximately double as long time as the zero bias calculation.
Finally, compare the difference in geometry of the optimization with and
without bias. Left-click the
li-h2-opt-1V.nc in the result browser. The file should only
have the optimized device
configuration.
Drag and drop the device configuration to the builder
,
switch to bulk mode
.
Select all atoms and only activate the z-matrix widget and you should see the following
The most striking feature of the optimized geometry is that, while the the zero-bias geometry is fully symmetric, a slight asymmetry is introduced at finite bias.
Using analysis from file you may also calculate the transmission spectrum and save
it into the file li-h2-opt-1V.nc.
When done open the Custom Analyzer
and select the I-V Curve tool from the Analyzers menu. Drop the file
li-h2-opt-1V.nc onto the NC file drop zone, and the current is
now displayed in the Log window.
|
Comparing with the non-optimized geometry, it is found that the optimization has increased the current by 10 percent.