Author Topic: Voltage Drop(V) vs. Device Length-Z(Ang) plot  (Read 2629 times)

0 Members and 1 Guest are viewing this topic.

Offline ruyam

  • Heavy QuantumATK user
  • ***
  • Posts: 60
  • Country: in
  • Reputation: 0
    • View Profile
Voltage Drop(V) vs. Device Length-Z(Ang) plot
« on: February 7, 2015, 05:19 »
I read on forum that to calculate the difference in the potentials of 2 atoms we can use the following code:
Code
pot = nlread("file.nc", ElectrostaticDifferencePotential)[0]
p1 = pot.evaluate(0.*Ang,0*Ang,0*Ang)
p2 = pot.evaluate(0.*Ang,0*Ang,1*Ang)
print p2-p1
But, this gives the value in Hartree. How to get this in Volts? Second: To get Voltage Drop(V) vs. Z(Ang) plot, why is it necessary that we should have both zero-bias and finite-bias calculations? Cant we plot it just with a finite bias calculation?

Offline zh

  • QuantumATK Support
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 1141
  • Reputation: 24
    • View Profile
Re: Voltage Drop(V) vs. Device Length-Z(Ang) plot
« Reply #1 on: February 7, 2015, 08:56 »
1. The unit of Hartree can be easily converted into that of "eV".  "eV"/ "e" ---> "V".

2. You have to at first understand the concept of "voltage drop". The distribution of electrostatic potential at a finite voltage doesn't corresponds to the voltage drop.

Offline ruyam

  • Heavy QuantumATK user
  • ***
  • Posts: 60
  • Country: in
  • Reputation: 0
    • View Profile
Re: Voltage Drop(V) vs. Device Length-Z(Ang) plot
« Reply #2 on: March 5, 2015, 08:24 »
In the forum ( http://quantumwise.com/forum/index.php?topic=21.0 ) , Dr. Norland has posted following script to plot voltage drop(V) vs. device_length(z). But, it seems its for older version. When I run the script I get errors with many functions used in the script not defined.
Code
zero_bias_filename = 'lih2li_00.nc'
finiate_bias_filename = 'lih2li_01.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

# Zero bias calculation.

zero_bias = restoreSelfConsistentCalculation(zero_bias_filename)

# Finite bias calculation.

finite_bias = restoreSelfConsistentCalculation(finiate_bias_filename)

# Calculate the voltage drop.

voltage_drop = calculateEffectivePotential(finite_bias) - calculateEffectivePotential(zero_bias)

# Store the results in a VNL file.

file = VNLFile(vnl_filename)
file.addToSample(voltage_drop,'Voltage Drop','Voltage Drop')

# Get the raw number of the potential, and print the average potential to the screen.

raw_data = voltage_drop.toArray()
z_axis_length = voltage_drop._cell().c().z()
print '### Voltage drop ###'
print '# z(bohr) V(Ry)'
# Loop over all the data and calculate the average in the xy-plane.
for i in range(raw_data.shape[2]):
    print i*z_axis_length/float(raw_data.shape[2]), numpy.average(raw_data[:,:,i])

#######################
Kindly let me know the changes to be made in the script to make it run for the recent ATK version.

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Voltage Drop(V) vs. Device Length-Z(Ang) plot
« Reply #3 on: March 5, 2015, 09:33 »
Indeed it refers to an old version.

Check out the latest tutorials online on this topic
http://quantumwise.com/publications/tutorials/itemlist/tag/voltage%20drop
and also the electrostatic difference potential entry in the Reference Manual here

In particular, if you want to use a script, combine the voltage_drop.py script here with the nh3_potential_average.py example in the reference manual to plot the average potential along z.

Offline ruyam

  • Heavy QuantumATK user
  • ***
  • Posts: 60
  • Country: in
  • Reputation: 0
    • View Profile
Re: Voltage Drop(V) vs. Device Length-Z(Ang) plot
« Reply #4 on: March 9, 2015, 16:10 »
In the voltage_drop.py I get an error in the following line:
Code
voltage_drop = potential[1]-potential[0]
Error: List Index out of range. What does this potential[1] and potential[0] functions extract?

Offline Umberto Martinez

  • Supreme QuantumATK Wizard
  • *****
  • Posts: 479
  • Country: dk
  • Reputation: 26
    • View Profile
Re: Voltage Drop(V) vs. Device Length-Z(Ang) plot
« Reply #5 on: March 10, 2015, 11:48 »
li-h2.nc in the tutorial above contains two EelctrostaticDifferencePotential analysis object. First one at zero bias and second one at -1 Volt.
Please check the tutorial.
« Last Edit: March 10, 2015, 13:13 by Umberto Martinez »