Author Topic: Script for calculating the voltage drop.  (Read 56793 times)

0 Members and 1 Guest are viewing this topic.

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Script for calculating the voltage drop.
« on: December 17, 2008, 23:12 »
Hey everyone.

I just thought I wanted to share with you a small script for calculate the voltage drop using two selfconsistent calculations
on a twoprobe device.

The usage is straight forward:
1)  perform a calculation of a twoprobe at zero bias and store the results in a netcdf file.
2) Do the same for the finite bias, and store this in another netcdf file.
3) Modify the script to match the names of your two calculations, and run it using atk voltagedrop.py.

Then you are done, and you will recieve the voltage drop in a VNL file for visualization in VNL and the
average voltage drop will be printed to the screen. Alternative you can pipe the screen into a log file and plot it using fx GNUplot.

I have attached the script and I have attached a graph showing the voltage drop calculated using this script for a Li-H2-Li system.

Offline Roc

  • QuantumATK Guru
  • ****
  • Posts: 104
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #1 on: January 5, 2009, 12:32 »
Dear Nordland,

If I want to calculate the voltage drop from 2V to -2V, could I do it using the followed script(just part of it and some changs from your script), is it right? (probe-molecular-probeHV2.nc is the .nc document at 2V, and the probe-molecular-probeLV-2.nc is at -2V)  Thanks!(Sorry, I am new to the Python Language :))

high_bias_filename = 'probe-molecular-probeHV2.nc'
low_bias_filename = 'probe-molecular-probeLV-2.nc'

vnl_filename = 'voltage_drop.vnl'


""" ------------ No need to modify anything below this point --------------------- """
# Implementation of the voltage drop.
from ATK.TwoProbe import *; import numpy

# High bias calculation.
high_bias
= restoreSelfConsistentCalculation(high_bias_filename )
# Low bias calculation.
low_bias = restoreSelfConsistentCalculation(low_bias_filename)
# Calculate the voltage drop.
voltage_drop = calculateEffectivePotential(low_bias) - calculateEffectivePotential(high_bias)


Thanks for your script again!
« Last Edit: January 5, 2009, 12:36 by anyipeng »

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #2 on: January 5, 2009, 13:52 »
Yes that should be correct! :)

Offline Roc

  • QuantumATK Guru
  • ****
  • Posts: 104
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #3 on: January 6, 2009, 01:19 »
Thanks :)

However, I got the questionable result, as follows, The polt descripes the voltage dropt from 0.1V to -0.1V.
All my scripts (Li-H2-Li as the example)are all upload. Moreover, the polt descriping the voltage dropt from 0V to -0.1V has the same curvilinear trend as that from 0.1V to -0.1V. How to explain it, or what's wrong with my scripts?Thanks again!
« Last Edit: January 6, 2009, 02:33 by anyipeng »

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #4 on: January 6, 2009, 06:51 »
Your script is correct and the results is correct in the sense if you calculate the current etc, then it is okay. However since we want to see the voltage drop, you need to use the new electrode constraint 'DensityMatrix' instead of 'Off'.

The explaination is that since the electrodes are allowed to adjust to the bias, a microscopic charge is moved inside the electrode layer and then it tries to screen the voltage ramp. However we want the any charge transfered to the electrode to vanish and hence we should use the new constraint that ensures this behavior.

Offline Roc

  • QuantumATK Guru
  • ****
  • Posts: 104
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #5 on: January 6, 2009, 08:45 »
Thank you, Nordland. I will try again!  :)

Another,I am confused with that when should I use the new electrode constraint 'DensityMatrix' instead of 'Off' and when not , could you list any examples when you have free time. ;).

Thanks again! ;D
« Last Edit: January 6, 2009, 09:27 by anyipeng »

Offline Roc

  • QuantumATK Guru
  • ****
  • Posts: 104
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #6 on: January 14, 2009, 01:39 »
Hello,

I have try it again and use the new electrode constraint 'DensityMatrix' instead of 'Off'.

The results show that as follows (the voltage drop is from 0.5V to -0.5V), it seems that the curve trend is questionable. How to explain it?

Thanks.

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #7 on: January 14, 2009, 13:47 »
Strange!

I don't know what you have done to get this curve, but I can't reproduce it :|

If I calculate the voltage drop over a Li-H2-Li chain with the same bias as you I get the following result:


The thing you have plotted looks more like the difference density as it shows the formation of a dipole to cancel
out the electric field.

Do you use the same script as posted above?

A second note: I noted that you use 110 eV mesh-cutoff and GGA.PBE at the same time. If you are doing GGA calculation,
you should go with atleast 200 eV mesh-cutoff and I would personally prefer 300 eV mesh-cutoff :)

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5573
  • Country: dk
  • Reputation: 95
    • View Profile
    • QuantumATK at Synopsys
Re: Script for calculating the voltage drop.
« Reply #8 on: January 14, 2009, 14:45 »
I think there is a fundamental misconception here, which we should clear out first. What we mean by voltage drop is the difference in real space effective potential V(r,bias) between two calculations, i.e. V(r,bias1) - V(r,bias0) where the reference calculation "bias0" is for zero bias, hence the notation. The obtained quantity shows how the applied bias is distributed across the structure, i.e. where the voltage drops, i.e. where the resistance is. The calculations posted by anyipeng (lih2li01 and lih2li-0.1) are both calculations with 0.1 V bias applied, but in two different directions. Comparing them makes no real sense, at least not in terms of "voltage drop". What you want is one calculation with no bias, i.e.
Code
electrode_voltages = (0.0,0.0)*Volt
and one calculation with bias (one of those you already made), and take the difference between these. However, the point about using "DensityMatrix" is still very valid; one can not expect to get a proper picture of the voltage drop using the other constraints.

Offline Roc

  • QuantumATK Guru
  • ****
  • Posts: 104
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #9 on: January 15, 2009, 03:43 »
Thanks for your attention and patient reply ! ;)

Offline carbn9

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #10 on: February 9, 2009, 06:00 »
Dear friends

I tried to calculate the voltage drop of a nanotube using the script of this thread, but I got strange results. I have attached the input files and output voltage drop to this message. I could not interpret or judge the voltage drop curve. Could you please help me explain it? I expected to have a curve start at .2V and end at 0V but the curve starts as -.1V and ends at .05V or so with a strange behavior?
« Last Edit: February 9, 2009, 06:02 by carbn9 »

Offline Nordland

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 812
  • Reputation: 18
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #11 on: February 9, 2009, 11:02 »
Hey !

As you say your self, there are couple of issues with your calculation.

First of all - and most important - the electrode length of your calculation is way too short! You need to increase the length of the electrode region, by at least a factor 3.

Secondly, if you want really good voltage drops you should use the new constraint DensityMatrix that are in ATK 2008.10

If you make these modifications, then I am pretty sure you are going to get very good voltage drops for this system! :) I am looking forward to see them.

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5573
  • Country: dk
  • Reputation: 95
    • View Profile
    • QuantumATK at Synopsys
Re: Script for calculating the voltage drop.
« Reply #12 on: February 9, 2009, 11:15 »
In addition to the relevant comments by Nordland, I also note that the two most central C atoms in the scattering region have a bond length of 1.058 Angstrom. That seems very short, perhaps it is not what you intended (although this is not related to the problems with the voltage drop).

Second, consider the size of the unit cell in the XY directions. If you plot in VNL the system as ATK actually considers it when the periodic boundary conditions, there will be quite small separation between the carbon atoms in the XY directions. This might actually be what you intended, if it should perhaps be graphite, somehow, between gold, but in that case the atomic distances are not correctly set up.


Offline carbn9

  • Regular QuantumATK user
  • **
  • Posts: 24
  • Reputation: 0
    • View Profile
Re: Script for calculating the voltage drop.
« Reply #13 on: February 9, 2009, 19:44 »
Thanks Sirs for yor replies...I'll try Nordland's recommendations, (to Anders Blom) I got the nanotube (scattering zone) from VNL nanotub grower as (1,0) nanotube. It generated atomic bond lenghts auomatically. Is there a problem???

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5573
  • Country: dk
  • Reputation: 95
    • View Profile
    • QuantumATK at Synopsys
Re: Script for calculating the voltage drop.
« Reply #14 on: February 9, 2009, 22:43 »
Well, a (1,0) nanotube isn't really a nanotube (most notably, it's not a cylinder...).

Actually, in hindsight I think the VNL tube grower should not have allowed such a small number as n=1. In fact, it appears that the tube generation algorithm fails for (1,0) and (1,1) in the sense that the resulting structures are not cylinders. Moreover, while (2,0) does look like a tube, it is not really acceptable at all either.

Tubes (2,1), (2,2), (3,0) and (3,1) are passable; they are cylindrical and relatively regular. However, calculations indicate that for thermal and mechanical stability, carbon nanotubes must have a diameter above 3-4 Ångström, where the smaller radius only can be realized for tubes grown inside multi-wall nanotubes (see PRL 92, 125502 (2004) but also Refs. 1 and 5 therein). In fact, even (4,0) and (4,1) fall below the 4 Å-diameter criterion (and (4,2) barely too), while (3,3) and (4,3) are above, and so would be possible to encounter in nature (and have, in fact, recently been identified in experiments, see Nano Letters 8 459 (2008), together with the small-radius tube (5,1)).
« Last Edit: February 9, 2009, 22:45 by Anders Blom »