As many have noticed, the latest version of ATK do not support
geometry optimization of a two-probe system under bias. Here is a solution that enables this feature!
First of all, let us point out one thing. The reason the functionality to relax under bias was removed in the first place (or more specifically, the reason why two-probes are relaxed as equivalent bulk systems; that's why you cannot use bias, since a bulk system cannot be biased), was that we found out that there was an ambiguity regarding the configuration that minimized the forces vs. the configuration that minimized the total energy. That is, the force minimum and the energy minimum did not coincide.
Now, some experts maintain that this is to be expected. Since the two-probe boundary conditions are open, the total energy is not a well-defined quantity, one should rather probably use the free energy.
However, the
forces as computed by ATK should still be correct. Therefore, it should be possible to use the force-based
Steepest Descent method to relax a two-probe system, even under bias. Now, all we need to do to enable this feature, is to tweak ATK a little bit, and this is what the attached script does.
An example is provided to show you how to use it. It's just a simple Li-H2-Li system, with constraints applied so that only the hydrogen atoms can move. It should converge in 9 steps or so.
The following things need to be observed:
1) Only the
Steepest Descent method is supported, for the reason mentioned above. The default in ATK is actually QuasiNewton, however if you forget to specify Steepest Descent the script will not complain, it will just silently use it anyway (and use the default "time_step").
For details on the relaxation method itself, and how to specify parameters to it, see
http://quantumwise.com/documents/manuals/ATK-2008.10/ref.geometricoptimizationparameters.html and the example provided there.
2) Unlike the built-in method for relaxation, the new function
calculateOptimizedTwoProbeGeometry() (note that the function has a different name, to separate it from the native one) returns BOTH the optimized geometry AND the final self-consistent object. This saves you the hassle of re-calculating the last step, as is otherwise necessary if you wish to follow up with some analysis in the same script.
3) A bug regarding verbosity level was fixed, so now the same verbosity level applies to the whole run (the native version reverts to zero after the first step).
4) This is not an officially released version of this functionality, so please use it a bit carefully, and at your own risk 5) There is also support for initializing the relaxation from an already converged density matrix (in the form of an SCF object). This can be used to boot-strap a finite bias relaxation from a converged calculation, e.g. for the same bias or a lower one.
6) Finally, I would recommend you place the module script
CalculateOptimizedTwoProbeGeometry.py centrally in your ATK installation, i.e. in
lib/python2.4/site-packages (on Linux, use
lib/site-packages on Windows). That way it will work in parallel just as well as in serial, and you don't have to worry about setting the Python path etc.
Attached files are:
- The module script
- An example NanoLanguage script
- The VNL file needed by the example
Comments, feedback etc is always welcome!
Update, after the original post: Added support for "initial_calculation".