Author Topic: Relaxation under bias  (Read 21874 times)

0 Members and 1 Guest are viewing this topic.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Relaxation under bias
« on: July 30, 2009, 13:13 »
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".
« Last Edit: August 28, 2009, 09:02 by Anders Blom »

Offline fangyongxinxi

  • QuantumATK Guru
  • ****
  • Posts: 143
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #1 on: August 9, 2009, 14:11 »
Thanks you for your replies, and I still have Two more questions:

First,after reading this reply, I still confused how to do geometry optimization of a two-probe system under bias, especially  "5) One can consider adding functionality for initializing the finite bias relaxation from a zero-bias converged density matrix. This requires a few more lines of code, but shouldn't be a huge task. It can sometimes be hard to converge a finite bias calculation from scratch, so we might need this... Post a reply here if you need that feature!"  Could you give an example or scripts about how to do it .

Second,  should I use the geometry configuration optimized under finite bias or the geometry configuration optimized under 0 bias, to calculate other properties, such as DOS.

Thank you.

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Relaxation under bias
« Reply #2 on: August 9, 2009, 15:27 »
Recommend you to read the following reference to understand the underlying formula for computing the force under bias (or the current-induced force):
1). T. N. Todorov, J. Hoekstra, and A. P. Sutton, Current-induced forces in atomic-scale conductors, Philos. Mag. B 80, 421 (2000)
2). Massimiliano Di Ventra and Sokrates T. Pantelides, Hellmann-Feynman theorem and the definition of forces in quantum time-dependent and transport problems, Phys. Rev. B 61, 16207 - 16212 (2000), http://prola.aps.org/abstract/PRB/v61/i23/p16207_1
3). M. Di Ventra, S. T. Pantelides, and N. D. Lang, Current-Induced Forces in Molecular Wires, Phys. Rev. Lett. 88, 046801 (2002), http://prola.aps.org/abstract/PRL/v88/i4/e046801
4). Mads Brandbyge, Kurt Stokbro, Jeremy Taylor, José-Luis Mozos, and Pablo Ordejón, Origin of current-induced forces in an atomic gold wire: A first-principles study, Phys. Rev. B 67, 193104 (2003), http://prola.aps.org/abstract/PRB/v67/i19/e193104
5). M. Di Ventra, Y.-C. Chen, and T. N. Todorov, Are Current-Induced Forces Conservative?, Phys. Rev. Lett. 92, 176803 (2004), http://prola.aps.org/abstract/PRL/v92/i17/e176803






« Last Edit: August 9, 2009, 15:38 by zh »

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Relaxation under bias
« Reply #3 on: August 10, 2009, 09:46 »
Dear fangyongxinxi,

1) I have updated the script to support initialization from a previously converged calculation. This can speed up things quite a lot if you for instance already have a converged calculation for a different bias (like when you do a voltage sweep), or you have a single-point calculation for the initial geometry of the relaxation already. To use it, there's a new keyword "initial_calculation" which works exactly the same way as for executeSelfConsistentCalculation().

I will update the script (and the text) in the original post to include this functionality.

2) In many cases the influence of the bias on the geometry is quite small, and you can then save yourself a lot of time by using the zero-bias geometry, but of course perform the self-consistent calculation for each bias (but not a relaxation). In some cases, however, one is specifically interested in this influence, and in this case it's obvious that you must optimize the geometry at each bias.

Also note that it is more correct to use the function provided in this thread to optimize the geometry also at zero bias, since it performs the relaxation under two-probe boundary conditions, and not as a slab or equivalent bulk.

The references posted by zh are certainly good reading material on the topic!

Offline kevin

  • Regular QuantumATK user
  • **
  • Posts: 6
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #4 on: August 28, 2009, 05:44 »
Dear Anders Blom,

I followed your suggestion replace the module script "CalculateOptimizedTwoProbeGeometry.py" in "lib/python2.4/site-packages".
And excute the example of "lih2li-scf_relax.py" after added the bias.
I get such error message:
[soft@localhost Geo-Bias]$ atk lih2li-scf_relax.py &
[1] 8174
[soft@localhost Geo-Bias]$ Traceback (most recent call last):
  File "lih2li-scf-bias_relax.py", line 53, in ?
    runtime_parameters = runtime_params
  File "/home/soft/atk-2008.10.0/lib/python2.4/site-packages/CalculateOptimizedTwoProbeGeometry.py", line 126, in calculateOptimizedTwoProbeGeometry
    self_consistent_calculation)
NLValueError: calculateOptimizedAtomicGeometry does not support optimization of two-probe systems with applied bias.


What change i should be to do?

Kevin

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Relaxation under bias
« Reply #5 on: August 28, 2009, 09:01 »
Lo and behold the danger of assumption.

As I wrote in the original post, I actually never tested it under bias, and of course it turned out that there is a special check for bias...

Anyway, I have modified the script in the original post (again), AND tested it under bias.

Sorry for the inconvenience and confusion!

Offline fangyongxinxi

  • QuantumATK Guru
  • ****
  • Posts: 143
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #6 on: October 15, 2009, 11:46 »
Dear Sr,
 
       I am very interested in electromigration, and could you tell me where can find the theoretical basis about the script you updated ? Or which book mentioned this basis ?

Thank you very much.

Offline zh

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Relaxation under bias
« Reply #7 on: October 16, 2009, 04:17 »
For the geometry optimization under bias, I think the fundamental problem is what is the correct definition or formula  of force under finite bias.

Offline Forum Administrator

  • Forum Administrator
  • Administrator
  • Heavy QuantumATK user
  • *****
  • Posts: 52
  • Country: dk
  • Reputation: 0
    • View Profile
    • QuantumATK at Synopsys
Re: Relaxation under bias
« Reply #8 on: October 16, 2009, 11:38 »
The main reference on this would be PRB 67, 193104 (2003).

It should, however, be noted that the current implementation of forces in ATK might not be 100% correct under bias, although it should still give reasonable results. An update of this will be made soon.

Offline xhsh

  • Heavy QuantumATK user
  • ***
  • Posts: 32
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #9 on: March 30, 2010, 03:27 »
Why I can not see the attached files, please?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Relaxation under bias
« Reply #10 on: March 30, 2010, 08:29 »
You need to register on the Forum to see attachments. Which you already did since you posted a message... So, you should see the attachments...

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #11 on: April 24, 2010, 22:19 »
 Dear Dr. Blom,

The script that you have written is really good. But I have written a script where a few atoms in the scattering region have spins. Thus the script gives an error related to spin dimensions:

Traceback (most recent call last):
  File "My_File_relaxOpt.py", line 107, in ?
    fixed_atoms = fixed_atoms,
  File "/data1/clusterfs/users/scaliskan/vnl-2008.10.0/atk/lib/python2.4/site-packages/CalculateOptimizedTwoProbeGeometry.py", line 248, in calculateOptimizedTwoProbeGeometry
    initial_calculation = initial_calculation
NLValueError: The two system has different spin dimensions

How can we include spin in your script to avoid this problem?

Thanks




Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5575
  • Country: dk
  • Reputation: 96
    • View Profile
    • QuantumATK at Synopsys
Re: Relaxation under bias
« Reply #12 on: April 26, 2010, 00:01 »
It looks to me as if the script isn't the issue here, but rather you are trying to initialize a spin-polarized calculation from the converged results of one that isn't spin-polarized. That doesn't work, whether in relaxation or not.

But to check: Does this error appear almost immediately, or after it's been running a while? Can you perhaps post the complete input and output, then it's easier to determine (you can mask the coordinates, in case your system geometry is sensitive).

I'm guessing that you see the error quite immediately, and in that case the problem is that the "initial_calculation" that you are providing is not spin-polarized, while your present system is (or opposite).

Offline sergio

  • Heavy QuantumATK user
  • ***
  • Posts: 56
  • Reputation: 0
    • View Profile
Re: Relaxation under bias
« Reply #13 on: April 27, 2010, 22:33 »
Hi Anders,

Thanks for your comment on the problem. The issue has been resolved after making a few modifications in the script...